Merge branch 'dev' into 4021_packaging
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Sergio De la torre 2024-05-31 06:43:20 +00:00
commit 1944a4f308
2 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,2 @@
ALTER TABLE vn.productionConfig ADD scannablePreviusCodeType enum('qr','barcode')
CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT 'barcode' NOT NULL;

View File

@ -54,6 +54,20 @@ module.exports = Self => {
value: rate
});
}
const monday = 1;
if (xmlDateWithoutTime.getDay() === monday) {
const saturday = new Date(xmlDateWithoutTime);
saturday.setDate(xmlDateWithoutTime.getDate() - 2);
const sunday = new Date(xmlDateWithoutTime);
sunday.setDate(xmlDateWithoutTime.getDate() - 1);
for (const date of [saturday, sunday]) {
await models.ReferenceRate.upsertWithWhere(
{currencyFk: currency.id, dated: date},
{currencyFk: currency.id, dated: date, value: rate}
);
}
}
}
}
}