webERP Forum
Credit_Invoice.php for Assembly items - Printable Version

+- webERP Forum (http://www.weberp.org/forum)
+-- Forum: webERP Discussion (/forumdisplay.php?fid=1)
+--- Forum: Problems / Bugs? (/forumdisplay.php?fid=8)
+--- Thread: Credit_Invoice.php for Assembly items (/showthread.php?tid=2063)



Credit_Invoice.php for Assembly items - srdjanm - 01-25-2014 11:55 AM

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'];


RE: Credit_Invoice.php for Assembly items - srdjanm - 01-26-2014 07:38 AM

And solution is to change line #700 ; webERP v4.07
from
$StandardCost += ($AssParts['standard']
to:
$StandardCost += ($AssParts['standard'] * $AssParts['quantity']);


RE: Credit_Invoice.php for Assembly items - Exsonqu_Qu - 01-27-2014 10:59 AM

Hi,

Thank you for your report!

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

Best regards!

Exson