From: ExsonQu <hex...@gm...> - 2015-09-20 14:31:06
|
*Hi, Phil,* Thank you for your quick reply. I'll prepare a test case to show it clear later. And I received a bug report from Akits monthes ago about the SupplierCredit.php. The cost update seems add at the wrong direction: $PurchPriceVar = $EnteredGRN->This_QuantityInv * (($EnteredGRN->ChgPrice /$_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit); $CostIncrement = ($PurchPriceVar - $WriteOffToVariances) / $TotalQuantityOnHand; $sql = "UPDATE stockmaster SET lastcost=materialcost+overheadcost+labourcost, materialcost=materialcost+" . $CostIncrement . " WHERE stockid='" . $EnteredGRN->ItemCode . "'"; If the PurchPriceVar is positive, when we issue a Credit Note, then the material cost should become lower. But above update SQL will make it become higher. Following is the actual data: Initial inventory: 176 standcost 50 #1 (Inv 43) 10kg // $ 51.5 // cost: 50.08 #2 (Inv 44) 5kg // $ 52.32 // cost: 50.14 #3 (Inv 45) 20kg // $ 52.15 // cost: 50.33 #4 (Inv 46) 8kg // $ 53.05 // cost: 50.43 A credit invoice to reverse #2, then the PurchPriceVar is (52.323-50.08)*5=2.24*5=11.2 11.2/219 = 0.051. Then the new material cost should be 50.43 - 0.051=50.379. Unfortunately, current calculation result is 50.43+0.051 = 50.481. Please confirm it and thank you again Phil. Best regards! Exson -- View this message in context: http://weberp-accounting.1478800.n4.nabble.com/Is-the-write-off-variance-correctly-defined-in-suppliers-invoice-tp4658329p4658331.html Sent from the web-ERP-developers mailing list archive at Nabble.com. |