Fix consulting booking flow and export CSV format

1. CSV Export: Use raw numbers for Total and Refund Amount columns
   - Changed from formatted IDR (with dots) to plain numbers
   - Prevents Excel from breaking values with thousand separators

2. Consulting Booking Flow:
   - Fixed "Booking Sekarang" to navigate to order detail instead of redirecting to Pakasir
   - Payment QR code now displays in OrderDetail page
   - Consulting orders show slot details instead of empty items list

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
dwindown
2025-12-26 21:09:06 +07:00
parent bf212fb973
commit c09d8b0c2a
3 changed files with 106 additions and 130 deletions

View File

@@ -336,7 +336,7 @@ export default function ConsultingBooking() {
const { error: slotsError } = await supabase.from('consulting_slots').insert(slotsToInsert);
if (slotsError) throw slotsError;
// Call edge function to create payment (avoids CORS)
// Call edge function to create payment with QR code
const { data: paymentData, error: paymentError } = await supabase.functions.invoke('create-payment', {
body: {
order_id: order.id,
@@ -351,12 +351,8 @@ export default function ConsultingBooking() {
throw new Error(paymentError.message || 'Gagal membuat pembayaran');
}
if (paymentData?.success && paymentData?.data?.payment_url) {
// Redirect to payment page
window.location.href = paymentData.data.payment_url;
} else {
throw new Error('Gagal membuat URL pembayaran');
}
// Navigate to order detail page to show QR code
navigate(`/orders/${order.id}`);
} catch (error: any) {
toast({ title: 'Error', description: error.message, variant: 'destructive' });
} finally {