Wrong Product Cost if current qty < 1 and when posting Invoice Price Variances (IPV) or landed costs

Description

Costing method=Average PO

The system updates Product=>Costs=>Current Cost Price INCORRECTLY when posting landed costs and/or invoice price variances (IPV) to inventory if the stock quantity < 1 (e.g. 0.01, 0.01 for products with UOM kilograms) using the following formulae:
o New Current Cost Price = Old Current Cost Price + Landed costs / Current Quantity =>incorrect
o New Current Cost Price = Old Current Cost Price + Invoice Price Variance (IPV) / Current Quantity=>incorrect

For example: if the invoice price variance is USD 500 and the current quantity = 0.01 and the current cost price is USD 10, the system updates the current cost price as follows:

Current Cost Price = USD 10 + USD 500 / 0.01 = 50,010,-- =>incorrect

since customer shipment, customer return etc. transactions seem to always assume a base cost quantity of 1, the formulae to update the current cost price if stock quantity < 1 should be:
o New Current Cost Price = Old Current Cost Price + Landed costs x Current Quantity =>correct
o New Current Cost Price = Old Current Cost Price + Invoice Price Variance (IPV) x Current Quantity=>correct

In the example above, the current cost price should be calculated as follows:
New Current Cost Price = USD 10 + USD 500 x 0.01 = USD 10=>correct

Environment

None

Activity

Show:
Michael Powacht
January 10, 2018, 1:06 AM

apologies for making a conceptual mistake! The suggested formula New Current Cost Price = Old Current Cost Price + Landed costs x Current Quantity is incorrect because it would break the all important rule "GL Product Inventory = Current Cost Price x Current Quantity". According to iDempiere’s current system design the existing formula remains intact but in order to resolve the issue of "inflated product costs" there needs to be an enhancement in the way the system allocates landed costs and invoice price variances (IPV) based on the principle of “stock coverage”. This enhancement request is documented in https://idempiere.atlassian.net/browse/IDEMPIERE-3040 .

Anna Fadeeva
August 22, 2020, 7:13 PM

Reprodused

Anna Fadeeva
August 22, 2020, 7:15 PM

In Storage < 1
Purchase Order 0.2 USD10
Invoise 0.2 USD500 , charge USD10

Anna Fadeeva
August 22, 2020, 7:17 PM
Michael Powacht
August 23, 2020, 2:13 AM

Thanks Anna.

Assignee

Unassigned

Reporter

Michael Powacht

Labels

Tested By

Anna Fadeeva

Components

Affects versions

Priority

Major
Configure