From: ExsonQu <hex...@gm...> - 2015-09-20 08:53:37
|
*Dear all,* Thank you for your long time efforts to webERP. When I studied the suppliers invoice scripts, I found that the WriteOffVariance is based on Current Quantity On Hand (The supplier's *invoice input date*): ($EnteredGRN->This_QuantityInv - $TotalQuantityOnHand) * (($EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit); The TotalQuantityOnHand is from following sql: $sql ="SELECT SUM(quantity) FROM locstock WHERE stockid='" . $EnteredGRN->ItemCode . "'"; But the Period GL posted is up to the *invoice date* input by users. I think it make sense if suppliers' *invoice date* and *input date* within the same period. But does it still make sense if the *input date* and *invoice date *are not within the same period? Need we change it to the historical (invoice date) QOH? Any comments are highly appreciated! Thanks and 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-tp4658329.html Sent from the web-ERP-developers mailing list archive at Nabble.com. |
From: Phil D. <ph...@lo...> - 2015-09-20 09:39:49
|
You might have to flesh this out a bit Exson... not sure I fully understand. I think it is right to base the GL posting date using the date of the invoice - if the "prohibit GL postings to periods before" system parameter is set to a period after the period identified by looking at the invoice date then the GL posting will occur in the first period following the "prohibit GL postings to periods before" system parameter. I don't think the input date has much to do with the GL posting. Using the weighted average costing - the quantity on hand at the time at the time the invoice is posted is required to identify the number of items that the variance needs to be averaged over. There is no retrospective costing going on or possible. Phil Phil Daintree Logic Works Ltd - +64 (0)275 567890 http://www.logicworks.co.nz On 20/09/15 20:45, ExsonQu wrote: > *Dear all,* > > Thank you for your long time efforts to webERP. > > When I studied the suppliers invoice scripts, I found that the > WriteOffVariance is based on Current Quantity On Hand (The supplier's > *invoice input date*): > > ($EnteredGRN->This_QuantityInv - $TotalQuantityOnHand) * > (($EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate) - > $EnteredGRN->StdCostUnit); > The TotalQuantityOnHand is from following sql: > $sql ="SELECT SUM(quantity) FROM locstock WHERE stockid='" . > $EnteredGRN->ItemCode . "'"; > But the Period GL posted is up to the *invoice date* input by > users. > I think it make sense if suppliers' *invoice date* and *input > date* within the same period. > But does it still make sense if the *input date* and *invoice > date *are not within the same period? Need we change it to the historical > (invoice date) QOH? > > Any comments are highly appreciated! > > Thanks and 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-tp4658329.html > Sent from the web-ERP-developers mailing list archive at Nabble.com. > > ------------------------------------------------------------------------------ > _______________________________________________ > Web-erp-developers mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/web-erp-developers > |
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. |
From: <ph...@lo...> - 2015-09-21 01:47:15
|
Yes of course this is correct Exson... when it is a supplier credit note (a debit note) then a positive variance needs to be deducted. Good spot! Sorry bout that. Phil On 2015-09-20 08:23, ExsonQu wrote: > *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. > > ------------------------------------------------------------------------------ > _______________________________________________ > Web-erp-developers mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/web-erp-developers |
From: ExsonQu <hex...@gm...> - 2015-09-21 02:05:47
|
*Hi, Phil,* Thank you for your confirmation. I've commit the fix to the trunk. And thank you very much for Akits' report. And sorry for the late to check it. 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-tp4658329p4658333.html Sent from the web-ERP-developers mailing list archive at Nabble.com. |