Merge branch 'test' of https://gitea.verdnatura.es/verdnatura/salix into dev
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
commit
4de2220b5c
|
@ -138,7 +138,9 @@ module.exports = Self => {
|
||||||
const params = [args.id, args.shipped, args.warehouseFk];
|
const params = [args.id, args.shipped, args.warehouseFk];
|
||||||
const [salesMovable] = await Self.rawSql(query, params, myOptions);
|
const [salesMovable] = await Self.rawSql(query, params, myOptions);
|
||||||
|
|
||||||
const salesNewTicket = salesMovable.filter(sale => (sale.movable ?? 0) >= sale.quantity);
|
const saleMovable = sale.movable ? sale.movable : 0;
|
||||||
|
|
||||||
|
const salesNewTicket = salesMovable.filter(sale => saleMovable >= sale.quantity);
|
||||||
if (salesNewTicket.length) {
|
if (salesNewTicket.length) {
|
||||||
const newTicket = await models.Ticket.transferSales(ctx, args.id, null, salesNewTicket, myOptions);
|
const newTicket = await models.Ticket.transferSales(ctx, args.id, null, salesNewTicket, myOptions);
|
||||||
args.id = newTicket.id;
|
args.id = newTicket.id;
|
||||||
|
|
|
@ -122,8 +122,10 @@ module.exports = Self => {
|
||||||
const [salesMovable] = await Self.rawSql(query, params, myOptions);
|
const [salesMovable] = await Self.rawSql(query, params, myOptions);
|
||||||
|
|
||||||
const itemMovable = new Map();
|
const itemMovable = new Map();
|
||||||
for (sale of salesMovable)
|
for (sale of salesMovable) {
|
||||||
itemMovable.set(sale.id, sale.movable ?? 0);
|
const saleMovable = sale.movable ? sale.movable : 0;
|
||||||
|
itemMovable.set(sale.id, saleMovable);
|
||||||
|
}
|
||||||
|
|
||||||
// Sale price component, one per sale
|
// Sale price component, one per sale
|
||||||
query = `CALL vn.ticket_priceDifference(?, ?, ?, ?, ?)`;
|
query = `CALL vn.ticket_priceDifference(?, ?, ?, ?, ?)`;
|
||||||
|
|
Loading…
Reference in New Issue