feat(invoice): refs #8388 update tax calculations and improve date filtering logic
gitea/salix-front/pipeline/pr-dev This commit is unstable
Details
gitea/salix-front/pipeline/pr-dev This commit is unstable
Details
This commit is contained in:
parent
753fa8489c
commit
1c594173fe
|
@ -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());
|
||||
|
|
|
@ -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 &&
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -41,7 +41,7 @@ async function checkToBook(id) {
|
|||
params: {
|
||||
where: JSON.stringify({
|
||||
invoiceInFk: id,
|
||||
dueDated: { gte: Date.vnNew() },
|
||||
dueDated: { lte: Date.vnNew() },
|
||||
}),
|
||||
},
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue