Oracle Order Management - Version 11.5.10.2 to 12.2.4 [Release 11.5.10 to 12.2] Information in this document applies to any platform. ***Checked for relevance on 17-Dec-2013***
SYMPTOMS
When enter a new sales order the system default tax code is X. If user change the tax code to Y and book the order, the tax code is changed back to X. This is happening even if user save the record before doing the initial change.
Same issue can also occur when the scheduling is happening at time of saving the order if autoschedule is used.
CAUSE
This is the standard functionality of the system.
What is happening here is explained below :
1. Create an Order and Line. Tax Date and Tax Code get defaulted to the Order Line. Line is saved. Right now Schedule Ship Date is blank, hence scheduling is not triggered. Tax calculation happens based on the defaulted Tax Code.
2. Change the Tax Code to the desired one. Saves the Line. Tax gets re-calculated based on the changed Tax Code.
3. Books the Order. Order is Booked successfully.
4. As part of the Booking process itself, before the control returns back to the user, the next activity in the WF gets triggered. Since Scheduling is the next activity on the Line, line gets scheduled. A new Schedule Ship Date is returned and updated on the Order Line.
Please note that as part of the standard order processing and defaulting frame work, when ever any attribute value changes, system always clears the dependent attributes and re-defaults them.
Now since, scheduling resulted in change of Schedule Ship Date, the dependent attributes of Schedule Ship Date are cleared. As per the seeded dependency Tax Date is dependent on Schedule Ship Date. Hence Tax Date is cleared and re-defaulted. Again, Tax Code is dependent on Tax Date. Hence, Tax Code is cleared and re-defaulted.
That is why you see that whenever you Book an Order, Tax Code is getting re-defaulted back to original value.
SOLUTION
You can avoid this issue in the following ways:
1. Change the Tax Code only after the Line is scheduled. But with this approach, when ever Schedule Ship Date changes, Tax Code will get re-defaulted.
or
2. Disable the seeded dependency between Schedule Ship Date and Tax Date. This you can do by adding code in OE_DEPENDENCIES_EXTN package. Below code can be used to do the same :