refs #6925 hotFix(invoice) parenthesis & handle incoterms error #2122

Merged
alexm merged 1 commits from hotFix_invoice_incoterms into master 2024-03-04 06:14:35 +00:00
3 changed files with 9 additions and 4 deletions
Showing only changes of commit a3052c1cf9 - Show all commits

View File

@ -15,7 +15,7 @@ BEGIN
JOIN agencyMode am ON am.id = t.agencyModeFk
LEFT JOIN ticketState ts ON ts.ticketFk = t.id
JOIN alertLevel al ON al.id = ts.alertLevel
WHERE al.code = 'PACKED' OR (am.code = 'refund' AND al.code != 'delivered')
WHERE (al.code = 'PACKED' OR (am.code = 'refund' AND al.code != 'delivered'))
AND t.id = vTicketFk
AND t.refFk IS NULL
GROUP BY t.id);

View File

@ -344,5 +344,6 @@
"CountryFK cannot be empty": "El país no puede estar vacío",
"Cmr file does not exist": "El archivo del cmr no existe",
"You are not allowed to modify the alias": "No estás autorizado a modificar el alias",
"No tickets to invoice": "No hay tickets para facturar"
"No tickets to invoice": "No hay tickets para facturar",
"The address of the customer must have information about Incoterms and Customs Agent": "El consignatario del cliente debe tener informado Incoterms y Agente de aduanas"
}

View File

@ -1,4 +1,5 @@
const vnReport = require('../../../core/mixins/vn-report.js');
const UserError = require('vn-loopback/util/user-error');
module.exports = {
name: 'invoice-incoterms',
@ -7,7 +8,10 @@ module.exports = {
this.invoice = await this.findOneFromDef('invoice', [this.reference]);
this.checkMainEntity(this.invoice);
this.client = await this.findOneFromDef('client', [this.reference]);
this.incoterms = await this.findOneFromDef('incoterms', [this.reference, this.reference, this.reference, this.reference]);
this.incoterms =
await this.findOneFromDef('incoterms', [this.reference, this.reference, this.reference, this.reference]);
if (!this.incoterms)
throw new UserError(`The address of the customer must have information about Incoterms and Customs Agent`);
},
props: {
reference: {