Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- async updateItemCost(omitcode = "") {
- for (let irow of await oo.query.select(["Code"]).from("Item").where({Recipe: this.Code}).fetch()) {
- if (!omitcode || omitcode != irow.Code) {
- let icost = await cm.ItemCost.bring(irow.Code);
- if (icost) {
- icost.SubCost = this.TotalCost;
- if (!icost.OperativeCostCurrency)
- icost.OperativeCostCurrency = await cm.Currency.default();
- let res = await icost.save();
- if (!res){
- this.__error_responses__ = icost.getErrorResponses();
- return res;
- }
- }
- }
- }
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement