diff --git a/ConfirmDispatch_Invoice.php b/ConfirmDispatch_Invoice.php index c8a61a8cc..a5d3a2f37 100644 --- a/ConfirmDispatch_Invoice.php +++ b/ConfirmDispatch_Invoice.php @@ -1737,7 +1737,7 @@ DB_Txn_Commit(); - EnsureGLEntriesBalance(10, $InvoiceNo,$db); + EnsureGLEntriesBalance(10, $InvoiceNo); // ************************************************************************* // E N D O F I N V O I C E S Q L P R O C E S S I N G // ************************************************************************* diff --git a/CounterReturns.php b/CounterReturns.php index 3aa0cda3f..c690bfb61 100644 --- a/CounterReturns.php +++ b/CounterReturns.php @@ -1431,7 +1431,7 @@ } } - EnsureGLEntriesBalance(11,$CreditNoteNo,$db); + EnsureGLEntriesBalance(11,$CreditNoteNo); /*Also if GL is linked to debtors need to process the debit to bank and credit to debtors for the payment */ /*Need to figure out the cross rate between customer currency and bank account currency */ @@ -1476,7 +1476,7 @@ $result = DB_query($SQL,$ErrMsg,$DbgMsg,true); }//amount paid was not zero - EnsureGLEntriesBalance(12,$PaymentNumber,$db); + EnsureGLEntriesBalance(12,$PaymentNumber); } /*end of if Sales and GL integrated */ diff --git a/CounterSales.php b/CounterSales.php index 6aedbfd21..e0dfcd70c 100644 --- a/CounterSales.php +++ b/CounterSales.php @@ -1241,7 +1241,7 @@ $result = DB_query($sql,$ErrMsg,$DbgMsg,true); //Recursively insert real component requirements - see includes/SQL_CommonFunctions.in for function WoRealRequirements - WoRealRequirements($db, $WONo, $_SESSION['DefaultFactoryLocation'], $StockItem->StockID); + WoRealRequirements($WONo, $_SESSION['DefaultFactoryLocation'], $StockItem->StockID); $FactoryManagerEmail = _('A new work order has been created for') . ":\n" . $StockItem->StockID . ' - ' . $StockItem->ItemDescription . ' x ' . $WOQuantity . ' ' . $StockItem->Units . @@ -1884,7 +1884,7 @@ } } - EnsureGLEntriesBalance(10,$InvoiceNo,$db); + EnsureGLEntriesBalance(10,$InvoiceNo); /*Also if GL is linked to debtors need to process the debit to bank and credit to debtors for the payment */ /*Need to figure out the cross rate between customer currency and bank account currency */ @@ -1929,7 +1929,7 @@ $result = DB_query($SQL,$ErrMsg,$DbgMsg,true); }//amount paid we not zero - EnsureGLEntriesBalance(12,$ReceiptNumber,$db); + EnsureGLEntriesBalance(12,$ReceiptNumber); } /*end of if Sales and GL integrated */ if ($_POST['AmountPaid']!=0){ diff --git a/Credit_Invoice.php b/Credit_Invoice.php index 17a79fd08..c63543a37 100644 --- a/Credit_Invoice.php +++ b/Credit_Invoice.php @@ -1502,7 +1502,7 @@ } } - EnsureGLEntriesBalance(11,$CreditNo,$db); + EnsureGLEntriesBalance(11,$CreditNo); } /*end of if Sales and GL integrated */ diff --git a/CustomerReceipt.php b/CustomerReceipt.php index 99e417393..5ac9f9109 100644 --- a/CustomerReceipt.php +++ b/CustomerReceipt.php @@ -587,7 +587,7 @@ functionalexrate, } //end if there is some discount } //end if there is GL work to be done - ie config is to link to GL - EnsureGLEntriesBalance(12,$_SESSION['ReceiptBatch' . $identifier]->BatchNo,$db); + EnsureGLEntriesBalance(12,$_SESSION['ReceiptBatch' . $identifier]->BatchNo); $ErrMsg = _('Cannot commit the changes'); $DbgMsg = _('The SQL that failed was'); diff --git a/DeliveryDetails.php b/DeliveryDetails.php index 1069c42bb..1ac452ee4 100644 --- a/DeliveryDetails.php +++ b/DeliveryDetails.php @@ -536,7 +536,7 @@ $result = DB_query($sql,$ErrMsg,$DbgMsg,true); //Recursively insert real component requirements - see includes/SQL_CommonFunctions.in for function WoRealRequirements - WoRealRequirements($db, $WONo, $_SESSION['DefaultFactoryLocation'], $StockItem->StockID); + WoRealRequirements($WONo, $_SESSION['DefaultFactoryLocation'], $StockItem->StockID); $FactoryManagerEmail = _('A new work order has been created for') . ":\n" . $StockItem->StockID . ' - ' . $StockItem->ItemDescription . ' x ' . $WOQuantity . ' ' . $StockItem->Units . @@ -738,7 +738,7 @@ $result = DB_query($sql,$ErrMsg,$DbgMsg,true); //Recursively insert real component requirements - see includes/SQL_CommonFunctions.in for function WoRealRequirements - WoRealRequirements($db, $WONo, $_SESSION['Items'.$identifier]->Location, $ContractRow['contractref']); + WoRealRequirements($WONo, $_SESSION['Items'.$identifier]->Location, $ContractRow['contractref']); }//end processing if the order was a contract quotation being changed to an order }//end test to see if the order was a contract quotation being changed to an order diff --git a/GoodsReceived.php b/GoodsReceived.php index 0a9925953..865f3241b 100644 --- a/GoodsReceived.php +++ b/GoodsReceived.php @@ -645,7 +645,7 @@ $DbgMsg = _('The following SQL to insert the serial stock movement records was used'); $Result = DB_query($SQL, $ErrMsg, $DbgMsg, true); if ($_SESSION['QualityLogSamples']==1) { - CreateQASample($OrderLine->StockID,$Item->BundleRef, '', 'Created from Purchase Order', 0, 0,$db); + CreateQASample($OrderLine->StockID,$Item->BundleRef, '', 'Created from Purchase Order', 0, 0); } }//non blank BundleRef } //end foreach @@ -771,7 +771,7 @@ } if ($_SESSION['PO'.$identifier]->GLLink==1) { - EnsureGLEntriesBalance(25, $GRN,$db); + EnsureGLEntriesBalance(25, $GRN); } $Result = DB_Txn_Commit(); diff --git a/Payments.php b/Payments.php index 153887c5b..eda80ec23 100644 --- a/Payments.php +++ b/Payments.php @@ -720,7 +720,7 @@ functionalexrate, $ErrMsg = _('Cannot insert a GL transaction for the bank account credit because'); $DbgMsg = _('Cannot insert a GL transaction for the bank account credit using the SQL'); $result = DB_query($SQL,$ErrMsg,$DbgMsg,true); - EnsureGLEntriesBalance($TransType,$TransNo,$db); + EnsureGLEntriesBalance($TransType,$TransNo); } } diff --git a/SelectCreditItems.php b/SelectCreditItems.php index f723288a3..a5496ad1c 100644 --- a/SelectCreditItems.php +++ b/SelectCreditItems.php @@ -1984,7 +1984,7 @@ } } - EnsureGLEntriesBalance(11,$CreditNo,$db); + EnsureGLEntriesBalance(11,$CreditNo); } /*end of if Sales and GL integrated */ diff --git a/SelectQASamples.php b/SelectQASamples.php index eee660284..f523ec0aa 100644 --- a/SelectQASamples.php +++ b/SelectQASamples.php @@ -105,7 +105,7 @@ } } else { - CreateQASample($_POST['ProdSpecKey'],$_POST['LotKey'], $_POST['Identifier'], $_POST['Comments'], $_POST['Cert'], $_POST['DuplicateOK'],$db); + CreateQASample($_POST['ProdSpecKey'],$_POST['LotKey'], $_POST['Identifier'], $_POST['Comments'], $_POST['Cert'], $_POST['DuplicateOK']); $SelectedSampleID=DB_Last_Insert_ID('qasamples','sampleid'); if ($SelectedSampleID > '') { $msg = _('Created New Sample'); diff --git a/StockAdjustments.php b/StockAdjustments.php index a4f53f96b..300eba0b8 100644 --- a/StockAdjustments.php +++ b/StockAdjustments.php @@ -366,7 +366,7 @@ $Result = DB_query($SQL, $ErrMsg, $DbgMsg,true); } - EnsureGLEntriesBalance(17, $AdjustmentNumber,$db); + EnsureGLEntriesBalance(17, $AdjustmentNumber); $Result = DB_Txn_Commit(); $AdjustReason = $_SESSION['Adjustment' . $identifier]->Narrative? _('Narrative') . ' ' . $_SESSION['Adjustment' . $identifier]->Narrative:''; diff --git a/SupplierInvoice.php b/SupplierInvoice.php index c11757387..8d14330c8 100644 --- a/SupplierInvoice.php +++ b/SupplierInvoice.php @@ -434,7 +434,7 @@ $result=DB_query($sql); if ($_SESSION['PO'.$identifier]->GLLink==1) { - EnsureGLEntriesBalance(25, $GRN,$db); + EnsureGLEntriesBalance(25, $GRN); } $Result = DB_Txn_Commit(); @@ -1486,7 +1486,7 @@ $DbgMsg = _('The following SQL to insert the GL transaction was used'); $Result = DB_query($SQL, $ErrMsg, $DbgMsg, True); - EnsureGLEntriesBalance(20, $InvoiceNo, $db); + EnsureGLEntriesBalance(20, $InvoiceNo); } /*Thats the end of the GL postings */ /*Now insert the invoice into the SuppTrans table*/ diff --git a/WorkOrderEntry.php b/WorkOrderEntry.php index d00a1d0c9..bfe33c632 100644 --- a/WorkOrderEntry.php +++ b/WorkOrderEntry.php @@ -379,7 +379,7 @@ $result = DB_query($SQL,$ErrMsg); //Recursively insert real component requirements - see includes/SQL_CommonFunctions.in for function WoRealRequirements - WoRealRequirements($db, $_POST['WO'], $CostRow['loccode'], $NewItem); + WoRealRequirements($_POST['WO'], $CostRow['loccode'], $NewItem); $result = DB_Txn_Commit(); @@ -469,7 +469,7 @@ $ErrMsg = _('The work order item could not be added'); $result = DB_query($SQL,$ErrMsg); //Recursively insert real component requirements - see includes/SQL_CommonFunctions.in for function WoRealRequirements - WoRealRequirements($db, $_POST['WO'], $CostRow['loccode'], $Itm); + WoRealRequirements($_POST['WO'], $CostRow['loccode'], $Itm); } //end if there were no input errors else { DB_txn_rollback(); diff --git a/WorkOrderEntry.php.orig b/WorkOrderEntry.php.orig index ec6952a04..d00a1d0c9 100644 --- a/WorkOrderEntry.php.orig +++ b/WorkOrderEntry.php.orig @@ -821,17 +821,11 @@ echo '