From ff9c4106ec7bb8a717faba8af6910597734a54b8 Mon Sep 17 00:00:00 2001 From: PaulT Date: Fri, 16 Mar 2018 00:39:27 -0400 Subject: [PATCH] Remove unused $db parameter Functions: GetPeriod, GetNextTransNo --- AnalysisHorizontalPosition.php | 2 +- BankReconciliation.php | 6 +++--- ConfirmDispatch_Invoice.php | 4 ++-- ContractCosting.php | 6 +++--- Contracts.php | 2 +- CounterReturns.php | 8 ++++---- CounterSales.php | 12 ++++++------ Credit_Invoice.php | 4 ++-- Currencies.php | 4 ++-- CustomerAllocations.php | 2 +- CustomerReceipt.php | 6 +++--- Customers.php | 2 +- DailySalesInquiry.php | 2 +- Dashboard.php | 4 ++-- DeliveryDetails.php | 6 +++--- EDISendInvoices.php | 2 +- EDISendInvoices_Reece.php | 2 +- FixedAssetDepreciation.php | 4 ++-- FixedAssetItems.php | 6 +++--- GLAccountInquiry.php | 4 ++-- GLBalanceSheet.php | 2 +- GLBudgets.php | 4 ++-- GLCashFlowsIndirect.php | 4 ++-- GLJournal.php | 4 ++-- GLProfit_Loss.php | 2 +- GLTagProfit_Loss.php | 2 +- GLTrialBalance.php | 4 ++-- GoodsReceived.php | 4 ++-- ImportBankTrans.php | 10 +++++----- InternalStockRequest.php | 2 +- InternalStockRequestFulfill.php | 4 ++-- InventoryPlanning.php | 4 ++-- InventoryPlanningPrefSupplier.php | 2 +- OffersReceived.php | 2 +- PDFPickingList.php | 2 +- PDFStockCheckComparison.php | 4 ++-- PO_Items.php | 2 +- Payments.php | 12 ++++++------ PcAnalysis.php | 24 ++++++++++++------------ PcAuthorizeCash.php | 6 +++--- PcAuthorizeExpenses.php | 4 ++-- PurchaseByPrefSupplier.php | 2 +- RecurringSalesOrdersProcess.php | 6 +++--- ReverseGRN.php | 2 +- SalesGraph.php | 2 +- SelectCreditItems.php | 4 ++-- SelectSalesOrder.php | 2 +- ShipmentCosting.php | 6 +++--- Shipments.php | 2 +- SpecialOrder.php | 4 ++-- StockAdjustments.php | 4 ++-- StockDispatch.php | 2 +- StockLocTransfer.php | 2 +- StockLocTransferReceive.php | 2 +- StockTransfers.php | 4 ++-- StockUsage.php | 2 +- Stocks.php | 12 ++++++------ SuppPaymentRun.php | 2 +- SupplierAllocations.php | 2 +- SupplierCredit.php | 4 ++-- SupplierInvoice.php | 8 ++++---- Suppliers.php | 2 +- Tax.php | 4 ++-- WorkOrderCosting.php | 4 ++-- WorkOrderEntry.php | 2 +- WorkOrderIssue.php | 8 ++++---- WorkOrderReceive.php | 12 ++++++------ Z_ImportDebtors.php | 2 +- Z_ImportFixedAssets.php | 4 ++-- Z_ImportGLTransactions.php | 4 ++-- api/api_debtortransactions.php | 2 +- api/api_salesorders.php | 2 +- includes/DateFunctions.inc | 2 +- includes/DefineTenderClass.php | 2 +- includes/EDIconfig.inc | 2 +- includes/PDFPaymentRun_PymtFooter.php | 2 +- includes/SQL_CommonFunctions.inc | 6 +++--- 77 files changed, 163 insertions(+), 163 deletions(-) diff --git a/AnalysisHorizontalPosition.php b/AnalysisHorizontalPosition.php index f351e77d1..32ac532b1 100644 --- a/AnalysisHorizontalPosition.php +++ b/AnalysisHorizontalPosition.php @@ -40,7 +40,7 @@ function RelativeChange($selected_period, $previous_period) { ';*/ - $periodno=GetPeriod(Date($_SESSION['DefaultDateFormat']), $db); + $periodno=GetPeriod(Date($_SESSION['DefaultDateFormat'])); $sql = "SELECT lastdate_in_period FROM periods WHERE periodno='".$periodno . "'"; $result = DB_query($sql); $myrow=DB_fetch_array($result); diff --git a/BankReconciliation.php b/BankReconciliation.php index 2b085fdc8..5decbf35c 100644 --- a/BankReconciliation.php +++ b/BankReconciliation.php @@ -48,10 +48,10 @@ $ExchangeDifference = ($CalculatedBalance - filter_number_format($_POST['BankStatementBalance']))/$CurrencyRow['rate']; include ('includes/SQL_CommonFunctions.inc'); - $ExDiffTransNo = GetNextTransNo(36,$db); + $ExDiffTransNo = GetNextTransNo(36); /*Post the exchange difference to the last day of the month prior to current date*/ $PostingDate = Date($_SESSION['DefaultDateFormat'],mktime(0,0,0, Date('m'), 0,Date('Y'))); - $PeriodNo = GetPeriod($PostingDate,$db); + $PeriodNo = GetPeriod($PostingDate); $result = DB_Txn_Begin(); //yet to code the journal @@ -148,7 +148,7 @@ /*Get the balance of the bank account concerned */ - $PeriodNo = GetPeriod(date($_SESSION['DefaultDateFormat']), $db); + $PeriodNo = GetPeriod(date($_SESSION['DefaultDateFormat'])); $SQL = "SELECT bfwd+actual AS balance FROM chartdetails diff --git a/ConfirmDispatch_Invoice.php b/ConfirmDispatch_Invoice.php index 8382992ab..e70178eff 100644 --- a/ConfirmDispatch_Invoice.php +++ b/ConfirmDispatch_Invoice.php @@ -807,8 +807,8 @@ /*Now Get the next invoice number - function in SQL_CommonFunctions*/ - $InvoiceNo = GetNextTransNo(10, $db); - $PeriodNo = GetPeriod($DefaultDispatchDate, $db); + $InvoiceNo = GetNextTransNo(10); + $PeriodNo = GetPeriod($DefaultDispatchDate); /*Start an SQL transaction */ diff --git a/ContractCosting.php b/ContractCosting.php index c738b272c..a681f1801 100644 --- a/ContractCosting.php +++ b/ContractCosting.php @@ -234,8 +234,8 @@ //Compare actual costs to original budgeted contract costs - if actual > budgeted - CR WIP and DR usage variance $Variance = ($OtherReqtsBudget+$ContractBOMBudget)-($OtherReqtsActual+$ContractBOMActual); - $ContractCloseNo = GetNextTransNo( 32 ,$db); - $PeriodNo = GetPeriod(Date($_SESSION['DefaultDateFormat']), $db); + $ContractCloseNo = GetNextTransNo( 32 ); + $PeriodNo = GetPeriod(Date($_SESSION['DefaultDateFormat'])); DB_Txn_Begin(); @@ -311,7 +311,7 @@ $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) - $WOReceiptNo = GetNextTransNo(26, $db); + $WOReceiptNo = GetNextTransNo(26); /* Need to get the current location quantity will need it later for the stock movement */ $SQL = "SELECT locstock.quantity diff --git a/Contracts.php b/Contracts.php index 75cf7e7c1..8c36c9aef 100644 --- a/Contracts.php +++ b/Contracts.php @@ -536,7 +536,7 @@ //start a DB transaction $Result = DB_Txn_Begin(); - $OrderNo = GetNextTransNo(30, $db); + $OrderNo = GetNextTransNo(30); $HeaderSQL = "INSERT INTO salesorders ( orderno, debtorno, branchcode, diff --git a/CounterReturns.php b/CounterReturns.php index ed41dcef1..b6ee4cdbf 100644 --- a/CounterReturns.php +++ b/CounterReturns.php @@ -895,8 +895,8 @@ /*Now Get the next invoice number - GetNextTransNo() function in SQL_CommonFunctions * GetPeriod() in includes/DateFunctions.inc */ - $CreditNoteNo = GetNextTransNo(11, $db); - $PeriodNo = GetPeriod(Date($_SESSION['DefaultDateFormat']), $db); + $CreditNoteNo = GetNextTransNo(11); + $PeriodNo = GetPeriod(Date($_SESSION['DefaultDateFormat'])); $ReturnDate = Date('Y-m-d'); @@ -1436,7 +1436,7 @@ /*Need to figure out the cross rate between customer currency and bank account currency */ if ($_POST['AmountPaid']!=0){ - $PaymentNumber = GetNextTransNo(12,$db); + $PaymentNumber = GetNextTransNo(12); $SQL="INSERT INTO gltrans (type, typeno, trandate, @@ -1481,7 +1481,7 @@ if ($_POST['AmountPaid']!=0){ if (!isset($PaymentNumber)){ - $PaymentNumber = GetNextTransNo(12,$db); + $PaymentNumber = GetNextTransNo(12); } //Now need to add the receipt banktrans record //First get the account currency that it has been banked into diff --git a/CounterSales.php b/CounterSales.php index ce0e6deef..8df95821a 100644 --- a/CounterSales.php +++ b/CounterSales.php @@ -1072,9 +1072,9 @@ // ************************************************************************* $result = DB_Txn_Begin(); /*First add the order to the database - it only exists in the session currently! */ - $OrderNo = GetNextTransNo(30, $db); - $InvoiceNo = GetNextTransNo(10, $db); - $PeriodNo = GetPeriod(Date($_SESSION['DefaultDateFormat']), $db); + $OrderNo = GetNextTransNo(30); + $InvoiceNo = GetNextTransNo(10); + $PeriodNo = GetPeriod(Date($_SESSION['DefaultDateFormat'])); $HeaderSQL = "INSERT INTO salesorders ( orderno, debtorno, @@ -1200,7 +1200,7 @@ $WOQuantity = $StockItem->EOQ; } - $WONo = GetNextTransNo(40,$db); + $WONo = GetNextTransNo(40); $ErrMsg = _('Unable to insert a new work order for the sales order item'); $InsWOResult = DB_query("INSERT INTO workorders (wo, loccode, @@ -1889,7 +1889,7 @@ /*Need to figure out the cross rate between customer currency and bank account currency */ if ($_POST['AmountPaid']!=0){ - $ReceiptNumber = GetNextTransNo(12,$db); + $ReceiptNumber = GetNextTransNo(12); $SQL="INSERT INTO gltrans (type, typeno, trandate, @@ -1933,7 +1933,7 @@ } /*end of if Sales and GL integrated */ if ($_POST['AmountPaid']!=0){ if (!isset($ReceiptNumber)){ - $ReceiptNumber = GetNextTransNo(12,$db); + $ReceiptNumber = GetNextTransNo(12); } //Now need to add the receipt banktrans record //First get the account currency that it has been banked into diff --git a/Credit_Invoice.php b/Credit_Invoice.php index 6143dfeea..1cf028435 100644 --- a/Credit_Invoice.php +++ b/Credit_Invoice.php @@ -548,8 +548,8 @@ /*Now Get the next credit note number - function in SQL_CommonFunctions*/ - $CreditNo = GetNextTransNo(11, $db); - $PeriodNo = GetPeriod($DefaultDispatchDate, $db); + $CreditNo = GetNextTransNo(11); + $PeriodNo = GetPeriod($DefaultDispatchDate); /*Start an SQL transaction */ diff --git a/Currencies.php b/Currencies.php index ab99a0a45..67214e95d 100644 --- a/Currencies.php +++ b/Currencies.php @@ -135,7 +135,7 @@ $msg = _('The currency definition record has been added'); } //run the SQL from either of the above possibilites - $ExDiffTransNo = GetNextTransNo(36,$db); + $ExDiffTransNo = GetNextTransNo(36); $resultTx = DB_Txn_Begin(); $result = DB_query($sql); @@ -154,7 +154,7 @@ if (isset($SelectedCurrency) AND $InputError !=1) { /*Get the current period */ $PostingDate = Date($_SESSION['DefaultDateFormat']); - $PeriodNo = GetPeriod($PostingDate,$db); + $PeriodNo = GetPeriod($PostingDate); /* get all the bank accounts denominated on the selected currency */ $SQLBankAccounts = "SELECT bankaccountname, diff --git a/CustomerAllocations.php b/CustomerAllocations.php index 07dcc5103..22f85b8ea 100644 --- a/CustomerAllocations.php +++ b/CustomerAllocations.php @@ -143,7 +143,7 @@ if ($MovtInDiffOnExch !=0) { if ($_SESSION['CompanyRecord']['gllink_debtors'] == 1) { - $PeriodNo = GetPeriod($_SESSION['Alloc']->TransDate, $db); + $PeriodNo = GetPeriod($_SESSION['Alloc']->TransDate); $_SESSION['Alloc']->TransDate = FormatDateForSQL($_SESSION['Alloc']->TransDate); $SQL = "INSERT INTO gltrans ( diff --git a/CustomerReceipt.php b/CustomerReceipt.php index 54107109b..1f0de368b 100644 --- a/CustomerReceipt.php +++ b/CustomerReceipt.php @@ -252,7 +252,7 @@ and add up the non-GL ones for posting to debtors later, also add the total discount total receipts*/ - $PeriodNo = GetPeriod($_SESSION['ReceiptBatch' . $identifier]->DateBanked,$db); + $PeriodNo = GetPeriod($_SESSION['ReceiptBatch' . $identifier]->DateBanked); if ($_SESSION['CompanyRecord']==0){ prnMsg(_('The company has not yet been set up properly') . ' - ' . _('this information is needed to process the batch') . '. ' . _('Processing has been cancelled'),'error'); @@ -272,7 +272,7 @@ /*Start a transaction to do the whole lot inside */ $result = DB_Txn_Begin(); - $_SESSION['ReceiptBatch' . $identifier]->BatchNo = GetNextTransNo(12,$db); + $_SESSION['ReceiptBatch' . $identifier]->BatchNo = GetNextTransNo(12); $BatchReceiptsTotal = 0; //in functional currency @@ -393,7 +393,7 @@ functionalexrate = (1NZD = EUR 0.52) */ - $PaymentTransNo = GetNextTransNo( 1, $db); + $PaymentTransNo = GetNextTransNo( 1 ); $SQL="INSERT INTO banktrans (transno, type, bankact, diff --git a/Customers.php b/Customers.php index e75cc4dcb..a46c4d4e6 100644 --- a/Customers.php +++ b/Customers.php @@ -210,7 +210,7 @@ if ($_SESSION['AutoDebtorNo'] > 0) { /* system assigned, sequential, numeric */ if ($_SESSION['AutoDebtorNo']== 1) { - $_POST['DebtorNo'] = GetNextTransNo(500, $db); + $_POST['DebtorNo'] = GetNextTransNo(500); } } diff --git a/DailySalesInquiry.php b/DailySalesInquiry.php index 7e24078a8..d770a4697 100644 --- a/DailySalesInquiry.php +++ b/DailySalesInquiry.php @@ -14,7 +14,7 @@ echo ''; if (!isset($_POST['MonthToShow'])){ - $_POST['MonthToShow'] = GetPeriod(Date($_SESSION['DefaultDateFormat']),$db); + $_POST['MonthToShow'] = GetPeriod(Date($_SESSION['DefaultDateFormat'])); $Result = DB_query("SELECT lastdate_in_period FROM periods WHERE periodno='" . $_POST['MonthToShow'] . "'"); $myrow = DB_fetch_array($Result); $EndDateSQL = $myrow['lastdate_in_period']; diff --git a/Dashboard.php b/Dashboard.php index b1b9bc8b6..2fcb4d020 100644 --- a/Dashboard.php +++ b/Dashboard.php @@ -428,8 +428,8 @@ '; - $FirstPeriodSelected = GetPeriod(date($_SESSION['DefaultDateFormat']), $db); - $LastPeriodSelected = GetPeriod(date($_SESSION['DefaultDateFormat']), $db); + $FirstPeriodSelected = GetPeriod(date($_SESSION['DefaultDateFormat'])); + $LastPeriodSelected = GetPeriod(date($_SESSION['DefaultDateFormat'])); $SelectedPeriod=$LastPeriodSelected; $Sql = "SELECT bankaccounts.accountcode, diff --git a/DeliveryDetails.php b/DeliveryDetails.php index 681f38753..792fa939c 100644 --- a/DeliveryDetails.php +++ b/DeliveryDetails.php @@ -336,7 +336,7 @@ $Result = DB_Txn_Begin(); - $OrderNo = GetNextTransNo(30, $db); + $OrderNo = GetNextTransNo(30); $HeaderSQL = "INSERT INTO salesorders ( orderno, @@ -494,7 +494,7 @@ $WOQuantity = $StockItem->EOQ; } - $WONo = GetNextTransNo(40,$db); + $WONo = GetNextTransNo(40); $ErrMsg = _('Unable to insert a new work order for the sales order item'); $InsWOResult = DB_query("INSERT INTO workorders (wo, loccode, @@ -664,7 +664,7 @@ 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); + $WONo = GetNextTransNo(40); $ErrMsg = _('Could not update the contract status'); $DbgMsg = _('The SQL that failed to update the contract status was'); $UpdContractResult=DB_query("UPDATE contracts SET status=2, diff --git a/EDISendInvoices.php b/EDISendInvoices.php index 9e157b667..143731f79 100644 --- a/EDISendInvoices.php +++ b/EDISendInvoices.php @@ -118,7 +118,7 @@ } DB_data_seek($MessageLinesResult,0); - $EDITransNo = GetNextTransNo(99,$db); + $EDITransNo = GetNextTransNo(99); $fp = fopen( $_SESSION['EDI_MsgPending'] . '/EDI_INV_' . $EDITransNo , 'w'); while ($LineDetails = DB_fetch_array($MessageLinesResult)){ diff --git a/EDISendInvoices_Reece.php b/EDISendInvoices_Reece.php index a9858ddca..9279076e5 100644 --- a/EDISendInvoices_Reece.php +++ b/EDISendInvoices_Reece.php @@ -198,7 +198,7 @@ } DB_data_seek($MessageLinesResult,0); - $EDITransNo = GetNextTransNo(99,$db); + $EDITransNo = GetNextTransNo(99); $fp = fopen('EDI_INV_' . $TransNo . '.txt', 'w'); while ($LineDetails = DB_fetch_array($MessageLinesResult)){ diff --git a/FixedAssetDepreciation.php b/FixedAssetDepreciation.php index ae3deb636..6aa632cb9 100644 --- a/FixedAssetDepreciation.php +++ b/FixedAssetDepreciation.php @@ -80,8 +80,8 @@ } if (isset($_POST['CommitDepreciation']) AND $InputError==false){ $result = DB_Txn_Begin(); - $TransNo = GetNextTransNo(44, $db); - $PeriodNo = GetPeriod($_POST['ProcessDate'],$db); + $TransNo = GetNextTransNo(44); + $PeriodNo = GetPeriod($_POST['ProcessDate']); } echo '
'; diff --git a/FixedAssetItems.php b/FixedAssetItems.php index 5753a9496..f350addf7 100644 --- a/FixedAssetItems.php +++ b/FixedAssetItems.php @@ -153,7 +153,7 @@ WHERE categoryid='" . $_POST['AssetCategoryID'] . "'"); $NewAccounts = DB_fetch_array($result); - $TransNo = GetNextTransNo( 42, $db); /* transaction type is asset category change */ + $TransNo = GetNextTransNo( 42 ); /* transaction type is asset category change */ //credit cost for the old category $SQL = "INSERT INTO gltrans (type, @@ -322,8 +322,8 @@ $result = DB_Txn_Begin(); /*Need to remove cost and accumulate depreciation from cost and accumdepn accounts */ - $PeriodNo = GetPeriod(Date($_SESSION['DefaultDateFormat']),$db); - $TransNo = GetNextTransNo( 43, $db); /* transaction type is asset deletion - (and remove cost/acc5umdepn from GL) */ + $PeriodNo = GetPeriod(Date($_SESSION['DefaultDateFormat'])); + $TransNo = GetNextTransNo( 43 ); /* transaction type is asset deletion - (and remove cost/acc5umdepn from GL) */ if ($AssetRow['cost'] > 0){ //credit cost for the asset deleted $SQL = "INSERT INTO gltrans (type, diff --git a/GLAccountInquiry.php b/GLAccountInquiry.php index 07fb8e812..b053a4e87 100644 --- a/GLAccountInquiry.php +++ b/GLAccountInquiry.php @@ -34,8 +34,8 @@ $FirstPeriodSelected = $_GET['FromPeriod']; $LastPeriodSelected = $_GET['ToPeriod']; } else { // Otherwise just highlight the current period - $FirstPeriodSelected = GetPeriod(date($_SESSION['DefaultDateFormat']), $db); - $LastPeriodSelected = GetPeriod(date($_SESSION['DefaultDateFormat']), $db); + $FirstPeriodSelected = GetPeriod(date($_SESSION['DefaultDateFormat'])); + $LastPeriodSelected = GetPeriod(date($_SESSION['DefaultDateFormat'])); } echo '
' . _('Use the keyboard Shift key to select multiple periods') . '

'; diff --git a/GLBalanceSheet.php b/GLBalanceSheet.php index 0d24a87a7..b47633d00 100644 --- a/GLBalanceSheet.php +++ b/GLBalanceSheet.php @@ -35,7 +35,7 @@
' . _('Select the balance date').': diff --git a/GLTagProfit_Loss.php b/GLTagProfit_Loss.php index ed21397fd..b1ebdc452 100644 --- a/GLTagProfit_Loss.php +++ b/GLTagProfit_Loss.php @@ -32,7 +32,7 @@ $DefaultFromDate = Date ('Y-m-d', Mktime(0,0,0,$_SESSION['YearEnd'] + 2,0,Date('Y')-1)); $FromDate = Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,$_SESSION['YearEnd'] + 2,0,Date('Y')-1)); } - $period=GetPeriod($FromDate, $db); + $period=GetPeriod($FromDate); /*Show a form to allow input of criteria for profit and loss to show */ echo '
diff --git a/GLTrialBalance.php b/GLTrialBalance.php index 2a34e1e71..e431a7716 100644 --- a/GLTrialBalance.php +++ b/GLTrialBalance.php @@ -46,7 +46,7 @@ $FromDate = Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,$_SESSION['YearEnd'] + 2,0,Date('Y')-1)); } /*GetPeriod function creates periods if need be the return value is not used */ - $NotUsedPeriodNo = GetPeriod($FromDate, $db); + $NotUsedPeriodNo = GetPeriod($FromDate); /*Show a form to allow input of criteria for TB to show */ echo '
@@ -81,7 +81,7 @@ echo ''; if (!isset($_POST['ToPeriod']) OR $_POST['ToPeriod']==''){ - $DefaultToPeriod = GetPeriod(date($_SESSION['DefaultDateFormat'],mktime(0,0,0,Date('m')+1,0,Date('Y'))),$db); + $DefaultToPeriod = GetPeriod(date($_SESSION['DefaultDateFormat'],mktime(0,0,0,Date('m')+1,0,Date('Y')))); } else { $DefaultToPeriod = $_POST['ToPeriod']; } diff --git a/GoodsReceived.php b/GoodsReceived.php index cbf23a842..52a2aa578 100644 --- a/GoodsReceived.php +++ b/GoodsReceived.php @@ -419,9 +419,9 @@ $Result = DB_Txn_Begin(); /*Now Get the next GRN - function in SQL_CommonFunctions*/ - $GRN = GetNextTransNo(25, $db); + $GRN = GetNextTransNo(25); - $PeriodNo = GetPeriod($_POST['DefaultReceivedDate'], $db); + $PeriodNo = GetPeriod($_POST['DefaultReceivedDate']); $_POST['DefaultReceivedDate'] = FormatDateForSQL($_POST['DefaultReceivedDate']); $OrderCompleted = true; //assume all received and completed - now test in case not foreach ($_SESSION['PO'.$identifier]->LineItems as $OrderLine) { diff --git a/ImportBankTrans.php b/ImportBankTrans.php index 3af884b44..2a5553818 100644 --- a/ImportBankTrans.php +++ b/ImportBankTrans.php @@ -174,7 +174,7 @@ $_SESSION['Trans'][$i]->GLTotal == $_SESSION['Trans'][$i]->Amount){ /*A Debtor or Supplier is entered or there is GL analysis for the bank trans */ - $PeriodNo = GetPeriod($_SESSION['Trans'][$i]->ValueDate,$db); + $PeriodNo = GetPeriod($_SESSION['Trans'][$i]->ValueDate); $InsertBankTrans = true; } elseif ($_SESSION['Trans'][$i]->BankTransID!=0) { //Update the banktrans to show it has cleared the bank @@ -192,7 +192,7 @@ if ($_SESSION['Trans'][$i]->DebtorNo!='') { $TransType = 12; - $TransNo = GetNextTransNo(12,$db); //debtors receipt + $TransNo = GetNextTransNo(12); //debtors receipt /* First insert the debtortrans record */ $result = DB_query("INSERT INTO debtortrans (transno, type, @@ -266,7 +266,7 @@ } elseif ($_SESSION['Trans'][$i]->GLTotal == $_SESSION['Trans'][$i]->Amount){ $TransType=2; //gl receipt - $TransNo = GetNextTransNo(2,$db); + $TransNo = GetNextTransNo(2); foreach ($_SESSION['Trans'][$i]->GLEntries as $GLAnalysis){ /*Credit each analysis account */ $result = DB_query("INSERT INTO gltrans (type, @@ -310,7 +310,7 @@ } else { //its a payment if ($_SESSION['Trans'][$i]->SupplierID!='') { //its a supplier payment $TransType = 22; - $TransNo = GetNextTransNo(22,$db); + $TransNo = GetNextTransNo(22); $result = DB_query("INSERT INTO supptrans (transno, type, supplierno, @@ -384,7 +384,7 @@ } elseif($_SESSION['Trans'][$i]->GLTotal == $_SESSION['Trans'][$i]->Amount){ //its a GL payment $TransType = 1; //gl payment - $TransNo = GetNextTransNo(1,$db); + $TransNo = GetNextTransNo(1); foreach ($_SESSION['Trans'][$i]->GLEntries as $GLAnalysis){ /*Debit each analysis account note payments are recorded as negative so need negative negative to make a debit (positive)*/ $result = DB_query("INSERT INTO gltrans (type, diff --git a/InternalStockRequest.php b/InternalStockRequest.php index 36346d631..f31b1b32a 100644 --- a/InternalStockRequest.php +++ b/InternalStockRequest.php @@ -71,7 +71,7 @@ $InputError=1; } if ($InputError==0) { - $RequestNo = GetNextTransNo(38, $db); + $RequestNo = GetNextTransNo(38); $HeaderSQL="INSERT INTO stockrequest (dispatchid, loccode, departmentid, diff --git a/InternalStockRequestFulfill.php b/InternalStockRequestFulfill.php index f8f18e03a..5e9d7808c 100644 --- a/InternalStockRequestFulfill.php +++ b/InternalStockRequestFulfill.php @@ -39,8 +39,8 @@ $Narrative = _('Issue') . ' ' . $Quantity . ' ' . _('of') . ' '. $StockID . ' ' . _('to department') . ' ' . $Department . ' ' . _('from') . ' ' . $Location ; - $AdjustmentNumber = GetNextTransNo(17,$db); - $PeriodNo = GetPeriod (Date($_SESSION['DefaultDateFormat']), $db); + $AdjustmentNumber = GetNextTransNo(17); + $PeriodNo = GetPeriod (Date($_SESSION['DefaultDateFormat'])); $SQLAdjustmentDate = FormatDateForSQL(Date($_SESSION['DefaultDateFormat'])); $Result = DB_Txn_Begin(); diff --git a/InventoryPlanning.php b/InventoryPlanning.php index f8b3f54c7..a0fb6d5de 100644 --- a/InventoryPlanning.php +++ b/InventoryPlanning.php @@ -117,7 +117,7 @@ $Category = ''; - $CurrentPeriod = GetPeriod(Date($_SESSION['DefaultDateFormat']), $db); + $CurrentPeriod = GetPeriod(Date($_SESSION['DefaultDateFormat'])); $Period_1 = $CurrentPeriod -1; $Period_2 = $CurrentPeriod -2; $Period_3 = $CurrentPeriod -3; @@ -394,7 +394,7 @@ function stripcomma($str) { //because we're using comma as a delimiter stockmaster.stockid"; } $InventoryResult = DB_query($SQL); - $CurrentPeriod = GetPeriod(Date($_SESSION['DefaultDateFormat']), $db); + $CurrentPeriod = GetPeriod(Date($_SESSION['DefaultDateFormat'])); $Periods = array(); for ($i=0;$i<24;$i++) { $Periods[$i]['Period'] = $CurrentPeriod - $i; diff --git a/InventoryPlanningPrefSupplier.php b/InventoryPlanningPrefSupplier.php index 13f70a968..64736954d 100644 --- a/InventoryPlanningPrefSupplier.php +++ b/InventoryPlanningPrefSupplier.php @@ -194,7 +194,7 @@ function NewPageHeader () { $SupplierID = ''; - $CurrentPeriod = GetPeriod(Date($_SESSION['DefaultDateFormat']),$db); + $CurrentPeriod = GetPeriod(Date($_SESSION['DefaultDateFormat'])); $Period_1 = $CurrentPeriod -1; $Period_2 = $CurrentPeriod -2; $Period_3 = $CurrentPeriod -3; diff --git a/OffersReceived.php b/OffersReceived.php index 0a4682bb1..1b50acd06 100644 --- a/OffersReceived.php +++ b/OffersReceived.php @@ -173,7 +173,7 @@ $result=DB_query($sql); $myrow=DB_fetch_array($result); $Rate=$myrow['rate']; - $OrderNo = GetNextTransNo(18, $db); + $OrderNo = GetNextTransNo(18); $sql="INSERT INTO purchorders ( orderno, supplierno, diff --git a/PDFPickingList.php b/PDFPickingList.php index 40f6a9934..01724f077 100644 --- a/PDFPickingList.php +++ b/PDFPickingList.php @@ -276,7 +276,7 @@ include('includes/PDFPickingListHeader.inc'); if (isset($_POST['TransDate']) or (isset($_GET['TransNo']) and $_GET['TransNo'] != 'Preview')) { $LinesToShow=DB_num_rows($LineResult); - $PickingListNo = GetNextTransNo(19, $db); + $PickingListNo = GetNextTransNo(19); $sql="INSERT INTO pickinglists VALUES ( '" . $PickingListNo ."', diff --git a/PDFStockCheckComparison.php b/PDFStockCheckComparison.php index a78e6f20c..74e52326b 100644 --- a/PDFStockCheckComparison.php +++ b/PDFStockCheckComparison.php @@ -41,9 +41,9 @@ exit; } - $PeriodNo = GetPeriod (Date($_SESSION['DefaultDateFormat']), $db); + $PeriodNo = GetPeriod (Date($_SESSION['DefaultDateFormat'])); $SQLAdjustmentDate = FormatDateForSQL(Date($_SESSION['DefaultDateFormat'])); - $AdjustmentNumber = GetNextTransNo(17,$db); + $AdjustmentNumber = GetNextTransNo(17); while ($myrow = DB_fetch_array($StockChecks)){ diff --git a/PO_Items.php b/PO_Items.php index d67d35043..21aa96437 100644 --- a/PO_Items.php +++ b/PO_Items.php @@ -125,7 +125,7 @@ if ($_SESSION['ExistingOrder']==0){ /*its a new order to be inserted */ /*Get the order number */ - $_SESSION['PO'.$identifier]->OrderNo = GetNextTransNo(18, $db); + $_SESSION['PO'.$identifier]->OrderNo = GetNextTransNo(18); /*Insert to purchase order header record */ $sql = "INSERT INTO purchorders ( orderno, diff --git a/Payments.php b/Payments.php index df6ab971c..d23e33013 100644 --- a/Payments.php +++ b/Payments.php @@ -135,7 +135,7 @@ $_SESSION['PaymentDetail'.$identifier]->Currency = $myrow['currcode']; $_POST['Currency'] = $_SESSION['PaymentDetail'.$identifier]->Currency; } - + if(isset($_GET['Amount']) AND is_numeric($_GET['Amount'])) { $_SESSION['PaymentDetail'.$identifier]->Amount = filter_number_format($_GET['Amount']); } @@ -347,7 +347,7 @@ $i++; } - $PeriodNo = GetPeriod($_SESSION['PaymentDetail'.$identifier]->DatePaid,$db); + $PeriodNo = GetPeriod($_SESSION['PaymentDetail'.$identifier]->DatePaid); $SQL = "SELECT usepreprintedstationery FROM paymentmethods @@ -427,7 +427,7 @@ //its a nominal bank transaction type 1 - $TransNo = GetNextTransNo( 1, $db); + $TransNo = GetNextTransNo( 1 ); $TransType = 1; if($_SESSION['CompanyRecord']['gllink_creditors']==1) { /* then enter GLTrans */ @@ -526,7 +526,7 @@ functionalexrate = (1NZD = EUR 0.52) */ - $ReceiptTransNo = GetNextTransNo( 2, $db); + $ReceiptTransNo = GetNextTransNo( 2 ); $SQL = "INSERT INTO banktrans ( transno, type, @@ -572,7 +572,7 @@ functionalexrate, /*Its a supplier payment type 22 */ $CreditorTotal = (($_SESSION['PaymentDetail'.$identifier]->Discount + $_SESSION['PaymentDetail'.$identifier]->Amount)/$_SESSION['PaymentDetail'.$identifier]->ExRate)/$_SESSION['PaymentDetail'.$identifier]->FunctionalExRate; - $TransNo = GetNextTransNo(22, $db); + $TransNo = GetNextTransNo(22); $TransType = 22; /* Create a SuppTrans entry for the supplier payment */ @@ -1363,7 +1363,7 @@ functionalexrate, AND supplierno='" . $_SESSION['PaymentDetail'.$identifier]->SupplierID . "' AND (supptrans.ovamount+supptrans.ovgst+supptrans.diffonexch-supptrans.alloc)<>0"; $Result = DB_query($SQL); - + echo '
diff --git a/PcAnalysis.php b/PcAnalysis.php index fda0335d3..1fa87087c 100644 --- a/PcAnalysis.php +++ b/PcAnalysis.php @@ -22,9 +22,9 @@ function submit($TabToShow) { if ($InputError == 0){ // Creation of beginning of SQL query $SQL = "SELECT pcexpenses.codeexpense,"; - + // Creation of periods SQL query - $PeriodToday=GetPeriod(Date($_SESSION['DefaultDateFormat']), $db); + $PeriodToday=GetPeriod(Date($_SESSION['DefaultDateFormat'])); $SQLPeriods = "SELECT periodno, lastdate_in_period FROM periods @@ -35,7 +35,7 @@ function submit($TabToShow) { $NumPeriod = 0; $LabelsArray = array(); while ($MyRow=DB_fetch_array($Periods)){ - + $NumPeriod++; $LabelsArray[$NumPeriod] = MonthAndYearFromSQLDate($MyRow['lastdate_in_period']); $SQL = $SQL . "(SELECT SUM(pcashdetails.amount) @@ -66,14 +66,14 @@ function submit($TabToShow) { ->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)'); @@ -108,14 +108,14 @@ function submit($TabToShow) { $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)) { $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.')'); @@ -146,7 +146,7 @@ function submit($TabToShow) { $i++; } - + // Freeze panes $objPHPExcel->getActiveSheet()->freezePane('E5'); @@ -156,7 +156,7 @@ function submit($TabToShow) { ->getColumnDimension($col) ->setAutoSize(true); } - + // Rename worksheet if ($TabToShow=='All'){ $objPHPExcel->getActiveSheet()->setTitle('All Accounts'); @@ -218,7 +218,7 @@ function display() //####DISPLAY_DISPLAY_DISPLAY_DISPLAY_DISPLAY_DISPLAY_##### '; if (!isset($_POST['ToPeriod']) OR $_POST['ToPeriod']==''){ - $DefaultToPeriod = GetPeriod(DateAdd(ConvertSQLDate($DefaultFromDate),'m',11),$db); + $DefaultToPeriod = GetPeriod(DateAdd(ConvertSQLDate($DefaultFromDate),'m',11)); } else { $DefaultToPeriod = $_POST['ToPeriod']; } diff --git a/SelectCreditItems.php b/SelectCreditItems.php index cf059aec9..6c8866a65 100644 --- a/SelectCreditItems.php +++ b/SelectCreditItems.php @@ -1107,9 +1107,9 @@ /*Now Get the next credit note number - function in SQL_CommonFunctions*/ - $CreditNo = GetNextTransNo(11, $db); + $CreditNo = GetNextTransNo(11); $SQLCreditDate = Date('Y-m-d'); - $PeriodNo = GetPeriod(Date($_SESSION['DefaultDateFormat']), $db); + $PeriodNo = GetPeriod(Date($_SESSION['DefaultDateFormat'])); /*Start an SQL transaction */ DB_Txn_Begin(); diff --git a/SelectSalesOrder.php b/SelectSalesOrder.php index 9864f1536..b29beb115 100644 --- a/SelectSalesOrder.php +++ b/SelectSalesOrder.php @@ -254,7 +254,7 @@ /*Starting a new purchase order with a different supplier */ $result = DB_Txn_Begin(); - $PO_OrderNo = GetNextTransNo(18, $db); //get the next PO number + $PO_OrderNo = GetNextTransNo(18); //get the next PO number $SupplierID = $ItemRow['supplierno']; $Order_Value = 0; diff --git a/ShipmentCosting.php b/ShipmentCosting.php index f53cd8185..01c4c3e8c 100644 --- a/ShipmentCosting.php +++ b/ShipmentCosting.php @@ -136,7 +136,7 @@ if (isset($_POST['Close'])){ /*Set up a transaction to buffer all updates or none */ $result = DB_Txn_Begin(); - $PeriodNo = GetPeriod(Date($_SESSION['DefaultDateFormat']), $db); + $PeriodNo = GetPeriod(Date($_SESSION['DefaultDateFormat'])); } echo '
' . _('Date') . '
'; @@ -399,8 +399,8 @@ $QOH=$QOHRow[0]; if ($_SESSION['CompanyRecord']['gllink_stock']==1){ - $CostUpdateNo = GetNextTransNo(35, $db); - $PeriodNo = GetPeriod(Date('d/m/Y'), $db); + $CostUpdateNo = GetNextTransNo(35); + $PeriodNo = GetPeriod(Date($_SESSION['DefaultDateFormat'])); $ValueOfChange = $QOH * ($ItemShipmentCost - $StdCostUnit); diff --git a/Shipments.php b/Shipments.php index c4b9f4dab..a39a9cced 100644 --- a/Shipments.php +++ b/Shipments.php @@ -157,7 +157,7 @@ $_SESSION['Shipment']->SupplierName = $myrow['suppname']; $_SESSION['Shipment']->CurrCode = $myrow['currcode']; $_SESSION['Shipment']->CurrDecimalPlaces = $myrow['currdecimalplaces']; - $_SESSION['Shipment']->ShiptRef = GetNextTransNo (31, $db); + $_SESSION['Shipment']->ShiptRef = GetNextTransNo (31); } diff --git a/SpecialOrder.php b/SpecialOrder.php index b4880f189..69a19ae0a 100644 --- a/SpecialOrder.php +++ b/SpecialOrder.php @@ -382,7 +382,7 @@ $DbgMsg = _('The SQL statement used to insert the purchase order header record and failed was'); $result = DB_query($sql,$ErrMsg,$DbgMsg,true); - $_SESSION['SPL'.$identifier]->PurchOrderNo = GetNextTransNo(18, $db); + $_SESSION['SPL'.$identifier]->PurchOrderNo = GetNextTransNo(18); /*Insert the purchase order detail records */ foreach ($_SESSION['SPL'.$identifier]->LineItems as $SPLLine) { @@ -494,7 +494,7 @@ $result =DB_query($sql,$ErrMsg,$DbgMsg,true); $BranchDetails=DB_fetch_array($result); - $SalesOrderNo=GetNextTransNo (30, $db); + $SalesOrderNo=GetNextTransNo (30); $HeaderSQL = "INSERT INTO salesorders (orderno, debtorno, branchcode, diff --git a/StockAdjustments.php b/StockAdjustments.php index 02cddda29..712f09fdb 100644 --- a/StockAdjustments.php +++ b/StockAdjustments.php @@ -190,8 +190,8 @@ /*All inputs must be sensible so make the stock movement records and update the locations stocks */ - $AdjustmentNumber = GetNextTransNo(17,$db); - $PeriodNo = GetPeriod (Date($_SESSION['DefaultDateFormat']), $db); + $AdjustmentNumber = GetNextTransNo(17); + $PeriodNo = GetPeriod (Date($_SESSION['DefaultDateFormat'])); $SQLAdjustmentDate = FormatDateForSQL(Date($_SESSION['DefaultDateFormat'])); $Result = DB_Txn_Begin(); diff --git a/StockDispatch.php b/StockDispatch.php index c8ac6f7e9..7a995cf84 100644 --- a/StockDispatch.php +++ b/StockDispatch.php @@ -33,7 +33,7 @@ } // Create Transfer Number if(!isset($Trf_ID) and $_POST['ReportType'] == 'Batch') { - $Trf_ID = GetNextTransNo(16,$db); + $Trf_ID = GetNextTransNo(16); } // from location diff --git a/StockLocTransfer.php b/StockLocTransfer.php index 5e3a35234..3099db905 100644 --- a/StockLocTransfer.php +++ b/StockLocTransfer.php @@ -230,7 +230,7 @@ } if(!isset($Trf_ID)){ - $Trf_ID = GetNextTransNo(16,$db); + $Trf_ID = GetNextTransNo(16); } if (isset($InputError) and $InputError==true){ diff --git a/StockLocTransferReceive.php b/StockLocTransferReceive.php index 5a928c082..6d5b25125 100644 --- a/StockLocTransferReceive.php +++ b/StockLocTransferReceive.php @@ -23,7 +23,7 @@ if(isset($_POST['ProcessTransfer'])) { /*Ok Time To Post transactions to Inventory Transfers, and Update Posted variable & received Qty's to LocTransfers */ - $PeriodNo = GetPeriod ($_SESSION['Transfer']->TranDate, $db); + $PeriodNo = GetPeriod ($_SESSION['Transfer']->TranDate); $SQLTransferDate = FormatDateForSQL($_SESSION['Transfer']->TranDate); $InputError = False; /*Start off hoping for the best */ diff --git a/StockTransfers.php b/StockTransfers.php index 095042d8a..4dbb0c2da 100644 --- a/StockTransfers.php +++ b/StockTransfers.php @@ -188,8 +188,8 @@ if($InputError==False) { /*All inputs must be sensible so make the stock movement records and update the locations stocks */ - $TransferNumber = GetNextTransNo(16,$db); - $PeriodNo = GetPeriod(Date($_SESSION['DefaultDateFormat']), $db); + $TransferNumber = GetNextTransNo(16); + $PeriodNo = GetPeriod(Date($_SESSION['DefaultDateFormat'])); $SQLTransferDate = FormatDateForSQL(Date($_SESSION['DefaultDateFormat'])); $Result = DB_Txn_Begin(); diff --git a/StockUsage.php b/StockUsage.php index 3aeb88a90..8197a1031 100644 --- a/StockUsage.php +++ b/StockUsage.php @@ -100,7 +100,7 @@ /*HideMovt ==1 if the movement was only created for the purpose of a transaction but is not a physical movement eg. A price credit will create a movement record for the purposes of display on a credit note but there is no physical stock movement - it makes sense honest ??? */ -$CurrentPeriod = GetPeriod(Date($_SESSION['DefaultDateFormat']),$db); +$CurrentPeriod = GetPeriod(Date($_SESSION['DefaultDateFormat'])); if (isset($_POST['ShowUsage'])){ if($_POST['StockLocation']=='All'){ diff --git a/Stocks.php b/Stocks.php index 2bfed0971..c06cace2e 100644 --- a/Stocks.php +++ b/Stocks.php @@ -521,7 +521,7 @@ if ($OldStockAccount != $NewStockAct AND $_SESSION['CompanyRecord']['gllink_stock']==1) { /*Then we need to make a journal to transfer the cost to the new stock account */ - $JournalNo = GetNextTransNo(0,$db); //enter as a journal + $JournalNo = GetNextTransNo(0); //enter as a journal $SQL = "INSERT INTO gltrans (type, typeno, trandate, @@ -532,7 +532,7 @@ VALUES ( 0, '" . $JournalNo . "', '" . Date('Y-m-d') . "', - '" . GetPeriod(Date($_SESSION['DefaultDateFormat']),$db,true) . "', + '" . GetPeriod(Date($_SESSION['DefaultDateFormat'])) . "', '" . $NewStockAct . "', '" . $StockID . ' ' . _('Change stock category') . "', '" . ($UnitCost* $StockQtyRow[0]) . "')"; @@ -549,7 +549,7 @@ VALUES ( 0, '" . $JournalNo . "', '" . Date('Y-m-d') . "', - '" . GetPeriod(Date($_SESSION['DefaultDateFormat']),$db,true) . "', + '" . GetPeriod(Date($_SESSION['DefaultDateFormat'])) . "', '" . $OldStockAccount . "', '" . $StockID . ' ' . _('Change stock category') . "', '" . (-$UnitCost* $StockQtyRow[0]) . "')"; @@ -575,7 +575,7 @@ $WIPValue += ($WIPRow['costissued']-$WIPRow['costrecd']); } if ($WIPValue !=0){ - $JournalNo = GetNextTransNo(0,$db); //enter as a journal + $JournalNo = GetNextTransNo(0); //enter as a journal $SQL = "INSERT INTO gltrans (type, typeno, trandate, @@ -586,7 +586,7 @@ VALUES ( 0, '" . $JournalNo . "', '" . Date('Y-m-d') . "', - '" . GetPeriod(Date($_SESSION['DefaultDateFormat']),$db,true) . "', + '" . GetPeriod(Date($_SESSION['DefaultDateFormat'])) . "', '" . $NewWIPAct . "', '" . $StockID . ' ' . _('Change stock category') . "', '" . $WIPValue . "')"; @@ -603,7 +603,7 @@ VALUES ( 0, '" . $JournalNo . "', '" . Date('Y-m-d') . "', - '" . GetPeriod(Date($_SESSION['DefaultDateFormat']),$db,true) . "', + '" . GetPeriod(Date($_SESSION['DefaultDateFormat'])) . "', '" . $OldWIPAccount . "', '" . $StockID . ' ' . _('Change stock category') . "', '" . (-$WIPValue) . "')"; diff --git a/SuppPaymentRun.php b/SuppPaymentRun.php index c33ed5d3c..e7f727cd5 100644 --- a/SuppPaymentRun.php +++ b/SuppPaymentRun.php @@ -137,7 +137,7 @@ function Allocation ($TransID, $Amount){ $SupplierID = $DetailTrans['supplierid']; $SupplierName = $DetailTrans['suppname']; if (isset($_POST['PrintPDFAndProcess'])){ - $SuppPaymentNo = GetNextTransNo(22, $db); + $SuppPaymentNo = GetNextTransNo(22); } $AccumBalance = 0; $AccumDiffOnExch = 0; diff --git a/SupplierAllocations.php b/SupplierAllocations.php index ec7cc9db1..bb7526286 100644 --- a/SupplierAllocations.php +++ b/SupplierAllocations.php @@ -193,7 +193,7 @@ if ($_SESSION['CompanyRecord']['gllink_debtors'] == 1){ - $PeriodNo = GetPeriod($_SESSION['Alloc']->TransDate, $db); + $PeriodNo = GetPeriod($_SESSION['Alloc']->TransDate); $_SESSION['Alloc']->TransDate = FormatDateForSQL($_SESSION['Alloc']->TransDate); diff --git a/SupplierCredit.php b/SupplierCredit.php index d011be9c0..b21663b1d 100644 --- a/SupplierCredit.php +++ b/SupplierCredit.php @@ -667,8 +667,8 @@ /*Get the next transaction number for internal purposes and the period to post GL transactions in based on the credit note date*/ - $CreditNoteNo = GetNextTransNo(21, $db); - $PeriodNo = GetPeriod($_SESSION['SuppTrans']->TranDate, $db); + $CreditNoteNo = GetNextTransNo(21); + $PeriodNo = GetPeriod($_SESSION['SuppTrans']->TranDate); $SQLCreditNoteDate = FormatDateForSQL($_SESSION['SuppTrans']->TranDate); diff --git a/SupplierInvoice.php b/SupplierInvoice.php index b4b37c878..255c0cdf2 100644 --- a/SupplierInvoice.php +++ b/SupplierInvoice.php @@ -153,7 +153,7 @@ if ($_SESSION['PO'.$identifier]->Status == 'Authorised'){ $Result = DB_Txn_Begin(); /*Now Get the next GRN - function in SQL_CommonFunctions*/ - $GRN = GetNextTransNo(25, $db); + $GRN = GetNextTransNo(25); if (!isset($_GET['DeliveryDate'])){ $DeliveryDate = date($_SESSION['DefaultDateFormat']); } else { @@ -162,7 +162,7 @@ $_POST['ExRate'] = $_SESSION['SuppTrans']->ExRate; $_POST['TranDate'] = $DeliveryDate; - $PeriodNo = GetPeriod($DeliveryDate, $db); + $PeriodNo = GetPeriod($DeliveryDate); $OrderHasControlledItems = false; //assume the best foreach ($_SESSION['PO'.$identifier]->LineItems as $OrderLine) { @@ -1069,8 +1069,8 @@ $Result = DB_Txn_Begin(); /*Get the next transaction number for internal purposes and the period to post GL transactions in based on the invoice date*/ - $InvoiceNo = GetNextTransNo(20, $db); - $PeriodNo = GetPeriod( $_SESSION['SuppTrans']->TranDate, $db); + $InvoiceNo = GetNextTransNo(20); + $PeriodNo = GetPeriod( $_SESSION['SuppTrans']->TranDate); $SQLInvoiceDate = FormatDateForSQL( $_SESSION['SuppTrans']->TranDate); if ( $_SESSION['SuppTrans']->GLLink_Creditors == 1){ diff --git a/Suppliers.php b/Suppliers.php index e0731b47a..dfd5221a2 100644 --- a/Suppliers.php +++ b/Suppliers.php @@ -525,7 +525,7 @@ } else { //its a new supplier if ($_SESSION['AutoSupplierNo']== 1) { /* system assigned, sequential, numeric */ - $SupplierID = GetNextTransNo(600, $db); + $SupplierID = GetNextTransNo(600); } $sql = "INSERT INTO suppliers (supplierid, suppname, diff --git a/Tax.php b/Tax.php index 451b3af27..1112ad8ee 100644 --- a/Tax.php +++ b/Tax.php @@ -235,7 +235,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: @@ -382,7 +382,7 @@ echo '
' . _('Return To') . ':