// if(input.Sales_Type == "Contract") // { clear Product_Details; fet_so = Sales_Order[ID == input.Sales_Order_ID]; if(input.Load_Products == True) { show Product_Details; show Total_Qty; show Total_Weight; sno = 0; for each var in input.Product_List { a1 = Sale_Order_Subform[Sales_Order_Exis_ID == fet_so.ID && Part_No == var && Balance_Qty > 0]; planvar1 = ifNull(a1.Balance_Qty,0) - ifNull(a1.Planned_Qty_So_far,0); if(a1.count() > 0) { fetch_inven = Inventory[Part_No == a1.Part_No].sum(Available_Qty); row1 = Create_Dispatch_Note_Format.Product_Details(); row1.Sale_Order_Subform_ID=a1.ID; row1.Product_Description=a1.Part_Description; row1.Product_Code=a1.Part_No; row1.Customer_Product_Code=a1.Customer_Part_Code; row1.Remarks=a1.Remarks; row1.UoM=a1.UoM; row1.Packing_Details1=a1.Packing_Std; //row1.Planned_Qty=a1.Qty; row1.Ordered_Qty=a1.Qty; // row1.Stock_Qty=fetch_inven; row1.Plan_Qty_so_far=a1.Planned_Qty_So_far; if(a1.Balance_Qty > 0 && planvar1 > 0) { row1.S_NO=sno + 1; sno = sno + 1; input.Product_Details.insert(row1); } disable Sale_Order_Subform_RECID; disable Product_Details.S_NO; disable Product_Details.Product_Code; disable Product_Details.Product_Description; } } if(input.Dispatch_Type == "Plan") { Total1 = 0; wt = 0; for each rec in input.Product_Details { fet_item = Materials[ID = rec.Product_Code]; salesub = Sale_Order_Subform[Sales_Order_Exis_ID == input.Sales_Order_ID && Part_No == rec.Product_Code]; rec.Planned_Qty=ifNull(salesub.Balance_Qty,0) - ifNull(salesub.Planned_Qty_So_far,0); // rec.Stock_Qty=fetch_inven; Total1 = Total1 + rec.Planned_Qty; rec.Product_Weight=ifNull(fet_item.Final_Weight,0.0) * ifNull(rec.Planned_Qty,0.0); wt = wt + rec.Product_Weight; disable Total_Qty; disable Total_Weight; } input.Total_Qty = Total1; input.Total_Weight = wt; } } //}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter