trigger for partial received in goods received document. help [message #215112] |
Fri, 19 January 2007 06:25  |
Smith_X
Messages: 56 Registered: January 2007
|
Member |
|
|
Short version
Which PL/SQL trigger I should insert the code to handle the situation receive item more than one time.
Whole story
I have a PO (Purchase Order document) which it's a master-detail relationship. Next, I create a GR (Goods Received document) The detail of GR should stick with the inventory data in PO detail only. (I'm already finished up that part, it's a cursor loop thing...)
Anyway, now I have another problem. If user made a partial receive or supplier want to split the inventory.. Then, my GR document should be able to handle this situation. So, what I design in my mind is below,
PO detail have quantity column and quantity left column. Quantity column is the total quantity of one record in PO detail but the quantity left is just only the remain item. In this case, I can use the logic below to update the number of inventory that I have not received yet.
v_Purchase_Order_Detail.Quantity_Left = Purchase_Order_Detail.Quantity_Left + :Goods_Receive_Doc.Quantity
next, if the Quantity Left is equal to Quantity Column, I will have a code to change the status of this record from Normal to Completed. I think I have an option for user to set the records status to Completed even though the Quantity Left column is not reach zero due to sometime.. Supplier just stop sending the product 
Could anybody tell me which PL/SQL's trigger that I should put the above two codes, please??
one more question..
If the Goods Received Document populates the detail from Purchase Order Document, I want to have a trigger that will detect the status of Purchase Order Detail Item which have the status 'Completed' and then I will use set_item_property to disable quantity received text item. This procedure will ensure that user cannot enter then inventory received for the detail item that already "finish received" Is it ok to use a checkbox to control the detail block please?
--check box (checked value is 'can receive', uncheck value is 'completed or cannot received' )
--first, I need to select data to checkbox. the status locate on the different table. I use cursor and it's work fine!.
IF :RRI.STS_CHECKBOX = 'completed' THEN
SET_ITEM_PROPERTY(':RRI.RRIQTY',ENABLED,PROPERTY_FALSE);
END IF;
However, the above code is not work.. The text item :RRI.RRIQTY is still accessible. Could anybody point me out an example please?
[Updated on: Fri, 19 January 2007 08:45] Report message to a moderator
|
|
|
Re: trigger for partial received in goods received document. help [message #215234 is a reply to message #215112] |
Sat, 20 January 2007 01:00   |
sameer_am2002
Messages: 129 Registered: September 2002
|
Senior Member |
|
|
Two ways you can handle the situation..First option write database trigger on GR Detail Tab for Insert , Update and Delete operations..Second option..Write trigger at GR Detail Block Level triggers should be Post-Insert , Post-Update , Post-Delete..Last Part For handling goods fully completed Write trigger of Post-Query at GR Detail Block ..use Set_Item_Instance_Property to handle.
|
|
|
|
|
|
|
|
Re: trigger for partial received in goods received document. help [message #215928 is a reply to message #215112] |
Wed, 24 January 2007 05:45   |
Smith_X
Messages: 56 Registered: January 2007
|
Member |
|
|
These code are inserted in Post-Query Trigger
message (:POI.STS_CHECKBOX);
If :POI.STS_CHECKBOX in ('sts03') then
set_item_property(':POI.POIUP', ENABLED, PROPERTY_FALSE);
set_item_property(':POI.POIQTY', ENABLED, PROPERTY_FALSE);
end if;
I looking for a method to disable some records in detail (turbular) I try to use both set_item_property and set_item_instance_property and the result is same.
For the above code, I click LOV button but the message is not appear. it seems I do something wrong.. T_T
|
|
|
|