faults
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Ainki 2020-03-23 13:26:45 +01:00
parent a4f14e5fda
commit c7a5d94ed0
3 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,35 @@
module.exports = Self => {
Self.remoteMethodCtx('collectionFaults', {
description: 'Update sale of a collection',
accessType: 'WRITE',
accepts: [{
arg: 'shelvingFk',
type: 'Number',
required: true,
description: 'The sale id'
}, {
arg: 'quantity',
type: 'Number',
required: true,
description: 'The quantity to sale'
}, {
arg: 'itemFk',
type: 'Number',
required: true,
description: 'The ticket id'
}],
returns: {
type: 'Object',
root: true
},
http: {
path: `/collectionFaults`,
verb: 'POST'
}
});
Self.collectionFaults = async(ctx, shelvingFk, quantity, itemFk) => {
query = `vn.collection_faults(?,?,?)`;
return await Self.rawSql(query, [shelvingFk, quantity, itemFk]);
};
};

View File

@ -45,6 +45,9 @@ module.exports = Self => {
query = `CALL vn.collectionPlacement_get(?)`; query = `CALL vn.collectionPlacement_get(?)`;
const [placements] = await Self.rawSql(query, [collectionFk]); const [placements] = await Self.rawSql(query, [collectionFk]);
query = `CALL vn.collectionSticker_print(?,?)`;
// await Self.rawSql(query, [collectionFk, sectorFk]);
return makeCollection(tickets, sales, placements); return makeCollection(tickets, sales, placements);
}; };

View File

@ -3,4 +3,5 @@ module.exports = Self => {
require('../methods/collection/collectionNew')(Self); require('../methods/collection/collectionNew')(Self);
require('../methods/collection/getSectors')(Self); require('../methods/collection/getSectors')(Self);
require('../methods/collection/collectionUpdateSale')(Self); require('../methods/collection/collectionUpdateSale')(Self);
require('../methods/collection/collectionFaults')(Self);
}; };