feat(invoice): refs #8388 update tax calculations and improve date filtering logic
gitea/salix-front/pipeline/pr-dev This commit is unstable Details

This commit is contained in:
Jorge Penadés 2025-04-22 18:18:42 +02:00
parent 753fa8489c
commit 1c594173fe
4 changed files with 10 additions and 3 deletions

View File

@ -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());

View File

@ -363,6 +363,7 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
<QTd>{{ toCurrency(entity.totals.totalTaxableBase) }}</QTd>
<QTd></QTd>
<QTd></QTd>
<QTd></QTd>
<QTd>{{ toCurrency(getTotalTax(entity.invoiceInTax)) }}</QTd>
<QTd>{{
entity.totals.totalTaxableBaseForeignValue &&

View File

@ -470,7 +470,7 @@ function setCursor(ref) {
size="lg"
v-shortcut="'+'"
round
@click="invoiceInFormRef.insert()"
@click="invoiceInFormRef.insert({ isDeductible: true })"
>
<QTooltip>{{ t('Add tax') }}</QTooltip>
</QBtn>

View File

@ -41,7 +41,7 @@ async function checkToBook(id) {
params: {
where: JSON.stringify({
invoiceInFk: id,
dueDated: { gte: Date.vnNew() },
dueDated: { lte: Date.vnNew() },
}),
},
})