Merge pull request 'refs #6312 no inserta el originalquantity' (!1803) from 6312 into dev
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
Reviewed-on: #1803 Reviewed-by: Alex Moreno <alexm@verdnatura.es>
This commit is contained in:
commit
84fc0de4ea
|
@ -138,14 +138,15 @@ module.exports = Self => {
|
|||
// Update original sale
|
||||
const rest = originalSale.quantity - sale.quantity;
|
||||
query = `UPDATE sale
|
||||
SET quantity = ?
|
||||
SET quantity = ?,
|
||||
originalQuantity = ?
|
||||
WHERE id = ?`;
|
||||
await Self.rawSql(query, [rest, sale.id], options);
|
||||
await Self.rawSql(query, [rest, rest, sale.id], options);
|
||||
|
||||
// Clone sale with new quantity
|
||||
query = `INSERT INTO sale (itemFk, ticketFk, concept, quantity, originalQuantity, price, discount, priceFixed,
|
||||
query = `INSERT INTO sale (itemFk, ticketFk, concept, quantity, price, discount, priceFixed,
|
||||
reserved, isPicked, isPriceFixed, isAdded)
|
||||
SELECT itemFk, ?, concept, ?, originalQuantity, price, discount, priceFixed,
|
||||
SELECT itemFk, ?, concept, ?, price, discount, priceFixed,
|
||||
reserved, isPicked, isPriceFixed, isAdded
|
||||
FROM sale
|
||||
WHERE id = ?`;
|
||||
|
|
Loading…
Reference in New Issue