diff --git a/back/methods/collection/collectionMissingTrash.js b/back/methods/collection/collectionMissingTrash.js index 54510fcb6..f03ac975c 100644 --- a/back/methods/collection/collectionMissingTrash.js +++ b/back/methods/collection/collectionMissingTrash.js @@ -1,5 +1,5 @@ module.exports = Self => { - Self.remoteMethodCtx('collectionMissingTrash', { + Self.remoteMethod('collectionMissingTrash', { description: 'Modify the amount of a sale throwing it into faults or trash', accessType: 'WRITE', accepts: [{ @@ -42,9 +42,10 @@ module.exports = Self => { } }); - Self.collectionMissingTrash = async function missingTrash(saleId, quantity, isTrash, warehouseId, newQuantity) { + Self.collectionMissingTrash = async(saleId, quantity, isTrash, warehouseId, newQuantity) => { + params = [saleId, quantity, isTrash, warehouseId, newQuantity]; const query = `CALL vn.collection_missingTrash(?,?,?,?,?)`; - const [result] = await Self.rawSql(query, [saleId.args.saleId, quantity, isTrash, warehouseId, newQuantity]); + const [result] = await Self.rawSql(query, [params]); return result; }; };