Actually, I have been exposed to such issues before and have found no predefined out-of-the-box solution for such case. Therefore, there was an urgent need to come up with a correction criteria that works on the same business logic of Dynamics GP.
First of all, it is essential to understand the root causes of such problems, which might be quite too many. Some of them is a result of improper business processes, while a small portion could be related to the system. I will be soon publishing a detailed article on my blog in order to thoroughly analyze this issue.
As for the correction criteria, I suggest matching the HITB table to the purchase receipt work. Based on the fact that [ IV10200 ] is the correct table. This means that new records (cost adjustment) must be inserted inton[ SEE30303 ] with the value variances retrieved by the script above. You need to justify the need to insert such records by the fact that these records must have been created automatically by the system, but haven't for several reasons. On the other hand, the purchase receipt work fortunately stores the new unit cost. For instance, let's take the item mentioned above (200-B20), the cost adjustment record that must be inserted into
[ SEE30303 ] is shown below;
ITEMNMBR: 200-B20
DOCDATE: 2013-07-13
GLPOSTDT: 2013-07-13
DOCNUMBR: COST_ADJUSTMENT
TRXQTYInBase: 0
TRXQTY: 0
VARIANCEQTY: 0
UNITCOST: 2377.59 / 7730 - - - - - - Variance value / Remaining Quantity
EXTDCOST: 2377.59
IVIVINDX: XXX - - - - - - The Inventory Index of item (200-B20)
IVIVOFIX: XXX - - - - - - An offset account
JRNENTRY: XXX - - - - - - The no. of the Journal Entry
DEBITAMT: 2377.59
CRDTAMNT: 0
In this case, the purchase receipt value is 25122.50 while HITB value is (22744.91). Therefore, you need to increase the HITB value by the record above in order to be identical to purchase receipt work. Please take into consideration that the value is written under the Debit amount, since you're increasing inventory.
Finally, a journal entry shall be entered with the variance value;
Journal Entry No. Debit_Amount Credit_Amount Inventory_Index Inventory_Offset
XXX 2377.59 0 XXX XXX
Now, you have purchase receipt work, HITB and GL all matched with the correct cost of
[ IV10200 ].
Please note that this is a work around solution to apply the same logic of cost adjustment and ensure that the correct cost of the remaining layers is entered into HITB. Though, There is not KB article that supports such solution. In case you are to apply this correction criteria, I recommend consulting with your partner.
Best Regards,
Mahmoud AlSaadi