ref #6138 setPasword created #1798

Merged
jorgep merged 6 commits from 6138-setPassword into dev 2023-10-19 10:48:17 +00:00
2 changed files with 5 additions and 8 deletions
Showing only changes of commit 5b1e5743b5 - Show all commits

View File

@ -23,10 +23,6 @@
"columnName": "name"
}
},
"password": {
"type": "string",
"required": true
},
"roleFk": {
"type": "number",
"mysql": {

View File

@ -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 = ?`;