fix build errors
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user