diff --git a/apps/dashboard/modules/appointments/appointment-actions.tsx b/apps/dashboard/modules/appointments/appointment-actions.tsx index c8518ac..ccca01c 100644 --- a/apps/dashboard/modules/appointments/appointment-actions.tsx +++ b/apps/dashboard/modules/appointments/appointment-actions.tsx @@ -76,51 +76,52 @@ export function AppointmentActions({ appointmentId, currentStatus, jobCardId }: } return ( - - - - - - editDialog.open(appointmentId)}> - - Edit - - {currentStatus !== "confirmed" && ( + <> + + + + + + editDialog.open(appointmentId)}> + + Edit + + {currentStatus !== "confirmed" && ( handleChangeStatus("confirmed")}> Confirm - )} - {currentStatus !== "completed" && ( + )} + {currentStatus !== "completed" && ( handleChangeStatus("completed")}> Mark Completed - )} - {currentStatus !== "cancelled" && ( + )} + {currentStatus !== "cancelled" && ( handleChangeStatus("cancelled")}> Cancel - )} - {jobCardId && ( - <> - - - - Unlink Job Card - - - )} - - - - Delete - - - + )} + {jobCardId && ( + <> + + + + Unlink Job Card + + + )} + + + + Delete + + + { if (!v) editDialog.close() }}> @@ -137,5 +138,6 @@ export function AppointmentActions({ appointmentId, currentStatus, jobCardId }: - ) + + ) } diff --git a/apps/dashboard/modules/payment-mades/payment-made-form.tsx b/apps/dashboard/modules/payment-mades/payment-made-form.tsx index 2d78f49..2ff785e 100644 --- a/apps/dashboard/modules/payment-mades/payment-made-form.tsx +++ b/apps/dashboard/modules/payment-mades/payment-made-form.tsx @@ -57,7 +57,7 @@ const DEFAULT_VALUES: PaymentMadeFormValues & { details: Array<{ bill_id?: strin employee: null, payment_mode: null, payment_for: "bill", - amount: "", + amount: 0, payment_number: "", payment_reference: "", payment_date: getTodayDate(), @@ -80,7 +80,7 @@ function mapToFormValues(data: unknown): typeof DEFAULT_VALUES { employee: toRelation(d.employee_id, d.employee?.first_name ? `${d.employee.first_name} ${d.employee.last_name ?? ""}`.trim() : d.employee_name), payment_mode: toRelation(paymentModeId, paymentModeLabel), payment_for: d.payment_for || "bill", - amount: d.payment_made ? String(d.payment_made) : "", + amount: d.payment_made != null ? Number(d.payment_made) : 0, payment_number: d.payment_number || "", payment_reference: d.payment_reference || "", payment_date: d.payment_date || "", @@ -93,20 +93,20 @@ function mapToFormValues(data: unknown): typeof DEFAULT_VALUES { function mapFormToPayload(values: PaymentMadeFormValues, billId?: string | number | null, expenseId?: string | number | null) { const paymentDetails = - expenseId ? [{ expense_id: expenseId, amount_paid: values.amount ? Number(values.amount) : 0 }] - : [{ bill_id: billId, amount_paid: values.amount ? Number(values.amount) : 0 }] + expenseId ? [{ expense_id: expenseId, amount_paid: values.amount || 0 }] + : [{ bill_id: billId, amount_paid: values.amount || 0 }] return { vendor_id: toId(values.vendor), employee_id: toId(values.employee) || undefined, payment_mode_id: toId(values.payment_mode), payment_for: values.payment_for, - amount: values.amount ? Number(values.amount) : 0, + amount: values.amount || 0, payment_number: values.payment_number || undefined, payment_reference: values.payment_reference || undefined, payment_date: values.payment_date, paid_through: values.paid_through || undefined, notes: values.notes || undefined, - payment_made: values.amount, + payment_made: values.amount || 0, details: paymentDetails, ...(billId ? { bill_id: Number(billId) } : {}), ...(expenseId ? { expense_id: Number(expenseId) } : {}), diff --git a/apps/dashboard/modules/payment-received/payment-received-form.tsx b/apps/dashboard/modules/payment-received/payment-received-form.tsx index 2dbe1ff..f134775 100644 --- a/apps/dashboard/modules/payment-received/payment-received-form.tsx +++ b/apps/dashboard/modules/payment-received/payment-received-form.tsx @@ -44,7 +44,7 @@ const DEFAULT_VALUES: PaymentReceivedFormValues = { job_card: null, payment_mode: null, customer: null, - amount_received: "", + amount_received: 0, payment_number: "", payment_date: new Date().toISOString().split("T")[0], note: "", @@ -59,7 +59,7 @@ function mapToFormValues(data: unknown): PaymentReceivedFormValues { job_card: toRelation(d.job_card_id, d.job_card_name), payment_mode: toRelation(d.payment_mode_id, d.payment_mode_name), customer: toRelation(d.customer_id, d.customer_name), - amount_received: d.amount_received ? String(d.amount_received) : "", + amount_received: d.amount_received != null ? Number(d.amount_received) : 0, payment_number: d.payment_number || "", payment_date: d.payment_date || "", note: d.note || "", @@ -106,7 +106,7 @@ export function PaymentReceivedForm({ resourceId, initialData, onSuccess, defaul base.customer = toRelation(invoiceCustomer.id, customerLabel) } if (invoiceAmount != null && invoiceAmount !== "") { - base.amount_received = String(invoiceAmount) + base.amount_received = Number(invoiceAmount) } } return Object.keys(base).length ? base : initialData diff --git a/build-output.log b/build-output.log new file mode 100644 index 0000000..0117d85 Binary files /dev/null and b/build-output.log differ diff --git a/dashboard-build.log b/dashboard-build.log new file mode 100644 index 0000000..f25077c Binary files /dev/null and b/dashboard-build.log differ