webERP Forum
Altering GoodsReceived.php & PO_ReadlnOrder.inc - Printable Version

+- webERP Forum (http://www.weberp.org/forum)
+-- Forum: webERP Discussion (http://www.weberp.org/forum/forumdisplay.php?fid=1)
+--- Forum: Development Discussion & Specification (http://www.weberp.org/forum/forumdisplay.php?fid=10)
+--- Thread: Altering GoodsReceived.php & PO_ReadlnOrder.inc (/showthread.php?tid=894)



Altering GoodsReceived.php & PO_ReadlnOrder.inc - kelo - 05-16-2013



Hi..

I am modifying GoodsReceive.php & PO_ReadlnOrder.inc so i can update stockmaster.materialcost as the price inputted on order price
supp Units.. when creating PO(see image) http://softwarebaruku.files.wordpress.com/2013/05/purchaseorder.png

so i had altered code at line around 485 like this at
GoodsReceived.php file
/**/
$sql0 = "UPDATE stockmaster SET materialcost = '" . $OrderLine->Price . "'
WHERE stockid = '" . $OrderLine->StockID . "'";


$ErrMsg = _('CRITICAL ERROR') . '! ' . _('Error message') . ': ' . _('Error message');
$DbgMsg = _('The following SQL to retrieve the standard cost was used');

$Result = DB_query($sql0,$db,$ErrMsg,$DbgMsg,true);

i inserted above code before this sql line code:
$SQL = "SELECT materialcost + labourcost + overheadcost as stdcost
FROM stockmaster
WHERE stockid='" . $OrderLine->StockID . "'";

and i altered PO_ReadlnOrder.inc around Line : 229 after this 2 lines of code

$_SESSION['PO'.$identifier]->LineItems[$_SESSION['PO'.$identifier]->LinesOnOrder]->PODetailRec = $myrow['podetailitem'];
$_SESSION['PO'.$identifier]->LineItems[$_SESSION['PO'.$identifier]->LinesOnOrder]->StandardCost = $myrow['stdcostunit']; /*Needed for receiving goods and GL interface */

i added this line code:
$_SESSION['PO'.$identifier]->LineItems[$_SESSION['PO'.$identifier]->LinesOnOrder]->Price = $myrow['unitprice'];

i want to hear your opinion about this, is this not affected any transactions and other reports? i just want to setting the stockmaster.materialcost
just like what i had inputed when creating purchasing order (PO)..


RE: Altering GoodsReceived.php & PO_ReadlnOrder.inc - phil - 05-16-2013

If you are using the GL then the GL stock control account will not tie up with the stock valuation report. This area needs great care.