feat: refs #7984 add currency in sale
gitea/salix/pipeline/pr-dev There was a failure building this commit
Details
gitea/salix/pipeline/pr-dev There was a failure building this commit
Details
This commit is contained in:
parent
2b21e7d62b
commit
cd776b691a
|
@ -127,15 +127,15 @@ module.exports = Self => {
|
|||
|
||||
async function getBarcodes(ticketId, options) {
|
||||
const query =
|
||||
`SELECT s.id movementId,
|
||||
b.code,
|
||||
`SELECT s.id movementId,
|
||||
b.code,
|
||||
c.id
|
||||
FROM vn.sale s
|
||||
LEFT JOIN vn.itemBarcode b ON b.itemFk = s.itemFk
|
||||
LEFT JOIN vn.buy c ON c.itemFk = s.itemFk
|
||||
LEFT JOIN vn.entry e ON e.id = c.entryFk
|
||||
LEFT JOIN vn.travel tr ON tr.id = e.travelFk
|
||||
WHERE s.ticketFk = ?
|
||||
WHERE s.ticketFk = ?
|
||||
AND tr.landed >= DATE_SUB(CURDATE(), INTERVAL 1 YEAR)`;
|
||||
return Self.rawSql(query, [ticketId], options);
|
||||
}
|
||||
|
|
|
@ -276,13 +276,6 @@ INSERT INTO `hedera`.`tpvConfig` (currency, terminal, transactionType, maxAmount
|
|||
VALUES (978, 1, 0, 2000, 9, 'https://sis.redsys.es/sis/realizarPago', 0, 'https://sis-t.redsys.es:25443/sis/realizarPago', 'sq7HjrUOBfKmC576ILgskD5srU870gJ7', NULL);
|
||||
*/
|
||||
|
||||
UPDATE vn.ticket t
|
||||
JOIN vn.sale s ON s.ticketFk = t.id
|
||||
JOIN vn.referenceRate rr ON rr.currencyFk = t.currency
|
||||
AND rr.dated = util.VN_CURDATE()
|
||||
SET t.foreignPrice = t.price * vn.currency_getRate(t.currencyFk, NULL);
|
||||
|
||||
|
||||
INSERT INTO hedera.tpvMerchantEnable (merchantFk, companyFk)
|
||||
VALUES (1, 442);
|
||||
|
||||
|
|
|
@ -4063,3 +4063,9 @@ INSERT IGNORE INTO vn.osrmConfig (id,url,tolerance)
|
|||
INSERT IGNORE INTO vn.inventoryConfig
|
||||
SET id = 1,
|
||||
supplierFk = 4;
|
||||
|
||||
UPDATE vn.ticket t
|
||||
JOIN vn.sale s ON s.ticketFk = t.id
|
||||
JOIN vn.referenceRate rr ON rr.currencyFk = t.currencyFk
|
||||
AND rr.dated = util.VN_CURDATE()
|
||||
SET s.foreignPrice = s.price * vn.currency_getRate(t.currencyFk, NULL);
|
||||
|
|
|
@ -25,6 +25,9 @@
|
|||
"price": {
|
||||
"type": "number"
|
||||
},
|
||||
"foreignPrice": {
|
||||
"type": "number"
|
||||
},
|
||||
"discount": {
|
||||
"type": "number"
|
||||
},
|
||||
|
|
|
@ -165,6 +165,11 @@
|
|||
"model": "Cmr",
|
||||
"foreignKey": "cmrFk"
|
||||
},
|
||||
"currency": {
|
||||
"type": "belongsTo",
|
||||
"model": "Currency",
|
||||
"foreignKey": "currencyFk"
|
||||
},
|
||||
"ticketCollections": {
|
||||
"type": "hasMany",
|
||||
"model": "TicketCollection",
|
||||
|
|
Loading…
Reference in New Issue