Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for(var i = 0; i < data.length; i++) {
- result.push(data[i])
- if(data[i].Approval == 1) {
- if(data[i].inventory_branch.inventory.IsBundle == 1) {
- // cek bundle id
- let itemBranchId = data[i].inventory_branch.Id
- // get bundle id dr item branch id
- Bundles.searchByItemId(itemBranchId).then(function (bundleData) {
- // extract item details
- ItemDetails.findbymodule("Bundle", bundleData.data.Id).then(function (itemdetailsrequest) {
- let itemdetails = itemdetailsrequest.data
- // kasih tag IsBundle = 1 di setiap item hasil extractnya
- for(var j = 0; j < itemdetails.length; j++) {
- let itemextrackan = itemdetails[j]
- itemextrackan.Code = "EXT/" + itemextrackan.Code
- itemextrackan.IsBundle = 1
- // push isi item details
- console.log(itemextrackan)
- result.push(itemextrackan)
- }
- })
- })
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement