Merge branch 'dev' into 7937-claimAgile
This commit is contained in:
commit
26af667727
|
@ -257,5 +257,6 @@
|
||||||
"Ticket has been delivered out of order": "The ticket {{ticket}} of route {{{fullUrl}}} has been delivered out of order.",
|
"Ticket has been delivered out of order": "The ticket {{ticket}} of route {{{fullUrl}}} has been delivered out of order.",
|
||||||
"clonedFromTicketWeekly": ", that is a cloned sale from ticket {{ ticketWeekly }}",
|
"clonedFromTicketWeekly": ", that is a cloned sale from ticket {{ ticketWeekly }}",
|
||||||
"negativeReplaced": "Replaced item [#{{oldItemId}}]({{{oldItemUrl}}}) {{oldItem}} with [#{{newItemId}}]({{{newItemUrl}}}) {{newItem}} from ticket [{{ticketId}}]({{{ticketUrl}}})",
|
"negativeReplaced": "Replaced item [#{{oldItemId}}]({{{oldItemUrl}}}) {{oldItem}} with [#{{newItemId}}]({{{newItemUrl}}}) {{newItem}} from ticket [{{ticketId}}]({{{ticketUrl}}})",
|
||||||
"The tag and priority can't be repeated": "The tag and priority can't be repeated"
|
"The tag and priority can't be repeated": "The tag and priority can't be repeated",
|
||||||
|
"duplicateWarehouse": "The introduced warehouse already exists"
|
||||||
}
|
}
|
||||||
|
|
|
@ -398,5 +398,6 @@
|
||||||
"Ticket has been delivered out of order": "El ticket {{ticket}} {{{fullUrl}}} no ha sido entregado en su orden.",
|
"Ticket has been delivered out of order": "El ticket {{ticket}} {{{fullUrl}}} no ha sido entregado en su orden.",
|
||||||
"Price cannot be blank": "El precio no puede estar en blanco",
|
"Price cannot be blank": "El precio no puede estar en blanco",
|
||||||
"clonedFromTicketWeekly": ", que es una linea clonada del ticket {{ticketWeekly}}",
|
"clonedFromTicketWeekly": ", que es una linea clonada del ticket {{ticketWeekly}}",
|
||||||
"negativeReplaced": "Sustituido el articulo [#{{oldItemId}}]({{{oldItemUrl}}}) {{oldItem}} por [#{{newItemId}}]({{{newItemUrl}}}) {{newItem}} del ticket [{{ticketId}}]({{{ticketUrl}}})"
|
"negativeReplaced": "Sustituido el articulo [#{{oldItemId}}]({{{oldItemUrl}}}) {{oldItem}} por [#{{newItemId}}]({{{newItemUrl}}}) {{newItem}} del ticket [{{ticketId}}]({{{ticketUrl}}})",
|
||||||
|
"duplicateWarehouse": "El almacén seleccionado ya existe en la zona"
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,12 +48,10 @@ module.exports = Self => {
|
||||||
}, myOptions);
|
}, myOptions);
|
||||||
|
|
||||||
let asien = bookEntry?.ASIEN;
|
let asien = bookEntry?.ASIEN;
|
||||||
|
const invoiceIn = await Self.findById(invoiceInId, myOptions);
|
||||||
if (asien) {
|
if (asien) {
|
||||||
accountingEntries = await models.Xdiario.count({ASIEN: asien}, myOptions);
|
accountingEntries = await models.Xdiario.count({ASIEN: asien}, myOptions);
|
||||||
|
|
||||||
await models.Xdiario.destroyAll({ASIEN: asien}, myOptions);
|
await models.Xdiario.destroyAll({ASIEN: asien}, myOptions);
|
||||||
const invoiceIn = await Self.findById(invoiceInId, myOptions);
|
|
||||||
await invoiceIn.updateAttribute('isBooked', false, myOptions);
|
|
||||||
} else {
|
} else {
|
||||||
const linkedBookEntry = await models.Xdiario.findOne({
|
const linkedBookEntry = await models.Xdiario.findOne({
|
||||||
fields: ['ASIEN'],
|
fields: ['ASIEN'],
|
||||||
|
@ -66,6 +64,8 @@ module.exports = Self => {
|
||||||
asien = linkedBookEntry?.ASIEN;
|
asien = linkedBookEntry?.ASIEN;
|
||||||
isLinked = true;
|
isLinked = true;
|
||||||
}
|
}
|
||||||
|
await invoiceIn.updateAttribute('isBooked', false, myOptions);
|
||||||
|
|
||||||
if (tx) await tx.commit();
|
if (tx) await tx.commit();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -67,6 +67,11 @@ module.exports = Self => {
|
||||||
type: 'number',
|
type: 'number',
|
||||||
description: 'The freighter supplier id'
|
description: 'The freighter supplier id'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
arg: 'entrySupplierFk',
|
||||||
|
type: 'number',
|
||||||
|
description: 'The supplier of the entry(not freighter) id'
|
||||||
|
},
|
||||||
],
|
],
|
||||||
returns: {
|
returns: {
|
||||||
type: ['Object'],
|
type: ['Object'],
|
||||||
|
@ -94,6 +99,8 @@ module.exports = Self => {
|
||||||
return {'t.landed': {lte: value}};
|
return {'t.landed': {lte: value}};
|
||||||
case 'continent':
|
case 'continent':
|
||||||
return {'cnt.code': value};
|
return {'cnt.code': value};
|
||||||
|
case 'entrySupplierFk':
|
||||||
|
return {'e.supplierFk': value};
|
||||||
case 'id':
|
case 'id':
|
||||||
case 'agencyModeFk':
|
case 'agencyModeFk':
|
||||||
case 'warehouseOutFk':
|
case 'warehouseOutFk':
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
let UserError = require('vn-loopback/util/user-error');
|
||||||
|
|
||||||
|
module.exports = Self => {
|
||||||
|
Self.rewriteDbError(function(err) {
|
||||||
|
if (err.code === 'ER_DUP_ENTRY')
|
||||||
|
return new UserError(`duplicateWarehouse`);
|
||||||
|
return err;
|
||||||
|
});
|
||||||
|
};
|
Loading…
Reference in New Issue