In this post I will provide brief information about how to customized COGS to recognize revenue in Past Period. This Post is more Technical and less Functional. For More Info on COGS please refer my previous posts on COGS
(Oracle Apps)
In R12, COGS got generated when Order line close.
Process - During Close Line Oracle Order Management Call API cst_revenuecogsmatch_grp.receive_closelineevent for COGS
One of parameter for this API is p_event_date and by default Oracle provides SYSDATE for this Parameter (as revenue recognition should be occur when order line close). Further this API insert the Data into cst_revenue_recognition_lines table and value in Parameter (p_event_date) got populated into LAST_EVENT_DATE column of this table.
Metalink description for this column is "The GL date corresponding to this revenue recognition percentage ". And to fulfill requirement to "recognition of cost of goods sold " on a date other than the date when line actually close, we need to populate date other than SYSDATE in this column.
Please Note that workflow background process (WBP) has nothing to with the COGS (cost of goods sold). WBP is just to progress any of line that is in Deferred status, many a time I notice that user are under impression that WBP is the process that close the line and execute COGS. , But actually it is not.
Below is little explanation about workflow in Order Management and workflow background process
---
Once we Book Sales Order line, workflow for line progress to SHIP_LINE Notified if SHIP activity involve in workflow, other wise it progress to "Deferred - Fulfill" activity.
Once we do ship Confirm and ITS (if applicable), workflow complete SHIP_LINE activity and progress to "Deferred - Fulfill". To Progress any workflow activity (I said any activity) from the Deferred status, we need to RUN WBP .Job of WBP is just to progress the line from Deferred status and nothing else.
Once WBP push the line from Deferred Status it go to FULFILL_LINE, INVOICE and then CLOSE_LINE with out any STOP (Unless you have some custom activity that Stop the workflow), Once workflow execute the Close line activity it calls COGS APIs, but since all that happened after WBP, user feel that WBP actually call COGS (cost of goods sold).
---
Let’s back to our Original Topic -
Now to recognize cost of goods sold (COGS) in Past date, we need to update the value in cst_revenue_recognition_lines table, and I feel one of option is Write a Trigger and overwrite the value of column p_event_date.
Please Note that One of the basic generally accepted accounting practices is that both revenue and Cost Of Goods Sold should be recorded in corresponding accounting periods as dictated by the Revenue/Cost matching principle and COGS functionality in R12i has taken care of all this.
Solution suggested in this post is based on one of the requirement of my reader and it should not be implemented without analyzing the complete impact on the business and also by keeping in mind any customization of the standard functionality not supported by Oracle.
Below is flow of APIs.