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.co...eorder.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)..