feat: refs #7984 add currency in sale
gitea/salix/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Alex Moreno 2025-01-21 15:09:24 +01:00
parent 2b21e7d62b
commit cd776b691a
5 changed files with 17 additions and 10 deletions

View File

@ -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);

View File

@ -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);

View File

@ -25,6 +25,9 @@
"price": {
"type": "number"
},
"foreignPrice": {
"type": "number"
},
"discount": {
"type": "number"
},

View File

@ -165,6 +165,11 @@
"model": "Cmr",
"foreignKey": "cmrFk"
},
"currency": {
"type": "belongsTo",
"model": "Currency",
"foreignKey": "currencyFk"
},
"ticketCollections": {
"type": "hasMany",
"model": "TicketCollection",