|
From: <dai...@us...> - 2014-10-27 02:48:36
|
Revision: 6942
http://sourceforge.net/p/web-erp/reponame/6942
Author: daintree
Date: 2014-10-27 02:48:29 +0000 (Mon, 27 Oct 2014)
Log Message:
-----------
continue removing $db from DB_query calls
Modified Paths:
--------------
trunk/BOMInquiry.php
trunk/BOMs.php
trunk/BankAccounts.php
trunk/BankMatching.php
trunk/CompanyPreferences.php
trunk/ConfirmDispatch_Invoice.php
trunk/ContractCosting.php
trunk/Contracts.php
trunk/CounterReturns.php
trunk/CounterSales.php
trunk/CustItem.php
trunk/Customers.php
trunk/Dashboard.php
trunk/DeliveryDetails.php
trunk/DiscountCategories.php
trunk/EDIProcessOrders.php
trunk/FixedAssetDepreciation.php
trunk/FixedAssetItems.php
trunk/GLAccountInquiry.php
trunk/GLAccountReport.php
trunk/GLTrialBalance.php
trunk/GoodsReceived.php
trunk/ImportBankTrans.php
trunk/ImportBankTransAnalysis.php
trunk/InternalStockRequestAuthorisation.php
trunk/Labels.php
trunk/Locations.php
trunk/MRPCreateDemands.php
trunk/NoSalesItems.php
trunk/PDFPrintLabel.php
trunk/PDFWOPrint.php
trunk/PO_Header.php
trunk/PO_Items.php
trunk/Payments.php
trunk/PcReportTab.php
trunk/Prices.php
trunk/PricesBasedOnMarkUp.php
trunk/Prices_Customer.php
trunk/PrintCustTrans.php
trunk/PrintCustTransPortrait.php
trunk/PurchData.php
trunk/RelatedItemsUpdate.php
trunk/SelectCompletedOrder.php
trunk/SelectOrderItems.php
trunk/SelectProduct.php
trunk/SelectSalesOrder.php
trunk/ShipmentCosting.php
trunk/ShopParameters.php
trunk/StockAdjustments.php
trunk/StockClone.php
trunk/StockCostUpdate.php
trunk/StockCounts.php
trunk/StockLocTransfer.php
trunk/StockSerialItems.php
trunk/StockStatus.php
trunk/StockTransfers.php
trunk/StockUsage.php
trunk/Stocks.php
trunk/SuppContractChgs.php
trunk/SuppLoginSetup.php
trunk/SupplierCredit.php
trunk/SupplierInvoice.php
trunk/SupplierTransInquiry.php
trunk/TaxAuthorityRates.php
trunk/TaxGroups.php
trunk/WOSerialNos.php
trunk/WhereUsedInquiry.php
trunk/WorkOrderCosting.php
trunk/WorkOrderEntry.php
trunk/WorkOrderIssue.php
trunk/WorkOrderReceive.php
trunk/WorkOrderStatus.php
trunk/Z_ChangeBranchCode.php
trunk/Z_ChangeSupplierCode.php
trunk/Z_CreateCompanyTemplateFile.php
trunk/Z_Upgrade_3.01-3.02.php
trunk/api/api_debtortransactions.php
trunk/api/api_login.php
trunk/api/api_salesorders.php
trunk/includes/ConnectDB_postgres.inc
trunk/includes/DefineCartClass.php
trunk/includes/DefineContractClass.php
trunk/includes/DefineSuppTransClass.php
trunk/includes/GetSalesTransGLCodes.inc
trunk/includes/SQL_CommonFunctions.inc
trunk/includes/Z_POSDataCreation.php
Modified: trunk/BOMInquiry.php
===================================================================
--- trunk/BOMInquiry.php 2014-10-26 23:18:08 UTC (rev 6941)
+++ trunk/BOMInquiry.php 2014-10-27 02:48:29 UTC (rev 6942)
@@ -157,8 +157,7 @@
labourcost,
overheadcost
FROM stockmaster
- WHERE stockid='" . $StockID . "'",
- $db);
+ WHERE stockid='" . $StockID . "'");
$myrow = DB_fetch_array($result);
$ParentLabourCost = $myrow['labourcost'];
$ParentOverheadCost = $myrow['overheadcost'];
@@ -174,9 +173,9 @@
ON bom.component = stockmaster.stockid
WHERE bom.parent = '" . $StockID . "'
AND bom.effectiveafter < '" . Date('Y-m-d') . "'
- AND (bom.effectiveto > '" . Date('Y-m-d') . "'
+ AND (bom.effectiveto > '" . Date('Y-m-d') . "'
OR bom.effectiveto='0000-00-00')";
-
+
$ErrMsg = _('The bill of material could not be retrieved because');
$BOMResult = DB_query ($sql,$ErrMsg);
Modified: trunk/BOMs.php
===================================================================
--- trunk/BOMs.php 2014-10-26 23:18:08 UTC (rev 6941)
+++ trunk/BOMs.php 2014-10-27 02:48:29 UTC (rev 6942)
@@ -17,7 +17,9 @@
// retrive all children of parent
$c_result = DB_query("SELECT parent,
component
- FROM bom WHERE parent='" . $Parent. "' ORDER BY sequence ASC" ,$db);
+ FROM bom
+ WHERE parent='" . $Parent. "'
+ ORDER BY sequence ASC");
if (DB_num_rows($c_result) > 0) {
while ($row = DB_fetch_array($c_result)) {
@@ -465,7 +467,7 @@
echo '<table class="selection">';
echo '<tr><td><div class="centre">' . _('Manufactured parent items').' : ';
while ($myrow = DB_fetch_array($result)){
- echo (($ix)?', ':'') . '<a href="'.htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?Select='.$myrow['parent'].'">' .
+ echo (($ix)?', ':'') . '<a href="'.htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?Select='.$myrow['parent'].'">' .
$myrow['description'].' ('.$myrow['parent'].')</a>';
$ix++;
} //end while loop
@@ -489,7 +491,7 @@
echo '<tr><td><div class="centre">' . _('Assembly parent items').' : ';
$ix = 0;
while ($myrow = DB_fetch_array($result)){
- echo (($ix)?', ':'') . '<a href="'.htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?Select='.$myrow['parent'].'">' .
+ echo (($ix)?', ':'') . '<a href="'.htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?Select='.$myrow['parent'].'">' .
$myrow['description'].' ('.$myrow['parent'].')</a>';
$ix++;
} //end while loop
@@ -514,7 +516,7 @@
echo '<tr><td><div class="centre">' . _('Kit sets').' : ';
$ix = 0;
while ($myrow = DB_fetch_array($result)){
- echo (($ix)?', ':'') . '<a href="'.htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?Select='.$myrow['parent'].'">' .
+ echo (($ix)?', ':'') . '<a href="'.htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?Select='.$myrow['parent'].'">' .
$myrow['description'].' ('.$myrow['parent'].')</a>';
$ix++;
} //end while loop
@@ -700,18 +702,18 @@
<td>' . _('Sequence in BOM') . ':</td>
<td><input type="text" class="integer" required="required" size="5" name="Sequence" value="' . $_POST['Sequence'] . '" /></td>
</tr>';
-
+
echo '<tr>
<td>' . _('Location') . ': </td>
<td><select tabindex="2" name="LocCode">';
DB_free_result($result);
- $sql = "SELECT locationname,
- locations.loccode
- FROM locations
- INNER JOIN locationusers
- ON locationusers.loccode=locations.loccode
- AND locationusers.userid='" . $_SESSION['UserID'] . "'
+ $sql = "SELECT locationname,
+ locations.loccode
+ FROM locations
+ INNER JOIN locationusers
+ ON locationusers.loccode=locations.loccode
+ AND locationusers.userid='" . $_SESSION['UserID'] . "'
AND locationusers.canupd=1
WHERE locations.usedforwo = 1";
$result = DB_query($sql);
Modified: trunk/BankAccounts.php
===================================================================
--- trunk/BankAccounts.php 2014-10-26 23:18:08 UTC (rev 6941)
+++ trunk/BankAccounts.php 2014-10-27 02:48:29 UTC (rev 6942)
@@ -380,7 +380,7 @@
}
$result = DB_query("SELECT currabrev,
currency
- FROM currencies",$db);
+ FROM currencies");
while ($myrow = DB_fetch_array($result)) {
if ($myrow['currabrev']==$_POST['CurrCode']) {
Modified: trunk/BankMatching.php
===================================================================
--- trunk/BankMatching.php 2014-10-26 23:18:08 UTC (rev 6941)
+++ trunk/BankMatching.php 2014-10-27 02:48:29 UTC (rev 6942)
@@ -202,8 +202,7 @@
currcode
FROM bankaccounts INNER JOIN currencies
ON bankaccounts.currcode=currencies.currabrev
- WHERE accountcode='" . $_POST['BankAccount'] . "'",
- $db);
+ WHERE accountcode='" . $_POST['BankAccount'] . "'");
$BankRow = DB_fetch_array($BankResult);
$CurrDecimalPlaces = $BankRow['decimalplaces'];
$CurrCode = $BankRow['currcode'];
Modified: trunk/CompanyPreferences.php
===================================================================
--- trunk/CompanyPreferences.php 2014-10-26 23:18:08 UTC (rev 6941)
+++ trunk/CompanyPreferences.php 2014-10-27 02:48:29 UTC (rev 6942)
@@ -255,8 +255,7 @@
FROM chartmaster INNER JOIN accountgroups
ON chartmaster.group_=accountgroups.groupname
WHERE accountgroups.pandl=0
- ORDER BY chartmaster.accountcode",
- $db);
+ ORDER BY chartmaster.accountcode");
echo '<tr>
<td>' . _('Debtors Control GL Account') . ':</td>
@@ -351,8 +350,7 @@
FROM chartmaster INNER JOIN accountgroups
ON chartmaster.group_=accountgroups.groupname
WHERE accountgroups.pandl=1
- ORDER BY chartmaster.accountcode",
- $db);
+ ORDER BY chartmaster.accountcode");
while ($myrow = DB_fetch_row($result)) {
if ($_POST['FreightAct']==$myrow[0]){
Modified: trunk/ConfirmDispatch_Invoice.php
===================================================================
--- trunk/ConfirmDispatch_Invoice.php 2014-10-26 23:18:08 UTC (rev 6941)
+++ trunk/ConfirmDispatch_Invoice.php 2014-10-27 02:48:29 UTC (rev 6942)
@@ -948,7 +948,8 @@
need the MBFlag later too so save it to $MBFlag */
$Result = DB_query("SELECT mbflag
FROM stockmaster
- WHERE stockid = '" . $OrderLine->StockID . "'",$db, _('Cannot retrieve the mbflag'));
+ WHERE stockid = '" . $OrderLine->StockID . "'",
+ _('Cannot retrieve the mbflag'));
$myrow = DB_fetch_row($Result);
$MBFlag = $myrow[0];
@@ -1000,7 +1001,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/ContractCosting.php
===================================================================
--- trunk/ContractCosting.php 2014-10-26 23:18:08 UTC (rev 6941)
+++ trunk/ContractCosting.php 2014-10-27 02:48:29 UTC (rev 6942)
@@ -288,15 +288,13 @@
/*Check if the contract work order is still open */
$CheckIfWOOpenResult = DB_query("SELECT closed
FROM workorders
- WHERE wo='" . $_SESSION['Contract'.$identifier]->WO . "'",
- $db);
+ WHERE wo='" . $_SESSION['Contract'.$identifier]->WO . "'");
$CheckWORow=DB_fetch_row($CheckIfWOOpenResult);
if ($CheckWORow[0]==0){
//then close the work order
$CloseWOResult =DB_query("UPDATE workorders
SET closed=1
WHERE wo='" . $_SESSION['Contract'.$identifier]->WO . "'",
- $db,
_('Could not update the work order to closed because:'),
_('The SQL used to close the work order was:'),
true);
@@ -309,8 +307,7 @@
$result =DB_query("SELECT qtyrecd FROM woitems
WHERE stockid='" . $_SESSION['Contract'.$identifier]->ContractRef . "'
- AND wo='" . $_SESSION['Contract'.$identifier]->WO . "'",
- $db);
+ AND wo='" . $_SESSION['Contract'.$identifier]->WO . "'");
if (DB_num_rows($result)==1) {
$myrow=DB_fetch_row($result);
if ($myrow[0]==0){ //then the contract wo has not been received (it will only ever be for 1 item)
@@ -428,7 +425,9 @@
SET qtyrecd=qtyrecd+1
WHERE wo='" . $_SESSION['Contract'.$identifier]->WO . "'
AND stockid='" . $_SESSION['Contract'.$identifier]->ContractRef . "'",
- $db,$ErrMsg,$DbgMsg,true);
+ $ErrMsg,
+ $DbgMsg,
+ true);
}//end if the contract wo was not received - work order item received/processed above if not
}//end if there was a row returned from the woitems query
} //end if the work order was still open (so end of closing it and processing receipt if necessary)
Modified: trunk/Contracts.php
===================================================================
--- trunk/Contracts.php 2014-10-26 23:18:08 UTC (rev 6941)
+++ trunk/Contracts.php 2014-10-27 02:48:29 UTC (rev 6942)
@@ -21,7 +21,7 @@
$_POST['SelectedCustomer']=$_POST['SelectedCustomer'.$Index];
$_POST['SelectedBranch']=$_POST['SelectedBranch'.$Index];
}
-}
+}
$ViewTopic= 'Contracts';
$BookMark = 'CreateContract';
@@ -283,7 +283,7 @@
VALUES ('" . $_SESSION['Contract'.$identifier]->LocCode . "',
'" . $_SESSION['Contract'.$identifier]->LocCode . "',
'" . _('Default for') . ' ' . $_SESSION['Contract'.$identifier]->LocCode . "',
- '1')",$db);
+ '1')");
$WorkCentre = $_SESSION['Contract'.$identifier]->LocCode;
}
/*The above is a bit of a hack to get a default workcentre for a location based on the users default location*/
Modified: trunk/CounterReturns.php
===================================================================
--- trunk/CounterReturns.php 2014-10-26 23:18:08 UTC (rev 6941)
+++ trunk/CounterReturns.php 2014-10-27 02:48:29 UTC (rev 6942)
@@ -1495,7 +1495,7 @@
$result = DB_query("SELECT rate FROM currencies
INNER JOIN bankaccounts
ON currencies.currabrev=bankaccounts.currcode
- WHERE bankaccounts.accountcode='" . $_POST['BankAccount'] . "'",$db);
+ WHERE bankaccounts.accountcode='" . $_POST['BankAccount'] . "'");
$myrow = DB_fetch_row($result);
$BankAccountExRate = $myrow[0];
Modified: trunk/CounterSales.php
===================================================================
--- trunk/CounterSales.php 2014-10-26 23:18:08 UTC (rev 6941)
+++ trunk/CounterSales.php 2014-10-27 02:48:29 UTC (rev 6942)
@@ -463,7 +463,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;
@@ -574,7 +574,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;
@@ -624,7 +624,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;
@@ -676,7 +676,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']);
@@ -715,7 +715,7 @@
FROM discountmatrix
WHERE salestype='" . $_SESSION['Items'.$identifier]->DefaultSalesType . "'
AND discountcategory ='" . $OrderLine->DiscCat . "'
- AND quantitybreak <= '" . $QuantityOfDiscCat ."'",$db);
+ AND quantitybreak <= '" . $QuantityOfDiscCat ."'");
$myrow = DB_fetch_row($result);
if ($myrow[0]==NULL){
$DiscountMatrixRate = 0;
@@ -1209,14 +1209,15 @@
'" . $_SESSION['DefaultFactoryLocation'] . "',
'" . Date('Y-m-d') . "',
'" . Date('Y-m-d'). "')",
- $db,$ErrMsg,$DbgMsg,true);
+ $ErrMsg,
+ $DbgMsg,
+ true);
//Need to get the latest BOM to roll up cost
$CostResult = DB_query("SELECT SUM((materialcost+labourcost+overheadcost)*bom.quantity) AS cost
FROM stockmaster INNER JOIN bom
ON stockmaster.stockid=bom.component
WHERE bom.parent='" . $StockItem->StockID . "'
- AND bom.loccode='" . $_SESSION['DefaultFactoryLocation'] . "'",
- $db);
+ AND bom.loccode='" . $_SESSION['DefaultFactoryLocation'] . "'");
$CostRow = DB_fetch_row($CostResult);
if (is_null($CostRow[0]) OR $CostRow[0]==0){
$Cost =0;
@@ -1252,7 +1253,7 @@
$result = DB_query("SELECT serialno FROM stockserialitems
WHERE serialno='" . ($StockItem->NextSerialNo + $i) . "'
- AND stockid='" . $StockItem->StockID ."'",$db);
+ AND stockid='" . $StockItem->StockID ."'");
if (DB_num_rows($result)!=0){
$WOQuantity++;
prnMsg(($StockItem->NextSerialNo + $i) . ': ' . _('This automatically generated serial number already exists - it cannot be added to the work order'),'error');
@@ -1424,7 +1425,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
@@ -1932,7 +1933,7 @@
$result = DB_query("SELECT rate FROM currencies
INNER JOIN bankaccounts
ON currencies.currabrev=bankaccounts.currcode
- WHERE bankaccounts.accountcode='" . $_POST['BankAccount'] . "'",$db);
+ WHERE bankaccounts.accountcode='" . $_POST['BankAccount'] . "'");
$myrow = DB_fetch_row($result);
$BankAccountExRate = $myrow[0];
Modified: trunk/CustItem.php
===================================================================
--- trunk/CustItem.php 2014-10-26 23:18:08 UTC (rev 6941)
+++ trunk/CustItem.php 2014-10-27 02:48:29 UTC (rev 6942)
@@ -49,7 +49,7 @@
$InputError = 1;
prnMsg(_('There is no stock item set up enter the stock code or select a stock item using the search page'), 'error');
}
-
+
if (!is_numeric(filter_number_format($_POST['ConversionFactor']))) {
$InputError = 1;
unset($_POST['ConversionFactor']);
@@ -90,7 +90,7 @@
unset($debtorsmasterResult);
unset($DebtorNo);
}
-
+
if ($InputError == 0 AND isset($_POST['AddRecord'])) {
/* insert took place and need to clear the form */
unset($DebtorNo);
@@ -98,7 +98,7 @@
unset($_POST['ConversionFactor']);
unset($_POST['cust_description']);
unset($_POST['cust_part']);
-
+
}
}
@@ -118,7 +118,7 @@
$ItemResult = DB_query("SELECT description FROM stockmaster WHERE stockid='" . $StockID . "'");
$DescriptionRow = DB_fetch_array($ItemResult);
echo '<p class="page_title_text"><img src="' . $RootPath . '/css/' . $Theme . '/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $Title . ' ' . _('For Stock Code') . ' - ' . $StockID . ' - ' . $DescriptionRow['description'] . '</p><br />';
-
+
$sql = "SELECT custitem.debtorno,
debtorsmaster.name,
debtorsmaster.currcode,
@@ -138,7 +138,7 @@
prnMsg(_('There is no customer data set up for the part selected'), 'info');
$NoCustItemData=1;
} else if ($StockID != '') {
-
+
echo '<table cellpadding="2" class="selection">';
$TableHeader = '<tr>
<th class="ascending">' . _('Customer') . '</th>
@@ -185,7 +185,7 @@
if (isset($DebtorNo) AND $DebtorNo != '' AND !isset($_POST['Searchcustomer'])) {
/*NOT EDITING AN EXISTING BUT customer selected OR ENTERED*/
-
+
$sql = "SELECT debtorsmaster.name,
debtorsmaster.currcode,
currencies.decimalplaces AS currdecimalplaces
@@ -280,7 +280,7 @@
stockmaster.units,
stockmaster.mbflag
FROM stockmaster
- WHERE stockmaster.stockid='".$StockID."'", $db);
+ WHERE stockmaster.stockid='".$StockID."'");
$myrow = DB_fetch_row($result);
$StockUOM = $myrow[1];
if (DB_num_rows($result) <> 1) {
@@ -357,12 +357,12 @@
ON debtorsmaster.currcode = currencies.currabrev
WHERE custitem.debtorno='" . $DebtorNo . "'
AND custitem.stockid='" . $StockID . "'";
-
+
$ErrMsg = _('The customer purchasing details for the selected customer and item could not be retrieved because');
$EditResult = DB_query($sql, $ErrMsg);
$myrow = DB_fetch_array($EditResult);
$name = $myrow['name'];
-
+
$CurrCode = $myrow['currcode'];
$CurrDecimalPlaces = $myrow['currdecimalplaces'];
$_POST['customersUOM'] = $myrow['customersUOM'];
@@ -401,7 +401,7 @@
if (!isset($CurrCode)) {
$CurrCode = '';
}
-
+
if (!isset($_POST['customersUOM'])) {
$_POST['customersUOM'] = '';
}
@@ -443,11 +443,11 @@
<td><input type="text" name="cust_description" maxlength="30" size="30" value="' . $_POST['cust_description'] . '" /></td>
</tr>';
-
+
echo '</table>
<br />
<div class="centre">';
-
+
if ($Edit == true) {
echo '<input type="submit" name="UpdateRecord" value="' . _('Update') . '" />';
echo '<input type="hidden" name="Edit" value="1" />';
@@ -457,7 +457,7 @@
echo '</div>
<div class="centre">';
-
+
if (isset($StockLocation) AND isset($StockID) AND mb_strlen($StockID) != 0) {
echo '<br /><a href="' . $RootPath . '/StockStatus.php?StockID=' . $StockID . '">' . _('Show Stock Status') . '</a>';
echo '<br /><a href="' . $RootPath . '/StockMovements.php?StockID=' . $StockID . '&StockLocation=' . $StockLocation . '">' . _('Show Stock Movements') . '</a>';
Modified: trunk/Customers.php
===================================================================
--- trunk/Customers.php 2014-10-26 23:18:08 UTC (rev 6941)
+++ trunk/Customers.php 2014-10-27 02:48:29 UTC (rev 6942)
@@ -1096,8 +1096,7 @@
/*Process this first before showing remaining contacts */
$resultupcc = DB_query("DELETE FROM custcontacts
WHERE debtorno='".$DebtorNo."'
- AND contid='".$ID."'",
- $db);
+ AND contid='".$ID."'");
prnMsg(_('Contact Deleted'),'success');
}
Modified: trunk/Dashboard.php
===================================================================
--- trunk/Dashboard.php 2014-10-26 23:18:08 UTC (rev 6941)
+++ trunk/Dashboard.php 2014-10-27 02:48:29 UTC (rev 6942)
@@ -545,7 +545,7 @@
$result = DB_query("SELECT pandl
FROM accountgroups
INNER JOIN chartmaster ON accountgroups.groupname=chartmaster.group_
- WHERE chartmaster.accountcode='" . $myrow['accountcode'] ."'",$db);
+ WHERE chartmaster.accountcode='" . $myrow['accountcode'] ."'");
$PandLRow = DB_fetch_row($result);
if ($PandLRow[0]==1){
$PandLAccount = True;
Modified: trunk/DeliveryDetails.php
===================================================================
--- trunk/DeliveryDetails.php 2014-10-26 23:18:08 UTC (rev 6941)
+++ trunk/DeliveryDetails.php 2014-10-27 02:48:29 UTC (rev 6942)
@@ -503,14 +503,15 @@
'" . $_SESSION['DefaultFactoryLocation'] . "',
'" . Date('Y-m-d') . "',
'" . Date('Y-m-d'). "')",
- $db,$ErrMsg,$DbgMsg,true);
+ $ErrMsg,
+ $DbgMsg,
+ true);
//Need to get the latest BOM to roll up cost
$CostResult = DB_query("SELECT SUM((materialcost+labourcost+overheadcost)*bom.quantity) AS cost
FROM stockmaster INNER JOIN bom
ON stockmaster.stockid=bom.component
WHERE bom.parent='" . $StockItem->StockID . "'
- AND bom.loccode='" . $_SESSION['DefaultFactoryLocation'] . "'",
- $db);
+ AND bom.loccode='" . $_SESSION['DefaultFactoryLocation'] . "'");
$CostRow = DB_fetch_row($CostResult);
if (is_null($CostRow[0]) OR $CostRow[0]==0){
$Cost =0;
@@ -546,7 +547,7 @@
$result = DB_query("SELECT serialno FROM stockserialitems
WHERE serialno='" . ($StockItem->NextSerialNo + $i) . "'
- AND stockid='" . $StockItem->StockID ."'",$db);
+ AND stockid='" . $StockItem->StockID ."'");
if (DB_num_rows($result)!=0){
$WOQuantity++;
prnMsg(($StockItem->NextSerialNo + $i) . ': ' . _('This automatically generated serial number already exists - it cannot be added to the work order'),'error');
@@ -659,7 +660,7 @@
$ContractResult = DB_query("SELECT contractref,
requireddate
FROM contracts WHERE orderno='" . $_SESSION['ExistingOrder'.$identifier] ."'
- AND status=1",$db);
+ AND status=1");
if (DB_num_rows($ContractResult)==1){ //then it is a contract quotation being changed to an order
$ContractRow = DB_fetch_array($ContractResult);
$WONo = GetNextTransNo(40,$db);
@@ -667,7 +668,10 @@
$DbgMsg = _('The SQL that failed to update the contract status was');
$UpdContractResult=DB_query("UPDATE contracts SET status=2,
wo='" . $WONo . "'
- WHERE orderno='" .$_SESSION['ExistingOrder'.$identifier] . "'", $db,$ErrMsg,$DbgMsg,true);
+ WHERE orderno='" .$_SESSION['ExistingOrder'.$identifier] . "'",
+ $ErrMsg,
+ $DbgMsg,
+ true);
$ErrMsg = _('Could not insert the contract bill of materials');
$InsContractBOM = DB_query("INSERT INTO bom (parent,
component,
@@ -684,7 +688,9 @@
'2099-12-31',
quantity
FROM contractbom
- WHERE contractref='" . $ContractRow['contractref'] . "'",$db,$ErrMsg,$DbgMsg);
+ WHERE contractref='" . $ContractRow['contractref'] . "'",
+ $ErrMsg,
+ $DbgMsg);
$ErrMsg = _('Unable to insert a new work order for the sales order item');
$InsWOResult = DB_query("INSERT INTO workorders (wo,
@@ -695,13 +701,13 @@
'" . $_SESSION['Items'.$identifier]->Location ."',
'" . $ContractRow['requireddate'] . "',
'" . Date('Y-m-d'). "')",
- $db,$ErrMsg,$DbgMsg);
+ $ErrMsg,
+ $DbgMsg);
//Need to get the latest BOM to roll up cost but also add the contract other requirements
$CostResult = DB_query("SELECT SUM((materialcost+labourcost+overheadcost)*contractbom.quantity) AS cost
FROM stockmaster INNER JOIN contractbom
ON stockmaster.stockid=contractbom.stockid
- WHERE contractbom.contractref='" . $ContractRow['contractref'] . "'",
- $db);
+ WHERE contractbom.contractref='" . $ContractRow['contractref'] . "'");
$CostRow = DB_fetch_row($CostResult);
if (is_null($CostRow[0]) OR $CostRow[0]==0){
$Cost =0;
@@ -711,8 +717,7 @@
}
$CostResult = DB_query("SELECT SUM(costperunit*quantity) AS cost
FROM contractreqts
- WHERE contractreqts.contractref='" . $ContractRow['contractref'] . "'",
- $db);
+ WHERE contractreqts.contractref='" . $ContractRow['contractref'] . "'");
$CostRow = DB_fetch_row($CostResult);
//add other requirements cost to cost of contract BOM
$Cost += $CostRow[0];
@@ -1009,7 +1014,9 @@
$ErrMsg = _('The stock locations could not be retrieved');
$DbgMsg = _('SQL used to retrieve the stock locations was') . ':';
$StkLocsResult = DB_query("SELECT locationname,locations.loccode
- FROM locations INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1",$db, $ErrMsg, $DbgMsg);
+ FROM locations INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1",
+ $ErrMsg,
+ $DbgMsg);
while ($myrow=DB_fetch_array($StkLocsResult)){
if ($_SESSION['Items'.$identifier]->Location==$myrow['loccode']){
Modified: trunk/DiscountCategories.php
===================================================================
--- trunk/DiscountCategories.php 2014-10-26 23:18:08 UTC (rev 6941)
+++ trunk/DiscountCategories.php 2014-10-27 02:48:29 UTC (rev 6942)
@@ -33,7 +33,7 @@
FROM stockmaster
WHERE mbflag <>'K'
AND mbflag<>'D'
- AND stockid='" . mb_strtoupper($_POST['StockID']) . "'",$db);
+ AND stockid='" . mb_strtoupper($_POST['StockID']) . "'");
if (DB_num_rows($result)==0){
$InputError = 1;
prnMsg(_('The stock item entered must be set up as either a manufactured or purchased or assembly item'),'warn');
Modified: trunk/EDIProcessOrders.php
===================================================================
--- trunk/EDIProcessOrders.php 2014-10-26 23:18:08 UTC (rev 6941)
+++ trunk/EDIProcessOrders.php 2014-10-27 02:48:29 UTC (rev 6942)
@@ -468,7 +468,7 @@
defaultlocation,
phoneno,
email
- FROM custbranch INNER JOIN debtorsmaster ON custbranch.debtorno = custbranch.debtorno WHERE custbranchcode='" . $NAD_C082[0] . "' AND custbranch.debtorno='" . $Order->DebtorNo . "' AND debtorsmaster.ediorders=1",$db);
+ FROM custbranch INNER JOIN debtorsmaster ON custbranch.debtorno = custbranch.debtorno WHERE custbranchcode='" . $NAD_C082[0] . "' AND custbranch.debtorno='" . $Order->DebtorNo . "' AND debtorsmaster.ediorders=1");
if (DB_num_rows($BranchResult)!=1){
$EmailText .= "\n" . _('The Store number was specified as') . ' ' . $NAD_C082[0] . ' ' . _('Unfortunately there are either no branches of customer code') . ' ' . $Order->DebtorNo . ' ' ._('or several that match this store number') . '. ' . _('This order could not be processed further');
$TryNextFile = True; /* Look for other EDI msgs */
Modified: trunk/FixedAssetDepreciation.php
===================================================================
--- trunk/FixedAssetDepreciation.php 2014-10-26 23:18:08 UTC (rev 6941)
+++ trunk/FixedAssetDepreciation.php 2014-10-27 02:48:29 UTC (rev 6942)
@@ -18,7 +18,7 @@
ON fixedassettrans.periodno=periods.periodno
WHERE transtype=44
GROUP BY periods.lastdate_in_period
- ORDER BY periods.lastdate_in_period DESC",$db);
+ ORDER BY periods.lastdate_in_period DESC");
$LastDepnRun = DB_fetch_row($result);
Modified: trunk/FixedAssetItems.php
===================================================================
--- trunk/FixedAssetItems.php 2014-10-26 23:18:08 UTC (rev 6941)
+++ trunk/FixedAssetItems.php 2014-10-27 02:48:29 UTC (rev 6942)
@@ -137,16 +137,16 @@
accumdepnact
FROM fixedassets INNER JOIN fixedassetcategories
ON fixedassets.assetcategoryid=fixedassetcategories.categoryid
- WHERE assetid='" . $AssetID . "'",$db);
+ WHERE assetid='" . $AssetID . "'");
$OldDetails = DB_fetch_array($result);
if ($OldDetails['assetcategoryid'] !=$_POST['AssetCategoryID'] AND $OldDetails['cost']!=0){
- $PeriodNo = GetPeriod(Date($_SESSION['DefaultDateFormat']),$db);
+ $PeriodNo = GetPeriod(Date($_SESSION['DefaultDateFormat']));
/* Get the new account codes for the new asset category */
$result = DB_query("SELECT costact,
accumdepnact
FROM fixedassetcategories
- WHERE categoryid='" . $_POST['AssetCategoryID'] . "'",$db);
+ WHERE categoryid='" . $_POST['AssetCategoryID'] . "'");
$NewAccounts = DB_fetch_array($result);
$TransNo = GetNextTransNo( 42, $db); /* transaction type is asset category change */
@@ -297,7 +297,7 @@
costact
FROM fixedassets INNER JOIN fixedassetcategories
ON fixedassets.assetcategoryid=fixedassetcategories.categoryid
- WHERE assetid='" . $AssetID . "'", $db);
+ WHERE assetid='" . $AssetID . "'");
$AssetRow = DB_fetch_array($result);
$NBV = $AssetRow['cost'] -$AssetRow['accumdepn'];
if ($NBV!=0) {
@@ -614,7 +614,7 @@
<td>' . _('P/L after disposal') . ':</td>
<td class="number">' . locale_number_format(-$AssetRow['cost']+$AssetRow['accumdepn']+$AssetRow['disposalproceeds'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
</tr>';
-
+
}else{
echo'<tr>
<td>' . _('Net Book Value') . ':</td>
@@ -628,7 +628,7 @@
ON fixedassettrans.periodno=periods.periodno
WHERE transtype=44
GROUP BY periods.lastdate_in_period
- ORDER BY periods.lastdate_in_period DESC",$db);
+ ORDER BY periods.lastdate_in_period DESC");
$LastDepnRun = DB_fetch_row($result);
if(DB_num_rows($result)==0){
Modified: trunk/GLAccountInquiry.php
===================================================================
--- trunk/GLAccountInquiry.php 2014-10-26 23:18:08 UTC (rev 6941)
+++ trunk/GLAccountInquiry.php 2014-10-27 02:48:29 UTC (rev 6942)
@@ -119,7 +119,7 @@
$result = DB_query("SELECT pandl
FROM accountgroups
INNER JOIN chartmaster ON accountgroups.groupname=chartmaster.group_
- WHERE chartmaster.accountcode='" . $SelectedAccount ."'",$db);
+ WHERE chartmaster.accountcode='" . $SelectedAccount ."'");
$PandLRow = DB_fetch_row($result);
if ($PandLRow[0]==1){
$PandLAccount = True;
@@ -152,7 +152,7 @@
if ($_POST['tag']!=0) {
$sql = $sql . " AND tag='" . $_POST['tag'] . "'";
}
-
+
$sql = $sql . " ORDER BY periodno, gltrans.trandate, counterindex";
$namesql = "SELECT accountname FROM chartmaster WHERE accountcode='" . $SelectedAccount . "'";
Modified: trunk/GLAccountReport.php
===================================================================
--- trunk/GLAccountReport.php 2014-10-26 23:18:08 UTC (rev 6941)
+++ trunk/GLAccountReport.php 2014-10-27 02:48:29 UTC (rev 6942)
@@ -42,7 +42,7 @@
accountgroups.pandl
FROM accountgroups
INNER JOIN chartmaster ON accountgroups.groupname=chartmaster.group_
- WHERE chartmaster.accountcode='" . $SelectedAccount . "'",$db);
+ WHERE chartmaster.accountcode='" . $SelectedAccount . "'");
$AccountDetailRow = DB_fetch_row($result);
$AccountName = $AccountDetailRow[0];
if ($AccountDetailRow[1]==1){
@@ -238,7 +238,7 @@
$sql = "SELECT accountcode, accountname FROM chartmaster ORDER BY 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'] . ' ' . $myrow['accountname'] . '</option>';
$i++;
@@ -254,7 +254,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/GLTrialBalance.php
===================================================================
--- trunk/GLTrialBalance.php 2014-10-26 23:18:08 UTC (rev 6941)
+++ trunk/GLTrialBalance.php 2014-10-27 02:48:29 UTC (rev 6942)
@@ -433,10 +433,7 @@
chartdetails.accountcode";
- $AccountsResult = DB_query($SQL,
- $db,
- _('No general ledger accounts were returned by the SQL because'),
- _('The SQL that failed was:'));
+ $AccountsResult = DB_query($SQL, _('No general ledger accounts were returned by the SQL because'), _('The SQL that failed was:'));
echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/magnifier.png" title="' .
_('Trial Balance') . '" alt="" />' . ' ' . _('Trial Balance Report') . '</p>';
Modified: trunk/GoodsReceived.php
===================================================================
--- trunk/GoodsReceived.php 2014-10-26 23:18:08 UTC (rev 6941)
+++ trunk/GoodsReceived.php 2014-10-27 02:48:29 UTC (rev 6942)
@@ -61,7 +61,7 @@
}
if ($_SESSION['PO'.$identifier]->Status != 'Printed') {
- prnMsg( _('Purchase orders must have a status of Printed before they can be received').'.<br />' .
+ prnMsg( _('Purchase orders must have a status of Printed before they can be received').'.<br />' .
_('Order number') . ' ' . $_GET['PONumber'] . ' ' . _('has a status of') . ' ' . _($_SESSION['PO'.$identifier]->Status), 'warn');
include('includes/footer.inc');
exit;
@@ -194,10 +194,10 @@
if ($LnItm->Controlled == 1) {
if ($LnItm->Serialised==1){
- echo '<td><a href="GoodsReceivedControlled.php?identifier=' . $identifier . '&LineNo=' . $LnItm->LineNo . '">' .
+ echo '<td><a href="GoodsReceivedControlled.php?identifier=' . $identifier . '&LineNo=' . $LnItm->LineNo . '">' .
_('Enter Serial Nos'). '</a></td>';
} else {
- echo '<td><a href="GoodsReceivedControlled.php?identifier=' . $identifier . '&LineNo=' . $LnItm->LineNo . '">' .
+ echo '<td><a href="GoodsReceivedControlled.php?identifier=' . $identifier . '&LineNo=' . $LnItm->LineNo . '">' .
_('Enter Batches'). '</a></td>';
}
}
@@ -306,7 +306,7 @@
$LineNo=1;
if(DB_num_rows($Result)==0){//Those goods must have been received by another user. So should destroy the session data and show warning to users
prnMsg(_('This order has been changed or invoiced since this delivery was started to be actioned').' . '._('Processing halted'),'error');
- echo '<div class="centre"><a href="' . $RootPath . '/PO_SelectOSPurchOrder.php">' .
+ echo '<div class="centre"><a href="' . $RootPath . '/PO_SelectOSPurchOrder.php">' .
_('Select a different purchase order for receiving goods against') . '</a></div>';
unset($_SESSION['PO'.$identifier]->LineItems);
unset($_SESSION['PO'.$identifier]);
@@ -368,7 +368,7 @@
</tr>
</table>';
}
- echo '<div class="centre"><a href="' . $RootPath . '/PO_SelectOSPurchOrder.php">' .
+ echo '<div class="centre"><a href="' . $RootPath . '/PO_SelectOSPurchOrder.php">' .
_('Select a different purchase order for receiving goods against') . '</a></div>';
echo '<div class="centre"><a href="' . $RootPath . '/GoodsReceived.php?PONumber=' . $_SESSION['PO'.$identifier]->OrderNo . '">' . _('Re-read the updated purchase order for receiving goods against'). '</a></div>';
unset($_SESSION['PO'.$identifier]->LineItems);
@@ -618,7 +618,7 @@
FROM fixedassets
INNER JOIN fixedassetcategories
ON fixedassets.assetcategoryid=fixedassetcategories.categoryid
- WHERE assetid='" . $OrderLine->AssetID . "'",$db);
+ WHERE assetid='" . $OrderLine->AssetID . "'");
if (DB_num_rows($CheckAssetExistsResult)==1){ //then work with the assetid provided
/*Need to add a fixedassettrans for the cost of the asset being received */
@@ -748,7 +748,7 @@
<br />
<br />
<a href="' . $RootPath . '/PO_SelectOSPurchOrder.php">' . _('Select a different purchase order for receiving goods against'). '</a>
- </div>';
+ </div>';
/*end of process goods received entry */
echo '</div>';
echo '</form>';
Modified: trunk/ImportBankTrans.php
===================================================================
--- trunk/ImportBankTrans.php 2014-10-26 23:18:08 UTC (rev 6941)
+++ trunk/ImportBankTrans.php 2014-10-27 02:48:29 UTC (rev 6942)
@@ -173,7 +173,6 @@
//Update the banktrans to show it has cleared the bank
$result = DB_query("UPDATE banktrans SET amountcleared=amount
WHERE banktransid = '" . $_SESSION['Trans'][$i]->BankTransID . "'",
- $db,
_('Could not update the bank transaction as cleared'),
_('The SQL that failed to update the bank transaction as cleared was'),
true);
@@ -208,7 +207,6 @@
'" . DB_escape_string($_SESSION['Trans'][$i]->Description) . "',
'" . DB_escape_string($_SESSION['Trans'][$i]->Description) . "',
'" . -$_SESSION['Trans'][$i]->Amount . "')",
- $db,
_('Could not insert the customer transaction'),
_('The SQL used to insert the debtortrans was'),
true);
@@ -217,7 +215,6 @@
SET lastpaiddate = '" . FormatDateForSQL($_SESSION['Trans'][$i]->ValueDate) . "',
lastpaid='" . $_SESSION['Trans'][$i]->Amount ."'
WHERE debtorno='" . $_SESSION['Trans'][$i]->DebtorNo . "'",
- $db,
_('Could not update the last payment date and amount paid'),
_('The SQL that failed to update the debtorsmaster was'),
true);
@@ -238,7 +235,6 @@
'" . $_SESSION['CompanyRecord']['debtorsact'] . "',
'" . DB_escape_string($_SESSION['Trans'][$i]->Description) . "',
'" . -round($_SESSION['Trans'][$i]->Amount/$_POST['ExchangeRate'],$_SESSION['CompanyRecord']['decimalplaces']+1) . "')",
- $db,
_('Cannot insert a GL entry for the receipt because'),
_('The SQL that failed to insert the receipt GL entry was'),
true);
@@ -257,7 +253,6 @@
'" . $_SESSION['Statement']->BankGLAccount . "',
'" . DB_escape_string($_SESSION['Trans'][$i]->Description) . "',
'" . round($_SESSION['Trans'][$i]->Amount/$_POST['ExchangeRate'],$_SESSION['CompanyRecord']['decimalplaces']+1) . "')",
- $db,
_('Cannot insert a GL entry for the receipt because'),
_('The SQL that failed to insert the receipt GL entry was'),
true);
@@ -281,7 +276,6 @@
'" . $GLAnalysis->GLCode . "',
'" . DB_escape_string($GLAnalysis->Narrative . ' ' . $_SESSION['Trans'][$i]->Description) . "',
'" . -round($GLAnalysis->Amount/$_POST['ExchangeRate'],$_SESSION['CompanyRecord']['decimalplaces']+1) . "')",
- $db,
_('Cannot insert a GL entry for the receipt gl analysis because'),
_('The SQL that failed to insert the gl analysis of this receipt was'),
true);
@@ -302,7 +296,6 @@
'" . $_SESSION['Statement']->BankGLAccount . "',
'" . DB_escape_string($_SESSION['Trans'][$i]->Description) . "',
'" . round($_SESSION['Trans'][$i]->Amount/$_POST['ExchangeRate'],$_SESSION['CompanyRecord']['decimalplaces']+1) . "')",
- $db,
_('Cannot insert a GL entry for the receipt because'),
_('The SQL that failed to insert the receipt GL entry was'),
true);
@@ -331,7 +324,6 @@
'" . DB_escape_string($_SESSION['Trans'][$i]->Description) . "',
'" . DB_escape_string($_SESSION['Trans'][$i]->Description) . "',
'" . $_SESSION['Trans'][$i]->Amount . "')",
- $db,
_('Could not insert the supplier transaction'),
_('The SQL used to insert the supptrans was'),
true);
@@ -340,7 +332,6 @@
SET lastpaiddate = '" . FormatDateForSQL($_SESSION['Trans'][$i]->ValueDate) . "',
lastpaid='" . $_SESSION['Trans'][$i]->Amount ."'
WHERE supplierid='" . $_SESSION['Trans'][$i]->SupplierID . "'",
- $db,
_('Could not update the supplier last payment date and amount paid'),
_('The SQL that failed to update the supplier with the last payment amount and date was'),
true);
@@ -360,7 +351,6 @@
'" . $_SESSION['CompanyRecord']['creditorsact'] . "',
'" . DB_escape_string($_SESSION['Trans'][$i]->Description) . "',
'" . round(-$_SESSION['Trans'][$i]->Amount/$_POST['ExchangeRate'],$_SESSION['CompanyRecord']['decimalplaces']+1) . "')",
- $db,
_('Cannot insert a GL entry for the supplier payment to creditors control because'),
_('The SQL that failed to insert the creditors control GL entry was'),
true);
@@ -380,7 +370,6 @@
'" . $_SESSION['Statement']->BankGLAccount . "',
'" . DB_escape_string($_SESSION['Trans'][$i]->Description) . "',
'" . round($_SESSION['Trans'][$i]->Amount/$_POST['ExchangeRate'],$_SESSION['CompanyRecord']['decimalplaces']+1) . "')",
- $db,
_('Cannot insert a GL entry for the supplier payment because'),
_('The SQL that failed to insert the supplier payment GL entry to the bank account was'),
true);
@@ -405,7 +394,6 @@
'" . $GLAnalysis->GLCode . "',
'" . DB_escape_string($GLAnalysis->Narrative . ' ' . $_SESSION['Trans'][$i]->Description) . "',
'" . -round($GLAnalysis->Amount/$_POST['ExchangeRate'],$_SESSION['CompanyRecord']['decimalplaces']+1) . "')",
- $db,
_('Cannot insert a GL entry for the payment gl analysis because'),
_('The SQL that failed to insert the gl analysis of this payment was'),
true);
@@ -427,7 +415,6 @@
'" . $_SESSION['Statement']->BankGLAccount . "',
'" . DB_escape_string($_SESSION['Trans'][$i]->Description) . "',
'" . round($_SESSION['Trans'][$i]->Amount/$_POST['ExchangeRate'],$_SESSION['CompanyRecord']['decimalplaces']+1) . "')",
- $db,
_('Cannot insert a GL entry for the payment because'),
_('The SQL that failed to insert the payment GL entry was'),
true);
@@ -461,7 +448,6 @@
'" . $_SESSION['Trans'][$i]->Amount . "',
'" . $_SESSION['Statement']->CurrCode . "',
'" . $_SESSION['Trans'][$i]->Amount . "')",
- $db,
_('Could not insert the bank transaction'),
_('The SQL that failed to insert the bank transaction was'),
true);
Modified: trunk/ImportBankTransAnalysis.php
===================================================================
--- trunk/ImportBankTransAnalysis.php 2014-10-26 23:18:08 UTC (rev 6941)
+++ trunk/ImportBankTransAnalysis.php 2014-10-27 02:48:29 UTC (rev 6942)
@@ -137,7 +137,7 @@
suppname
FROM suppliers
WHERE currcode='" . $_SESSION['Statement']->CurrCode . "'
- ORDER BY suppname",$db);
+ ORDER BY suppname");
if ($_SESSION['Trans'][$TransID]->SupplierID ==''){
echo '<option selected value="">' . _('GL Payment') . '</option>';
} else {
@@ -168,7 +168,7 @@
name
FROM debtorsmaster
WHERE currcode='" . $_SESSION['Statement']->CurrCode . "'
- ORDER BY name",$db);
+ ORDER BY name");
if ($_SESSION['Trans'][$TransID]->DebtorNo ==''){
echo '<option selected value="">' . _('GL Receipt') . '</option>';
} else {
Modified: trunk/InternalStockRequestAuthorisation.php
===================================================================
--- trunk/InternalStockRequestAuthorisation.php 2014-10-26 23:18:08 UTC (rev 6941)
+++ trunk/InternalStockRequestAuthorisation.php 2014-10-27 02:48:29 UTC (rev 6942)
@@ -28,13 +28,13 @@
WHERE dispatchid='" . $CancelItems[0] . "'
AND dispatchitemsid='" . $CancelItems[1] . "'";
$result = DB_query($sql);
- $result = DB_Query("SELECT stockid FROM stockrequestitems WHERE completed=0 AND dispatchid='" . $CancelItems[0] . "'",$db);
+ $result = DB_query("SELECT stockid FROM stockrequestitems WHERE completed=0 AND dispatchid='" . $CancelItems[0] . "'");
if (DB_num_rows($result) ==0){
$result = DB_query("UPDATE stockrequest
SET authorised='1'
- WHERE dispatchid='" . $CancelItems[0] . "'",$db);
+ WHERE dispatchid='" . $CancelItems[0] . "'");
}
-
+
}
}
}
Modified: trunk/Labels.php
===================================================================
--- trunk/Labels.php 2014-10-26 23:18:08 UTC (rev 6941)
+++ trunk/Labels.php 2014-10-27 02:48:29 UTC (rev 6942)
@@ -136,8 +136,7 @@
hpos='" . $_POST['HPos' . $i] . "',
fontsize='" . $_POST['FontSize' . $i] . "',
barcode='" . $_POST['Barcode' . $i] . "'
- WHERE labelfieldid='" . $_POST['LabelFieldID' . $i] . "'",
- $db);
+ WHERE labelfieldid='" . $_POST['LabelFieldID' . $i] . "'");
} else {
prnMsg (_('Entries for Vertical Position, Horizontal Position, and Font Size must be integers.'),'error');
}
@@ -160,8 +159,7 @@
'" . $_POST['VPos'] . "',
'" . $_POST['HPos'] . "',
'" . $_POST['FontSize'] . "',
- '" . $_POST['Barcode'] . "')",
- $db);
+ '" . $_POST['Barcode'] . "')");
}
} elseif(isset($_GET['SelectedLabelID'])){
$SelectedLabelID =$_GET['SelectedLabelID'];
Modified: trunk/Locations.php
===================================================================
--- trunk/Locations.php 2014-10-26 23:18:08 UTC (rev 6941)
+++ trunk/Locations.php 2014-10-27 02:48:29 UTC (rev 6942)
@@ -348,15 +348,15 @@
/* need to figure out if this location is the only one in the same tax province */
$result = DB_query("SELECT taxprovinceid FROM locations
- WHERE loccode='" . $SelectedLocation . "'",$db);
+ WHERE loccode='" . $SelectedLocation . "'");
$TaxProvinceRow = DB_fetch_row($result);
$result = DB_query("SELECT COUNT(taxprovinceid) FROM locations
- WHERE taxprovinceid='" .$TaxProvinceRow[0] . "'",$db);
+ WHERE taxprovinceid='" .$TaxProvinceRow[0] . "'");
$TaxProvinceCount = DB_fetch_row($result);
if ($TaxProvinceCount[0]==1){
/* if its the only location in this tax authority then delete the appropriate records in TaxAuthLevels */
$result = DB_query("DELETE FROM taxauthrates
- WHERE dispatchtaxprovince='" . $TaxProvinceRow[0] . "'",$db);
+ WHERE dispatchtaxprovince='" . $TaxProvinceRow[0] . "'");
}
$result= DB_query("DELETE FROM locstock WHERE loccode ='" . $SelectedLocation . "'");
Modified: trunk/MRPCreateDemands.php
===================================================================
--- trunk/MRPCreateDemands.php 2014-10-26 23:18:08 UTC (rev 6941)
+++ trunk/MRPCreateDemands.php 2014-10-27 02:48:29 UTC (rev 6942)
@@ -228,7 +228,7 @@
$result= DB_query("SELECT locations.loccode,
locationname
- FROM locations INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1",$db);
+ FROM locations INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1");
while ($myrow=DB_fetch_array($result)){
echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>';
}
Modified: trunk/NoSalesItems.php
===================================================================
--- trunk/NoSalesItems.php 2014-10-26 23:18:08 UTC (rev 6941)
+++ trunk/NoSalesItems.php 2014-10-27 02:48:29 UTC (rev 6942)
@@ -21,7 +21,7 @@
<td><select name="Location[]" multiple="multiple">
<option value="All" selected="selected">' . _('All') . '</option>';;
$sql = "SELECT locations.loccode,locationname
- FROM locations
+ FROM locations
INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1
ORDER BY locationname";
$locationresult = DB_query($sql);
@@ -214,7 +214,7 @@
FROM locstock
INNER JOIN locationusers ON locationusers.loccode=locstock.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1
WHERE stockid = '" . $myrow['stockid'] . "'" .
- $WhereLocation , $db);
+ $WhereLocation);
$QOHRow = DB_fetch_row($QOHResult);
$QOH = $QOHRow[0];
Modified: trunk/PDFPrintLabel.php
===================================================================
--- trunk/PDFPrintLabel.php 2014-10-26 23:18:08 UTC (rev 6941)
+++ trunk/PDFPrintLabel.php 2014-10-27 02:48:29 UTC (rev 6942)
@@ -141,8 +141,7 @@
topmargin*" . $PtsPerMM . " as label_topmargin,
leftmargin*" . $PtsPerMM . " as label_leftmargin
FROM labels
- WHERE labelid='" . $_POST['LabelID'] . "'",
- $db);
+ WHERE labelid='" . $_POST['LabelID'] . "'");
$LabelDimensions = DB_fetch_array($result);
$result = DB_query("SELECT fieldvalue,
@@ -151,8 +150,7 @@
fontsize,
barcode
FROM labelfields
- WHERE labelid = '" . $_POST['LabelID'] . "'",
- $db);
+ WHERE labelid = '" . $_POST['LabelID'] . "'");
$LabelFields = array();
$i=0;
while ($LabelFieldRow = DB_fetch_array($result)){
Modified: trunk/PDFWOPrint.php
===================================================================
--- trunk/PDFWOPrint.php 2014-10-26 23:18:08 UTC (rev 6941)
+++ trunk/PDFWOPrint.php 2014-10-27 02:48:29 UTC (rev 6942)
@@ -196,28 +196,28 @@
$WOHeader = DB_fetch_array($result);
if ($WOHeader['controlled']==1) {
$sql = "SELECT serialno
- FROM woserialnos
+ FROM woserialnos
WHERE woserialnos.stockid='" . $StockID . "'
AND woserialnos.wo ='" . $SelectedWO . "'";
$result = DB_query($sql, $ErrMsg);
if (DB_num_rows($result) > 0) {
$SerialNoArray=DB_fetch_array($result);
$SerialNo=$SerialNoArray[0];
- }
+ }
else {
$SerialNo=$WOHeader['nextlotsnref'];
- }
+ }
} //controlled
$PackQty=0;
- $sql = "SELECT value
- FROM stockitemproperties
+ $sql = "SELECT value
+ FROM stockitemproperties
INNER JOIN stockcatproperties
ON stockcatproperties.stkcatpropid=stockitemproperties.stkcatpropid
WHERE stockid='" . $StockID . "'
AND label='PackQty'";
$result = DB_query($sql, $ErrMsg);
$PackQtyArray=DB_fetch_array($result);
- $PackQty=$PackQtyArray['value'];
+ $PackQty=$PackQtyArray['value'];
if ($PackQty==0) {
$PackQty=1;
}
@@ -271,14 +271,13 @@
FROM worequirements INNER JOIN stockmaster
ON worequirements.stockid=stockmaster.stockid
WHERE wo='" . $SelectedWO . "'
- AND worequirements.parentstockid='" . $StockID . "'",
- $db);
+ AND worequirements.parentstockid='" . $StockID . "'");
$IssuedAlreadyResult = DB_query("SELECT stockid,
- SUM(-qty) AS total
- FROM stockmoves
- WHERE stockmoves.type=28
- AND reference='".$SelectedWO."'
- GROUP BY stockid",$db);
+ SUM(-qty) AS total
+ FROM stockmoves
+ WHERE stockmoves.type=28
+ AND reference='".$SelectedWO."'
+ GROUP BY stockid");
while ($IssuedRow = DB_fetch_array($IssuedAlreadyResult)){
$IssuedAlreadyRow[$IssuedRow['stockid']] = $IssuedRow['total'];
}
@@ -300,7 +299,7 @@
$WOLine[$i]['description'] = $RequirementsRow['description'];
$WOLine[$i]['controlled'] = $RequirementsRow['controlled'];
$WOLine[$i]['qtyreqd'] = $WOHeader['qtyreqd']*$RequirementsRow['qtypu'];
- $WOLine[$i]['issued'] = $Issued ;
+ $WOLine[$i]['issued'] = $Issued ;
$WOLine[$i]['decimalplaces'] = $RequirementsRow['decimalplaces'];
$i+=1;
}
@@ -325,7 +324,7 @@
$i+=1;
}
}
-
+
}
if ($SelectedWO == 'Preview' or $i > -1) {
/*Yes there are line items to start the ball rolling with a page header */
@@ -336,7 +335,7 @@
if ($SelectedWO == 'Preview') {
$WOLine[$i]['action'] = str_pad('', 20, 'x');
$WOLine[$i]['item'] = str_pad('', 10, 'x');
- $WOLine[$i]['description'] = str_pad('', 50, 'x');
+ $WOLine[$i]['description'] = str_pad('', 50, 'x');
$WOLine[$i]['qtyreqd'] = 9999999.99;
$WOLine[$i]['issued'] = 9999999.99;
$WOLine[$i]['decimalplaces'] = 2;
@@ -353,16 +352,16 @@
$LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column3->x, $YPos, $FormDesign->Data->Column3->Length, $FormDesign->Data->Column3->FontSize, $WOLine[$i]['description'], 'left');
$LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column4->x, $YPos, $FormDesign->Data->Column4->Length, $FormDesign->Data->Column4->FontSize, locale_number_format($WOLine[$i]['qtyreqd'],$WOLine[$i]['decimalplaces']), 'right');
$LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column5->x, $YPos, $FormDesign->Data->Column5->Length, $FormDesign->Data->Column5->FontSize, locale_number_format($WOLine[$i]['issued'],$WOLine[$i]['decimalplaces']), 'right');
-
+
$YPos -= $line_height;
if ($YPos - (2*$line_height) <= $Page_Height - $FormDesign->Comments->y) {
$PageNumber++;
$YPos = $Page_Height - $FormDesign->Data->y;
include('includes/PDFWOPageHeader.inc');
- }
-
+ }
+
/*display already issued and available qty and lots where applicable*/
-
+
$IssuedAlreadyDetail = DB_query("SELECT stockmoves.stockid,
SUM(qty) as qty,
stockserialmoves.serialno,
@@ -374,8 +373,8 @@
ON stockmoves.loccode=locations.loccode
WHERE stockmoves.type=28
AND stockmoves.stockid = '".$WOLine[$i]['item']."'
- AND reference='".$SelectedWO."'
- GROUP BY stockserialmoves.serialno",$db);
+ AND reference='".$SelectedWO."'
+ GROUP BY stockserialmoves.serialno");
while ($IssuedRow = DB_fetch_array($IssuedAlreadyDetail)){
if ($WOLine[$i]['controlled']) {
$CurLot=$IssuedRow['serialno'];
@@ -392,9 +391,9 @@
$PageNumber++;
$YPos = $Page_Height - $FormDesign->Data->y;
include('includes/PDFWOPageHeader.inc');
- }
+ }
}
-
+
if ($WOLine[$i]['issued'] <= $WOLine[$i]['qtyreqd']) {
$AvailQty = DB_query("SELECT locstock.loccode,
locstock.bin,
@@ -402,9 +401,9 @@
serialno,
stockserialitems.quantity as qty
FROM locstock LEFT OUTER JOIN stockserialitems
- ON locstock.loccode=stockserialitems.loccode AND locstock.stockid = stockserialitems.stockid
+ ON locstock.loccode=stockserialitems.loccode AND locstock.stockid = stockserialitems.stockid
WHERE locstock.loccode='".$WOHeader['loccode']."'
- AND locstock.stockid='".$WOLine[$i]['item']."'",$db);
+ AND locstock.stockid='".$WOLine[$i]['item']."'");
while ($ToIssue = DB_fetch_array($AvailQty)){
if ($WOLine[$i]['controlled']) {
$CurLot=$ToIssue['serialno'];
@@ -423,7 +422,7 @@
$PageNumber++;
$YPos = $Page_Height - $FormDesign->Data->y;
include('includes/PDFWOPageHeader.inc');
- }
+ }
//echo $CurLot . ' ' . $CurQty . '<br>';
}
}
@@ -437,9 +436,9 @@
$PageNumber++;
$YPos = $Page_Height - $FormDesign->Data->y;
include('includes/PDFWOPageHeader.inc');
- }
+ }
} //end while there are line items to print out
-
+
if ($YPos - (2*$line_height) <= $Page_Height - $FormDesign->Comments->y) { // need to ensure space for totals
$PageNumber++;
include('includes/PDFWOPageHeader.inc');
@@ -460,7 +459,7 @@
$PageNumber++;
$YPos = $Page_Height - $FormDesign->Headings->Column1->y;
include('includes/PDFWOPageHeader.inc');
- }
+ }
$LeftOvers = $pdf->addTextWrap($FormDesign->Comments->x, $YPos,$FormDesign->Comments->Length,$FormDesign->Comments->FontSize, $LeftOvers, 'left');
}
@@ -512,7 +511,7 @@
/**
/*the user has just gone into the page need to ask the question whether to print the order or email it */
include('includes/header.inc');
-
+
if (!isset($LabelItem)) {
$sql = "SELECT workorders.wo,
stockmaster.description,
@@ -528,21 +527,21 @@
ON woitems.stockid=stockmaster.stockid
WHERE woitems.stockid='" . $StockID . "'
AND woitems.wo ='" . $SelectedWO . "'";
-
+
$result = DB_query($sql, $ErrMsg);
$Labels = DB_fetch_array($result);
$LabelItem=$Labels['stockid'];
$LabelDesc=$Labels['description'];
$QtyPerBox=0;
- $sql = "SELECT value
- FROM stockitemproperties
+ $sql = "SELECT value
+ FROM stockitemproperties
INNER JOIN stockcatproperties
ON stockcatproperties.stkcatpropid=stockitemproperties.stkcatpropid
WHERE stockid='" . $StockID . "'
AND label='PackQty'";
$result = DB_query($sql, $ErrMsg);
$PackQtyArray=DB_fetch_array($result);
- $QtyPerBox=$PackQtyArray['value'];
+ $QtyPerBox=$PackQtyArray['value'];
if ($QtyPerBox==0) {
$QtyPerBox=1;
}
@@ -553,17 +552,17 @@
$LeftOverQty=locale_number_format($LeftOverQty, $Labels['decimalplaces']);
if ($Labels['controlled']==1) {
$sql = "SELECT serialno
- FROM woserialnos
+ FROM woserialnos
WHERE woserialnos.stockid='" . $StockID . "'
AND woserialnos.wo ='" . $SelectedWO . "'";
$result = DB_query($sql, $ErrMsg);
if (DB_num_rows($result) > 0) {
$SerialNoArray=DB_fetch_array($result);
$LabelLot=$SerialNoArray[0];
- }
+ }
else {
$LabelLot=$WOHeader['nextlotsnref'];
- }
+ }
} //controlled
} //not set yet
echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post">';
@@ -574,7 +573,7 @@
} //$ViewingOnly == 1
echo '<br /><br />';
echo '<input type="hidden" name="WO" value="' . $SelectedWO . '" />';
- echo '<input type="hidden" name="StockID" value="' . $StockID . '" />';
+ echo '<input type="hidden" name="StockID" value="' . $StockID . '" />';
echo '<table>
<tr...
[truncated message content] |