Hi guys, im currently creating an On Hand Report Filter by ItemGroupId and seggregated by Warehouse
this should be the layout of the report
On Hand Inventory FROMDATE - TODATE
WAREHOUSE1
ITEMID ITEMNAME OPENING QTY OPENING AMOUNT CLOSE QTY CLOSE AMOUNT
Item1
Item3
SUBTOTAL
WAREHOUSE2
ITEMID ITEMNAME OPENING QTY OPENING AMOUNT CLOSE QTY CLOSE AMOUNT
Item2
Item4
SUBTOTAL
GRANDTOTAL
--------->
Here is my simple code, however it doesnt group the items per warehouse…any wrong code or misplaced or missing code…please help me… or you can suggest any other way on how i can accomplish this one…thanks in advance
public boolean fetch()
{
;
while select * from inventtable
where inventtable.ItemGroupId == itemgrid || itemgrid == “”
{
itemnum = inventtable.ItemId;
itemname = inventtable.ItemName;
while select * from inventtrans join inventdim
where inventtrans.ItemId == inventtable.ItemId
&& inventtrans.DateFinancial <= tdate
&& inventdim.inventDimId == inventtrans.inventDimId
&& inventtrans.StatusReceipt != StatusReceipt::Ordered
{
endbal += inventtrans.costValue();
qty += inventtrans.Qty;
costprice = inventsum.averageCostPrice();
if(inventtrans.DateFinancial <= fdate
&& inventtrans.StatusReceipt != StatusReceipt::Ordered)
{
begbal += inventtrans.costValue();
bqty +=inventtrans.Qty;
}
if( ilocid != inventdim.InventLocationId)
{
info(strfmt("%1-%2-%3",inventdim.inventDimId,inventtrans.inventDimId,inventdim.InventLocationId));
ilocid = inventdim.InventLocationId;
element.execute(3);//Warehouse
}
}
element.execute(1);//lines
begbal =0;
endbal =0;
qty =0;
costprice =0;
bqty = 0;
}
While Select count(ItemId) from InventTable
where inventtable.ItemGroupId == itemgrid
{
flag = strfmt("%1",inventtable.ItemId);
}
return true;
}