Advertisement
Guest User

Untitled

a guest
Mar 26th, 2020
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. async updateItemCost(omitcode = "") {
  2. for (let irow of await oo.query.select(["Code"]).from("Item").where({Recipe: this.Code}).fetch()) {
  3. if (!omitcode || omitcode != irow.Code) {
  4. let icost = await cm.ItemCost.bring(irow.Code);
  5. if (icost) {
  6. icost.SubCost = this.TotalCost;
  7. if (!icost.OperativeCostCurrency)
  8. icost.OperativeCostCurrency = await cm.Currency.default();
  9. let res = await icost.save();
  10. if (!res){
  11. this.__error_responses__ = icost.getErrorResponses();
  12. return res;
  13. }
  14. }
  15. }
  16. }
  17. return true;
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement