#7108 - exchange-rate #2295

Merged
jgallego merged 11 commits from 7108-exchange-rate into dev 2024-04-26 05:00:07 +00:00
5 changed files with 221 additions and 220 deletions
Showing only changes of commit b0c4f7fd3c - Show all commits

View File

@ -5,5 +5,4 @@ module.exports = Self => {
require('../methods/collection/getTickets')(Self); require('../methods/collection/getTickets')(Self);
require('../methods/collection/assign')(Self); require('../methods/collection/assign')(Self);
require('../methods/collection/getSales')(Self); require('../methods/collection/getSales')(Self);
require('../methods/collection/exchangeRateUpdate')(Self);
}; };

View File

@ -224,5 +224,6 @@
"There are not picking tickets": "There are not picking tickets", "There are not picking tickets": "There are not picking tickets",
"ticketCommercial": "The ticket {{ ticket }} for the salesperson {{ salesMan }} is in preparation. (automatically generated message)", "ticketCommercial": "The ticket {{ ticket }} for the salesperson {{ salesMan }} is in preparation. (automatically generated message)",
"This password can only be changed by the user themselves": "This password can only be changed by the user themselves", "This password can only be changed by the user themselves": "This password can only be changed by the user themselves",
"They're not your subordinate": "They're not your subordinate" "They're not your subordinate": "They're not your subordinate",
"InvoiceIn is already booked": "InvoiceIn is already booked"
} }

View File

@ -17,7 +17,7 @@ describe('exchangeRateUpdate functionality', function() {
spyOn(models.ReferenceRate, 'findOne').and.returnValue(Promise.resolve(null)); spyOn(models.ReferenceRate, 'findOne').and.returnValue(Promise.resolve(null));
spyOn(models.ReferenceRate, 'create').and.returnValue(Promise.resolve()); spyOn(models.ReferenceRate, 'create').and.returnValue(Promise.resolve());
await models.Collection.exchangeRateUpdate(); await models.InvoiceIn.exchangeRateUpdate();
expect(models.ReferenceRate.create).toHaveBeenCalledTimes(2); expect(models.ReferenceRate.create).toHaveBeenCalledTimes(2);
}); });
@ -28,7 +28,7 @@ describe('exchangeRateUpdate functionality', function() {
let thrownError = null; let thrownError = null;
try { try {
await models.Collection.exchangeRateUpdate(); await models.InvoiceIn.exchangeRateUpdate();
} catch (error) { } catch (error) {
thrownError = error; thrownError = error;
} }
@ -41,7 +41,7 @@ describe('exchangeRateUpdate functionality', function() {
let error; let error;
try { try {
await models.Collection.exchangeRateUpdate(); await models.InvoiceIn.exchangeRateUpdate();
} catch (e) { } catch (e) {
error = e; error = e;
} }

View File

@ -10,6 +10,7 @@ module.exports = Self => {
require('../methods/invoice-in/invoiceInEmail')(Self); require('../methods/invoice-in/invoiceInEmail')(Self);
require('../methods/invoice-in/getSerial')(Self); require('../methods/invoice-in/getSerial')(Self);
require('../methods/invoice-in/corrective')(Self); require('../methods/invoice-in/corrective')(Self);
require('../methods/invoice-in/exchangeRateUpdate')(Self);
Self.rewriteDbError(function(err) { Self.rewriteDbError(function(err) {
if (err.code === 'ER_ROW_IS_REFERENCED_2' && err.sqlMessage.includes('vehicleInvoiceIn')) if (err.code === 'ER_ROW_IS_REFERENCED_2' && err.sqlMessage.includes('vehicleInvoiceIn'))