8627-devToTest #1421
|
@ -15,6 +15,20 @@ const { store } = useArrayData();
|
||||||
async function checkToBook(id) {
|
async function checkToBook(id) {
|
||||||
let messages = [];
|
let messages = [];
|
||||||
|
|
||||||
|
const hasProblemWithTax = (
|
||||||
|
await axios.get('InvoiceInTaxes/count', {
|
||||||
|
params: {
|
||||||
|
where: JSON.stringify({
|
||||||
|
invoiceInFk: id,
|
||||||
|
or: [{ taxTypeSageFk: null }, { transactionTypeSageFk: null }],
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
).data?.count;
|
||||||
|
|
||||||
|
if (hasProblemWithTax)
|
||||||
|
messages.push(t('The VAT and Transaction fields have not been informed'));
|
||||||
|
|
||||||
const { data: totals } = await axios.get(`InvoiceIns/${id}/getTotals`);
|
const { data: totals } = await axios.get(`InvoiceIns/${id}/getTotals`);
|
||||||
const taxableBaseNotEqualDueDay = totals.totalDueDay != totals.totalTaxableBase;
|
const taxableBaseNotEqualDueDay = totals.totalDueDay != totals.totalTaxableBase;
|
||||||
const vatNotEqualDueDay = totals.totalDueDay != totals.totalVat;
|
const vatNotEqualDueDay = totals.totalDueDay != totals.totalVat;
|
||||||
|
@ -43,11 +57,7 @@ async function checkToBook(id) {
|
||||||
title: t('Are you sure you want to book this invoice?'),
|
title: t('Are you sure you want to book this invoice?'),
|
||||||
message: messages.reduce((acc, msg) => `${acc}<p>${msg}</p>`, ''),
|
message: messages.reduce((acc, msg) => `${acc}<p>${msg}</p>`, ''),
|
||||||
},
|
},
|
||||||
}).onOk(async () => {
|
}).onOk(() => toBook(id));
|
||||||
await toBook(id);
|
|
||||||
|
|
||||||
axios.get();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function toBook(id) {
|
async function toBook(id) {
|
||||||
|
@ -74,4 +84,5 @@ es:
|
||||||
It was not able to book the invoice: No se pudo contabilizar la factura
|
It was not able to book the invoice: No se pudo contabilizar la factura
|
||||||
Some due dates are less than or equal to today: Algún vencimiento tiene una fecha menor o igual que hoy
|
Some due dates are less than or equal to today: Algún vencimiento tiene una fecha menor o igual que hoy
|
||||||
The sum of the taxable bases does not match the due dates: La suma de las bases imponibles no coincide con la de los vencimientos
|
The sum of the taxable bases does not match the due dates: La suma de las bases imponibles no coincide con la de los vencimientos
|
||||||
|
The VAT and Transaction fields have not been informed: No se han informado los campos de IVA y Transacción
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
Loading…
Reference in New Issue