8713-testToMaster #3523

Merged
alexm merged 383 commits from 8713-testToMaster into master 2025-03-04 06:52:15 +00:00
1 changed files with 2 additions and 3 deletions
Showing only changes of commit f347d9668f - Show all commits

View File

@ -24,7 +24,6 @@ module.exports = Self => {
const userId = ctx.req.accessToken.userId;
const myOptions = {userId};
let tx;
let result;
if (typeof options == 'object')
Object.assign(myOptions, options);
@ -33,12 +32,12 @@ module.exports = Self => {
myOptions.transaction = tx;
}
const entry = await Self.findById(entryFk, myOptions);
const entryConfig = await Self.app.models.EntryConfig.findOne(myOptions);
const entryConfig = await Self.app.models.EntryConfig.findOne({}, myOptions);
if (entry.supplierFk === entryConfig.inventorySupplierFk) return;
try {
result = await Self.rawSql('CALL vn.buy_recalcPricesByEntry(?)', [entryFk], myOptions);
const result = await Self.rawSql('CALL vn.buy_recalcPricesByEntry(?)', [entryFk], myOptions);
if (tx) await tx.commit();
return result[0];