From: <tu...@us...> - 2018-02-04 15:57:48
|
Revision: 7933 http://sourceforge.net/p/web-erp/reponame/7933 Author: turbopt Date: 2018-02-04 15:57:45 +0000 (Sun, 04 Feb 2018) Log Message: ----------- Remove unused $db parameter from DB_fetch_array() and DB_Query() functions. Also, rename several DB_Query names to match function definition name: DB_query. Modified Paths: -------------- trunk/AgedDebtors.php trunk/AgedSuppliers.php trunk/BOMExtendedQty.php trunk/BOMListing.php trunk/CounterReturns.php trunk/Credit_Invoice.php trunk/Dashboard.php trunk/DebtorsAtPeriodEnd.php trunk/GLAccountCSV.php trunk/GLAccountInquiry.php trunk/GLProfit_Loss.php trunk/GLTagProfit_Loss.php trunk/GLTrialBalance.php trunk/InventoryPlanningPrefSupplier.php trunk/InventoryQuantities.php trunk/MRPPlannedWorkOrders.php trunk/MRPReschedules.php trunk/MRPShortages.php trunk/MailInventoryValuation.php trunk/OutstandingGRNs.php trunk/PDFCustomerList.php trunk/PDFLowGP.php trunk/PDFSellThroughSupportClaim.php trunk/PDFStockCheckComparison.php trunk/PcAnalysis.php trunk/PurchaseByPrefSupplier.php trunk/ReorderLevel.php trunk/SalesGraph.php trunk/SelectCreditItems.php trunk/StockCheck.php trunk/StockDispatch.php trunk/SuppPriceList.php trunk/SupplierBalsAtPeriodEnd.php trunk/Tax.php trunk/Z_DataExport.php trunk/Z_RePostGLFromPeriod.php trunk/Z_UpdateChartDetailsBFwd.php trunk/api/api_branches.php trunk/api/api_customers.php trunk/api/api_debtortransactions.php trunk/api/api_glaccounts.php trunk/api/api_glgroups.php trunk/api/api_glsections.php trunk/api/api_locations.php trunk/api/api_purchdata.php trunk/api/api_salesareas.php trunk/api/api_salesman.php trunk/api/api_salesorders.php trunk/api/api_salestypes.php trunk/api/api_stock.php trunk/api/api_stockcategories.php trunk/api/api_suppliers.php trunk/api/api_workorders.php trunk/doc/Change.log Modified: trunk/AgedDebtors.php =================================================================== --- trunk/AgedDebtors.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/AgedDebtors.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -287,7 +287,7 @@ $ListCount = DB_num_rows($CustomerResult); $CurrDecimalPlaces =2; //by default - while ($AgedAnalysis = DB_fetch_array($CustomerResult,$db)) { + while ($AgedAnalysis = DB_fetch_array($CustomerResult)) { $CurrDecimalPlaces = $AgedAnalysis['decimalplaces']; $DisplayDue = locale_number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],$CurrDecimalPlaces); $DisplayCurrent = locale_number_format($AgedAnalysis['balance']-$AgedAnalysis['due'],$CurrDecimalPlaces); Modified: trunk/AgedSuppliers.php =================================================================== --- trunk/AgedSuppliers.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/AgedSuppliers.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -126,7 +126,7 @@ $ListCount = DB_num_rows($SupplierResult); // UldisN - while ($AgedAnalysis = DB_fetch_array($SupplierResult,$db)){ + while ($AgedAnalysis = DB_fetch_array($SupplierResult)){ $CurrDecimalPlaces = $AgedAnalysis['currdecimalplaces']; Modified: trunk/BOMExtendedQty.php =================================================================== --- trunk/BOMExtendedQty.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/BOMExtendedQty.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -202,7 +202,7 @@ stockmaster.mbflag"; $result = DB_query($sql); $ListCount = DB_num_rows($result); - while ($myrow = DB_fetch_array($result,$db)){ + while ($myrow = DB_fetch_array($result)){ // Parameters for addTextWrap are defined in /includes/class.pdf.php // 1) X position 2) Y position 3) Width Modified: trunk/BOMListing.php =================================================================== --- trunk/BOMListing.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/BOMListing.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -62,7 +62,7 @@ $ParentPart = ''; - while ($BOMList = DB_fetch_array($BOMResult,$db)){ + while ($BOMList = DB_fetch_array($BOMResult)){ if ($ParentPart!=$BOMList['parent']){ Modified: trunk/CounterReturns.php =================================================================== --- trunk/CounterReturns.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/CounterReturns.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -420,7 +420,7 @@ $KitResult = DB_query($sql,$ErrMsg,$DbgMsg); $ParentQty = $NewItemQty; - while ($KitParts = DB_fetch_array($KitResult,$db)) { + while ($KitParts = DB_fetch_array($KitResult)) { $NewItem = $KitParts['component']; $NewItemQty = $KitParts['quantity'] * $ParentQty; $NewPOLine = 0; @@ -533,7 +533,7 @@ $KitResult = DB_query($sql,$ErrMsg); $ParentQty = $NewItemQty; - while ($KitParts = DB_fetch_array($KitResult,$db)){ + while ($KitParts = DB_fetch_array($KitResult)){ $NewItem = $KitParts['component']; $NewItemQty = $KitParts['quantity'] * $ParentQty; $NewPOLine = 0; @@ -582,7 +582,7 @@ $KitResult = DB_query($sql,$ErrMsg); $ParentQty = $NewItemQty; - while ($KitParts = DB_fetch_array($KitResult,$db)){ + while ($KitParts = DB_fetch_array($KitResult)){ $NewItem = $KitParts['component']; $NewItemQty = $KitParts['quantity'] * $ParentQty; $NewPOLine = 0; @@ -633,7 +633,7 @@ $KitResult = DB_query($sql,$ErrMsg); $ParentQty = $NewItemQty; - while ($KitParts = DB_fetch_array($KitResult,$db)){ + while ($KitParts = DB_fetch_array($KitResult)){ $NewItem = $KitParts['component']; $NewItemQty = $KitParts['quantity'] * $ParentQty; $NewItemDue = date($_SESSION['DefaultDateFormat']); @@ -1020,7 +1020,7 @@ $DbgMsg = _('The SQL that failed was'); $AssResult = DB_query($SQL,$ErrMsg,$DbgMsg,true); - while ($AssParts = DB_fetch_array($AssResult,$db)){ + while ($AssParts = DB_fetch_array($AssResult)){ $StandardCost += ($AssParts['standard'] * $AssParts['quantity']) ; /* Need to get the current location quantity Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/Credit_Invoice.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -774,7 +774,7 @@ $DbgMsg = _('The SQL that failed was'); $AssResult = DB_query($sql, $ErrMsg, $DbgMsg, true); - while($AssParts = DB_fetch_array($AssResult,$db)) { + while($AssParts = DB_fetch_array($AssResult)) { $StandardCost += $AssParts['standard'] * $AssParts['quantity']; /*Determine the type of stock item being credited */ Modified: trunk/Dashboard.php =================================================================== --- trunk/Dashboard.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/Dashboard.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -163,7 +163,7 @@ exit; } - while($AgedAnalysis = DB_fetch_array($CustomerResult,$db)) { + while($AgedAnalysis = DB_fetch_array($CustomerResult)) { if($k == 1) { echo '<tr class="EvenTableRows">'; $k = 0; Modified: trunk/DebtorsAtPeriodEnd.php =================================================================== --- trunk/DebtorsAtPeriodEnd.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/DebtorsAtPeriodEnd.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -78,7 +78,7 @@ $TotBal=0; - while ($DebtorBalances = DB_fetch_array($CustomerResult,$db)){ + while ($DebtorBalances = DB_fetch_array($CustomerResult)){ $Balance = $DebtorBalances['balance'] - $DebtorBalances['afterdatetrans'] + $DebtorBalances['afterdatediffonexch'] ; $FXBalance = $DebtorBalances['fxbalance'] - $DebtorBalances['fxafterdatetrans']; @@ -153,7 +153,7 @@ $sql = "SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno DESC"; $Periods = DB_query($sql,_('Could not retrieve period data because'),_('The SQL that failed to get the period data was')); - while ($myrow = DB_fetch_array($Periods,$db)){ + while ($myrow = DB_fetch_array($Periods)){ echo '<option value="' . $myrow['periodno'] . '">' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; Modified: trunk/GLAccountCSV.php =================================================================== --- trunk/GLAccountCSV.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/GLAccountCSV.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -41,7 +41,7 @@ ORDER BY chartmaster.accountcode"; $AccountsResult = DB_query($sql); $i=0; -while ($myrow=DB_fetch_array($AccountsResult,$db)){ +while ($myrow=DB_fetch_array($AccountsResult)){ if(isset($_POST['Account'][$i]) AND $myrow['accountcode'] == $_POST['Account'][$i]){ echo '<option selected="selected" value="' . $myrow['accountcode'] . '">' . $myrow['accountcode'] . ' ' . htmlspecialchars($myrow['accountname'], ENT_QUOTES, 'UTF-8', false) . '</option>'; $i++; @@ -57,7 +57,7 @@ $Periods = DB_query($sql); $id=0; -while ($myrow=DB_fetch_array($Periods,$db)){ +while ($myrow=DB_fetch_array($Periods)){ if (isset($SelectedPeriod[$id]) and $myrow['periodno'] == $SelectedPeriod[$id]){ echo '<option selected="selected" value="' . $myrow['periodno'] . '">' . _(MonthAndYearFromSQLDate($myrow['lastdate_in_period'])) . '</option>'; $id++; Modified: trunk/GLAccountInquiry.php =================================================================== --- trunk/GLAccountInquiry.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/GLAccountInquiry.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -62,7 +62,7 @@ INNER JOIN glaccountusers ON glaccountusers.accountcode=chartmaster.accountcode AND glaccountusers.userid='" . $_SESSION['UserID'] . "' AND glaccountusers.canview=1 ORDER BY chartmaster.accountcode"; $Account = DB_query($sql); -while($myrow=DB_fetch_array($Account,$db)) { +while($myrow=DB_fetch_array($Account)) { if($myrow['accountcode'] == $SelectedAccount) { if(!is_null($myrow['bankact'])) { $BankAccount = true; @@ -104,7 +104,7 @@ $sql = "SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno DESC"; $Periods = DB_query($sql); -while($myrow=DB_fetch_array($Periods,$db)) { +while($myrow=DB_fetch_array($Periods)) { if(isset($FirstPeriodSelected) AND $myrow['periodno'] >= $FirstPeriodSelected AND $myrow['periodno'] <= $LastPeriodSelected) { echo '<option selected="selected" value="' . $myrow['periodno'] . '">' . _(MonthAndYearFromSQLDate($myrow['lastdate_in_period'])) . '</option>'; } else { Modified: trunk/GLProfit_Loss.php =================================================================== --- trunk/GLProfit_Loss.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/GLProfit_Loss.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -58,7 +58,7 @@ $Periods = DB_query($sql); - while ($myrow=DB_fetch_array($Periods,$db)){ + while ($myrow=DB_fetch_array($Periods)){ if(isset($_POST['FromPeriod']) AND $_POST['FromPeriod']!=''){ if( $_POST['FromPeriod']== $myrow['periodno']){ echo '<option selected="selected" value="' . $myrow['periodno'] . '">' .MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; Modified: trunk/GLTagProfit_Loss.php =================================================================== --- trunk/GLTagProfit_Loss.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/GLTagProfit_Loss.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -48,7 +48,7 @@ $Periods = DB_query($sql); - while ($myrow=DB_fetch_array($Periods,$db)){ + while ($myrow=DB_fetch_array($Periods)){ if(isset($_POST['FromPeriod']) AND $_POST['FromPeriod']!=''){ if( $_POST['FromPeriod']== $myrow['periodno']){ echo '<option selected="selected" value="' . $myrow['periodno'] . '">' .MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; @@ -83,7 +83,7 @@ $RetResult = DB_data_seek($Periods,0); - while ($myrow=DB_fetch_array($Periods,$db)){ + while ($myrow=DB_fetch_array($Periods)){ if($myrow['periodno']==$DefaultToPeriod){ echo '<option selected="selected" value="' . $myrow['periodno'] . '">' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; Modified: trunk/GLTrialBalance.php =================================================================== --- trunk/GLTrialBalance.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/GLTrialBalance.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -63,7 +63,7 @@ $Periods = DB_query($sql); - while ($myrow=DB_fetch_array($Periods,$db)){ + while ($myrow=DB_fetch_array($Periods)){ if(isset($_POST['FromPeriod']) AND $_POST['FromPeriod']!=''){ if( $_POST['FromPeriod']== $myrow['periodno']){ echo '<option selected="selected" value="' . $myrow['periodno'] . '">' .MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; @@ -93,7 +93,7 @@ $RetResult = DB_data_seek($Periods,0); - while ($myrow=DB_fetch_array($Periods,$db)){ + while ($myrow=DB_fetch_array($Periods)){ if($myrow['periodno']==$DefaultToPeriod){ echo '<option selected="selected" value="' . $myrow['periodno'] . '">' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; Modified: trunk/InventoryPlanningPrefSupplier.php =================================================================== --- trunk/InventoryPlanningPrefSupplier.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/InventoryPlanningPrefSupplier.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -201,7 +201,7 @@ $Period_3 = $CurrentPeriod -3; $Period_4 = $CurrentPeriod -4; - while ($InventoryPlan = DB_fetch_array($InventoryResult,$db)){ + while ($InventoryPlan = DB_fetch_array($InventoryResult)){ if ($SupplierID!=$InventoryPlan['supplierno']){ $FontSize=10; Modified: trunk/InventoryQuantities.php =================================================================== --- trunk/InventoryQuantities.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/InventoryQuantities.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -113,7 +113,7 @@ $FontSize=8; $holdpart = " "; - While ($myrow = DB_fetch_array($result,$db)){ + While ($myrow = DB_fetch_array($result)){ if ($myrow['stockid'] != $holdpart) { $YPos -=(2 * $line_height); $holdpart = $myrow['stockid']; Modified: trunk/MRPPlannedWorkOrders.php =================================================================== --- trunk/MRPPlannedWorkOrders.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/MRPPlannedWorkOrders.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -148,7 +148,7 @@ $TotalPartCost = 0; $Total_ExtCost = 0; - while ($myrow = DB_fetch_array($result,$db)){ + while ($myrow = DB_fetch_array($result)){ $YPos -=$line_height; // Print information on part break @@ -265,7 +265,7 @@ $Total_ExtCost = 0; $j=1; //row ID $k=0; //row colour counter - while ($myrow = DB_fetch_array($result,$db)){ + while ($myrow = DB_fetch_array($result)){ // Alternate row color if ($k==1){ Modified: trunk/MRPReschedules.php =================================================================== --- trunk/MRPReschedules.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/MRPReschedules.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -68,7 +68,7 @@ $Tot_Val=0; $fill = false; $pdf->SetFillColor(224,235,255); - While ($myrow = DB_fetch_array($result,$db)){ + While ($myrow = DB_fetch_array($result)){ $YPos -=$line_height; $FontSize=8; Modified: trunk/MRPShortages.php =================================================================== --- trunk/MRPShortages.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/MRPShortages.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -181,7 +181,7 @@ $Partctr = 0; $fill = false; $pdf->SetFillColor(224,235,255); // Defines color to make alternating lines highlighted - while ($myrow = DB_fetch_array($result,$db)){ + while ($myrow = DB_fetch_array($result)){ if ($_POST['ReportType'] == 'Shortage'){ $LineToPrint = ($myrow['demand'] > $myrow['supply']); Modified: trunk/MailInventoryValuation.php =================================================================== --- trunk/MailInventoryValuation.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/MailInventoryValuation.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -134,7 +134,7 @@ $Tot_Val=0; $Category = ''; $CatTot_Val=0; -While ($InventoryValn = DB_fetch_array($InventoryResult,$db)){ +While ($InventoryValn = DB_fetch_array($InventoryResult)){ if ($Category!=$InventoryValn['categoryid']){ $FontSize=10; Modified: trunk/OutstandingGRNs.php =================================================================== --- trunk/OutstandingGRNs.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/OutstandingGRNs.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -86,7 +86,7 @@ $Tot_Val=0; $Supplier = ''; $SuppTot_Val=0; - While ($GRNs = DB_fetch_array($GRNsResult,$db)){ + While ($GRNs = DB_fetch_array($GRNsResult)){ if ($Supplier!=$GRNs['supplierid']){ @@ -192,7 +192,7 @@ $k = 0; //row colour counter $i = 1; $TotalHomeCurrency = 0; - while ($GRNs = DB_fetch_array($GRNsResult,$db) ){ + while ($GRNs = DB_fetch_array($GRNsResult) ){ if ($k == 1) { echo '<tr class="EvenTableRows">'; $k = 0; Modified: trunk/PDFCustomerList.php =================================================================== --- trunk/PDFCustomerList.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/PDFCustomerList.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -255,7 +255,7 @@ $Area =''; $SalesPerson=''; - while($Customers = DB_fetch_array($CustomersResult,$db)) { + while($Customers = DB_fetch_array($CustomersResult)) { if($_POST['Activity']!='All') { Modified: trunk/PDFLowGP.php =================================================================== --- trunk/PDFLowGP.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/PDFLowGP.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -80,7 +80,7 @@ $Tot_Val=0; $Category = ''; $CatTot_Val=0; - while ($LowGPItems = DB_fetch_array($LowGPSalesResult,$db)){ + while ($LowGPItems = DB_fetch_array($LowGPSalesResult)){ $YPos -=$line_height; $FontSize=8; Modified: trunk/PDFSellThroughSupportClaim.php =================================================================== --- trunk/PDFSellThroughSupportClaim.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/PDFSellThroughSupportClaim.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -95,7 +95,7 @@ $SupplierClaimTotal=0; $Supplier = ''; $FontSize=8; - while ($SellThroRow = DB_fetch_array($ClaimsResult,$db)){ + while ($SellThroRow = DB_fetch_array($ClaimsResult)){ $YPos -=$line_height; if ($SellThroRow['suppname']!=$Supplier){ Modified: trunk/PDFStockCheckComparison.php =================================================================== --- trunk/PDFStockCheckComparison.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/PDFStockCheckComparison.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -225,7 +225,7 @@ $Location = ''; $Category = ''; - While ($CheckItemRow = DB_fetch_array($CheckedItems,$db)){ + While ($CheckItemRow = DB_fetch_array($CheckedItems)){ if ($Location!=$CheckItemRow['loccode']){ $FontSize=14; @@ -294,7 +294,7 @@ } } elseif (DB_num_rows($Counts)>0) { $TotalCount =0; - while ($CountRow=DB_fetch_array($Counts,$db)){ + while ($CountRow=DB_fetch_array($Counts)){ $LeftOvers = $pdf->addTextWrap(375, $YPos, 60, $FontSize, locale_number_format(($CountRow['qtycounted']),$CheckItemRow['decimalplaces']), 'right'); $LeftOvers = $pdf->addTextWrap(440, $YPos, 100, $FontSize, $CountRow['reference'], 'left'); $TotalCount += $CountRow['qtycounted']; Modified: trunk/PcAnalysis.php =================================================================== --- trunk/PcAnalysis.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/PcAnalysis.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -23,7 +23,7 @@ if ($InputError == 0){ // Creation of beginning of SQL query $SQL = "SELECT pcexpenses.codeexpense,"; - + // Creation of periods SQL query $PeriodToday=GetPeriod(Date($_SESSION['DefaultDateFormat']), $db); $SQLPeriods = "SELECT periodno, @@ -35,8 +35,8 @@ $Periods = DB_query($SQLPeriods); $NumPeriod = 0; $LabelsArray = array(); - while ($MyRow=DB_fetch_array($Periods,$db)){ - + while ($MyRow=DB_fetch_array($Periods)){ + $NumPeriod++; $LabelsArray[$NumPeriod] = MonthAndYearFromSQLDate($MyRow['lastdate_in_period']); $SQL = $SQL . "(SELECT SUM(pcashdetails.amount) @@ -67,14 +67,14 @@ ->setDescription("Petty Cash Expenses Analysis") ->setKeywords("") ->setCategory(""); - + // Formatting - + $objPHPExcel->getActiveSheet()->getStyle('C:AB')->getNumberFormat()->setFormatCode('#,##0.00'); $objPHPExcel->getActiveSheet()->getStyle('4')->getFont()->setBold(true); $objPHPExcel->getActiveSheet()->getStyle('A2')->getFont()->setBold(true); $objPHPExcel->getActiveSheet()->getStyle('A:B')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); - + // Add title data $objPHPExcel->setActiveSheetIndex(0); $objPHPExcel->getActiveSheet()->setCellValue('A2', 'Petty Cash Tab(s)'); @@ -109,7 +109,7 @@ $objPHPExcel->getActiveSheet()->setCellValue('Z4', $LabelsArray[3]); $objPHPExcel->getActiveSheet()->setCellValue('AA4', $LabelsArray[2]); $objPHPExcel->getActiveSheet()->setCellValue('AB4', $LabelsArray[1]); - + // Add data $i = 5; while ($MyRow = DB_fetch_array($Result)) { @@ -116,7 +116,7 @@ $objPHPExcel->setActiveSheetIndex(0); $objPHPExcel->getActiveSheet()->setCellValue('A'.$i, $MyRow['codeexpense']); $objPHPExcel->getActiveSheet()->setCellValue('B'.$i, $MyRow['description']); - + $objPHPExcel->getActiveSheet()->setCellValue('C'.$i, '=SUM(Q'.$i.':AB'.$i.')'); $objPHPExcel->getActiveSheet()->setCellValue('D'.$i, '=AVERAGE(Q'.$i.':AB'.$i.')'); @@ -147,7 +147,7 @@ $i++; } - + // Freeze panes $objPHPExcel->getActiveSheet()->freezePane('E5'); @@ -157,7 +157,7 @@ ->getColumnDimension($col) ->setAutoSize(true); } - + // Rename worksheet if ($TabToShow=='All'){ $objPHPExcel->getActiveSheet()->setTitle('All Accounts'); @@ -219,7 +219,7 @@ <td><select name="Tabs">'; $SQL = "SELECT tabcode - FROM pctabs + FROM pctabs ORDER BY tabcode"; $CatResult = DB_query($SQL); @@ -248,7 +248,7 @@ function beginning_of_month($Date){ $Date2 = explode("-",$Date); - $M = $Date2[1]; + $M = $Date2[1]; $Y = $Date2[0]; $FirstOfMonth = $Y . '-' . $M . '-01'; return $FirstOfMonth; Modified: trunk/PurchaseByPrefSupplier.php =================================================================== --- trunk/PurchaseByPrefSupplier.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/PurchaseByPrefSupplier.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -425,7 +425,7 @@ $i=0; - while ($ItemRow = DB_fetch_array($ItemsResult,$db)){ + while ($ItemRow = DB_fetch_array($ItemsResult)){ $SQL = "SELECT SUM(CASE WHEN (trandate>='" . Date('Y-m-d',mktime(0,0,0, date('m')-2, date('d'), date('Y'))) . "' AND Modified: trunk/ReorderLevel.php =================================================================== --- trunk/ReorderLevel.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/ReorderLevel.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -75,7 +75,7 @@ $ListCount = 0; // UldisN - while ($myrow = DB_fetch_array($result,$db)){ + while ($myrow = DB_fetch_array($result)){ $YPos -=(2 * $line_height); $ListCount ++; @@ -123,7 +123,7 @@ AND locstock.stockid ='" . $myrow['stockid'] . "' AND locstock.loccode !='" . $myrow['loccode'] . "'"; $OtherResult = DB_query($sql2,'','',false,true); - while ($myrow2 = DB_fetch_array($OtherResult,$db)){ + while ($myrow2 = DB_fetch_array($OtherResult)){ $YPos -=$line_height; // Parameters for addTextWrap are defined in /includes/class.pdf.php Modified: trunk/SalesGraph.php =================================================================== --- trunk/SalesGraph.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/SalesGraph.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -51,7 +51,7 @@ $sql = "SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno"; $Periods = DB_query($sql); - while ($myrow=DB_fetch_array($Periods,$db)){ + while ($myrow=DB_fetch_array($Periods)){ if(isset($_POST['FromPeriod']) AND $_POST['FromPeriod']!=''){ if( $_POST['FromPeriod']== $myrow['periodno']){ echo '<option selected="selected" value="' . $myrow['periodno'] . '">' .MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; @@ -80,7 +80,7 @@ $RetResult = DB_data_seek($Periods,0); - while ($myrow=DB_fetch_array($Periods,$db)){ + while ($myrow=DB_fetch_array($Periods)){ if($myrow['periodno']==$DefaultToPeriod){ echo '<option selected="selected" value="' . $myrow['periodno'] . '">' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; Modified: trunk/SelectCreditItems.php =================================================================== --- trunk/SelectCreditItems.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/SelectCreditItems.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -1454,7 +1454,7 @@ $DbgMsg = _('The SQL that failed was'); $AssResult = DB_query($SQL,$ErrMsg,$DbgMsg,true); - while ($AssParts = DB_fetch_array($AssResult,$db)){ + while ($AssParts = DB_fetch_array($AssResult)){ $StandardCost += $AssParts['standard'] * $AssParts['quantity']; Modified: trunk/StockCheck.php =================================================================== --- trunk/StockCheck.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/StockCheck.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -152,7 +152,7 @@ $Category = ''; - While ($InventoryCheckRow = DB_fetch_array($InventoryResult,$db)){ + While ($InventoryCheckRow = DB_fetch_array($InventoryResult)){ if ($Category!=$InventoryCheckRow['categoryid']){ $FontSize=12; Modified: trunk/StockDispatch.php =================================================================== --- trunk/StockDispatch.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/StockDispatch.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -148,7 +148,7 @@ $FontSize=8; $Now = Date('Y-m-d H-i-s'); - while ($myrow = DB_fetch_array($result,$db)){ + while ($myrow = DB_fetch_array($result)){ // Check if there is any stock in transit already sent from FROM LOCATION $InTransitQuantityAtFrom = 0; if ($_SESSION['ProhibitNegativeStock']==1){ Modified: trunk/SuppPriceList.php =================================================================== --- trunk/SuppPriceList.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/SuppPriceList.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -161,7 +161,7 @@ $FontSize=8; $code=''; - while ($myrow = DB_fetch_array($result,$db)){ + while ($myrow = DB_fetch_array($result)){ $YPos -=$line_height; $PriceDated=ConvertSQLDate($myrow[4]); @@ -217,8 +217,8 @@ <th class="ascending">' . _('Date From') . '</th> <th>' . _('Supp Code') . '</th> </tr>'; - $k = 0; - while ($myrow = DB_fetch_array($result,$db)){ + $k = 0; + while ($myrow = DB_fetch_array($result)){ echo '<tr'; if ($k==0) { echo ' class="OddTableRows">'; Modified: trunk/SupplierBalsAtPeriodEnd.php =================================================================== --- trunk/SupplierBalsAtPeriodEnd.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/SupplierBalsAtPeriodEnd.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -71,7 +71,7 @@ $TotBal=0; - While ($SupplierBalances = DB_fetch_array($SupplierResult,$db)){ + While ($SupplierBalances = DB_fetch_array($SupplierResult)){ $Balance = $SupplierBalances['balance'] - $SupplierBalances['afterdatetrans'] + $SupplierBalances['afterdatediffonexch']; $FXBalance = $SupplierBalances['fxbalance'] - $SupplierBalances['fxafterdatetrans']; @@ -147,7 +147,7 @@ $ErrMsg = _('Could not retrieve period data because'); $Periods = DB_query($sql,$ErrMsg); - while ($myrow = DB_fetch_array($Periods,$db)){ + while ($myrow = DB_fetch_array($Periods)){ echo '<option value="' . $myrow['lastdate_in_period'] . '" selected="selected" >' . MonthAndYearFromSQLDate($myrow['lastdate_in_period'],'M',-1) . '</option>'; } echo '</select></td> Modified: trunk/Tax.php =================================================================== --- trunk/Tax.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/Tax.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -65,7 +65,7 @@ $YPos -= $FontSize; $YPos -= $FontSize; $FontSize = 8; - while ($DebtorTransRow = DB_fetch_array($DebtorTransResult,$db)) { + while ($DebtorTransRow = DB_fetch_array($DebtorTransResult)) { $pdf->addText($Left_Margin, $YPos, $FontSize, ConvertSQLDate($DebtorTransRow['trandate'])); $pdf->addText(82, $YPos, $FontSize, _($DebtorTransRow['typename'])); $pdf->addTextWrap(140, $YPos - $FontSize, 40, $FontSize, $DebtorTransRow['transno'], 'right'); @@ -236,7 +236,7 @@ if ($_POST['DetailOrSummary'] == 'Detail') { $FontSize = 10; $YPos -= $FontSize; // Jumps additional line. - $YPos -= $FontSize; + $YPos -= $FontSize; $pdf->addText($Left_Margin, $YPos + $FontSize, $FontSize, _('Tax on Petty Cash Expenses')); $YPos -= $FontSize; // Prints out lines: Modified: trunk/Z_DataExport.php =================================================================== --- trunk/Z_DataExport.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/Z_DataExport.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -89,7 +89,7 @@ stripcomma('categoryid') . ',' . stripcomma('categorydescription') . "\n"; - While ($PriceList = DB_fetch_array($PricesResult,$db)){ + While ($PriceList = DB_fetch_array($PricesResult)){ $Qty = 0; $sqlQty = "SELECT newqoh FROM stockmoves @@ -193,7 +193,7 @@ stripcomma('disabletrans') . "\n"; - While ($CustList = DB_fetch_array($CustResult,$db)){ + While ($CustList = DB_fetch_array($CustResult)){ $CreditLimit = $CustList['creditlimit']; if ( mb_strlen($CustList['braddress1']) <= 3 ) { @@ -273,7 +273,7 @@ stripcomma('commissionrate2') . "\n"; - While ($SalesManList = DB_fetch_array($SalesManResult,$db)){ + While ($SalesManList = DB_fetch_array($SalesManResult)){ $CommissionRate1 = $SalesManList['commissionrate1']; $BreakPoint = $SalesManList['breakpoint']; @@ -317,7 +317,7 @@ stripcomma('filename') . ','. stripcomma('url') . "\n"; $baseurl = 'http://'. $_SERVER['HTTP_HOST'] . dirname(htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8')) . '/' . 'getstockimg.php?automake=1&stockid=%s.png'; - While ($ImageList = DB_fetch_array($ImageResult,$db)){ + While ($ImageList = DB_fetch_array($ImageResult)){ $url = sprintf($baseurl, urlencode($ImageList['stockid'])); $CSVContent .= ( stripcomma($ImageList['stockid']) . ',' . @@ -356,7 +356,7 @@ stripcomma('tokenname') . "\n"; - While ($SecTokenList = DB_fetch_array($SecTokenResult,$db)){ + While ($SecTokenList = DB_fetch_array($SecTokenResult)){ $CSVContent .= (stripcomma($SecTokenList['tokenid']) . ',' . stripcomma($SecTokenList['tokenname']) . "\n"); @@ -392,7 +392,7 @@ stripcomma('secrolename') . "\n"; - While ($SecRoleList = DB_fetch_array($SecRoleResult,$db)){ + While ($SecRoleList = DB_fetch_array($SecRoleResult)){ $CSVContent .= (stripcomma($SecRoleList['secroleid']) . ',' . stripcomma($SecRoleList['secrolename']) . "\n"); @@ -428,7 +428,7 @@ stripcomma('tokenid') . "\n"; - While ($SecGroupList = DB_fetch_array($SecGroupResult,$db)){ + While ($SecGroupList = DB_fetch_array($SecGroupResult)){ $CSVContent .= (stripcomma($SecGroupList['secroleid']) . ',' . stripcomma($SecGroupList['tokenid']) . "\n"); @@ -496,7 +496,7 @@ stripcomma('swipecard') . "\n"; - While ($SecUserList = DB_fetch_array($SecUserResult,$db)){ + While ($SecUserList = DB_fetch_array($SecUserResult)){ $CSVContent .= (stripcomma($SecUserList['userid']) . ',' . stripcomma($SecUserList['password']) . ',' . Modified: trunk/Z_RePostGLFromPeriod.php =================================================================== --- trunk/Z_RePostGLFromPeriod.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/Z_RePostGLFromPeriod.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -23,7 +23,7 @@ FROM periods ORDER BY periodno"; $Periods = DB_query($sql); - while ($myrow=DB_fetch_array($Periods,$db)){ + while ($myrow=DB_fetch_array($Periods)){ echo '<option value="' . $myrow['periodno'] . '">' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } Modified: trunk/Z_UpdateChartDetailsBFwd.php =================================================================== --- trunk/Z_UpdateChartDetailsBFwd.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/Z_UpdateChartDetailsBFwd.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -27,7 +27,7 @@ $Periods = DB_query($sql); - while ($myrow=DB_fetch_array($Periods,$db)){ + while ($myrow=DB_fetch_array($Periods)){ echo '<option value="' . $myrow['periodno'] . '">' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } @@ -43,7 +43,7 @@ $RetResult = DB_data_seek($Periods,0); - while ($myrow=DB_fetch_array($Periods,$db)){ + while ($myrow=DB_fetch_array($Periods)){ if($myrow['periodno']==$DefaultToPeriod){ echo '<option selected="selected" value="' . $myrow['periodno'] . '">' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; Modified: trunk/api/api_branches.php =================================================================== --- trunk/api/api_branches.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/api/api_branches.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -348,7 +348,7 @@ $sql = 'INSERT INTO custbranch ('.mb_substr($FieldNames,0,-2).') '. 'VALUES ('.mb_substr($FieldValues,0,-2).') '; if (sizeof($Errors)==0) { - $result = DB_Query($sql, $db); + $result = DB_query($sql); if (DB_error_no() != 0) { $Errors[0] = DatabaseUpdateFailed; } else { @@ -471,7 +471,7 @@ $sql = mb_substr($sql,0,-2)." WHERE debtorno='".$BranchDetails['debtorno']."' AND branchcode='".$BranchDetails['branchcode']."'"; if (sizeof($Errors)==0) { - $result = DB_Query($sql, $db); + $result = DB_query($sql); if (DB_error_no() != 0) { $Errors[0] = DatabaseUpdateFailed; } else { @@ -527,7 +527,7 @@ $sql="SELECT * FROM custbranch WHERE debtorno='".$DebtorNumber."' AND branchcode='".$BranchCode."'"; - $result = api_DB_Query($sql, $db); + $result = api_DB_query($sql); if (DB_error_no() != 0 ) { $Errors[0] = DatabaseUpdateFailed; } else { Modified: trunk/api/api_customers.php =================================================================== --- trunk/api/api_customers.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/api/api_customers.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -361,7 +361,7 @@ $sql = 'INSERT INTO debtorsmaster ('.mb_substr($FieldNames,0,-2).') '. 'VALUES ('.mb_substr($FieldValues,0,-2).') '; if (sizeof($Errors)==0) { - $result = DB_Query($sql, $db); + $result = DB_query($sql); if (DB_error_no() != 0) { $Errors[0] = DatabaseUpdateFailed; } else { @@ -487,7 +487,7 @@ } $sql = mb_substr($sql,0,-2)." WHERE debtorno='".$CustomerDetails['debtorno']."'"; if (sizeof($Errors)==0) { - $result = DB_Query($sql, $db); + $result = DB_query($sql); if (DB_error_no() != 0) { $Errors[0] = DatabaseUpdateFailed; } else { @@ -513,7 +513,7 @@ return $Errors; } $sql="SELECT * FROM debtorsmaster WHERE debtorno='".$DebtorNumber."'"; - $result = DB_Query($sql, $db); + $result = DB_query($sql); $Errors[0] = 0; // None found. $Errors[1] = DB_fetch_array($result); @@ -533,7 +533,7 @@ $sql='SELECT debtorno FROM debtorsmaster WHERE '.$Field." LIKE '%".$Criteria."%'"; - $result = DB_Query($sql, $db); + $result = DB_query($sql); $DebtorList = array(0); // First element: no errors while ($myrow=DB_fetch_array($result)) { $DebtorList[]=$myrow[0]; Modified: trunk/api/api_debtortransactions.php =================================================================== --- trunk/api/api_debtortransactions.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/api/api_debtortransactions.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -708,7 +708,7 @@ $AssResult = api_DB_query($SQL); - while ($AssParts = DB_fetch_array($AssResult,$db)){ + while ($AssParts = DB_fetch_array($AssResult)){ $StandardCost += ($AssParts['standard'] * $AssParts['quantity']) ; /* Need to get the current location quantity Modified: trunk/api/api_glaccounts.php =================================================================== --- trunk/api/api_glaccounts.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/api/api_glaccounts.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -72,7 +72,7 @@ if (sizeof($Errors)==0) { $sql = 'INSERT INTO chartmaster ('.mb_substr($FieldNames,0,-2).') '. "VALUES ('".mb_substr($FieldValues,0,-2)."') "; - $result = DB_Query($sql, $db); + $result = DB_query($sql); $sql='INSERT INTO chartdetails (accountcode, period) SELECT ' . $AccountDetails['accountcode'] . ', Modified: trunk/api/api_glgroups.php =================================================================== --- trunk/api/api_glgroups.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/api/api_glgroups.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -81,7 +81,7 @@ if (sizeof($Errors)==0) { $sql = "INSERT INTO accountgroups ('" .mb_substr($FieldNames,0,-2) . "') VALUES ('" . mb_substr($FieldValues,0,-2) . "' ) "; - $result = DB_Query($sql, $db); + $result = DB_query($sql); if (DB_error_no() != 0) { $Errors[0] = DatabaseUpdateFailed; } else { Modified: trunk/api/api_glsections.php =================================================================== --- trunk/api/api_glsections.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/api/api_glsections.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -45,7 +45,7 @@ if (sizeof($Errors)==0) { $sql = "INSERT INTO accountsection ('" . mb_substr($FieldNames,0,-2) . "') VALUES ('" . mb_substr($FieldValues,0,-2) . "')"; - $result = DB_Query($sql, $db); + $result = DB_query($sql); if (DB_error_no() != 0) { $Errors[0] = DatabaseUpdateFailed; } else { Modified: trunk/api/api_locations.php =================================================================== --- trunk/api/api_locations.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/api/api_locations.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -152,7 +152,7 @@ $sql = "INSERT INTO locations (" . mb_substr($FieldNames,0,-2) . ") VALUES ('" . mb_substr($FieldValues,0,-2) . "') "; - $result = DB_Query($sql, $db); + $result = DB_query($sql); if (DB_error_no() != 0) { $Errors[0] = DatabaseUpdateFailed; } else { @@ -214,7 +214,7 @@ } $sql = mb_substr($sql,0,-2)." WHERE loccode='".$Location['loccode']."'"; if (sizeof($Errors)==0) { - $result = DB_Query($sql, $db); + $result = DB_query($sql); if (DB_error_no() != 0) { $Errors[0] = DatabaseUpdateFailed; } else { Modified: trunk/api/api_purchdata.php =================================================================== --- trunk/api/api_purchdata.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/api/api_purchdata.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -86,7 +86,7 @@ $sql = "INSERT INTO purchdata (".mb_substr($FieldNames,0,-2).") VALUES ('" . mb_substr($FieldValues,0,-2). "') "; DB_Txn_Begin(); - $result = DB_Query($sql, $db); + $result = DB_query($sql); DB_Txn_Commit(); if (DB_error_no() != 0) { $Errors[0] = DatabaseUpdateFailed; @@ -135,7 +135,7 @@ $sql = mb_substr($sql,0,-2) . " WHERE stockid='" . $PurchDataDetails['stockid'] ."' AND supplierno='" . $PurchDataDetails['supplierno'] ."'"; if (sizeof($Errors)==0) { - $result = DB_Query($sql, $db); + $result = DB_query($sql); echo DB_error_no(); if (DB_error_no() != 0) { $Errors[0] = DatabaseUpdateFailed; Modified: trunk/api/api_salesareas.php =================================================================== --- trunk/api/api_salesareas.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/api/api_salesareas.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -83,7 +83,7 @@ $sql = 'INSERT INTO areas ('.mb_substr($FieldNames,0,-2) . ") VALUES ('" .mb_substr($FieldValues,0,-2) . "') "; if (sizeof($Errors)==0) { - $result = DB_Query($sql, $db); + $result = DB_query($sql); if (DB_error_no() != 0) { $Errors[0] = DatabaseUpdateFailed; } else { Modified: trunk/api/api_salesman.php =================================================================== --- trunk/api/api_salesman.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/api/api_salesman.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -67,7 +67,7 @@ $sql = 'INSERT INTO salesman ('.mb_substr($FieldNames,0,-2).') '. 'VALUES ('.mb_substr($FieldValues,0,-2).') '; if (sizeof($Errors)==0) { - $result = DB_Query($sql, $db); + $result = DB_query($sql); if (DB_error_no() != 0) { $Errors[0] = DatabaseUpdateFailed; } else { Modified: trunk/api/api_salesorders.php =================================================================== --- trunk/api/api_salesorders.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/api/api_salesorders.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -875,7 +875,7 @@ $AssResult = api_DB_query($SQL); - while ($AssParts = DB_fetch_array($AssResult,$db)){ + while ($AssParts = DB_fetch_array($AssResult)){ $StandardCost += ($AssParts['standard'] * $AssParts['quantity']) ; /* Need to get the current location quantity Modified: trunk/api/api_salestypes.php =================================================================== --- trunk/api/api_salestypes.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/api/api_salestypes.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -69,7 +69,7 @@ $sql = "INSERT INTO salestypes ('" . mb_substr($FieldNames,0,-2) . "') VALUES ('" . mb_substr($FieldValues,0,-2) . "') "; if (sizeof($Errors)==0) { - $result = DB_Query($sql, $db); + $result = DB_query($sql); if (DB_error_no() != 0) { $Errors[0] = DatabaseUpdateFailed; } else { Modified: trunk/api/api_stock.php =================================================================== --- trunk/api/api_stock.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/api/api_stock.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -258,7 +258,7 @@ function GetCategoryGLCode($CategoryID, $field, $db) { $sql='SELECT '.$field." FROM stockcategory WHERE categoryid='".$CategoryID."'"; - $result = DB_Query($sql, $db); + $result = DB_query($sql); $myrow = DB_fetch_row($result); return $myrow[0]; } @@ -369,8 +369,8 @@ $locsql = "INSERT INTO locstock (loccode,stockid) SELECT locations.loccode,'" . $StockItemDetails['stockid'] . "' FROM locations"; DB_Txn_Begin(); - $stockresult = DB_Query($stocksql, $db); - $locresult = DB_Query($locsql, $db); + $stockresult = DB_query($stocksql); + $locresult = DB_query($locsql); DB_Txn_Commit(); if (DB_error_no() != 0) { $Errors[0] = DatabaseUpdateFailed; @@ -483,7 +483,7 @@ } $sql = mb_substr($sql,0,-2)." WHERE stockid='".$StockItemDetails['stockid']."'"; if (sizeof($Errors)==0) { - $result = DB_Query($sql, $db); + $result = DB_query($sql); echo DB_error_no(); if (DB_error_no() != 0) { $Errors[0] = DatabaseUpdateFailed; @@ -510,7 +510,7 @@ return $Errors; } $sql="SELECT * FROM stockmaster WHERE stockid='".$StockID."'"; - $result = DB_Query($sql, $db); + $result = DB_query($sql); if (sizeof($Errors)==0) { $Errors[0]=0; $Errors[1]=DB_fetch_array($result); @@ -533,7 +533,7 @@ $sql="SELECT stockid FROM stockmaster WHERE " . $Field ." LIKE '%".$Criteria."%'"; - $result = DB_Query($sql, $db); + $result = DB_query($sql); $i=0; $StockItemList = array(); while ($myrow=DB_fetch_array($result)) { @@ -591,7 +591,7 @@ return $Errors; } $sql="SELECT reorderlevel, loccode FROM locstock WHERE stockid='".$StockID."'"; - $result = DB_Query($sql, $db); + $result = DB_query($sql); if (sizeof($Errors)==0) { $i=0; while ($myrow=DB_fetch_array($result)) { @@ -621,7 +621,7 @@ $sql="UPDATE locstock SET reorderlevel='".$ReorderLevel."' WHERE stockid='".$StockID."' AND loccode='".$Location."'"; - $result = DB_Query($sql, $db); + $result = DB_query($sql); if (sizeof($Errors)==0) { return 0; } else { @@ -644,7 +644,7 @@ FROM salesorderdetails WHERE stkcode='".$StockID."' AND completed=0"; - $result = DB_Query($sql, $db); + $result = DB_query($sql); if (sizeof($Errors)==0) { $Errors[0]=0; $Errors[1]=DB_fetch_array($result); @@ -669,7 +669,7 @@ FROM purchorderdetails WHERE itemcode='".$StockID."' AND completed=0"; - $result = DB_Query($sql, $db); + $result = DB_query($sql); if (sizeof($Errors)==0) { $Errors[0]=0; $Errors[1]=DB_fetch_array($result); @@ -696,7 +696,7 @@ WHERE stockid='".$StockID."' and typeabbrev='".$SalesType."' and currabrev='".$Currency."'"; - $result = DB_Query($sql, $db); + $result = DB_query($sql); $myrow = DB_fetch_row($result); if ($myrow[0]==0) { $sql="INSERT INTO prices VALUES('". $StockID."', @@ -711,7 +711,7 @@ AND typeabbrev='".$SalesType."' AND currabrev='".$Currency."'"; } - $result = DB_Query($sql, $db); + $result = DB_query($sql); $Errors[0] = 0; return $Errors; } @@ -735,7 +735,7 @@ AND currabrev='".$Currency. "' AND startdate<='". Date('Y-m-d') . "' AND (enddate>'" . Date('Y-m-d') . "' OR enddate='0000-00-00')"; - $result = DB_Query($sql, $db); + $result = DB_query($sql); $myrow = DB_fetch_row($result); if ($myrow[0]==0) { $Errors[0] = NoPricesSetup; @@ -748,7 +748,7 @@ AND startdate<='". Date('Y-m-d') . "' AND (enddate>'" . Date('Y-m-d') . "' OR enddate='0000-00-00')"; } - $result = DB_Query($sql, $db); + $result = DB_query($sql); $myrow = DB_fetch_row($result); $Errors[0]=0; $Errors[1]=$myrow; @@ -770,7 +770,7 @@ ON taxauthrates.taxcatid=stockmaster.taxcatid WHERE stockid='". $StockID . "' AND taxauthority='". $TaxAuth . "'"; - $result = DB_Query($sql, $db); + $result = DB_query($sql); $myrow = DB_fetch_row($result); $Errors[0]=0; $Errors[1]=$myrow; @@ -886,7 +886,7 @@ WHERE stockmoves.type=25) as t ON stockserialitems.stockid=t.stockid and stockserialitems.serialno=t.serialno WHERE stockid='".$StockID."' AND loccode='".$Location."'"; - $result = DB_Query($sql, $db); + $result = DB_query($sql); if (sizeof($Errors)==0) { $i=0; while ($myrow=DB_fetch_array($result)) { Modified: trunk/api/api_stockcategories.php =================================================================== --- trunk/api/api_stockcategories.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/api/api_stockcategories.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -66,7 +66,7 @@ $sql = "INSERT INTO stockcategory ('" . mb_substr($FieldNames,0,-2) . "') VALUES ('" . mb_substr($FieldValues,0,-2) . "') "; if (sizeof($Errors)==0) { - $result = DB_Query($sql, $db); + $result = DB_query($sql); if (DB_error_no() != 0) { $Errors[0] = DatabaseUpdateFailed; } else { @@ -107,7 +107,7 @@ } $sql = mb_substr($sql,0,-2)." WHERE categoryid='" . $CategoryDetails['categoryid'] . "'"; if (sizeof($Errors)==0) { - $result = DB_Query($sql, $db); + $result = DB_query($sql); echo DB_error_no(); if (DB_error_no() != 0) { $Errors[0] = DatabaseUpdateFailed; @@ -134,7 +134,7 @@ return $Errors; } $sql="SELECT * FROM stockcategory WHERE categoryid='".$Categoryid."'"; - $result = DB_Query($sql, $db); + $result = DB_query($sql); if (sizeof($Errors)==0) { return DB_fetch_array($result); } else { @@ -156,7 +156,7 @@ categorydescription FROM stockcategory WHERE " . $Field ." " . LIKE . " '%".$Criteria."%'"; - $result = DB_Query($sql, $db); + $result = DB_query($sql); $i=0; $CategoryList = array(); while ($myrow=DB_fetch_array($result)) { @@ -183,7 +183,7 @@ ON stockitemproperties.stockid=stockmaster.stockid WHERE stockitemproperties.value like '".$Label."' AND stockcatproperties.categoryid='".$Category."'"; - $result = DB_Query($sql, $db); + $result = DB_query($sql); $i=0; $ItemList = array(); $ItemList[0]=0; @@ -205,7 +205,7 @@ $sql="SELECT value FROM stockitemproperties WHERE stockid='".$StockID."' AND stkcatpropid='".$Property . "'"; - $result = DB_Query($sql, $db); + $result = DB_query($sql); $myrow=DB_fetch_array($result); $Errors[0]=0; $Errors[1]=$myrow[0]; Modified: trunk/api/api_suppliers.php =================================================================== --- trunk/api/api_suppliers.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/api/api_suppliers.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -206,7 +206,7 @@ $sql = 'INSERT INTO suppliers ('.mb_substr($FieldNames,0,-2).') '. 'VALUES ('.mb_substr($FieldValues,0,-2).') '; if (sizeof($Errors)==0) { - $result = DB_Query($sql, $db); + $result = DB_query($sql); if (DB_error_no() != 0) { $Errors[0] = DatabaseUpdateFailed; } else { @@ -294,7 +294,7 @@ } $sql = mb_substr($sql,0,-2)." WHERE supplierid='".$SupplierDetails['supplierid']."'"; if (sizeof($Errors)==0) { - $result = DB_Query($sql, $db); + $result = DB_query($sql); echo DB_error_no(); if (DB_error_no() != 0) { $Errors[0] = DatabaseUpdateFailed; @@ -321,7 +321,7 @@ return $Errors; } $sql="SELECT * FROM suppliers WHERE supplierid='".$SupplierID."'"; - $result = DB_Query($sql, $db); + $result = DB_query($sql); if (sizeof($Errors)==0) { return DB_fetch_array($result); } else { @@ -342,7 +342,7 @@ $sql='SELECT supplierid FROM suppliers WHERE '.$Field." LIKE '%".$Criteria."%' ORDER BY supplierid"; - $result = DB_Query($sql, $db); + $result = DB_query($sql); $i=0; $SupplierList = array(); while ($myrow=DB_fetch_array($result)) { Modified: trunk/api/api_workorders.php =================================================================== --- trunk/api/api_workorders.php 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/api/api_workorders.php 2018-02-04 15:57:45 UTC (rev 7933) @@ -244,9 +244,9 @@ 'VALUES ('.mb_substr($ItemFieldValues,0,-2).') '; $systypessql = 'UPDATE systypes set typeno='.GetNextTransactionNo(40, $db).' where typeid=40'; DB_Txn_Begin(); - $woresult = DB_Query($wosql, $db); - $itemresult = DB_Query($itemsql, $db); - $systyperesult = DB_Query($systypessql, $db); + $woresult = DB_query($wosql); + $itemresult = DB_query($itemsql); + $systyperesult = DB_query($systypessql); DB_Txn_Commit(); if (DB_error_no() != 0) { $Errors[0] = DatabaseUpdateFailed; @@ -355,7 +355,7 @@ DB_query($systypessql); DB_query($costsql); if ($Batch!='') { - DB_Query($batchsql, $db); + DB_query($batchsql); } DB_Txn_Commit(); if (DB_error_no() != 0) { @@ -475,7 +475,7 @@ $sql="SELECT wo FROM woitems WHERE " . $Field ." " . LIKE . " '%".$Criteria."%'"; - $result = DB_Query($sql, $db); + $result = DB_query($sql); $i=0; $WOList = array(); while ($myrow=DB_fetch_array($result)) { Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2018-02-03 00:57:14 UTC (rev 7932) +++ trunk/doc/Change.log 2018-02-04 15:57:45 UTC (rev 7933) @@ -1,5 +1,6 @@ webERP Change Log +2/4/18 PaulT: Remove unused $db parameter from DB_fetch_array() and DB_Query() functions. Also, rename several DB_Query names to match function definition name: DB_query. 2/2/18 PaulT: Dashboard.php: Replace due date handling with existing function. 2/2/18 PaulT: PrintCustTrans.php, PDFTransPageHeader.inc, PrintCustTransPortrait.php, PDFTransPageHeaderPortrait.inc: Add missing stock lot/serial info to landscape output to be consistent with portrait output (reported by HDeriauFF), add Due Date info to invoices (reported by Paul Becker), and (PaulT) add security checks to portrait file, layout improvements, change PDF initialization handling, and more. (A summary of all changes in this commit can be viewed here: http://www.weberp.org/forum/showthread.php?tid=8065&pid=14115#pid14115) 31/1/18 PaulT: Add a 'warning' case to getMsg(), as there is mixed use of 'warn' and 'warning' usage with prnMsg() calls. The 'warning' (before this change) defaults to an 'info' style message. |