Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Altering GoodsReceived.php & PO_ReadlnOrder.inc
05-16-2013, 12:56 AM,
#1
Altering GoodsReceived.php & PO_ReadlnOrder.inc


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)..
Reply
05-16-2013, 06:54 AM,
#2
RE: Altering GoodsReceived.php & PO_ReadlnOrder.inc
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.
Phil Daintree
webERP Admin
Logic Works Ltd
http://www.logicworks.co.nz
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)