Merge branch 'test' into dev
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Guillermo Bonet 2024-07-29 09:24:57 +02:00
commit f9c58e63e1
2 changed files with 7 additions and 2 deletions

View File

@ -367,5 +367,6 @@
"It has been invoiced but the PDF of refund not be generated": "Se ha facturado pero no se ha podido generar el PDF del abono", "It has been invoiced but the PDF of refund not be generated": "Se ha facturado pero no se ha podido generar el PDF del abono",
"Payment method is required": "El método de pago es obligatorio", "Payment method is required": "El método de pago es obligatorio",
"Cannot send mail": "Não é possível enviar o email", "Cannot send mail": "Não é possível enviar o email",
"CONSTRAINT `supplierAccountTooShort` failed for `vn`.`supplier`": "La cuenta debe tener exactamente 10 dígitos" "CONSTRAINT `supplierAccountTooShort` failed for `vn`.`supplier`": "La cuenta debe tener exactamente 10 dígitos",
} "The sale not exists in the item shelving": "La venta no existe en la estantería del artículo"
}

View File

@ -1,3 +1,4 @@
const UserError = require('vn-loopback/util/user-error');
module.exports = Self => { module.exports = Self => {
Self.remoteMethod('updateFromSale', { Self.remoteMethod('updateFromSale', {
description: 'Update the visible items', description: 'Update the visible items',
@ -32,6 +33,9 @@ module.exports = Self => {
include: {relation: 'itemShelving'} include: {relation: 'itemShelving'}
}, myOptions); }, myOptions);
if (!itemShelvingSale?.itemShelving())
throw new UserError('The sale not exists in the item shelving');
const itemShelving = itemShelvingSale.itemShelving(); const itemShelving = itemShelvingSale.itemShelving();
const quantity = itemShelving.visible + itemShelvingSale.quantity; const quantity = itemShelving.visible + itemShelvingSale.quantity;