8062-testToMaster_2 #3059
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue