webERP Forum

Full Version: Credit_Invoice.php for Assembly items
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
For Assembly items with decimal value the Credit invoice post wrong $ amount in General Ledger gltrans, table.

Here is example:
Item: A - Purtchased , unit cost: $ 7,581.60
Item B - Asembled,:
from Item A amount 0.003 , cost: A*0.003 = $22.74

Now, I produce invoice and in General Ledger trail balance:
5000 Cost of Sale $22.74
1460 Finish Goods Inventory: $ -22.74

Now, I credit this invoice and return item. The new value in General Ledger are:
5000 Cost of Sale $-7553.09
1460 Finish Goods Inventory: $ 7553.09

In addition to gltrans table following table are also effected:
- salesanalysis : Item B gets cost of $ -7553.09 . This should be $-22.74
- stockmoves: Itme B gets standardcost $7581.60

Someone with good php knowledge would be able to fix this? I'm trying...

I'm on 4.07 version
Thanks
Srdjan

I think I found one problematic line, #700, standard cost calculation for component
$StandardCost += $AssParts['standard'];
Instead this should be calculated:
$StandardCost += $AssParts['standard'] * $AssParts['quantity'];
And solution is to change line #700 ; webERP v4.07
from
$StandardCost += ($AssParts['standard']
to:
$StandardCost += ($AssParts['standard'] * $AssParts['quantity']);
Hi,

Thank you for your report!

I think it has been fixed at least in the trunk now.

Best regards!

Exson