feat: invoice (#174)

* feat: add 10 invoice

* feat: invoicelayout

* feat: invoicetable

* refactor: uew new table

* fix: columns missing

* feat: invoicebadgestatus

* feat: formatdate

#156

* refactor: watch pagesize and page

#159

* refector: filter status

#160

* feat: invoice stats

* fix: typo

* chore: cleanup

* refactor: add columns action

* refactor: add btn view invoice

* refactor: add query tab

* refactor: change set code invoice to function

* chore: change case

* refactor: add i18n netvalue

* refactor: add record colors of status invoice

* feat: add view card invoice

* chore: cleanpu

* refactor: handle i18n pay condition

* refactor: handle value by storage or by api

* refactor: add btnn preview

* refactor: function view doc example

* refactor: bind function view doc example

---------

Co-authored-by: Thanaphon Frappet <thanaphon@frappet.com>
Co-authored-by: nwpptrs <jay02499@gmail.com>
Co-authored-by: Methapon2001 <61303214+Methapon2001@users.noreply.github.com>
Co-authored-by: oat_dev <nattapon@frappet.com>
This commit is contained in:
Methapon Metanipat 2025-01-14 11:34:20 +07:00 committed by GitHub
parent 7d1f32a5cb
commit c5d3897d76
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 801 additions and 86 deletions

View file

@ -356,18 +356,8 @@ async function fetchStatus() {
code.value = '';
selectedInstallmentNo.value = [];
selectedInstallment.value = [];
view.value =
quotationFormData.value.payCondition === 'Full' ||
quotationFormData.value.payCondition === 'BillFull'
? View.Invoice
: View.InvoicePre;
if (
quotationFormData.value.payCondition === 'Full' ||
quotationFormData.value.payCondition === 'BillFull'
) {
getInvoiceCodeFullPay();
}
getInvoice();
},
},
{
@ -1011,35 +1001,7 @@ onMounted(async () => {
pageState.isLoaded = true;
if (route.query['tab'] === 'invoice') {
if (route.query['id']) {
const queryInvoiceId = route.query['id'] as string;
const queryInvoiceAmount = Number(route.query['amount']) || 0;
await getInvoiceCode(queryInvoiceId);
selectedInstallmentNo.value =
quotationFormState.value.source?.paySplit
.filter((v) => v.invoiceId === queryInvoiceId)
.map((v) => v.no) || [];
installmentAmount.value = queryInvoiceAmount;
view.value = View.Invoice;
return;
}
selectedInstallmentNo.value = [];
selectedInstallment.value = [];
view.value =
quotationFormData.value.payCondition === 'Full' ||
quotationFormData.value.payCondition === 'BillFull'
? View.Invoice
: View.InvoicePre;
if (
quotationFormData.value.payCondition === 'Full' ||
quotationFormData.value.payCondition === 'BillFull'
) {
getInvoiceCodeFullPay();
}
getInvoice();
}
if (route.query['tab'] === 'receipt') {
await fetchReceipt();
@ -1241,6 +1203,23 @@ async function exampleReceipt(id: string) {
}
}
function getInvoice() {
view.value =
quotationFormData.value.payCondition === 'Full' ||
quotationFormData.value.payCondition === 'BillFull'
? View.Invoice
: View.InvoicePre;
if (
quotationFormData.value.payCondition === 'Full' ||
quotationFormData.value.payCondition === 'BillFull'
) {
getInvoiceCodeFullPay();
} else {
code.value = '';
}
}
watch(
[
() => quotationFormState.value.statusFilterRequest,