refactor: handle btn installment

This commit is contained in:
Thanaphon Frappet 2024-11-27 10:46:15 +07:00
parent ac1f034bfa
commit e902bcce8d
2 changed files with 4 additions and 2 deletions

View file

@ -296,7 +296,9 @@ const productService = computed(() => {
function isIssueInvoice() {
return quotationFormData.value.paySplit.some(
(v) => selectedInstallmentNo.value.includes(v.no) && !!v.invoiceId,
(value) =>
selectedInstallmentNo.value.includes(value.no) &&
value.invoiceId !== undefined,
);
}

View file

@ -136,7 +136,7 @@ export const useQuotationForm = defineStore('form-quotation', () => {
payBillDate: data.payBillDate ? new Date(data.payBillDate) : undefined,
paySplit: data.paySplit.map((p) => ({
no: p.no,
invoiceId: p.invoiceId,
invoiceId: p.invoiceId || undefined,
name: p.name,
amount: p.amount,
})),