fix: Date format in sales/purchases APIs.

fix: Algorithm FIFO cost calculate method.
This commit is contained in:
Ahmed Bouhuolia
2020-08-19 00:13:53 +02:00
parent a202a21df5
commit 52d01b4ed8
21 changed files with 291 additions and 133 deletions

View File

@@ -6,7 +6,14 @@ export default class ComputeItemCostJob {
const Logger = Container.get('logger');
const { startingDate, itemId, costMethod } = job.attrs.data;
await InventoryService.computeItemCost(startingDate, itemId, costMethod);
done();
try {
await InventoryService.computeItemCost(startingDate, itemId, costMethod);
Logger.log(`Compute item cost: ${job.attrs.data}`);
done();
} catch(e) {
Logger.error(`Compute item cost: ${job.attrs.data}, error: ${e}`);
done(e);
}
}
}