From 1c594173fe0699ec4b97865c77aefe3181ab7e5f Mon Sep 17 00:00:00 2001 From: jorgep Date: Tue, 22 Apr 2025 18:18:42 +0200 Subject: [PATCH 01/43] feat(invoice): refs #8388 update tax calculations and improve date filtering logic --- src/pages/InvoiceIn/Card/InvoiceInDueDay.vue | 8 +++++++- src/pages/InvoiceIn/Card/InvoiceInSummary.vue | 1 + src/pages/InvoiceIn/Card/InvoiceInVat.vue | 2 +- src/pages/InvoiceIn/InvoiceInToBook.vue | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/pages/InvoiceIn/Card/InvoiceInDueDay.vue b/src/pages/InvoiceIn/Card/InvoiceInDueDay.vue index 59bebcae2..62fa4be09 100644 --- a/src/pages/InvoiceIn/Card/InvoiceInDueDay.vue +++ b/src/pages/InvoiceIn/Card/InvoiceInDueDay.vue @@ -26,7 +26,12 @@ const invoiceId = +route.params.id; const filter = { where: { invoiceInFk: invoiceId } }; const areRows = ref(false); const totalTaxableBase = ref(); -const noMatch = computed(() => totalAmount.value != totalTaxableBase.value); +const totalVat = ref(); +const noMatch = computed( + () => + totalAmount.value != totalTaxableBase.value && + totalAmount.value != totalVat.value, +); const columns = computed(() => [ { name: 'duedate', @@ -78,6 +83,7 @@ async function insert() { async function setTaxableBase() { const { data } = await axios.get(`InvoiceIns/${invoiceId}/getTotals`); totalTaxableBase.value = data.totalTaxableBase; + totalVat.value = data.totalVat; } onBeforeMount(async () => await setTaxableBase()); diff --git a/src/pages/InvoiceIn/Card/InvoiceInSummary.vue b/src/pages/InvoiceIn/Card/InvoiceInSummary.vue index 74936f00a..79c3c65ae 100644 --- a/src/pages/InvoiceIn/Card/InvoiceInSummary.vue +++ b/src/pages/InvoiceIn/Card/InvoiceInSummary.vue @@ -363,6 +363,7 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`; {{ toCurrency(entity.totals.totalTaxableBase) }} + {{ toCurrency(getTotalTax(entity.invoiceInTax)) }} {{ entity.totals.totalTaxableBaseForeignValue && diff --git a/src/pages/InvoiceIn/Card/InvoiceInVat.vue b/src/pages/InvoiceIn/Card/InvoiceInVat.vue index 61c3040ae..2c8392397 100644 --- a/src/pages/InvoiceIn/Card/InvoiceInVat.vue +++ b/src/pages/InvoiceIn/Card/InvoiceInVat.vue @@ -470,7 +470,7 @@ function setCursor(ref) { size="lg" v-shortcut="'+'" round - @click="invoiceInFormRef.insert()" + @click="invoiceInFormRef.insert({ isDeductible: true })" > {{ t('Add tax') }} diff --git a/src/pages/InvoiceIn/InvoiceInToBook.vue b/src/pages/InvoiceIn/InvoiceInToBook.vue index 28f54f040..a77777597 100644 --- a/src/pages/InvoiceIn/InvoiceInToBook.vue +++ b/src/pages/InvoiceIn/InvoiceInToBook.vue @@ -41,7 +41,7 @@ async function checkToBook(id) { params: { where: JSON.stringify({ invoiceInFk: id, - dueDated: { gte: Date.vnNew() }, + dueDated: { lte: Date.vnNew() }, }), }, }) From 6c49c9ea82473818ca70d2770f2794b5b54abf79 Mon Sep 17 00:00:00 2001 From: jorgep Date: Wed, 23 Apr 2025 16:38:34 +0200 Subject: [PATCH 02/43] fix: refs #8388 update VnSelect component to handle option rendering based on optionLabel type --- src/components/common/VnSelect.vue | 7 +- .../InvoiceIn/Card/InvoiceInIntrastat.vue | 277 ++++++------------ 2 files changed, 96 insertions(+), 188 deletions(-) diff --git a/src/components/common/VnSelect.vue b/src/components/common/VnSelect.vue index 2cb72261f..9010c2e8d 100644 --- a/src/components/common/VnSelect.vue +++ b/src/components/common/VnSelect.vue @@ -407,7 +407,12 @@ function getCaption(opt) {