8032-devToTest_2440 #3009

Merged
alexm merged 262 commits from 8032-devToTest_2440 into test 2024-09-24 09:34:49 +00:00
1 changed files with 6 additions and 5 deletions
Showing only changes of commit 6c9676ce9c - Show all commits

View File

@ -70,12 +70,13 @@ module.exports = Self => {
const [{taxArea}] = await Self.rawSql('SELECT clientTaxArea(?,?) taxArea',
[ticket.clientFk, ticket.warehouseFk], myOptions);
if (ticketState.alertLevel >= packedState.alertLevel && taxArea == 'WORLD' && client.hasDailyInvoice) {
await Self.invoiceTicketsAndPdf(ctx, [ticketId], null, myOptions);
return true;
}
const isInvoiceable = ticketState.alertLevel >= packedState.alertLevel &&
taxArea == 'WORLD' && client.hasDailyInvoice;
if (tx) await tx.commit();
return false;
if (isInvoiceable) await Self.invoiceTicketsAndPdf(ctx, [ticketId]);
return isInvoiceable;
} catch (e) {
if (tx) await tx.rollback();
throw e;