5914-transferInvoiceOut #1761
|
@ -23,10 +23,6 @@
|
||||||
"columnName": "name"
|
"columnName": "name"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"password": {
|
|
||||||
"type": "string",
|
|
||||||
"required": true
|
|
||||||
},
|
|
||||||
"roleFk": {
|
"roleFk": {
|
||||||
"type": "number",
|
"type": "number",
|
||||||
"mysql": {
|
"mysql": {
|
||||||
|
@ -42,9 +38,6 @@
|
||||||
"active": {
|
"active": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"email": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"created": {
|
"created": {
|
||||||
"type": "date"
|
"type": "date"
|
||||||
},
|
},
|
||||||
|
|
|
@ -138,14 +138,15 @@ module.exports = Self => {
|
||||||
// Update original sale
|
// Update original sale
|
||||||
const rest = originalSale.quantity - sale.quantity;
|
const rest = originalSale.quantity - sale.quantity;
|
||||||
query = `UPDATE sale
|
query = `UPDATE sale
|
||||||
SET quantity = ?
|
SET quantity = ?,
|
||||||
|
originalQuantity = ?
|
||||||
WHERE id = ?`;
|
WHERE id = ?`;
|
||||||
await Self.rawSql(query, [rest, sale.id], options);
|
await Self.rawSql(query, [rest, rest, sale.id], options);
|
||||||
|
|
||||||
// Clone sale with new quantity
|
// 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)
|
reserved, isPicked, isPriceFixed, isAdded)
|
||||||
SELECT itemFk, ?, concept, ?, originalQuantity, price, discount, priceFixed,
|
SELECT itemFk, ?, concept, ?, price, discount, priceFixed,
|
||||||
reserved, isPicked, isPriceFixed, isAdded
|
reserved, isPicked, isPriceFixed, isAdded
|
||||||
FROM sale
|
FROM sale
|
||||||
WHERE id = ?`;
|
WHERE id = ?`;
|
||||||
|
|
Loading…
Reference in New Issue