Hi -
I'm trying to modify the Open Sales Order Lines Inquiry. I have to add a new field which is PO Ordered on Open Sales Order Lines.
I have to make a link between On Hand Inventory Inquiry and Open Sales Order Lines in order to get this new field (PO Ordered) populated on Open Sales Order Lines.
I need to display all the PO ordered for a particular item with respect to the Warehouse. Take a look at the screen shot below.
I need to pick the PO ordered value from this On hand Inquiry and display it on my Open Sales Order Lines.
As you can see I have the Ordered PO field populated in Open sales Lines but my data is not matching with the On Hand Inquiry.
I'm using Item 48010151 for example. If you look in the first screen shot item 48010151 has the following results
Ware House PO Quantity
whse 01 20
whse 04 12
whse 05 36
And now in my Open Sales Order Form the results are as follows
Warehouse Po Quantity
whse 01 20
whse 04 20
whse 05 20
The problem is that my query is only getting the first PO quantity for an item per warehouse. and it uses the same value for every other warehouse. I need to write the query which will get the exact value of PO ordered from On hand inquiry over to my Open sales Lines Inquiry. Please take a look at my code below
display InventQtyOrdered MTR_DisplayOrderedPoQty()
{
InventSum inventSum;
SalesLine salesline;
InventDim inventDim;
SalesTable salesTable;
InventLocationId id ;
select * from inventSum
where inventSum.Ordered != 0
&& inventSum.ItemId == this.ItemId
join * from inventDim
where inventDim.inventDimId == inventSum.InventDimId;
return inventSum.Ordered;
}
Can anyone please suggest me how I can fix my code to get the values of PO ordered according to the warehouse in Open sales Lines Inquiry?
Thank You
*This post is locked for comments