diff --git a/src/pages/12_debit-note/FormPage.vue b/src/pages/12_debit-note/FormPage.vue index 2d877731..a003b814 100644 --- a/src/pages/12_debit-note/FormPage.vue +++ b/src/pages/12_debit-note/FormPage.vue @@ -119,7 +119,7 @@ const currentFormData = ref({ payBillDate: new Date(), paySplitCount: 0, payCondition: PayCondition.Full, - dueDate: new Date(), + dueDate: new Date(Date.now() + 86400000), discount: 0, status: 'CREATED', remark: '#[quotation-labor]

#[quotation-payment]', diff --git a/src/pages/12_debit-note/expansion/DocumentExpansion.vue b/src/pages/12_debit-note/expansion/DocumentExpansion.vue index 573d8c81..9206863b 100644 --- a/src/pages/12_debit-note/expansion/DocumentExpansion.vue +++ b/src/pages/12_debit-note/expansion/DocumentExpansion.vue @@ -69,6 +69,22 @@ const quotationCreatedBy = defineModel('quotationCreatedBy'); if (typeof v === 'string') dueDate = v; } " + :rules="[ + () => { + if (!dueDate) return $t('form.error.required'); + + const currentDate = new Date(dueDate); + const toDate = new Date(); + if ( + !readonly && + (currentDate.getTime() === toDate.getTime() || + currentDate.getTime() < toDate.getTime()) + ) + return $t('quotation.validateDueDate'); + return true; + }, + ]" + :disabled-dates="(date: Date) => date.getTime() <= Date.now()" :readonly />