Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Altering GoodsReceived.php & PO_ReadlnOrder.inc
05-16-2013, 12:56 AM
Post: #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)..
Find all posts by this user
Quote this message in a reply
05-16-2013, 06:54 AM
Post: #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
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)