From: <tu...@us...> - 2018-02-11 04:33:19
|
Revision: 7951 http://sourceforge.net/p/web-erp/reponame/7951 Author: turbopt Date: 2018-02-11 04:33:16 +0000 (Sun, 11 Feb 2018) Log Message: ----------- PaulT: Remove $db parameter from all GetStockGLCode() functions. Modified Paths: -------------- trunk/ConfirmDispatch_Invoice.php trunk/ContractCosting.php trunk/CounterReturns.php trunk/CounterSales.php trunk/Credit_Invoice.php trunk/InternalStockRequestFulfill.php trunk/PDFStockCheckComparison.php trunk/SelectCreditItems.php trunk/ShipmentCosting.php trunk/StockAdjustments.php trunk/StockLocTransferReceive.php trunk/StockTransfers.php trunk/SupplierCredit.php trunk/SupplierInvoice.php trunk/WorkOrderIssue.php trunk/WorkOrderReceive.php trunk/api/api_debtortransactions.php trunk/api/api_salesorders.php trunk/doc/Change.log trunk/includes/SQL_CommonFunctions.inc Modified: trunk/ConfirmDispatch_Invoice.php =================================================================== --- trunk/ConfirmDispatch_Invoice.php 2018-02-11 04:11:05 UTC (rev 7950) +++ trunk/ConfirmDispatch_Invoice.php 2018-02-11 04:33:16 UTC (rev 7951) @@ -1427,7 +1427,7 @@ $Result = DB_query($SQL,$ErrMsg,$DbgMsg,true); /*now the stock entry - this is set to the cost act in the case of a fixed asset disposal */ - $StockGLCode = GetStockGLCode($OrderLine->StockID,$db); + $StockGLCode = GetStockGLCode($OrderLine->StockID); $SQL = "INSERT INTO gltrans (type, typeno, Modified: trunk/ContractCosting.php =================================================================== --- trunk/ContractCosting.php 2018-02-11 04:11:05 UTC (rev 7950) +++ trunk/ContractCosting.php 2018-02-11 04:33:16 UTC (rev 7951) @@ -231,7 +231,7 @@ include('includes/SQL_CommonFunctions.inc'); - $GLCodes = GetStockGLCode($_SESSION['Contract'.$identifier]->ContractRef,$db); + $GLCodes = GetStockGLCode($_SESSION['Contract'.$identifier]->ContractRef); //Compare actual costs to original budgeted contract costs - if actual > budgeted - CR WIP and DR usage variance $Variance = ($OtherReqtsBudget+$ContractBOMBudget)-($OtherReqtsActual+$ContractBOMActual); Modified: trunk/CounterReturns.php =================================================================== --- trunk/CounterReturns.php 2018-02-11 04:11:05 UTC (rev 7950) +++ trunk/CounterReturns.php 2018-02-11 04:33:16 UTC (rev 7951) @@ -1313,7 +1313,7 @@ $Result = DB_query($SQL,$ErrMsg,$DbgMsg,true); /*now the stock entry*/ - $StockGLCode = GetStockGLCode($ReturnItemLine->StockID,$db); + $StockGLCode = GetStockGLCode($ReturnItemLine->StockID); $SQL = "INSERT INTO gltrans (type, typeno, Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2018-02-11 04:11:05 UTC (rev 7950) +++ trunk/CounterSales.php 2018-02-11 04:33:16 UTC (rev 7951) @@ -1766,7 +1766,7 @@ $Result = DB_query($SQL,$ErrMsg,$DbgMsg,true); /*now the stock entry*/ - $StockGLCode = GetStockGLCode($OrderLine->StockID,$db); + $StockGLCode = GetStockGLCode($OrderLine->StockID); $SQL = "INSERT INTO gltrans (type, typeno, Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2018-02-11 04:11:05 UTC (rev 7950) +++ trunk/Credit_Invoice.php 2018-02-11 04:33:16 UTC (rev 7951) @@ -1350,7 +1350,7 @@ '" . $_SESSION['CreditItems' . $identifier]->DebtorNo . " - " . $CreditLine->StockID . " x " . $CreditLine->QtyDispatched . " @ " . $CreditLine->StandardCost . "', '" . round($CreditLine->StandardCost * $CreditLine->QtyDispatched,$_SESSION['CompanyRecord']['decimalplaces']) . "')"; } else { - $StockGLCode = GetStockGLCode($CreditLine->StockID, $db); + $StockGLCode = GetStockGLCode($CreditLine->StockID); $SQL = "INSERT INTO gltrans(type, typeno, trandate, Modified: trunk/InternalStockRequestFulfill.php =================================================================== --- trunk/InternalStockRequestFulfill.php 2018-02-11 04:11:05 UTC (rev 7950) +++ trunk/InternalStockRequestFulfill.php 2018-02-11 04:33:16 UTC (rev 7951) @@ -145,7 +145,7 @@ if ($_SESSION['CompanyRecord']['gllink_stock']==1 AND $StandardCost > 0){ - $StockGLCodes = GetStockGLCode($StockID,$db); + $StockGLCodes = GetStockGLCode($StockID); $SQL = "INSERT INTO gltrans (type, typeno, Modified: trunk/PDFStockCheckComparison.php =================================================================== --- trunk/PDFStockCheckComparison.php 2018-02-11 04:11:05 UTC (rev 7950) +++ trunk/PDFStockCheckComparison.php 2018-02-11 04:33:16 UTC (rev 7951) @@ -132,7 +132,7 @@ if ($_SESSION['CompanyRecord']['gllink_stock']==1 AND $myrow['standardcost'] > 0){ - $StockGLCodes = GetStockGLCode($myrow['stockid'],$db); + $StockGLCodes = GetStockGLCode($myrow['stockid']); $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction entries could not be added because'); $DbgMsg = _('The following SQL to insert the GL entries was used'); Modified: trunk/SelectCreditItems.php =================================================================== --- trunk/SelectCreditItems.php 2018-02-11 04:11:05 UTC (rev 7950) +++ trunk/SelectCreditItems.php 2018-02-11 04:33:16 UTC (rev 7951) @@ -1838,7 +1838,7 @@ } else { /*the goods are coming back into stock so debit the stock account*/ - $StockGLCode = GetStockGLCode($CreditLine->StockID, $db); + $StockGLCode = GetStockGLCode($CreditLine->StockID); $SQL = "INSERT INTO gltrans (type, typeno, trandate, Modified: trunk/ShipmentCosting.php =================================================================== --- trunk/ShipmentCosting.php 2018-02-11 04:11:05 UTC (rev 7950) +++ trunk/ShipmentCosting.php 2018-02-11 04:33:16 UTC (rev 7951) @@ -217,7 +217,7 @@ if ($_SESSION['CompanyRecord']['gllink_stock']==1){ - $StockGLCodes = GetStockGLCode($myrow['itemcode'],$db); + $StockGLCodes = GetStockGLCode($myrow['itemcode']); } /*GL journals depend on the costing method used currently: Modified: trunk/StockAdjustments.php =================================================================== --- trunk/StockAdjustments.php 2018-02-11 04:11:05 UTC (rev 7950) +++ trunk/StockAdjustments.php 2018-02-11 04:33:16 UTC (rev 7951) @@ -319,7 +319,7 @@ if ($_SESSION['CompanyRecord']['gllink_stock']==1 AND $_SESSION['Adjustment' . $identifier]->StandardCost > 0){ - $StockGLCodes = GetStockGLCode($_SESSION['Adjustment' . $identifier]->StockID,$db); + $StockGLCodes = GetStockGLCode($_SESSION['Adjustment' . $identifier]->StockID); $SQL = "INSERT INTO gltrans (type, typeno, Modified: trunk/StockLocTransferReceive.php =================================================================== --- trunk/StockLocTransferReceive.php 2018-02-11 04:11:05 UTC (rev 7950) +++ trunk/StockLocTransferReceive.php 2018-02-11 04:33:16 UTC (rev 7951) @@ -204,7 +204,7 @@ if($_SESSION['Transfer']->StockLocationFromAccount !='') { $AccountCode = $_SESSION['Transfer']->StockLocationFromAccount; } else { - $StockGLCode = GetStockGLCode($TrfLine->StockID, $db);// Get Category's account codes. + $StockGLCode = GetStockGLCode($TrfLine->StockID);// Get Category's account codes. $AccountCode = $StockGLCode['stockact'];// Select account code for stock. } // Get the item cost: @@ -357,7 +357,7 @@ if($_SESSION['Transfer']->StockLocationToAccount !='') { $AccountCode = $_SESSION['Transfer']->StockLocationToAccount; } else { - $StockGLCode = GetStockGLCode($TrfLine->StockID, $db);// Get Category's account codes. + $StockGLCode = GetStockGLCode($TrfLine->StockID);// Get Category's account codes. $AccountCode = $StockGLCode['stockact'];// Select account code for stock. } // Get the item cost: Modified: trunk/StockTransfers.php =================================================================== --- trunk/StockTransfers.php 2018-02-11 04:11:05 UTC (rev 7950) +++ trunk/StockTransfers.php 2018-02-11 04:33:16 UTC (rev 7951) @@ -221,7 +221,7 @@ if($_SESSION['Transfer']->StockLocationToAccount !='') { $AccountCode = $_SESSION['Transfer']->StockLocationToAccount; } else { - $StockGLCode = GetStockGLCode($_SESSION['Transfer']->TransferItem[0]->StockID, $db);// Get Category's account codes. + $StockGLCode = GetStockGLCode($_SESSION['Transfer']->TransferItem[0]->StockID);// Get Category's account codes. $AccountCode = $StockGLCode['stockact'];// Select account code for stock. } // Get the item cost: @@ -377,7 +377,7 @@ if($_SESSION['Transfer']->StockLocationToAccount !='') { $AccountCode = $_SESSION['Transfer']->StockLocationToAccount; } else { - $StockGLCode = GetStockGLCode($_SESSION['Transfer']->TransferItem[0]->StockID, $db);// Get Category's account codes. + $StockGLCode = GetStockGLCode($_SESSION['Transfer']->TransferItem[0]->StockID);// Get Category's account codes. $AccountCode = $StockGLCode['stockact'];// Select account code for stock. } // Get the item cost: Modified: trunk/SupplierCredit.php =================================================================== --- trunk/SupplierCredit.php 2018-02-11 04:11:05 UTC (rev 7950) +++ trunk/SupplierCredit.php 2018-02-11 04:33:16 UTC (rev 7951) @@ -860,7 +860,7 @@ if (mb_strlen($EnteredGRN->ItemCode)>0 OR $EnteredGRN->ItemCode != ''){ /*so it is a stock item */ /*need to get the stock category record for this stock item - this is function in SQL_CommonFunctions.inc */ - $StockGLCode = GetStockGLCode($EnteredGRN->ItemCode,$db); + $StockGLCode = GetStockGLCode($EnteredGRN->ItemCode); /*We have stock item and a purchase price variance need to see whether we are using Standard or WeightedAverageCosting */ Modified: trunk/SupplierInvoice.php =================================================================== --- trunk/SupplierInvoice.php 2018-02-11 04:11:05 UTC (rev 7950) +++ trunk/SupplierInvoice.php 2018-02-11 04:33:16 UTC (rev 7951) @@ -1261,7 +1261,7 @@ if (mb_strlen($EnteredGRN->ItemCode)>0 OR $EnteredGRN->ItemCode != ''){ /*so it is a stock item */ /*need to get the stock category record for this stock item - this is function in SQL_CommonFunctions.inc */ - $StockGLCode = GetStockGLCode($EnteredGRN->ItemCode,$db); + $StockGLCode = GetStockGLCode($EnteredGRN->ItemCode); /*We have stock item and a purchase price variance need to see whether we are using Standard or WeightedAverageCosting */ Modified: trunk/WorkOrderIssue.php =================================================================== --- trunk/WorkOrderIssue.php 2018-02-11 04:11:05 UTC (rev 7950) +++ trunk/WorkOrderIssue.php 2018-02-11 04:33:16 UTC (rev 7951) @@ -168,7 +168,7 @@ $PeriodNo = GetPeriod(Date($_SESSION['DefaultDateFormat']), $db); //backdate $SQLIssuedDate = FormatDateForSQL($_POST['IssuedDate']); - $StockGLCode = GetStockGLCode($_POST['IssueItem'],$db); + $StockGLCode = GetStockGLCode($_POST['IssueItem']); if ($IssueItemRow['mbflag']=='M' OR $IssueItemRow['mbflag']=='B'){ @@ -491,7 +491,7 @@ $_POST['IssueItem'] = $itm['item']; $QuantityIssued = $itm['qty']; $IssueItemRow['mbflag'] = $itm['mbflag']; - $StockGLCode = GetStockGLCode($_POST['IssueItem'],$db); + $StockGLCode = GetStockGLCode($_POST['IssueItem']); $IssueItemRow['cost'] = $itm['cost']; if ($IssueItemRow['mbflag']=='M' OR $IssueItemRow['mbflag']=='B'){ /* Need to get the current location quantity will need it later for the stock movement */ Modified: trunk/WorkOrderReceive.php =================================================================== --- trunk/WorkOrderReceive.php 2018-02-11 04:11:05 UTC (rev 7950) +++ trunk/WorkOrderReceive.php 2018-02-11 04:33:16 UTC (rev 7951) @@ -208,7 +208,7 @@ } $SQLReceivedDate = FormatDateForSQL($_POST['ReceivedDate']); - $StockGLCode = GetStockGLCode($_POST['StockID'],$db); + $StockGLCode = GetStockGLCode($_POST['StockID']); //Recalculate the standard for the item if there were no items previously received against the work order if ($WORow['qtyrecd']==0){ Modified: trunk/api/api_debtortransactions.php =================================================================== --- trunk/api/api_debtortransactions.php 2018-02-11 04:11:05 UTC (rev 7950) +++ trunk/api/api_debtortransactions.php 2018-02-11 04:33:16 UTC (rev 7951) @@ -935,7 +935,7 @@ $Result = api_DB_query($SQL,'','',true); /*now the stock entry - this is set to the cost act in the case of a fixed asset disposal */ - $StockGLCode = GetStockGLCode($CN_Line['stockid'],$db); + $StockGLCode = GetStockGLCode($CN_Line['stockid']); $SQL = "INSERT INTO gltrans (type, typeno, Modified: trunk/api/api_salesorders.php =================================================================== --- trunk/api/api_salesorders.php 2018-02-11 04:11:05 UTC (rev 7950) +++ trunk/api/api_salesorders.php 2018-02-11 04:33:16 UTC (rev 7951) @@ -1104,7 +1104,7 @@ $Result = api_DB_query($SQL,'','',true); /*now the stock entry - this is set to the cost act in the case of a fixed asset disposal */ - $StockGLCode = GetStockGLCode($OrderLineRow['stkcode'],$db); + $StockGLCode = GetStockGLCode($OrderLineRow['stkcode']); $SQL = "INSERT INTO gltrans (type, typeno, Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2018-02-11 04:11:05 UTC (rev 7950) +++ trunk/doc/Change.log 2018-02-11 04:33:16 UTC (rev 7951) @@ -1,6 +1,7 @@ webERP Change Log -9/2/18 PaulT: Remove lingering $k and $j variable left behind from 7944 commit. +10/2/18 PaulT: Remove $db parameter from all GetStockGLCode() functions. +10/2/18 PaulT: Remove variables left behind from 7944 commit. 9/2/18 PaulT: MRPReschedules.php, MRPShortages.php: Use DB_table_exists() from commit 7943 to replace table check query. 9/2/18 PaulT: Remove the last of the remaining URL 'SID' references. 9/2/18 Paul Becker (PaulT commit): StockLocMovements.php, StockMovements.php: Add serial number column to output. (Reported in forums: http://www.weberp.org/forum/showthread.php?tid=8088) Modified: trunk/includes/SQL_CommonFunctions.inc =================================================================== --- trunk/includes/SQL_CommonFunctions.inc 2018-02-11 04:11:05 UTC (rev 7950) +++ trunk/includes/SQL_CommonFunctions.inc 2018-02-11 04:33:16 UTC (rev 7951) @@ -31,7 +31,7 @@ } -Function GetStockGLCode ($StockID, &$db){ +Function GetStockGLCode ($StockID){ /*Gets the GL Codes relevant to the stock item account from the stock category record */ $QuerySQL = "SELECT stockact, @@ -158,7 +158,7 @@ $CostUpdateNo = GetNextTransNo(35, $db); $PeriodNo = GetPeriod(date($_SESSION['DefaultDateFormat']), $db); - $StockGLCode = GetStockGLCode($StockID,$db); + $StockGLCode = GetStockGLCode($StockID); $ValueOfChange = $QOH * ($NewCost - $OldCost); @@ -503,4 +503,4 @@ } //$myrow[0]>0 } -?> +?> \ No newline at end of file |