@@ -100,12 +100,10 @@ export function PaymentReceivedForm({ resourceId, initialData, onSuccess, defaul
|
||||
base.job_card = toRelation(defaultJobCard.id, defaultJobCard.title ?? undefined)
|
||||
}
|
||||
if (invoiceCustomer?.id != null) {
|
||||
base.customer = toRelation(
|
||||
invoiceCustomer.id,
|
||||
invoiceCustomer.first_name
|
||||
? `${invoiceCustomer.first_name} ${invoiceCustomer.last_name || ""}`.trim()
|
||||
: undefined
|
||||
)
|
||||
const customerLabel = invoiceCustomer.first_name
|
||||
? `${invoiceCustomer.first_name} ${invoiceCustomer.last_name || ""}`.trim()
|
||||
: (invoiceCustomer as any).company_name || (invoiceCustomer as any).name || undefined
|
||||
base.customer = toRelation(invoiceCustomer.id, customerLabel)
|
||||
}
|
||||
if (invoiceAmount != null && invoiceAmount !== "") {
|
||||
base.amount_received = String(invoiceAmount)
|
||||
|
||||
Reference in New Issue
Block a user