From: <tim...@us...> - 2011-03-29 13:55:47
|
Revision: 4525 http://web-erp.svn.sourceforge.net/web-erp/?rev=4525&view=rev Author: tim_schofield Date: 2011-03-29 13:55:41 +0000 (Tue, 29 Mar 2011) Log Message: ----------- Fix error where Bank account wasnt being carried through to the preprinted cheque page Modified Paths: -------------- trunk/Payments.php Modified: trunk/Payments.php =================================================================== --- trunk/Payments.php 2011-03-29 09:20:20 UTC (rev 4524) +++ trunk/Payments.php 2011-03-29 13:55:41 UTC (rev 4525) @@ -260,6 +260,7 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo _('Has the cheque been printed') . '?<br><br>'; echo '<input type="hidden" name="CommitBatch" value="' . $_POST['CommitBatch'] . '">'; + echo '<input type="hidden" name="BankAccount" value="' . $_POST['BankAccount'] . '">'; echo '<input type="submit" name="ChequePrinted" value="' . _('Yes / Continue') . '"> '; echo '<input type="submit" name="PaymentCancelled" value="' . _('No / Cancel Payment') . '">'; } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-03-29 13:55:48
|
Revision: 4525 http://web-erp.svn.sourceforge.net/web-erp/?rev=4525&view=rev Author: tim_schofield Date: 2011-03-29 13:55:41 +0000 (Tue, 29 Mar 2011) Log Message: ----------- Fix error where Bank account wasnt being carried through to the preprinted cheque page Modified Paths: -------------- trunk/Payments.php Modified: trunk/Payments.php =================================================================== --- trunk/Payments.php 2011-03-29 09:20:20 UTC (rev 4524) +++ trunk/Payments.php 2011-03-29 13:55:41 UTC (rev 4525) @@ -260,6 +260,7 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo _('Has the cheque been printed') . '?<br><br>'; echo '<input type="hidden" name="CommitBatch" value="' . $_POST['CommitBatch'] . '">'; + echo '<input type="hidden" name="BankAccount" value="' . $_POST['BankAccount'] . '">'; echo '<input type="submit" name="ChequePrinted" value="' . _('Yes / Continue') . '"> '; echo '<input type="submit" name="PaymentCancelled" value="' . _('No / Cancel Payment') . '">'; } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ex...@us...> - 2012-01-30 01:15:30
|
Revision: 4851 http://web-erp.svn.sourceforge.net/web-erp/?rev=4851&view=rev Author: ExsonQu Date: 2012-01-30 01:15:22 +0000 (Mon, 30 Jan 2012) Log Message: ----------- Fix for $_SESSION overwritten problem with $identifier variable and minor html modification Modified Paths: -------------- trunk/Payments.php Modified: trunk/Payments.php =================================================================== --- trunk/Payments.php 2012-01-29 09:42:44 UTC (rev 4850) +++ trunk/Payments.php 2012-01-30 01:15:22 UTC (rev 4851) @@ -16,15 +16,20 @@ include('includes/footer.inc'); exit(); } - +if (empty($_GET['identifier'])){ + /*unique session identifier to ensure that there is no conflict with other order enty session on the same machine */ + $identifier=date('U'); +}else{ + $identifier=$_GET['identifier'];//edit GLItems +} if (isset($_GET['NewPayment']) AND $_GET['NewPayment']=='Yes'){ - unset($_SESSION['PaymentDetail']->GLItems); - unset($_SESSION['PaymentDetail']); + unset($_SESSION['PaymentDetail' . $identifier]->GLItems); + unset($_SESSION['PaymentDetail' . $identifier]); } -if (!isset($_SESSION['PaymentDetail'])){ - $_SESSION['PaymentDetail'] = new Payment; - $_SESSION['PaymentDetail']->GLItemCounter = 1; +if (!isset($_SESSION['PaymentDetail' . $identifier])){ + $_SESSION['PaymentDetail' . $identifier] = new Payment; + $_SESSION['PaymentDetail' . $identifier]->GLItemCounter = 1; } if ((isset($_POST['UpdateHeader']) @@ -49,10 +54,10 @@ if (isset($_GET['SupplierID'])){ /*The page was called with a supplierID check it is valid and default the inputs for Supplier Name and currency of payment */ - unset($_SESSION['PaymentDetail']->GLItems); - unset($_SESSION['PaymentDetail']); - $_SESSION['PaymentDetail'] = new Payment; - $_SESSION['PaymentDetail']->GLItemCounter = 1; + unset($_SESSION['PaymentDetail' . $identifier]->GLItems); + unset($_SESSION['PaymentDetail' . $identifier]); + $_SESSION['PaymentDetail' . $identifier] = new Payment; + $_SESSION['PaymentDetail' . $identifier]->GLItemCounter = 1; $SQL= "SELECT suppname, @@ -75,16 +80,16 @@ } else { $myrow = DB_fetch_array($Result); if ($myrow['factorcompanyid'] == 0) { - $_SESSION['PaymentDetail']->SuppName = $myrow['suppname']; - $_SESSION['PaymentDetail']->Address1 = $myrow['address1']; - $_SESSION['PaymentDetail']->Address2 = $myrow['address2']; - $_SESSION['PaymentDetail']->Address3 = $myrow['address3']; - $_SESSION['PaymentDetail']->Address4 = $myrow['address4']; - $_SESSION['PaymentDetail']->Address5 = $myrow['address5']; - $_SESSION['PaymentDetail']->Address6 = $myrow['address6']; - $_SESSION['PaymentDetail']->SupplierID = $_GET['SupplierID']; - $_SESSION['PaymentDetail']->Currency = $myrow['currcode']; - $_POST['Currency'] = $_SESSION['PaymentDetail']->Currency; + $_SESSION['PaymentDetail' . $identifier]->SuppName = $myrow['suppname']; + $_SESSION['PaymentDetail' . $identifier]->Address1 = $myrow['address1']; + $_SESSION['PaymentDetail' . $identifier]->Address2 = $myrow['address2']; + $_SESSION['PaymentDetail' . $identifier]->Address3 = $myrow['address3']; + $_SESSION['PaymentDetail' . $identifier]->Address4 = $myrow['address4']; + $_SESSION['PaymentDetail' . $identifier]->Address5 = $myrow['address5']; + $_SESSION['PaymentDetail' . $identifier]->Address6 = $myrow['address6']; + $_SESSION['PaymentDetail' . $identifier]->SupplierID = $_GET['SupplierID']; + $_SESSION['PaymentDetail' . $identifier]->Currency = $myrow['currcode']; + $_POST['Currency'] = $_SESSION['PaymentDetail' . $identifier]->Currency; } else { $factorsql= "SELECT coyname, @@ -99,23 +104,23 @@ $FactorResult = DB_query($factorsql, $db); $myfactorrow = DB_fetch_array($FactorResult); - $_SESSION['PaymentDetail']->SuppName = $myrow['suppname'] . ' ' . _('care of') . ' ' . $myfactorrow['coyname']; - $_SESSION['PaymentDetail']->Address1 = $myfactorrow['address1']; - $_SESSION['PaymentDetail']->Address2 = $myfactorrow['address2']; - $_SESSION['PaymentDetail']->Address3 = $myfactorrow['address3']; - $_SESSION['PaymentDetail']->Address4 = $myfactorrow['address4']; - $_SESSION['PaymentDetail']->Address5 = $myfactorrow['address5']; - $_SESSION['PaymentDetail']->Address6 = $myfactorrow['address6']; - $_SESSION['PaymentDetail']->SupplierID = $_GET['SupplierID']; - $_SESSION['PaymentDetail']->Currency = $myrow['currcode']; - $_POST['Currency'] = $_SESSION['PaymentDetail']->Currency; + $_SESSION['PaymentDetail' . $identifier]->SuppName = $myrow['suppname'] . ' ' . _('care of') . ' ' . $myfactorrow['coyname']; + $_SESSION['PaymentDetail' . $identifier]->Address1 = $myfactorrow['address1']; + $_SESSION['PaymentDetail' . $identifier]->Address2 = $myfactorrow['address2']; + $_SESSION['PaymentDetail' . $identifier]->Address3 = $myfactorrow['address3']; + $_SESSION['PaymentDetail' . $identifier]->Address4 = $myfactorrow['address4']; + $_SESSION['PaymentDetail' . $identifier]->Address5 = $myfactorrow['address5']; + $_SESSION['PaymentDetail' . $identifier]->Address6 = $myfactorrow['address6']; + $_SESSION['PaymentDetail' . $identifier]->SupplierID = $_GET['SupplierID']; + $_SESSION['PaymentDetail' . $identifier]->Currency = $myrow['currcode']; + $_POST['Currency'] = $_SESSION['PaymentDetail' . $identifier]->Currency; } } } if (isset($_POST['BankAccount']) AND $_POST['BankAccount']!=''){ - $_SESSION['PaymentDetail']->Account=$_POST['BankAccount']; + $_SESSION['PaymentDetail' . $identifier]->Account=$_POST['BankAccount']; /*Get the bank account currency and set that too */ $ErrMsg = _('Could not get the currency of the bank account'); $result = DB_query("SELECT currcode, @@ -127,41 +132,41 @@ $ErrMsg); $myrow = DB_fetch_array($result); - $_SESSION['PaymentDetail']->AccountCurrency=$myrow['currcode']; - $_SESSION['PaymentDetail']->CurrDecimalPlaces=$myrow['decimalplaces']; + $_SESSION['PaymentDetail' . $identifier]->AccountCurrency=$myrow['currcode']; + $_SESSION['PaymentDetail' . $identifier]->CurrDecimalPlaces=$myrow['decimalplaces']; } else { - $_SESSION['PaymentDetail']->AccountCurrency =$_SESSION['CompanyRecord']['currencydefault']; - $_SESSION['PaymentDetail']->CurrDecimalPlaces=$_SESSION['CompanyRecord']['decimalplaces']; + $_SESSION['PaymentDetail' . $identifier]->AccountCurrency =$_SESSION['CompanyRecord']['currencydefault']; + $_SESSION['PaymentDetail' . $identifier]->CurrDecimalPlaces=$_SESSION['CompanyRecord']['decimalplaces']; } if (isset($_POST['DatePaid']) AND $_POST['DatePaid']!='' AND Is_Date($_POST['DatePaid'])){ - $_SESSION['PaymentDetail']->DatePaid=$_POST['DatePaid']; + $_SESSION['PaymentDetail' . $identifier]->DatePaid=$_POST['DatePaid']; } if (isset($_POST['ExRate']) AND $_POST['ExRate']!=''){ - $_SESSION['PaymentDetail']->ExRate=filter_number_format($_POST['ExRate']); //ex rate between payment currency and account currency + $_SESSION['PaymentDetail' . $identifier]->ExRate=filter_number_format($_POST['ExRate']); //ex rate between payment currency and account currency } if (isset($_POST['FunctionalExRate']) AND $_POST['FunctionalExRate']!=''){ - $_SESSION['PaymentDetail']->FunctionalExRate=filter_number_format($_POST['FunctionalExRate']); //ex rate between payment currency and account currency + $_SESSION['PaymentDetail' . $identifier]->FunctionalExRate=filter_number_format($_POST['FunctionalExRate']); //ex rate between payment currency and account currency } if (isset($_POST['Paymenttype']) AND $_POST['Paymenttype']!=''){ - $_SESSION['PaymentDetail']->Paymenttype = $_POST['Paymenttype']; + $_SESSION['PaymentDetail' . $identifier]->Paymenttype = $_POST['Paymenttype']; } if (isset($_POST['Currency']) AND $_POST['Currency']!=''){ - $_SESSION['PaymentDetail']->Currency=$_POST['Currency']; //payment currency + $_SESSION['PaymentDetail' . $identifier]->Currency=$_POST['Currency']; //payment currency /*Get the exchange rate between the functional currency and the payment currency*/ - $result = DB_query("SELECT rate FROM currencies WHERE currabrev='" . $_SESSION['PaymentDetail']->Currency . "'",$db); + $result = DB_query("SELECT rate FROM currencies WHERE currabrev='" . $_SESSION['PaymentDetail' . $identifier]->Currency . "'",$db); $myrow = DB_fetch_row($result); $tableExRate = $myrow[0]; //this is the rate of exchange between the functional currency and the payment currency - if ($_POST['Currency']==$_SESSION['PaymentDetail']->AccountCurrency){ + if ($_POST['Currency']==$_SESSION['PaymentDetail' . $identifier]->AccountCurrency){ $_POST['ExRate']=1; - $_SESSION['PaymentDetail']->ExRate=filter_number_format($_POST['ExRate']); //ex rate between payment currency and account currency + $_SESSION['PaymentDetail' . $identifier]->ExRate=filter_number_format($_POST['ExRate']); //ex rate between payment currency and account currency $SuggestedExRate=1; } - if ($_SESSION['PaymentDetail']->AccountCurrency==$_SESSION['CompanyRecord']['currencydefault']){ + if ($_SESSION['PaymentDetail' . $identifier]->AccountCurrency==$_SESSION['CompanyRecord']['currencydefault']){ $_POST['FunctionalExRate']=1; - $_SESSION['PaymentDetail']->FunctionalExRate=filter_number_format($_POST['FunctionalExRate']); + $_SESSION['PaymentDetail' . $identifier]->FunctionalExRate=filter_number_format($_POST['FunctionalExRate']); $SuggestedExRate = $tableExRate; $SuggestedFunctionalExRate =1; @@ -176,12 +181,12 @@ */ /*Get suggested FunctionalExRate */ - $result = DB_query("SELECT rate FROM currencies WHERE currabrev='" . $_SESSION['PaymentDetail']->AccountCurrency . "'",$db); + $result = DB_query("SELECT rate FROM currencies WHERE currabrev='" . $_SESSION['PaymentDetail' . $identifier]->AccountCurrency . "'",$db); $myrow = DB_fetch_row($result); $SuggestedFunctionalExRate = $myrow[0]; /*Get the exchange rate between the functional currency and the payment currency*/ - $result = DB_query("SELECT rate FROM currencies WHERE currabrev='" . $_SESSION['PaymentDetail']->Currency . "'",$db); + $result = DB_query("SELECT rate FROM currencies WHERE currabrev='" . $_SESSION['PaymentDetail' . $identifier]->Currency . "'",$db); $myrow = DB_fetch_row($result); $tableExRate = $myrow[0]; //this is the rate of exchange between the functional currency and the payment currency /*Calculate cross rate to suggest appropriate exchange rate between payment currency and account currency */ @@ -192,20 +197,20 @@ if (isset($_POST['Narrative']) AND $_POST['Narrative']!=''){ - $_SESSION['PaymentDetail']->Narrative=$_POST['Narrative']; + $_SESSION['PaymentDetail' . $identifier]->Narrative=$_POST['Narrative']; } if (isset($_POST['Amount']) AND $_POST['Amount']!=''){ - $_SESSION['PaymentDetail']->Amount=filter_number_format($_POST['Amount']); + $_SESSION['PaymentDetail' . $identifier]->Amount=filter_number_format($_POST['Amount']); } else { - if (!isset($_SESSION['PaymentDetail']->Amount)) { - $_SESSION['PaymentDetail']->Amount=0; + if (!isset($_SESSION['PaymentDetail' . $identifier]->Amount)) { + $_SESSION['PaymentDetail' . $identifier]->Amount=0; } } if (isset($_POST['Discount']) AND $_POST['Discount']!=''){ - $_SESSION['PaymentDetail']->Discount=filter_number_format($_POST['Discount']); + $_SESSION['PaymentDetail' . $identifier]->Discount=filter_number_format($_POST['Discount']); } else { - if (!isset($_SESSION['PaymentDetail']->Discount)) { - $_SESSION['PaymentDetail']->Discount=0; + if (!isset($_SESSION['PaymentDetail' . $identifier]->Discount)) { + $_SESSION['PaymentDetail' . $identifier]->Discount=0; } } @@ -227,12 +232,12 @@ /*First off check we have an amount entered as paid ?? */ $TotalAmount =0; - foreach ($_SESSION['PaymentDetail']->GLItems AS $PaymentItem) { + foreach ($_SESSION['PaymentDetail' . $identifier]->GLItems AS $PaymentItem) { $TotalAmount += $PaymentItem->Amount; } if ($TotalAmount==0 AND - ($_SESSION['PaymentDetail']->Discount + $_SESSION['PaymentDetail']->Amount)/$_SESSION['PaymentDetail']->ExRate ==0){ + ($_SESSION['PaymentDetail' . $identifier]->Discount + $_SESSION['PaymentDetail' . $identifier]->Amount)/$_SESSION['PaymentDetail' . $identifier]->ExRate ==0){ prnMsg( _('This payment has no amounts entered and will not be processed'),'warn'); include('includes/footer.inc'); exit; @@ -258,11 +263,11 @@ $i++; } - $PeriodNo = GetPeriod($_SESSION['PaymentDetail']->DatePaid,$db); + $PeriodNo = GetPeriod($_SESSION['PaymentDetail' . $identifier]->DatePaid,$db); $sql="SELECT usepreprintedstationery FROM paymentmethods - WHERE paymentname='" . $_SESSION['PaymentDetail']->Paymenttype ."'"; + WHERE paymentname='" . $_SESSION['PaymentDetail' . $identifier]->Paymenttype ."'"; $result=DB_query($sql, $db); $myrow=DB_fetch_row($result); @@ -277,7 +282,7 @@ <br /> <br />'; - echo '<form method=post action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; + echo '<form method=post action="' . htmlspecialchars($_SERVER['PHP_SELF'] . '?identifier=' . $identifier) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo _('Has the cheque been printed') . '? <br /> @@ -287,7 +292,7 @@ <input type="submit" name="ChequePrinted" value="' . _('Yes / Continue') . '" /> <input type="submit" name="PaymentCancelled" value="' . _('No / Cancel Payment') . '" />'; - echo '<br />Payment amount = ' . $_SESSION['PaymentDetail']->Amount; + echo '<br />Payment amount = ' . $_SESSION['PaymentDetail' . $identifier]->Amount; } else { @@ -296,7 +301,7 @@ $result = DB_Txn_Begin($db); - if ($_SESSION['PaymentDetail']->SupplierID=='') { + if ($_SESSION['PaymentDetail' . $identifier]->SupplierID=='') { //its a nominal bank transaction type 1 @@ -305,7 +310,7 @@ if ($_SESSION['CompanyRecord']['gllink_creditors']==1){ /* then enter GLTrans */ $TotalAmount=0; - foreach ($_SESSION['PaymentDetail']->GLItems as $PaymentItem) { + foreach ($_SESSION['PaymentDetail' . $identifier]->GLItems as $PaymentItem) { /*The functional currency amount will be the payment currenct amount / the bank account currency exchange rate - to get to the bank account currency @@ -322,11 +327,11 @@ tag) "; $SQL= $SQL . "VALUES (1, '" . $TransNo . "', - '" . FormatDateForSQL($_SESSION['PaymentDetail']->DatePaid) . "', + '" . FormatDateForSQL($_SESSION['PaymentDetail' . $identifier]->DatePaid) . "', '" . $PeriodNo . "', '" . $PaymentItem->GLCode . "', '" . $PaymentItem->Narrative . "', - '" . ($PaymentItem->Amount/$_SESSION['PaymentDetail']->ExRate/$_SESSION['PaymentDetail']->FunctionalExRate) . "', + '" . ($PaymentItem->Amount/$_SESSION['PaymentDetail' . $identifier]->ExRate/$_SESSION['PaymentDetail' . $identifier]->FunctionalExRate) . "', '". $PaymentItem->Cheque ."', '" . $PaymentItem->Tag . "' )"; @@ -335,13 +340,13 @@ $TotalAmount += $PaymentItem->Amount; } - $_SESSION['PaymentDetail']->Amount = $TotalAmount; - $_SESSION['PaymentDetail']->Discount=0; + $_SESSION['PaymentDetail' . $identifier]->Amount = $TotalAmount; + $_SESSION['PaymentDetail' . $identifier]->Discount=0; } //Run through the GL postings to check to see if there is a posting to another bank account (or the same one) if there is then a receipt needs to be created for this account too - foreach ($_SESSION['PaymentDetail']->GLItems as $PaymentItem) { + foreach ($_SESSION['PaymentDetail' . $identifier]->GLItems as $PaymentItem) { if (in_array($PaymentItem->GLCode, $BankAccounts)) { @@ -357,9 +362,9 @@ $TrfToBankCurrCode = $TrfToBankRow['currcode']; $TrfToBankExRate = $TrfToBankRow['rate']; - if ($_SESSION['PaymentDetail']->AccountCurrency == $TrfToBankCurrCode){ + if ($_SESSION['PaymentDetail' . $identifier]->AccountCurrency == $TrfToBankCurrCode){ /*Make sure to use the same rate if the transfer is between two bank accounts in the same currency */ - $TrfToBankExRate = $_SESSION['PaymentDetail']->FunctionalExRate; + $TrfToBankExRate = $_SESSION['PaymentDetail' . $identifier]->FunctionalExRate; } /*Consider an example @@ -403,13 +408,13 @@ VALUES ('" . $ReceiptTransNo . "', 2, '" . $PaymentItem->GLCode . "', - '" . _('Act Transfer From ') . $_SESSION['PaymentDetail']->Account . ' - ' . $PaymentItem->Narrative . "', - '" . (($_SESSION['PaymentDetail']->ExRate * $_SESSION['PaymentDetail']->FunctionalExRate)/$TrfToBankExRate). "', + '" . _('Act Transfer From ') . $_SESSION['PaymentDetail' . $identifier]->Account . ' - ' . $PaymentItem->Narrative . "', + '" . (($_SESSION['PaymentDetail' . $identifier]->ExRate * $_SESSION['PaymentDetail' . $identifier]->FunctionalExRate)/$TrfToBankExRate). "', '" . $TrfToBankExRate . "', - '" . FormatDateForSQL($_SESSION['PaymentDetail']->DatePaid) . "', - '" . $_SESSION['PaymentDetail']->Paymenttype . "', + '" . FormatDateForSQL($_SESSION['PaymentDetail' . $identifier]->DatePaid) . "', + '" . $_SESSION['PaymentDetail' . $identifier]->Paymenttype . "', '" . $PaymentItem->Amount . "', - '" . $_SESSION['PaymentDetail']->Currency . "' + '" . $_SESSION['PaymentDetail' . $identifier]->Currency . "' )"; $ErrMsg = _('Cannot insert a bank transaction because'); $DbgMsg = _('Cannot insert a bank transaction with the SQL'); @@ -419,7 +424,7 @@ } } else { /*Its a supplier payment type 22 */ - $CreditorTotal = (($_SESSION['PaymentDetail']->Discount + $_SESSION['PaymentDetail']->Amount)/$_SESSION['PaymentDetail']->ExRate)/$_SESSION['PaymentDetail']->FunctionalExRate; + $CreditorTotal = (($_SESSION['PaymentDetail' . $identifier]->Discount + $_SESSION['PaymentDetail' . $identifier]->Amount)/$_SESSION['PaymentDetail' . $identifier]->ExRate)/$_SESSION['PaymentDetail' . $identifier]->FunctionalExRate; $TransNo = GetNextTransNo(22, $db); $TransType = 22; @@ -436,13 +441,13 @@ transtext) "; $SQL = $SQL . "valueS ('" . $TransNo . "', 22, - '" . $_SESSION['PaymentDetail']->SupplierID . "', - '" . FormatDateForSQL($_SESSION['PaymentDetail']->DatePaid) . "', + '" . $_SESSION['PaymentDetail' . $identifier]->SupplierID . "', + '" . FormatDateForSQL($_SESSION['PaymentDetail' . $identifier]->DatePaid) . "', '" . date('Y-m-d H-i-s') . "', - '" . $_SESSION['PaymentDetail']->Paymenttype . "', - '" . ($_SESSION['PaymentDetail']->FunctionalExRate/$_SESSION['PaymentDetail']->ExRate) . "', - '" . (-$_SESSION['PaymentDetail']->Amount-$_SESSION['PaymentDetail']->Discount) . "', - '" . $_SESSION['PaymentDetail']->Narrative . "' + '" . $_SESSION['PaymentDetail' . $identifier]->Paymenttype . "', + '" . ($_SESSION['PaymentDetail' . $identifier]->FunctionalExRate/$_SESSION['PaymentDetail' . $identifier]->ExRate) . "', + '" . (-$_SESSION['PaymentDetail' . $identifier]->Amount-$_SESSION['PaymentDetail' . $identifier]->Discount) . "', + '" . $_SESSION['PaymentDetail' . $identifier]->Narrative . "' )"; $ErrMsg = _('Cannot insert a payment transaction against the supplier because'); @@ -451,9 +456,9 @@ /*Update the supplier master with the date and amount of the last payment made */ $SQL = "UPDATE suppliers - SET lastpaiddate = '" . FormatDateForSQL($_SESSION['PaymentDetail']->DatePaid) . "', - lastpaid='" . $_SESSION['PaymentDetail']->Amount ."' - WHERE suppliers.supplierid='" . $_SESSION['PaymentDetail']->SupplierID . "'"; + SET lastpaiddate = '" . FormatDateForSQL($_SESSION['PaymentDetail' . $identifier]->DatePaid) . "', + lastpaid='" . $_SESSION['PaymentDetail' . $identifier]->Amount ."' + WHERE suppliers.supplierid='" . $_SESSION['PaymentDetail' . $identifier]->SupplierID . "'"; @@ -461,7 +466,7 @@ $DbgMsg = _('Cannot update the supplier record for the date of the last payment made using the SQL'); $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); - $_SESSION['PaymentDetail']->Narrative = $_SESSION['PaymentDetail']->SupplierID . '-' . $_SESSION['PaymentDetail']->Narrative; + $_SESSION['PaymentDetail' . $identifier]->Narrative = $_SESSION['PaymentDetail' . $identifier]->SupplierID . '-' . $_SESSION['PaymentDetail' . $identifier]->Narrative; if ($_SESSION['CompanyRecord']['gllink_creditors']==1){ /* then do the supplier control GLTrans */ /* Now debit creditors account with payment + discount */ @@ -475,16 +480,16 @@ amount) "; $SQL=$SQL . "VALUES (22, '" . $TransNo . "', - '" . FormatDateForSQL($_SESSION['PaymentDetail']->DatePaid) . "', + '" . FormatDateForSQL($_SESSION['PaymentDetail' . $identifier]->DatePaid) . "', '" . $PeriodNo . "', '" . $_SESSION['CompanyRecord']['creditorsact'] . "', - '" . $_SESSION['PaymentDetail']->Narrative . "', + '" . $_SESSION['PaymentDetail' . $identifier]->Narrative . "', '" . $CreditorTotal . "')"; $ErrMsg = _('Cannot insert a GL transaction for the creditors account debit because'); $DbgMsg = _('Cannot insert a GL transaction for the creditors account debit using the SQL'); $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); - if ($_SESSION['PaymentDetail']->Discount !=0){ + if ($_SESSION['PaymentDetail' . $identifier]->Discount !=0){ /* Now credit Discount received account with discounts */ $SQL="INSERT INTO gltrans ( type, typeno, @@ -495,11 +500,11 @@ amount) VALUES (22, '" . $TransNo . "', - '" . FormatDateForSQL($_SESSION['PaymentDetail']->DatePaid) . "', + '" . FormatDateForSQL($_SESSION['PaymentDetail' . $identifier]->DatePaid) . "', '" . $PeriodNo . "', '" . $_SESSION['CompanyRecord']['pytdiscountact'] . "', - '" . $_SESSION['PaymentDetail']->Narrative . "', - '" . (-$_SESSION['PaymentDetail']->Discount/$_SESSION['PaymentDetail']->ExRate/$_SESSION['PaymentDetail']->FunctionalExRate) . "' + '" . $_SESSION['PaymentDetail' . $identifier]->Narrative . "', + '" . (-$_SESSION['PaymentDetail' . $identifier]->Discount/$_SESSION['PaymentDetail' . $identifier]->ExRate/$_SESSION['PaymentDetail' . $identifier]->FunctionalExRate) . "' )"; $ErrMsg = _('Cannot insert a GL transaction for the payment discount credit because'); $DbgMsg = _('Cannot insert a GL transaction for the payment discount credit using the SQL'); @@ -511,7 +516,7 @@ if ($_SESSION['CompanyRecord']['gllink_creditors']==1){ /* then do the common GLTrans */ - if ($_SESSION['PaymentDetail']->Amount !=0){ + if ($_SESSION['PaymentDetail' . $identifier]->Amount !=0){ /* Bank account entry first */ $SQL = "INSERT INTO gltrans ( type, typeno, @@ -522,11 +527,11 @@ amount) VALUES ('" . $TransType . "', '" . $TransNo . "', - '" . FormatDateForSQL($_SESSION['PaymentDetail']->DatePaid) . "', + '" . FormatDateForSQL($_SESSION['PaymentDetail' . $identifier]->DatePaid) . "', '" . $PeriodNo . "', - '" . $_SESSION['PaymentDetail']->Account . "', - '" . $_SESSION['PaymentDetail']->Narrative . "', - '" . (-$_SESSION['PaymentDetail']->Amount/$_SESSION['PaymentDetail']->ExRate/$_SESSION['PaymentDetail']->FunctionalExRate) . "')"; + '" . $_SESSION['PaymentDetail' . $identifier]->Account . "', + '" . $_SESSION['PaymentDetail' . $identifier]->Narrative . "', + '" . (-$_SESSION['PaymentDetail' . $identifier]->Amount/$_SESSION['PaymentDetail' . $identifier]->ExRate/$_SESSION['PaymentDetail' . $identifier]->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'); @@ -550,21 +555,21 @@ currcode) VALUES ('" . $TransNo . "', '" . $TransType . "', - '" . $_SESSION['PaymentDetail']->Account . "', - '" . $_SESSION['PaymentDetail']->Narrative . "', - '" . $_SESSION['PaymentDetail']->ExRate . "', - '" . $_SESSION['PaymentDetail']->FunctionalExRate . "', - '" . FormatDateForSQL($_SESSION['PaymentDetail']->DatePaid) . "', - '" . $_SESSION['PaymentDetail']->Paymenttype . "', - '" . -$_SESSION['PaymentDetail']->Amount . "', - '" . $_SESSION['PaymentDetail']->Currency . "' + '" . $_SESSION['PaymentDetail' . $identifier]->Account . "', + '" . $_SESSION['PaymentDetail' . $identifier]->Narrative . "', + '" . $_SESSION['PaymentDetail' . $identifier]->ExRate . "', + '" . $_SESSION['PaymentDetail' . $identifier]->FunctionalExRate . "', + '" . FormatDateForSQL($_SESSION['PaymentDetail' . $identifier]->DatePaid) . "', + '" . $_SESSION['PaymentDetail' . $identifier]->Paymenttype . "', + '" . -$_SESSION['PaymentDetail' . $identifier]->Amount . "', + '" . $_SESSION['PaymentDetail' . $identifier]->Currency . "' )"; $ErrMsg = _('Cannot insert a bank transaction because'); $DbgMsg = _('Cannot insert a bank transaction using the SQL'); $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); } else { - foreach ($_SESSION['PaymentDetail']->GLItems as $PaymentItem) { + foreach ($_SESSION['PaymentDetail' . $identifier]->GLItems as $PaymentItem) { $SQL="INSERT INTO banktrans (transno, type, bankact, @@ -577,14 +582,14 @@ currcode) VALUES ('" . $TransNo . "', '" . $TransType . "', - '" . $_SESSION['PaymentDetail']->Account . "', - '" . $_SESSION['PaymentDetail']->Narrative . "', - '" . $_SESSION['PaymentDetail']->ExRate . "', - '" . $_SESSION['PaymentDetail']->FunctionalExRate . "', - '" . FormatDateForSQL($_SESSION['PaymentDetail']->DatePaid) . "', - '" . $_SESSION['PaymentDetail']->Paymenttype . "', + '" . $_SESSION['PaymentDetail' . $identifier]->Account . "', + '" . $_SESSION['PaymentDetail' . $identifier]->Narrative . "', + '" . $_SESSION['PaymentDetail' . $identifier]->ExRate . "', + '" . $_SESSION['PaymentDetail' . $identifier]->FunctionalExRate . "', + '" . FormatDateForSQL($_SESSION['PaymentDetail' . $identifier]->DatePaid) . "', + '" . $_SESSION['PaymentDetail' . $identifier]->Paymenttype . "', '" . -$PaymentItem->Amount . "', - '" . $_SESSION['PaymentDetail']->Currency . "' )"; + '" . $_SESSION['PaymentDetail' . $identifier]->Currency . "' )"; $ErrMsg = _('Cannot insert a bank transaction because'); $DbgMsg = _('Cannot insert a bank transaction using the SQL'); @@ -595,7 +600,7 @@ DB_Txn_Commit($db); prnMsg(_('Payment') . ' ' . $TransNo . ' ' . _('has been successfully entered'),'success'); - $LastSupplier = ($_SESSION['PaymentDetail']->SupplierID); + $LastSupplier = ($_SESSION['PaymentDetail' . $identifier]->SupplierID); unset($_POST['BankAccount']); unset($_POST['DatePaid']); @@ -605,8 +610,8 @@ unset($_POST['Narrative']); unset($_POST['Amount']); unset($_POST['Discount']); - unset($_SESSION['PaymentDetail']->GLItems); - unset($_SESSION['PaymentDetail']); + unset($_SESSION['PaymentDetail' . $identifier]->GLItems); + unset($_SESSION['PaymentDetail' . $identifier]); /*Set up a newy in case user wishes to enter another */ if (isset($LastSupplier) and $LastSupplier!='') { @@ -617,7 +622,7 @@ echo '<br /><a href="' . $rootpath . '/Payments.php?SupplierID=' . $LastSupplier . '">' . _('Enter another Payment for') . ' ' . $myrow['suppname'] . '</a>'; } else { - echo '<br /><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) .'">' . _('Enter another General Ledger Payment') . '</a><br />'; + echo '<br /><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">' . _('Enter another General Ledger Payment') . '</a><br />'; } } @@ -626,7 +631,7 @@ } elseif (isset($_GET['Delete'])){ /* User hit delete the receipt entry from the batch */ - $_SESSION['PaymentDetail']->Remove_GLItem($_GET['Delete']); + $_SESSION['PaymentDetail' . $identifier]->Remove_GLItem($_GET['Delete']); } elseif (isset($_POST['Process']) AND !$BankAccountEmpty){ //user hit submit a new GL Analysis line into the payment @@ -648,7 +653,7 @@ prnMsg( _('The Cheque/Voucher number has already been used') . ' - ' . _('This GL analysis item could not be added'),'error'); } else { $myrow = DB_fetch_array($Result); - $_SESSION['PaymentDetail']->add_to_glanalysis(filter_number_format($_POST['GLAmount']), + $_SESSION['PaymentDetail' . $identifier]->add_to_glanalysis(filter_number_format($_POST['GLAmount']), $_POST['GLNarrative'], $_POST['GLManualCode'], $myrow['accountname'], @@ -664,7 +669,7 @@ $SQL = "SELECT accountname FROM chartmaster WHERE accountcode='" . $_POST['GLCode'] . "'"; $Result=DB_query($SQL,$db); $myrow=DB_fetch_array($Result); - $_SESSION['PaymentDetail']->add_to_glanalysis(filter_number_format($_POST['GLAmount']), + $_SESSION['PaymentDetail' . $identifier]->add_to_glanalysis(filter_number_format($_POST['GLAmount']), $_POST['GLNarrative'], $_POST['GLCode'], $myrow['accountname'], @@ -690,14 +695,14 @@ if (isset($_POST['DatePaid']) AND ($_POST['DatePaid']=='' - OR !Is_Date($_SESSION['PaymentDetail']->DatePaid))){ + OR !Is_Date($_SESSION['PaymentDetail' . $identifier]->DatePaid))){ $_POST['DatePaid']= Date($_SESSION['DefaultDateFormat']); - $_SESSION['PaymentDetail']->DatePaid = $_POST['DatePaid']; + $_SESSION['PaymentDetail' . $identifier]->DatePaid = $_POST['DatePaid']; } -if ($_SESSION['PaymentDetail']->Currency=='' AND $_SESSION['PaymentDetail']->SupplierID==''){ - $_SESSION['PaymentDetail']->Currency=$_SESSION['CompanyRecord']['currencydefault']; +if ($_SESSION['PaymentDetail' . $identifier]->Currency=='' AND $_SESSION['PaymentDetail' . $identifier]->SupplierID==''){ + $_SESSION['PaymentDetail' . $identifier]->Currency=$_SESSION['CompanyRecord']['currencydefault']; } @@ -715,29 +720,29 @@ if (DB_num_rows($result)==1){ $myrow = DB_fetch_row($result); - $_SESSION['PaymentDetail']->BankAccountName = $myrow[0]; + $_SESSION['PaymentDetail' . $identifier]->BankAccountName = $myrow[0]; unset($result); } elseif (DB_num_rows($result)==0){ prnMsg( _('The bank account number') . ' ' . $_POST['BankAccount'] . ' ' . _('is not set up as a bank account with a valid general ledger account'),'error'); } } -echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">'; +echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'] . '?identifier=' . $identifier) . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p><table class="selection">'; echo '<tr><th colspan="4"><font size="3" color="blue">' . _('Payment'); -if ($_SESSION['PaymentDetail']->SupplierID!=''){ - echo ' ' . _('to') . ' ' . $_SESSION['PaymentDetail']->SuppName; +if ($_SESSION['PaymentDetail' . $identifier]->SupplierID!=''){ + echo ' ' . _('to') . ' ' . $_SESSION['PaymentDetail' . $identifer]->SuppName; } -if ($_SESSION['PaymentDetail']->BankAccountName!=''){ - echo ' ' . _('from the') . ' ' . $_SESSION['PaymentDetail']->BankAccountName; +if ($_SESSION['PaymentDetail' . $identifier]->BankAccountName!=''){ + echo ' ' . _('from the') . ' ' . $_SESSION['PaymentDetail' . $identifier]->BankAccountName; } -echo ' ' . _('on') . ' ' . $_SESSION['PaymentDetail']->DatePaid . '</font></th></tr>'; +echo ' ' . _('on') . ' ' . $_SESSION['PaymentDetail' . $identifier]->DatePaid . '</font></th></tr>'; $SQL = "SELECT bankaccountname, bankaccounts.accountcode, @@ -777,11 +782,11 @@ echo '<tr> <td>' . _('Date Paid') . ':</td> - <td><input type="text" name="DatePaid" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" maxlength="10" size="11" onChange="isDate(this, this.value, '."'".$_SESSION['DefaultDateFormat']."'".')" value="' . $_SESSION['PaymentDetail']->DatePaid . '" /></td> + <td><input type="text" name="DatePaid" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" maxlength="10" size="11" onChange="isDate(this, this.value, '."'".$_SESSION['DefaultDateFormat']."'".')" value="' . $_SESSION['PaymentDetail' . $identifier]->DatePaid . '" /></td> </tr>'; -if ($_SESSION['PaymentDetail']->SupplierID==''){ +if ($_SESSION['PaymentDetail' . $identifier]->SupplierID==''){ echo '<tr><td>' . _('Currency of Payment') . ':</td> <td><select name="Currency" onChange="ReloadForm(UpdateHeader)">'; $SQL = "SELECT currency, currabrev, rate FROM currencies"; @@ -793,7 +798,7 @@ prnMsg( _('No currencies are defined yet. Payments cannot be entered until a currency is defined'),'error'); } else { while ($myrow=DB_fetch_array($result)){ - if ($_SESSION['PaymentDetail']->Currency==$myrow['currabrev']){ + if ($_SESSION['PaymentDetail' . $identifier]->Currency==$myrow['currabrev']){ echo '<option selected="selected" value="' . $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; } else { echo '<option value="' . $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; @@ -806,17 +811,16 @@ } else { /*its a supplier payment so it must be in the suppliers currency */ echo '<tr> <td>' . _('Supplier Currency') . ':</td> - <td>' . $_SESSION['PaymentDetail']->Currency . '</td> + <td>' . $_SESSION['PaymentDetail' . $identifier]->Currency . '</td> </tr>'; - echo '<input type="hidden" name="Currency" value="' . $_SESSION['PaymentDetail']->Currency . '" />'; + echo '<input type="hidden" name="Currency" value="' . $_SESSION['PaymentDetail' . $identifier]->Currency . '" />'; /*get the default rate from the currency table if it has not been set */ if (!isset($_POST['ExRate']) OR $_POST['ExRate']==''){ - $SQL = "SELECT rate FROM currencies WHERE currabrev='" . $_SESSION['PaymentDetail']->Currency ."'"; + $SQL = "SELECT rate FROM currencies WHERE currabrev='" . $_SESSION['PaymentDetail' . $identifier]->Currency ."'"; $Result=DB_query($SQL,$db); $myrow=DB_fetch_row($Result); $_POST['ExRate']=locale_number_format($myrow[0],'Variable'); } - } if (!isset($_POST['ExRate'])){ @@ -826,7 +830,7 @@ if (!isset($_POST['FunctionalExRate'])){ $_POST['FunctionalExRate']=1; } -if ($_SESSION['PaymentDetail']->AccountCurrency!=$_SESSION['PaymentDetail']->Currency AND isset($_SESSION['PaymentDetail']->AccountCurrency)){ +if ($_SESSION['PaymentDetail' . $identifier]->AccountCurrency!=$_SESSION['PaymentDetail' . $identifier]->Currency AND isset($_SESSION['PaymentDetail' . $identifier]->AccountCurrency)){ if (isset($SuggestedExRate)){ $SuggestedExRateText = '<b>' . _('Suggested rate:') . ' ' . locale_number_format($SuggestedExRate,6) . '</b>'; } else { @@ -838,12 +842,12 @@ echo '<tr> <td>' . _('Payment Exchange Rate') . ':</td> <td><input class="number" type="text" name="ExRate" maxlength="10" size="12" value="' . $_POST['ExRate'] . '" /></td> - <td>' . $SuggestedExRateText . ' <i>' . _('The exchange rate between the currency of the bank account currency and the currency of the payment') . '. 1 ' . $_SESSION['PaymentDetail']->AccountCurrency . ' = ? ' . $_SESSION['PaymentDetail']->Currency . '</i></td> + <td>' . $SuggestedExRateText . ' <i>' . _('The exchange rate between the currency of the bank account currency and the currency of the payment') . '. 1 ' . $_SESSION['PaymentDetail' . $identifier]->AccountCurrency . ' = ? ' . $_SESSION['PaymentDetail' . $identifier]->Currency . '</i></td> </tr>'; } -if ($_SESSION['PaymentDetail']->AccountCurrency!=$_SESSION['CompanyRecord']['currencydefault'] - AND isset($_SESSION['PaymentDetail']->AccountCurrency)){ +if ($_SESSION['PaymentDetail' . $identifier]->AccountCurrency!=$_SESSION['CompanyRecord']['currencydefault'] + AND isset($_SESSION['PaymentDetail' . $identifier]->AccountCurrency)){ if (isset($SuggestedFunctionalExRate)){ $SuggestedFunctionalExRateText = '<b>' . _('Suggested rate:') . ' ' . locale_number_format($SuggestedFunctionalExRate,6) . '</b>'; } else { @@ -855,7 +859,7 @@ echo '<tr> <td>' . _('Functional Exchange Rate') . ':</td> <td><input type="text" name="FunctionalExRate" maxlength="10" size="12" value="' . $_POST['FunctionalExRate'] . '" /></td> - <td>' . ' ' . $SuggestedFunctionalExRateText . ' <i>' . _('The exchange rate between the currency of the business (the functional currency) and the currency of the bank account') . '. 1 ' . $_SESSION['CompanyRecord']['currencydefault'] . ' = ? ' . $_SESSION['PaymentDetail']->AccountCurrency . '</i></td> + <td>' . ' ' . $SuggestedFunctionalExRateText . ' <i>' . _('The exchange rate between the currency of the business (the functional currency) and the currency of the bank account') . '. 1 ' . $_SESSION['CompanyRecord']['currencydefault'] . ' = ? ' . $_SESSION['PaymentDetail' . $identifier]->AccountCurrency . '</i></td> </tr>'; } echo '<tr> @@ -902,7 +906,7 @@ echo '</table><br />'; -if ($_SESSION['CompanyRecord']['gllink_creditors']==1 AND $_SESSION['PaymentDetail']->SupplierID==''){ +if ($_SESSION['CompanyRecord']['gllink_creditors']==1 AND $_SESSION['PaymentDetail' . $identifier]->SupplierID==''){ /* Set upthe form for the transaction entry for a GL Payment Analysis item */ echo '<br /><table class="selection">'; @@ -1023,11 +1027,11 @@ if (isset($_POST['GLAmount'])) { echo '<tr> - <td>' . _('Amount') . ' (' . $_SESSION['PaymentDetail']->Currency . '):</td> + <td>' . _('Amount') . ' (' . $_SESSION['PaymentDetail' . $identifier]->Currency . '):</td> <td><input type="text" name="GLAmount" maxlength="12" size="12" class="number" value="' . $_POST['GLAmount'] . '" /></td> </tr>'; } else { - echo '<tr><td>' . _('Amount') . ' (' . $_SESSION['PaymentDetail']->Currency . '):</td> + echo '<tr><td>' . _('Amount') . ' (' . $_SESSION['PaymentDetail' . $identifier]->Currency . '):</td> <td><input type="text" name="GLAmount" maxlength="12" size="12" class="number" /></td> </tr>'; } @@ -1038,19 +1042,19 @@ <input type="submit" name="Cancel" value="' . _('Cancel') . '" /> </div>'; - if (sizeOf($_SESSION['PaymentDetail']->GLItems)>0) { + if (sizeOf($_SESSION['PaymentDetail' . $identifier]->GLItems)>0) { echo '<br /> <table class="selection"> <tr> <th>' . _('Cheque No').'</th> - <th>' . _('Amount') . ' (' . $_SESSION['PaymentDetail']->Currency . ')</th> + <th>' . _('Amount') . ' (' . $_SESSION['PaymentDetail' . $identifier]->Currency . ')</th> <th>' . _('GL Account') . '</th> <th>' . _('Narrative') . '</th> <th>' . _('Tag') . '</th> </tr>'; $PaymentTotal = 0; - foreach ($_SESSION['PaymentDetail']->GLItems as $PaymentItem) { + foreach ($_SESSION['PaymentDetail' . $identifier]->GLItems as $PaymentItem) { $Tagsql="SELECT tagdescription from tags where tagref='" . $PaymentItem->Tag . "'"; $TagResult=DB_query($Tagsql, $db); $TagMyrow=DB_fetch_row($TagResult); @@ -1062,17 +1066,17 @@ echo '<tr> <td>' . $PaymentItem->Cheque . '</td> - <td class="number">' . locale_number_format($PaymentItem->Amount,$_SESSION['PaymentDetail']->CurrDecimalPlaces) . '</td> + <td class="number">' . locale_number_format($PaymentItem->Amount,$_SESSION['PaymentDetail' . $identifier]->CurrDecimalPlaces) . '</td> <td>' . $PaymentItem->GLCode . ' - ' . $PaymentItem->GLActName . '</td> <td>' . stripslashes($PaymentItem->Narrative) . '</td> <td>' . $PaymentItem->Tag . ' - ' . $TagName . '</td> - <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?Delete=' . $PaymentItem->ID . '" onclick="return confirm(\'' . _('Are you sure you wish to delete this payment analysis item?') . '\');">' . _('Delete') . '</a></td> + <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'] . '?identifier=' . $identifier) . '?Delete=' . $PaymentItem->ID . '" onclick="return confirm(\'' . _('Are you sure you wish to delete this payment analysis item?') . '\');">' . _('Delete') . '</a></td> </tr>'; $PaymentTotal += $PaymentItem->Amount; } echo '<tr> <td></td> - <td class="number"><b>' . locale_number_format($PaymentTotal,$_SESSION['PaymentDetail']->CurrDecimalPlaces) . '</b></td> + <td class="number"><b>' . locale_number_format($PaymentTotal,$_SESSION['PaymentDetail' . $identifier]->CurrDecimalPlaces) . '</b></td> <td></td> <td></td> <td></td> @@ -1088,16 +1092,16 @@ echo '<table class="selection"> <tr> - <td>' . _('Amount of Payment') . ' ' . $_SESSION['PaymentDetail']->Currency . ':</td> - <td><input class="number" type="text" name="Amount" maxlength="12" size="13" value="' . $_SESSION['PaymentDetail']->Amount . '" /></td> + <td>' . _('Amount of Payment') . ' ' . $_SESSION['PaymentDetail' . $identifier]->Currency . ':</td> + <td><input class="number" type="text" name="Amount" maxlength="12" size="13" value="' . $_SESSION['PaymentDetail' . $identifier]->Amount . '" /></td> </tr>'; - if (isset($_SESSION['PaymentDetail']->SupplierID)){ /*So it is a supplier payment so show the discount entry item */ + if (isset($_SESSION['PaymentDetail' . $identifier]->SupplierID)){ /*So it is a supplier payment so show the discount entry item */ echo '<tr> <td>' . _('Amount of Discount') . ':</td> - <td><input class="number" type="text" name="Discount" maxlength="12" size="13" value="' . $_SESSION['PaymentDetail']->Discount . '" /></td> + <td><input class="number" type="text" name="Discount" maxlength="12" size="13" value="' . $_SESSION['PaymentDetail' . $identifier]->Discount . '" /></td> </tr>'; - echo '<input type="hidden" name="SuppName" value="' . $_SESSION['PaymentDetail']->SuppName . '" />'; + echo '<input type="hidden" name="SuppName" value="' . $_SESSION['PaymentDetail' . $identifier]->SuppName . '" />'; } else { echo '<input type="hidden" name="Discount" Value="0" />'; } @@ -1107,4 +1111,4 @@ echo '</form>'; include('includes/footer.inc'); -?> \ No newline at end of file +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ex...@us...> - 2012-01-30 01:15:30
|
Revision: 4851 http://web-erp.svn.sourceforge.net/web-erp/?rev=4851&view=rev Author: ExsonQu Date: 2012-01-30 01:15:22 +0000 (Mon, 30 Jan 2012) Log Message: ----------- Fix for $_SESSION overwritten problem with $identifier variable and minor html modification Modified Paths: -------------- trunk/Payments.php Modified: trunk/Payments.php =================================================================== --- trunk/Payments.php 2012-01-29 09:42:44 UTC (rev 4850) +++ trunk/Payments.php 2012-01-30 01:15:22 UTC (rev 4851) @@ -16,15 +16,20 @@ include('includes/footer.inc'); exit(); } - +if (empty($_GET['identifier'])){ + /*unique session identifier to ensure that there is no conflict with other order enty session on the same machine */ + $identifier=date('U'); +}else{ + $identifier=$_GET['identifier'];//edit GLItems +} if (isset($_GET['NewPayment']) AND $_GET['NewPayment']=='Yes'){ - unset($_SESSION['PaymentDetail']->GLItems); - unset($_SESSION['PaymentDetail']); + unset($_SESSION['PaymentDetail' . $identifier]->GLItems); + unset($_SESSION['PaymentDetail' . $identifier]); } -if (!isset($_SESSION['PaymentDetail'])){ - $_SESSION['PaymentDetail'] = new Payment; - $_SESSION['PaymentDetail']->GLItemCounter = 1; +if (!isset($_SESSION['PaymentDetail' . $identifier])){ + $_SESSION['PaymentDetail' . $identifier] = new Payment; + $_SESSION['PaymentDetail' . $identifier]->GLItemCounter = 1; } if ((isset($_POST['UpdateHeader']) @@ -49,10 +54,10 @@ if (isset($_GET['SupplierID'])){ /*The page was called with a supplierID check it is valid and default the inputs for Supplier Name and currency of payment */ - unset($_SESSION['PaymentDetail']->GLItems); - unset($_SESSION['PaymentDetail']); - $_SESSION['PaymentDetail'] = new Payment; - $_SESSION['PaymentDetail']->GLItemCounter = 1; + unset($_SESSION['PaymentDetail' . $identifier]->GLItems); + unset($_SESSION['PaymentDetail' . $identifier]); + $_SESSION['PaymentDetail' . $identifier] = new Payment; + $_SESSION['PaymentDetail' . $identifier]->GLItemCounter = 1; $SQL= "SELECT suppname, @@ -75,16 +80,16 @@ } else { $myrow = DB_fetch_array($Result); if ($myrow['factorcompanyid'] == 0) { - $_SESSION['PaymentDetail']->SuppName = $myrow['suppname']; - $_SESSION['PaymentDetail']->Address1 = $myrow['address1']; - $_SESSION['PaymentDetail']->Address2 = $myrow['address2']; - $_SESSION['PaymentDetail']->Address3 = $myrow['address3']; - $_SESSION['PaymentDetail']->Address4 = $myrow['address4']; - $_SESSION['PaymentDetail']->Address5 = $myrow['address5']; - $_SESSION['PaymentDetail']->Address6 = $myrow['address6']; - $_SESSION['PaymentDetail']->SupplierID = $_GET['SupplierID']; - $_SESSION['PaymentDetail']->Currency = $myrow['currcode']; - $_POST['Currency'] = $_SESSION['PaymentDetail']->Currency; + $_SESSION['PaymentDetail' . $identifier]->SuppName = $myrow['suppname']; + $_SESSION['PaymentDetail' . $identifier]->Address1 = $myrow['address1']; + $_SESSION['PaymentDetail' . $identifier]->Address2 = $myrow['address2']; + $_SESSION['PaymentDetail' . $identifier]->Address3 = $myrow['address3']; + $_SESSION['PaymentDetail' . $identifier]->Address4 = $myrow['address4']; + $_SESSION['PaymentDetail' . $identifier]->Address5 = $myrow['address5']; + $_SESSION['PaymentDetail' . $identifier]->Address6 = $myrow['address6']; + $_SESSION['PaymentDetail' . $identifier]->SupplierID = $_GET['SupplierID']; + $_SESSION['PaymentDetail' . $identifier]->Currency = $myrow['currcode']; + $_POST['Currency'] = $_SESSION['PaymentDetail' . $identifier]->Currency; } else { $factorsql= "SELECT coyname, @@ -99,23 +104,23 @@ $FactorResult = DB_query($factorsql, $db); $myfactorrow = DB_fetch_array($FactorResult); - $_SESSION['PaymentDetail']->SuppName = $myrow['suppname'] . ' ' . _('care of') . ' ' . $myfactorrow['coyname']; - $_SESSION['PaymentDetail']->Address1 = $myfactorrow['address1']; - $_SESSION['PaymentDetail']->Address2 = $myfactorrow['address2']; - $_SESSION['PaymentDetail']->Address3 = $myfactorrow['address3']; - $_SESSION['PaymentDetail']->Address4 = $myfactorrow['address4']; - $_SESSION['PaymentDetail']->Address5 = $myfactorrow['address5']; - $_SESSION['PaymentDetail']->Address6 = $myfactorrow['address6']; - $_SESSION['PaymentDetail']->SupplierID = $_GET['SupplierID']; - $_SESSION['PaymentDetail']->Currency = $myrow['currcode']; - $_POST['Currency'] = $_SESSION['PaymentDetail']->Currency; + $_SESSION['PaymentDetail' . $identifier]->SuppName = $myrow['suppname'] . ' ' . _('care of') . ' ' . $myfactorrow['coyname']; + $_SESSION['PaymentDetail' . $identifier]->Address1 = $myfactorrow['address1']; + $_SESSION['PaymentDetail' . $identifier]->Address2 = $myfactorrow['address2']; + $_SESSION['PaymentDetail' . $identifier]->Address3 = $myfactorrow['address3']; + $_SESSION['PaymentDetail' . $identifier]->Address4 = $myfactorrow['address4']; + $_SESSION['PaymentDetail' . $identifier]->Address5 = $myfactorrow['address5']; + $_SESSION['PaymentDetail' . $identifier]->Address6 = $myfactorrow['address6']; + $_SESSION['PaymentDetail' . $identifier]->SupplierID = $_GET['SupplierID']; + $_SESSION['PaymentDetail' . $identifier]->Currency = $myrow['currcode']; + $_POST['Currency'] = $_SESSION['PaymentDetail' . $identifier]->Currency; } } } if (isset($_POST['BankAccount']) AND $_POST['BankAccount']!=''){ - $_SESSION['PaymentDetail']->Account=$_POST['BankAccount']; + $_SESSION['PaymentDetail' . $identifier]->Account=$_POST['BankAccount']; /*Get the bank account currency and set that too */ $ErrMsg = _('Could not get the currency of the bank account'); $result = DB_query("SELECT currcode, @@ -127,41 +132,41 @@ $ErrMsg); $myrow = DB_fetch_array($result); - $_SESSION['PaymentDetail']->AccountCurrency=$myrow['currcode']; - $_SESSION['PaymentDetail']->CurrDecimalPlaces=$myrow['decimalplaces']; + $_SESSION['PaymentDetail' . $identifier]->AccountCurrency=$myrow['currcode']; + $_SESSION['PaymentDetail' . $identifier]->CurrDecimalPlaces=$myrow['decimalplaces']; } else { - $_SESSION['PaymentDetail']->AccountCurrency =$_SESSION['CompanyRecord']['currencydefault']; - $_SESSION['PaymentDetail']->CurrDecimalPlaces=$_SESSION['CompanyRecord']['decimalplaces']; + $_SESSION['PaymentDetail' . $identifier]->AccountCurrency =$_SESSION['CompanyRecord']['currencydefault']; + $_SESSION['PaymentDetail' . $identifier]->CurrDecimalPlaces=$_SESSION['CompanyRecord']['decimalplaces']; } if (isset($_POST['DatePaid']) AND $_POST['DatePaid']!='' AND Is_Date($_POST['DatePaid'])){ - $_SESSION['PaymentDetail']->DatePaid=$_POST['DatePaid']; + $_SESSION['PaymentDetail' . $identifier]->DatePaid=$_POST['DatePaid']; } if (isset($_POST['ExRate']) AND $_POST['ExRate']!=''){ - $_SESSION['PaymentDetail']->ExRate=filter_number_format($_POST['ExRate']); //ex rate between payment currency and account currency + $_SESSION['PaymentDetail' . $identifier]->ExRate=filter_number_format($_POST['ExRate']); //ex rate between payment currency and account currency } if (isset($_POST['FunctionalExRate']) AND $_POST['FunctionalExRate']!=''){ - $_SESSION['PaymentDetail']->FunctionalExRate=filter_number_format($_POST['FunctionalExRate']); //ex rate between payment currency and account currency + $_SESSION['PaymentDetail' . $identifier]->FunctionalExRate=filter_number_format($_POST['FunctionalExRate']); //ex rate between payment currency and account currency } if (isset($_POST['Paymenttype']) AND $_POST['Paymenttype']!=''){ - $_SESSION['PaymentDetail']->Paymenttype = $_POST['Paymenttype']; + $_SESSION['PaymentDetail' . $identifier]->Paymenttype = $_POST['Paymenttype']; } if (isset($_POST['Currency']) AND $_POST['Currency']!=''){ - $_SESSION['PaymentDetail']->Currency=$_POST['Currency']; //payment currency + $_SESSION['PaymentDetail' . $identifier]->Currency=$_POST['Currency']; //payment currency /*Get the exchange rate between the functional currency and the payment currency*/ - $result = DB_query("SELECT rate FROM currencies WHERE currabrev='" . $_SESSION['PaymentDetail']->Currency . "'",$db); + $result = DB_query("SELECT rate FROM currencies WHERE currabrev='" . $_SESSION['PaymentDetail' . $identifier]->Currency . "'",$db); $myrow = DB_fetch_row($result); $tableExRate = $myrow[0]; //this is the rate of exchange between the functional currency and the payment currency - if ($_POST['Currency']==$_SESSION['PaymentDetail']->AccountCurrency){ + if ($_POST['Currency']==$_SESSION['PaymentDetail' . $identifier]->AccountCurrency){ $_POST['ExRate']=1; - $_SESSION['PaymentDetail']->ExRate=filter_number_format($_POST['ExRate']); //ex rate between payment currency and account currency + $_SESSION['PaymentDetail' . $identifier]->ExRate=filter_number_format($_POST['ExRate']); //ex rate between payment currency and account currency $SuggestedExRate=1; } - if ($_SESSION['PaymentDetail']->AccountCurrency==$_SESSION['CompanyRecord']['currencydefault']){ + if ($_SESSION['PaymentDetail' . $identifier]->AccountCurrency==$_SESSION['CompanyRecord']['currencydefault']){ $_POST['FunctionalExRate']=1; - $_SESSION['PaymentDetail']->FunctionalExRate=filter_number_format($_POST['FunctionalExRate']); + $_SESSION['PaymentDetail' . $identifier]->FunctionalExRate=filter_number_format($_POST['FunctionalExRate']); $SuggestedExRate = $tableExRate; $SuggestedFunctionalExRate =1; @@ -176,12 +181,12 @@ */ /*Get suggested FunctionalExRate */ - $result = DB_query("SELECT rate FROM currencies WHERE currabrev='" . $_SESSION['PaymentDetail']->AccountCurrency . "'",$db); + $result = DB_query("SELECT rate FROM currencies WHERE currabrev='" . $_SESSION['PaymentDetail' . $identifier]->AccountCurrency . "'",$db); $myrow = DB_fetch_row($result); $SuggestedFunctionalExRate = $myrow[0]; /*Get the exchange rate between the functional currency and the payment currency*/ - $result = DB_query("SELECT rate FROM currencies WHERE currabrev='" . $_SESSION['PaymentDetail']->Currency . "'",$db); + $result = DB_query("SELECT rate FROM currencies WHERE currabrev='" . $_SESSION['PaymentDetail' . $identifier]->Currency . "'",$db); $myrow = DB_fetch_row($result); $tableExRate = $myrow[0]; //this is the rate of exchange between the functional currency and the payment currency /*Calculate cross rate to suggest appropriate exchange rate between payment currency and account currency */ @@ -192,20 +197,20 @@ if (isset($_POST['Narrative']) AND $_POST['Narrative']!=''){ - $_SESSION['PaymentDetail']->Narrative=$_POST['Narrative']; + $_SESSION['PaymentDetail' . $identifier]->Narrative=$_POST['Narrative']; } if (isset($_POST['Amount']) AND $_POST['Amount']!=''){ - $_SESSION['PaymentDetail']->Amount=filter_number_format($_POST['Amount']); + $_SESSION['PaymentDetail' . $identifier]->Amount=filter_number_format($_POST['Amount']); } else { - if (!isset($_SESSION['PaymentDetail']->Amount)) { - $_SESSION['PaymentDetail']->Amount=0; + if (!isset($_SESSION['PaymentDetail' . $identifier]->Amount)) { + $_SESSION['PaymentDetail' . $identifier]->Amount=0; } } if (isset($_POST['Discount']) AND $_POST['Discount']!=''){ - $_SESSION['PaymentDetail']->Discount=filter_number_format($_POST['Discount']); + $_SESSION['PaymentDetail' . $identifier]->Discount=filter_number_format($_POST['Discount']); } else { - if (!isset($_SESSION['PaymentDetail']->Discount)) { - $_SESSION['PaymentDetail']->Discount=0; + if (!isset($_SESSION['PaymentDetail' . $identifier]->Discount)) { + $_SESSION['PaymentDetail' . $identifier]->Discount=0; } } @@ -227,12 +232,12 @@ /*First off check we have an amount entered as paid ?? */ $TotalAmount =0; - foreach ($_SESSION['PaymentDetail']->GLItems AS $PaymentItem) { + foreach ($_SESSION['PaymentDetail' . $identifier]->GLItems AS $PaymentItem) { $TotalAmount += $PaymentItem->Amount; } if ($TotalAmount==0 AND - ($_SESSION['PaymentDetail']->Discount + $_SESSION['PaymentDetail']->Amount)/$_SESSION['PaymentDetail']->ExRate ==0){ + ($_SESSION['PaymentDetail' . $identifier]->Discount + $_SESSION['PaymentDetail' . $identifier]->Amount)/$_SESSION['PaymentDetail' . $identifier]->ExRate ==0){ prnMsg( _('This payment has no amounts entered and will not be processed'),'warn'); include('includes/footer.inc'); exit; @@ -258,11 +263,11 @@ $i++; } - $PeriodNo = GetPeriod($_SESSION['PaymentDetail']->DatePaid,$db); + $PeriodNo = GetPeriod($_SESSION['PaymentDetail' . $identifier]->DatePaid,$db); $sql="SELECT usepreprintedstationery FROM paymentmethods - WHERE paymentname='" . $_SESSION['PaymentDetail']->Paymenttype ."'"; + WHERE paymentname='" . $_SESSION['PaymentDetail' . $identifier]->Paymenttype ."'"; $result=DB_query($sql, $db); $myrow=DB_fetch_row($result); @@ -277,7 +282,7 @@ <br /> <br />'; - echo '<form method=post action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; + echo '<form method=post action="' . htmlspecialchars($_SERVER['PHP_SELF'] . '?identifier=' . $identifier) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo _('Has the cheque been printed') . '? <br /> @@ -287,7 +292,7 @@ <input type="submit" name="ChequePrinted" value="' . _('Yes / Continue') . '" /> <input type="submit" name="PaymentCancelled" value="' . _('No / Cancel Payment') . '" />'; - echo '<br />Payment amount = ' . $_SESSION['PaymentDetail']->Amount; + echo '<br />Payment amount = ' . $_SESSION['PaymentDetail' . $identifier]->Amount; } else { @@ -296,7 +301,7 @@ $result = DB_Txn_Begin($db); - if ($_SESSION['PaymentDetail']->SupplierID=='') { + if ($_SESSION['PaymentDetail' . $identifier]->SupplierID=='') { //its a nominal bank transaction type 1 @@ -305,7 +310,7 @@ if ($_SESSION['CompanyRecord']['gllink_creditors']==1){ /* then enter GLTrans */ $TotalAmount=0; - foreach ($_SESSION['PaymentDetail']->GLItems as $PaymentItem) { + foreach ($_SESSION['PaymentDetail' . $identifier]->GLItems as $PaymentItem) { /*The functional currency amount will be the payment currenct amount / the bank account currency exchange rate - to get to the bank account currency @@ -322,11 +327,11 @@ tag) "; $SQL= $SQL . "VALUES (1, '" . $TransNo . "', - '" . FormatDateForSQL($_SESSION['PaymentDetail']->DatePaid) . "', + '" . FormatDateForSQL($_SESSION['PaymentDetail' . $identifier]->DatePaid) . "', '" . $PeriodNo . "', '" . $PaymentItem->GLCode . "', '" . $PaymentItem->Narrative . "', - '" . ($PaymentItem->Amount/$_SESSION['PaymentDetail']->ExRate/$_SESSION['PaymentDetail']->FunctionalExRate) . "', + '" . ($PaymentItem->Amount/$_SESSION['PaymentDetail' . $identifier]->ExRate/$_SESSION['PaymentDetail' . $identifier]->FunctionalExRate) . "', '". $PaymentItem->Cheque ."', '" . $PaymentItem->Tag . "' )"; @@ -335,13 +340,13 @@ $TotalAmount += $PaymentItem->Amount; } - $_SESSION['PaymentDetail']->Amount = $TotalAmount; - $_SESSION['PaymentDetail']->Discount=0; + $_SESSION['PaymentDetail' . $identifier]->Amount = $TotalAmount; + $_SESSION['PaymentDetail' . $identifier]->Discount=0; } //Run through the GL postings to check to see if there is a posting to another bank account (or the same one) if there is then a receipt needs to be created for this account too - foreach ($_SESSION['PaymentDetail']->GLItems as $PaymentItem) { + foreach ($_SESSION['PaymentDetail' . $identifier]->GLItems as $PaymentItem) { if (in_array($PaymentItem->GLCode, $BankAccounts)) { @@ -357,9 +362,9 @@ $TrfToBankCurrCode = $TrfToBankRow['currcode']; $TrfToBankExRate = $TrfToBankRow['rate']; - if ($_SESSION['PaymentDetail']->AccountCurrency == $TrfToBankCurrCode){ + if ($_SESSION['PaymentDetail' . $identifier]->AccountCurrency == $TrfToBankCurrCode){ /*Make sure to use the same rate if the transfer is between two bank accounts in the same currency */ - $TrfToBankExRate = $_SESSION['PaymentDetail']->FunctionalExRate; + $TrfToBankExRate = $_SESSION['PaymentDetail' . $identifier]->FunctionalExRate; } /*Consider an example @@ -403,13 +408,13 @@ VALUES ('" . $ReceiptTransNo . "', 2, '" . $PaymentItem->GLCode . "', - '" . _('Act Transfer From ') . $_SESSION['PaymentDetail']->Account . ' - ' . $PaymentItem->Narrative . "', - '" . (($_SESSION['PaymentDetail']->ExRate * $_SESSION['PaymentDetail']->FunctionalExRate)/$TrfToBankExRate). "', + '" . _('Act Transfer From ') . $_SESSION['PaymentDetail' . $identifier]->Account . ' - ' . $PaymentItem->Narrative . "', + '" . (($_SESSION['PaymentDetail' . $identifier]->ExRate * $_SESSION['PaymentDetail' . $identifier]->FunctionalExRate)/$TrfToBankExRate). "', '" . $TrfToBankExRate . "', - '" . FormatDateForSQL($_SESSION['PaymentDetail']->DatePaid) . "', - '" . $_SESSION['PaymentDetail']->Paymenttype . "', + '" . FormatDateForSQL($_SESSION['PaymentDetail' . $identifier]->DatePaid) . "', + '" . $_SESSION['PaymentDetail' . $identifier]->Paymenttype . "', '" . $PaymentItem->Amount . "', - '" . $_SESSION['PaymentDetail']->Currency . "' + '" . $_SESSION['PaymentDetail' . $identifier]->Currency . "' )"; $ErrMsg = _('Cannot insert a bank transaction because'); $DbgMsg = _('Cannot insert a bank transaction with the SQL'); @@ -419,7 +424,7 @@ } } else { /*Its a supplier payment type 22 */ - $CreditorTotal = (($_SESSION['PaymentDetail']->Discount + $_SESSION['PaymentDetail']->Amount)/$_SESSION['PaymentDetail']->ExRate)/$_SESSION['PaymentDetail']->FunctionalExRate; + $CreditorTotal = (($_SESSION['PaymentDetail' . $identifier]->Discount + $_SESSION['PaymentDetail' . $identifier]->Amount)/$_SESSION['PaymentDetail' . $identifier]->ExRate)/$_SESSION['PaymentDetail' . $identifier]->FunctionalExRate; $TransNo = GetNextTransNo(22, $db); $TransType = 22; @@ -436,13 +441,13 @@ transtext) "; $SQL = $SQL . "valueS ('" . $TransNo . "', 22, - '" . $_SESSION['PaymentDetail']->SupplierID . "', - '" . FormatDateForSQL($_SESSION['PaymentDetail']->DatePaid) . "', + '" . $_SESSION['PaymentDetail' . $identifier]->SupplierID . "', + '" . FormatDateForSQL($_SESSION['PaymentDetail' . $identifier]->DatePaid) . "', '" . date('Y-m-d H-i-s') . "', - '" . $_SESSION['PaymentDetail']->Paymenttype . "', - '" . ($_SESSION['PaymentDetail']->FunctionalExRate/$_SESSION['PaymentDetail']->ExRate) . "', - '" . (-$_SESSION['PaymentDetail']->Amount-$_SESSION['PaymentDetail']->Discount) . "', - '" . $_SESSION['PaymentDetail']->Narrative . "' + '" . $_SESSION['PaymentDetail' . $identifier]->Paymenttype . "', + '" . ($_SESSION['PaymentDetail' . $identifier]->FunctionalExRate/$_SESSION['PaymentDetail' . $identifier]->ExRate) . "', + '" . (-$_SESSION['PaymentDetail' . $identifier]->Amount-$_SESSION['PaymentDetail' . $identifier]->Discount) . "', + '" . $_SESSION['PaymentDetail' . $identifier]->Narrative . "' )"; $ErrMsg = _('Cannot insert a payment transaction against the supplier because'); @@ -451,9 +456,9 @@ /*Update the supplier master with the date and amount of the last payment made */ $SQL = "UPDATE suppliers - SET lastpaiddate = '" . FormatDateForSQL($_SESSION['PaymentDetail']->DatePaid) . "', - lastpaid='" . $_SESSION['PaymentDetail']->Amount ."' - WHERE suppliers.supplierid='" . $_SESSION['PaymentDetail']->SupplierID . "'"; + SET lastpaiddate = '" . FormatDateForSQL($_SESSION['PaymentDetail' . $identifier]->DatePaid) . "', + lastpaid='" . $_SESSION['PaymentDetail' . $identifier]->Amount ."' + WHERE suppliers.supplierid='" . $_SESSION['PaymentDetail' . $identifier]->SupplierID . "'"; @@ -461,7 +466,7 @@ $DbgMsg = _('Cannot update the supplier record for the date of the last payment made using the SQL'); $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); - $_SESSION['PaymentDetail']->Narrative = $_SESSION['PaymentDetail']->SupplierID . '-' . $_SESSION['PaymentDetail']->Narrative; + $_SESSION['PaymentDetail' . $identifier]->Narrative = $_SESSION['PaymentDetail' . $identifier]->SupplierID . '-' . $_SESSION['PaymentDetail' . $identifier]->Narrative; if ($_SESSION['CompanyRecord']['gllink_creditors']==1){ /* then do the supplier control GLTrans */ /* Now debit creditors account with payment + discount */ @@ -475,16 +480,16 @@ amount) "; $SQL=$SQL . "VALUES (22, '" . $TransNo . "', - '" . FormatDateForSQL($_SESSION['PaymentDetail']->DatePaid) . "', + '" . FormatDateForSQL($_SESSION['PaymentDetail' . $identifier]->DatePaid) . "', '" . $PeriodNo . "', '" . $_SESSION['CompanyRecord']['creditorsact'] . "', - '" . $_SESSION['PaymentDetail']->Narrative . "', + '" . $_SESSION['PaymentDetail' . $identifier]->Narrative . "', '" . $CreditorTotal . "')"; $ErrMsg = _('Cannot insert a GL transaction for the creditors account debit because'); $DbgMsg = _('Cannot insert a GL transaction for the creditors account debit using the SQL'); $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); - if ($_SESSION['PaymentDetail']->Discount !=0){ + if ($_SESSION['PaymentDetail' . $identifier]->Discount !=0){ /* Now credit Discount received account with discounts */ $SQL="INSERT INTO gltrans ( type, typeno, @@ -495,11 +500,11 @@ amount) VALUES (22, '" . $TransNo . "', - '" . FormatDateForSQL($_SESSION['PaymentDetail']->DatePaid) . "', + '" . FormatDateForSQL($_SESSION['PaymentDetail' . $identifier]->DatePaid) . "', '" . $PeriodNo . "', '" . $_SESSION['CompanyRecord']['pytdiscountact'] . "', - '" . $_SESSION['PaymentDetail']->Narrative . "', - '" . (-$_SESSION['PaymentDetail']->Discount/$_SESSION['PaymentDetail']->ExRate/$_SESSION['PaymentDetail']->FunctionalExRate) . "' + '" . $_SESSION['PaymentDetail' . $identifier]->Narrative . "', + '" . (-$_SESSION['PaymentDetail' . $identifier]->Discount/$_SESSION['PaymentDetail' . $identifier]->ExRate/$_SESSION['PaymentDetail' . $identifier]->FunctionalExRate) . "' )"; $ErrMsg = _('Cannot insert a GL transaction for the payment discount credit because'); $DbgMsg = _('Cannot insert a GL transaction for the payment discount credit using the SQL'); @@ -511,7 +516,7 @@ if ($_SESSION['CompanyRecord']['gllink_creditors']==1){ /* then do the common GLTrans */ - if ($_SESSION['PaymentDetail']->Amount !=0){ + if ($_SESSION['PaymentDetail' . $identifier]->Amount !=0){ /* Bank account entry first */ $SQL = "INSERT INTO gltrans ( type, typeno, @@ -522,11 +527,11 @@ amount) VALUES ('" . $TransType . "', '" . $TransNo . "', - '" . FormatDateForSQL($_SESSION['PaymentDetail']->DatePaid) . "', + '" . FormatDateForSQL($_SESSION['PaymentDetail' . $identifier]->DatePaid) . "', '" . $PeriodNo . "', - '" . $_SESSION['PaymentDetail']->Account . "', - '" . $_SESSION['PaymentDetail']->Narrative . "', - '" . (-$_SESSION['PaymentDetail']->Amount/$_SESSION['PaymentDetail']->ExRate/$_SESSION['PaymentDetail']->FunctionalExRate) . "')"; + '" . $_SESSION['PaymentDetail' . $identifier]->Account . "', + '" . $_SESSION['PaymentDetail' . $identifier]->Narrative . "', + '" . (-$_SESSION['PaymentDetail' . $identifier]->Amount/$_SESSION['PaymentDetail' . $identifier]->ExRate/$_SESSION['PaymentDetail' . $identifier]->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'); @@ -550,21 +555,21 @@ currcode) VALUES ('" . $TransNo . "', '" . $TransType . "', - '" . $_SESSION['PaymentDetail']->Account . "', - '" . $_SESSION['PaymentDetail']->Narrative . "', - '" . $_SESSION['PaymentDetail']->ExRate . "', - '" . $_SESSION['PaymentDetail']->FunctionalExRate . "', - '" . FormatDateForSQL($_SESSION['PaymentDetail']->DatePaid) . "', - '" . $_SESSION['PaymentDetail']->Paymenttype . "', - '" . -$_SESSION['PaymentDetail']->Amount . "', - '" . $_SESSION['PaymentDetail']->Currency . "' + '" . $_SESSION['PaymentDetail' . $identifier]->Account . "', + '" . $_SESSION['PaymentDetail' . $identifier]->Narrative . "', + '" . $_SESSION['PaymentDetail' . $identifier]->ExRate . "', + '" . $_SESSION['PaymentDetail' . $identifier]->FunctionalExRate . "', + '" . FormatDateForSQL($_SESSION['PaymentDetail' . $identifier]->DatePaid) . "', + '" . $_SESSION['PaymentDetail' . $identifier]->Paymenttype . "', + '" . -$_SESSION['PaymentDetail' . $identifier]->Amount . "', + '" . $_SESSION['PaymentDetail' . $identifier]->Currency . "' )"; $ErrMsg = _('Cannot insert a bank transaction because'); $DbgMsg = _('Cannot insert a bank transaction using the SQL'); $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); } else { - foreach ($_SESSION['PaymentDetail']->GLItems as $PaymentItem) { + foreach ($_SESSION['PaymentDetail' . $identifier]->GLItems as $PaymentItem) { $SQL="INSERT INTO banktrans (transno, type, bankact, @@ -577,14 +582,14 @@ currcode) VALUES ('" . $TransNo . "', '" . $TransType . "', - '" . $_SESSION['PaymentDetail']->Account . "', - '" . $_SESSION['PaymentDetail']->Narrative . "', - '" . $_SESSION['PaymentDetail']->ExRate . "', - '" . $_SESSION['PaymentDetail']->FunctionalExRate . "', - '" . FormatDateForSQL($_SESSION['PaymentDetail']->DatePaid) . "', - '" . $_SESSION['PaymentDetail']->Paymenttype . "', + '" . $_SESSION['PaymentDetail' . $identifier]->Account . "', + '" . $_SESSION['PaymentDetail' . $identifier]->Narrative . "', + '" . $_SESSION['PaymentDetail' . $identifier]->ExRate . "', + '" . $_SESSION['PaymentDetail' . $identifier]->FunctionalExRate . "', + '" . FormatDateForSQL($_SESSION['PaymentDetail' . $identifier]->DatePaid) . "', + '" . $_SESSION['PaymentDetail' . $identifier]->Paymenttype . "', '" . -$PaymentItem->Amount . "', - '" . $_SESSION['PaymentDetail']->Currency . "' )"; + '" . $_SESSION['PaymentDetail' . $identifier]->Currency . "' )"; $ErrMsg = _('Cannot insert a bank transaction because'); $DbgMsg = _('Cannot insert a bank transaction using the SQL'); @@ -595,7 +600,7 @@ DB_Txn_Commit($db); prnMsg(_('Payment') . ' ' . $TransNo . ' ' . _('has been successfully entered'),'success'); - $LastSupplier = ($_SESSION['PaymentDetail']->SupplierID); + $LastSupplier = ($_SESSION['PaymentDetail' . $identifier]->SupplierID); unset($_POST['BankAccount']); unset($_POST['DatePaid']); @@ -605,8 +610,8 @@ unset($_POST['Narrative']); unset($_POST['Amount']); unset($_POST['Discount']); - unset($_SESSION['PaymentDetail']->GLItems); - unset($_SESSION['PaymentDetail']); + unset($_SESSION['PaymentDetail' . $identifier]->GLItems); + unset($_SESSION['PaymentDetail' . $identifier]); /*Set up a newy in case user wishes to enter another */ if (isset($LastSupplier) and $LastSupplier!='') { @@ -617,7 +622,7 @@ echo '<br /><a href="' . $rootpath . '/Payments.php?SupplierID=' . $LastSupplier . '">' . _('Enter another Payment for') . ' ' . $myrow['suppname'] . '</a>'; } else { - echo '<br /><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) .'">' . _('Enter another General Ledger Payment') . '</a><br />'; + echo '<br /><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">' . _('Enter another General Ledger Payment') . '</a><br />'; } } @@ -626,7 +631,7 @@ } elseif (isset($_GET['Delete'])){ /* User hit delete the receipt entry from the batch */ - $_SESSION['PaymentDetail']->Remove_GLItem($_GET['Delete']); + $_SESSION['PaymentDetail' . $identifier]->Remove_GLItem($_GET['Delete']); } elseif (isset($_POST['Process']) AND !$BankAccountEmpty){ //user hit submit a new GL Analysis line into the payment @@ -648,7 +653,7 @@ prnMsg( _('The Cheque/Voucher number has already been used') . ' - ' . _('This GL analysis item could not be added'),'error'); } else { $myrow = DB_fetch_array($Result); - $_SESSION['PaymentDetail']->add_to_glanalysis(filter_number_format($_POST['GLAmount']), + $_SESSION['PaymentDetail' . $identifier]->add_to_glanalysis(filter_number_format($_POST['GLAmount']), $_POST['GLNarrative'], $_POST['GLManualCode'], $myrow['accountname'], @@ -664,7 +669,7 @@ $SQL = "SELECT accountname FROM chartmaster WHERE accountcode='" . $_POST['GLCode'] . "'"; $Result=DB_query($SQL,$db); $myrow=DB_fetch_array($Result); - $_SESSION['PaymentDetail']->add_to_glanalysis(filter_number_format($_POST['GLAmount']), + $_SESSION['PaymentDetail' . $identifier]->add_to_glanalysis(filter_number_format($_POST['GLAmount']), $_POST['GLNarrative'], $_POST['GLCode'], $myrow['accountname'], @@ -690,14 +695,14 @@ if (isset($_POST['DatePaid']) AND ($_POST['DatePaid']=='' - OR !Is_Date($_SESSION['PaymentDetail']->DatePaid))){ + OR !Is_Date($_SESSION['PaymentDetail' . $identifier]->DatePaid))){ $_POST['DatePaid']= Date($_SESSION['DefaultDateFormat']); - $_SESSION['PaymentDetail']->DatePaid = $_POST['DatePaid']; + $_SESSION['PaymentDetail' . $identifier]->DatePaid = $_POST['DatePaid']; } -if ($_SESSION['PaymentDetail']->Currency=='' AND $_SESSION['PaymentDetail']->SupplierID==''){ - $_SESSION['PaymentDetail']->Currency=$_SESSION['CompanyRecord']['currencydefault']; +if ($_SESSION['PaymentDetail' . $identifier]->Currency=='' AND $_SESSION['PaymentDetail' . $identifier]->SupplierID==''){ + $_SESSION['PaymentDetail' . $identifier]->Currency=$_SESSION['CompanyRecord']['currencydefault']; } @@ -715,29 +720,29 @@ if (DB_num_rows($result)==1){ $myrow = DB_fetch_row($result); - $_SESSION['PaymentDetail']->BankAccountName = $myrow[0]; + $_SESSION['PaymentDetail' . $identifier]->BankAccountName = $myrow[0]; unset($result); } elseif (DB_num_rows($result)==0){ prnMsg( _('The bank account number') . ' ' . $_POST['BankAccount'] . ' ' . _('is not set up as a bank account with a valid general ledger account'),'error'); } } -echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">'; +echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'] . '?identifier=' . $identifier) . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p><table class="selection">'; echo '<tr><th colspan="4"><font size="3" color="blue">' . _('Payment'); -if ($_SESSION['PaymentDetail']->SupplierID!=''){ - echo ' ' . _('to') . ' ' . $_SESSION['PaymentDetail']->SuppName; +if ($_SESSION['PaymentDetail' . $identifier]->SupplierID!=''){ + echo ' ' . _('to') . ' ' . $_SESSION['PaymentDetail' . $identifer]->SuppName; } -if ($_SESSION['PaymentDetail']->BankAccountName!=''){ - echo ' ' . _('from the') . ' ' . $_SESSION['PaymentDetail']->BankAccountName; +if ($_SESSION['PaymentDetail' . $identifier]->BankAccountName!=''){ + echo ' ' . _('from the') . ' ' . $_SESSION['PaymentDetail' . $identifier]->BankAccountName; } -echo ' ' . _('on') . ' ' . $_SESSION['PaymentDetail']->DatePaid . '</font></th></tr>'; +echo ' ' . _('on') . ' ' . $_SESSION['PaymentDetail' . $identifier]->DatePaid . '</font></th></tr>'; $SQL = "SELECT bankaccountname, bankaccounts.accountcode, @@ -777,11 +782,11 @@ echo '<tr> <td>' . _('Date Paid') . ':</td> - <td><input type="text" name="DatePaid" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" maxlength="10" size="11" onChange="isDate(this, this.value, '."'".$_SESSION['DefaultDateFormat']."'".')" value="' . $_SESSION['PaymentDetail']->DatePaid . '" /></td> + <td><input type="text" name="DatePaid" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" maxlength="10" size="11" onChange="isDate(this, this.value, '."'".$_SESSION['DefaultDateFormat']."'".')" value="' . $_SESSION['PaymentDetail' . $identifier]->DatePaid . '" /></td> </tr>'; -if ($_SESSION['PaymentDetail']->SupplierID==''){ +if ($_SESSION['PaymentDetail' . $identifier]->SupplierID==''){ echo '<tr><td>' . _('Currency of Payment') . ':</td> <td><select name="Currency" onChange="ReloadForm(UpdateHeader)">'; $SQL = "SELECT currency, currabrev, rate FROM currencies"; @@ -793,7 +798,7 @@ prnMsg( _('No currencies are defined yet. Payments cannot be entered until a currency is defined'),'error'); } else { while ($myrow=DB_fetch_array($result)){ - if ($_SESSION['PaymentDetail']->Currency==$myrow['currabrev']){ + if ($_SESSION['PaymentDetail' . $identifier]->Currency==$myrow['currabrev']){ echo '<option selected="selected" value="' . $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; } else { echo '<option value="' . $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; @@ -806,17 +811,16 @@ } else { /*its a supplier payment so it must be in the suppliers currency */ echo '<tr> <td>' . _('Supplier Currency') . ':</td> - <td>' . $_SESSION['PaymentDetail']->Currency . '</td> + <td>' . $_SESSION['PaymentDetail' . $identifier]->Currency . '</td> </tr>'; - echo '<input type="hidden" name="Currency" value="' . $_SESSION['PaymentDetail']->Currency . '" />'; + echo '<input type="hidden" name="Currency" value="' . $_SESSION['PaymentDetail' . $identifier]->Currency . '" />'; /*get the default rate from the currency table if it has not been set */ if (!isset($_POST['ExRate']) OR $_POST['ExRate']==''){ - $SQL = "SELECT rate FROM currencies WHERE currabrev='" . $_SESSION['PaymentDetail']->Currency ."'"; + $SQL = "SELECT rate FROM currencies WHERE currabrev='" . $_SESSION['PaymentDetail' . $identifier]->Currency ."'"; $Result=DB_query($SQL,$db); $myrow=DB_fetch_row($Result); $_POST['ExRate']=locale_number_format($myrow[0],'Variable'); } - } if (!isset($_POST['ExRate'])){ @@ -826,7 +830,7 @@ if (!isset($_POST['FunctionalExRate'])){ $_POST['FunctionalExRate']=1; } -if ($_SESSION['PaymentDetail']->AccountCurrency!=$_SESSION['PaymentDetail']->Currency AND isset($_SESSION['PaymentDetail']->AccountCurrency)){ +if ($_SESSION['PaymentDetail' . $identifier]->AccountCurrency!=$_SESSION['PaymentDetail' . $identifier]->Currency AND isset($_SESSION['PaymentDetail' . $identifier]->AccountCurrency)){ if (isset($SuggestedExRate)){ $SuggestedExRateText = '<b>' . _('Suggested rate:') . ' ' . locale_number_format($SuggestedExRate,6) . '</b>'; } else { @@ -838,12 +842,12 @@ echo '<tr> <td>' . _('Payment Exchange Rate') . ':</td> <td><input class="number" type="text" name="ExRate" maxlength="10" size="12" value="' . $_POST['ExRate'] . '" /></td> - <td>' . $SuggestedExRateText . ' <i>' . _('The exchange rate between the currency of the bank account currency and the currency of the payment') . '. 1 ' . $_SESSION['PaymentDetail']->AccountCurrency . ' = ? ' . $_SESSION['PaymentDetail']->Currency . '</i></td> + <td>' . $SuggestedExRateText . ' <i>' . _('The exchange rate between the currency of the bank account currency and the currency of the payment') . '. 1 ' . $_SESSION['PaymentDetail' . $identifier]->AccountCurrency . ' = ? ' . $_SESSION['PaymentDetail' . $identifier]->Currency . '</i></td> </tr>'; } -if ($_SESSION['PaymentDetail']->AccountCurrency!=$_SESSION['CompanyRecord']['currencydefault'] - AND isset($_SESSION['PaymentDetail']->AccountCurrency)){ +if ($_SESSION['PaymentDetail' . $identifier]->AccountCurrency!=$_SESSION['CompanyRecord']['currencydefault'] + AND isset($_SESSION['PaymentDetail' . $identifier]->AccountCurrency)){ if (isset($SuggestedFunctionalExRate)){ $SuggestedFunctionalExRateText = '<b>' . _('Suggested rate:') . ' ' . locale_number_format($SuggestedFunctionalExRate,6) . '</b>'; } else { @@ -855,7 +859,7 @@ echo '<tr> <td>' . _('Functional Exchange Rate') . ':</td> <td><input type="text" name="FunctionalExRate" maxlength="10" size="12" value="' . $_POST['FunctionalExRate'] . '" /></td> - <td>' . ' ' . $SuggestedFunctionalExRateText . ' <i>' . _('The exchange rate between the currency of the business (the functional currency) and the currency of the bank account') . '. 1 ' . $_SESSION['CompanyRecord']['currencydefault'] . ' = ? ' . $_SESSION['PaymentDetail']->AccountCurrency . '</i></td> + <td>' . ' ' . $SuggestedFunctionalExRateText . ' <i>' . _('The exchange rate between the currency of the business (the functional currency) and the currency of the bank account') . '. 1 ' . $_SESSION['CompanyRecord']['currencydefault'] . ' = ? ' . $_SESSION['PaymentDetail' . $identifier]->AccountCurrency . '</i></td> </tr>'; } echo '<tr> @@ -902,7 +906,7 @@ echo '</table><br />'; -if ($_SESSION['CompanyRecord']['gllink_creditors']==1 AND $_SESSION['PaymentDetail']->SupplierID==''){ +if ($_SESSION['CompanyRecord']['gllink_creditors']==1 AND $_SESSION['PaymentDetail' . $identifier]->SupplierID==''){ /* Set upthe form for the transaction entry for a GL Payment Analysis item */ echo '<br /><table class="selection">'; @@ -1023,11 +1027,11 @@ if (isset($_POST['GLAmount'])) { echo '<tr> - <td>' . _('Amount') . ' (' . $_SESSION['PaymentDetail']->Currency . '):</td> + <td>' . _('Amount') . ' (' . $_SESSION['PaymentDetail' . $identifier]->Currency . '):</td> <td><input type="text" name="GLAmount" maxlength="12" size="12" class="number" value="' . $_POST['GLAmount'] . '" /></td> </tr>'; } else { - echo '<tr><td>' . _('Amount') . ' (' . $_SESSION['PaymentDetail']->Currency . '):</td> + echo '<tr><td>' . _('Amount') . ' (' . $_SESSION['PaymentDetail' . $identifier]->Currency . '):</td> <td><input type="text" name="GLAmount" maxlength="12" size="12" class="number" /></td> </tr>'; } @@ -1038,19 +1042,19 @@ <input type="submit" name="Cancel" value="' . _('Cancel') . '" /> </div>'; - if (sizeOf($_SESSION['PaymentDetail']->GLItems)>0) { + if (sizeOf($_SESSION['PaymentDetail' . $identifier]->GLItems)>0) { echo '<br /> <table class="selection"> <tr> <th>' . _('Cheque No').'</th> - <th>' . _('Amount') . ' (' . $_SESSION['PaymentDetail']->Currency . ')</th> + <th>' . _('Amount') . ' (' . $_SESSION['PaymentDetail' . $identifier]->Currency . ')</th> <th>' . _('GL Account') . '</th> <th>' . _('Narrative') . '</th> <th>' . _('Tag') . '</th> </tr>'; $PaymentTotal = 0; - foreach ($_SESSION['PaymentDetail']->GLItems as $PaymentItem) { + foreach ($_SESSION['PaymentDetail' . $identifier]->GLItems as $PaymentItem) { $Tagsql="SELECT tagdescription from tags where tagref='" . $PaymentItem->Tag . "'"; $TagResult=DB_query($Tagsql, $db); $TagMyrow=DB_fetch_row($TagResult); @@ -1062,17 +1066,17 @@ echo '<tr> <td>' . $PaymentItem->Cheque . '</td> - <td class="number">' . locale_number_format($PaymentItem->Amount,$_SESSION['PaymentDetail']->CurrDecimalPlaces) . '</td> + <td class="number">' . locale_number_format($PaymentItem->Amount,$_SESSION['PaymentDetail' . $identifier]->CurrDecimalPlaces) . '</td> <td>' . $PaymentItem->GLCode . ' - ' . $PaymentItem->GLActName . '</td> <td>' . stripslashes($PaymentItem->Narrative) . '</td> <td>' . $PaymentItem->Tag . ' - ' . $TagName . '</td> - <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?Delete=' . $PaymentItem->ID . '" onclick="return confirm(\'' . _('Are you sure you wish to delete this payment analysis item?') . '\');">' . _('Delete') . '</a></td> + <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'] . '?identifier=' . $identifier) . '?Delete=' . $PaymentItem->ID . '" onclick="return confirm(\'' . _('Are you sure you wish to delete this payment analysis item?') . '\');">' . _('Delete') . '</a></td> </tr>'; $PaymentTotal += $PaymentItem->Amount; } echo '<tr> <td></td> - <td class="number"><b>' . locale_number_format($PaymentTotal,$_SESSION['PaymentDetail']->CurrDecimalPlaces) . '</b></td> + <td class="number"><b>' . locale_number_format($PaymentTotal,$_SESSION['PaymentDetail' . $identifier]->CurrDecimalPlaces) . '</b></td> <td></td> <td></td> <td></td> @@ -1088,16 +1092,16 @@ echo '<table class="selection"> <tr> - <td>' . _('Amount of Payment') . ' ' . $_SESSION['PaymentDetail']->Currency . ':</td> - <td><input class="number" type="text" name="Amount" maxlength="12" size="13" value="' . $_SESSION['PaymentDetail']->Amount . '" /></td> + <td>' . _('Amount of Payment') . ' ' . $_SESSION['PaymentDetail' . $identifier]->Currency . ':</td> + <td><input class="number" type="text" name="Amount" maxlength="12" size="13" value="' . $_SESSION['PaymentDetail' . $identifier]->Amount . '" /></td> </tr>'; - if (isset($_SESSION['PaymentDetail']->SupplierID)){ /*So it is a supplier payment so show the discount entry item */ + if (isset($_SESSION['PaymentDetail' . $identifier]->SupplierID)){ /*So it is a supplier payment so show the discount entry item */ echo '<tr> <td>' . _('Amount of Discount') . ':</td> - <td><input class="number" type="text" name="Discount" maxlength="12" size="13" value="' . $_SESSION['PaymentDetail']->Discount . '" /></td> + <td><input class="number" type="text" name="Discount" maxlength="12" size="13" value="' . $_SESSION['PaymentDetail' . $identifier]->Discount . '" /></td> </tr>'; - echo '<input type="hidden" name="SuppName" value="' . $_SESSION['PaymentDetail']->SuppName . '" />'; + echo '<input type="hidden" name="SuppName" value="' . $_SESSION['PaymentDetail' . $identifier]->SuppName . '" />'; } else { echo '<input type="hidden" name="Discount" Value="0" />'; } @@ -1107,4 +1111,4 @@ echo '</form>'; include('includes/footer.inc'); -?> \ No newline at end of file +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ex...@us...> - 2012-01-30 05:01:41
|
Revision: 4852 http://web-erp.svn.sourceforge.net/web-erp/?rev=4852&view=rev Author: ExsonQu Date: 2012-01-30 05:01:35 +0000 (Mon, 30 Jan 2012) Log Message: ----------- Fixed for $_SESSION overwritten to print Cheque Modified Paths: -------------- trunk/Payments.php Modified: trunk/Payments.php =================================================================== --- trunk/Payments.php 2012-01-30 01:15:22 UTC (rev 4851) +++ trunk/Payments.php 2012-01-30 05:01:35 UTC (rev 4852) @@ -278,7 +278,7 @@ // it is a supplier payment by cheque and haven't printed yet so print cheque echo '<br /> - <a href="' . $rootpath . '/PrintCheque.php?ChequeNum=' . $_POST['ChequeNum'] . '">' . _('Print Cheque using pre-printed stationery') . '</a> + <a href="' . $rootpath . '/PrintCheque.php?ChequeNum=' . $_POST['ChequeNum'] . '&identifier=' . $identifier . '">' . _('Print Cheque using pre-printed stationery') . '</a> <br /> <br />'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ex...@us...> - 2012-01-30 05:01:41
|
Revision: 4852 http://web-erp.svn.sourceforge.net/web-erp/?rev=4852&view=rev Author: ExsonQu Date: 2012-01-30 05:01:35 +0000 (Mon, 30 Jan 2012) Log Message: ----------- Fixed for $_SESSION overwritten to print Cheque Modified Paths: -------------- trunk/Payments.php Modified: trunk/Payments.php =================================================================== --- trunk/Payments.php 2012-01-30 01:15:22 UTC (rev 4851) +++ trunk/Payments.php 2012-01-30 05:01:35 UTC (rev 4852) @@ -278,7 +278,7 @@ // it is a supplier payment by cheque and haven't printed yet so print cheque echo '<br /> - <a href="' . $rootpath . '/PrintCheque.php?ChequeNum=' . $_POST['ChequeNum'] . '">' . _('Print Cheque using pre-printed stationery') . '</a> + <a href="' . $rootpath . '/PrintCheque.php?ChequeNum=' . $_POST['ChequeNum'] . '&identifier=' . $identifier . '">' . _('Print Cheque using pre-printed stationery') . '</a> <br /> <br />'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ex...@us...> - 2012-01-31 04:18:47
|
Revision: 4857 http://web-erp.svn.sourceforge.net/web-erp/?rev=4857&view=rev Author: ExsonQu Date: 2012-01-31 04:18:41 +0000 (Tue, 31 Jan 2012) Log Message: ----------- Bug fix change ?Delete to &Delete Modified Paths: -------------- trunk/Payments.php Modified: trunk/Payments.php =================================================================== --- trunk/Payments.php 2012-01-30 21:03:38 UTC (rev 4856) +++ trunk/Payments.php 2012-01-31 04:18:41 UTC (rev 4857) @@ -1070,7 +1070,7 @@ <td>' . $PaymentItem->GLCode . ' - ' . $PaymentItem->GLActName . '</td> <td>' . stripslashes($PaymentItem->Narrative) . '</td> <td>' . $PaymentItem->Tag . ' - ' . $TagName . '</td> - <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'] . '?identifier=' . $identifier) . '?Delete=' . $PaymentItem->ID . '" onclick="return confirm(\'' . _('Are you sure you wish to delete this payment analysis item?') . '\');">' . _('Delete') . '</a></td> + <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'] . '?identifier=' . $identifier) . '&Delete=' . $PaymentItem->ID . '" onclick="return confirm(\'' . _('Are you sure you wish to delete this payment analysis item?') . '\');">' . _('Delete') . '</a></td> </tr>'; $PaymentTotal += $PaymentItem->Amount; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ex...@us...> - 2012-01-31 04:18:47
|
Revision: 4857 http://web-erp.svn.sourceforge.net/web-erp/?rev=4857&view=rev Author: ExsonQu Date: 2012-01-31 04:18:41 +0000 (Tue, 31 Jan 2012) Log Message: ----------- Bug fix change ?Delete to &Delete Modified Paths: -------------- trunk/Payments.php Modified: trunk/Payments.php =================================================================== --- trunk/Payments.php 2012-01-30 21:03:38 UTC (rev 4856) +++ trunk/Payments.php 2012-01-31 04:18:41 UTC (rev 4857) @@ -1070,7 +1070,7 @@ <td>' . $PaymentItem->GLCode . ' - ' . $PaymentItem->GLActName . '</td> <td>' . stripslashes($PaymentItem->Narrative) . '</td> <td>' . $PaymentItem->Tag . ' - ' . $TagName . '</td> - <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'] . '?identifier=' . $identifier) . '?Delete=' . $PaymentItem->ID . '" onclick="return confirm(\'' . _('Are you sure you wish to delete this payment analysis item?') . '\');">' . _('Delete') . '</a></td> + <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'] . '?identifier=' . $identifier) . '&Delete=' . $PaymentItem->ID . '" onclick="return confirm(\'' . _('Are you sure you wish to delete this payment analysis item?') . '\');">' . _('Delete') . '</a></td> </tr>'; $PaymentTotal += $PaymentItem->Amount; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ex...@us...> - 2012-03-20 14:52:06
|
Revision: 5113 http://web-erp.svn.sourceforge.net/web-erp/?rev=5113&view=rev Author: ExsonQu Date: 2012-03-20 14:51:55 +0000 (Tue, 20 Mar 2012) Log Message: ----------- 20/03/2012 Exson: Fixed Multi currency payment exchange rate errors in Payments.php. Reported by PakRichard Modified Paths: -------------- trunk/Payments.php Modified: trunk/Payments.php =================================================================== --- trunk/Payments.php 2012-03-20 14:24:08 UTC (rev 5112) +++ trunk/Payments.php 2012-03-20 14:51:55 UTC (rev 5113) @@ -838,6 +838,9 @@ } if ($_POST['ExRate']==1 AND isset($SuggestedExRate)){ $_POST['ExRate'] = locale_number_format($SuggestedExRate,6); + }elseif(isset($_POST['SuggestedExRate1']) and $_POST['ExRate']==locale_number_format($_POST['SuggestedExRate1'],6) and isset($SuggestedExRate)){ + $_POST['ExRate'] = locale_number_format($SuggestedExRate,6); + } echo '<tr> <td>' . _('Payment Exchange Rate') . ':</td> @@ -898,8 +901,12 @@ <td>' . _('Reference / Narrative') . ':</td> <td colspan="2"><input type="text" name="Narrative" maxlength="80" size="82" value="' . $_POST['Narrative'] . '" /> ' . _('(Max. length 80 characters)') . '</td> </tr>'; -echo '<tr> - <td colspan="3"><div class="centre"><input type="submit" name="UpdateHeader" value="' . _('Update'). '" /></td> +echo '<tr>'; + if(isset($SuggestedExRate)){ + echo '<td><input type="hidden" name="SuggestedExRate1" value="'.$SuggestedExRate.'" /></td>'; + } +echo ' + <td colspan="3"><div class="centre"><input type="submit" name="UpdateHeader" value="' . _('Update'). '" /></td> </tr>'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ex...@us...> - 2012-03-20 14:52:06
|
Revision: 5113 http://web-erp.svn.sourceforge.net/web-erp/?rev=5113&view=rev Author: ExsonQu Date: 2012-03-20 14:51:55 +0000 (Tue, 20 Mar 2012) Log Message: ----------- 20/03/2012 Exson: Fixed Multi currency payment exchange rate errors in Payments.php. Reported by PakRichard Modified Paths: -------------- trunk/Payments.php Modified: trunk/Payments.php =================================================================== --- trunk/Payments.php 2012-03-20 14:24:08 UTC (rev 5112) +++ trunk/Payments.php 2012-03-20 14:51:55 UTC (rev 5113) @@ -838,6 +838,9 @@ } if ($_POST['ExRate']==1 AND isset($SuggestedExRate)){ $_POST['ExRate'] = locale_number_format($SuggestedExRate,6); + }elseif(isset($_POST['SuggestedExRate1']) and $_POST['ExRate']==locale_number_format($_POST['SuggestedExRate1'],6) and isset($SuggestedExRate)){ + $_POST['ExRate'] = locale_number_format($SuggestedExRate,6); + } echo '<tr> <td>' . _('Payment Exchange Rate') . ':</td> @@ -898,8 +901,12 @@ <td>' . _('Reference / Narrative') . ':</td> <td colspan="2"><input type="text" name="Narrative" maxlength="80" size="82" value="' . $_POST['Narrative'] . '" /> ' . _('(Max. length 80 characters)') . '</td> </tr>'; -echo '<tr> - <td colspan="3"><div class="centre"><input type="submit" name="UpdateHeader" value="' . _('Update'). '" /></td> +echo '<tr>'; + if(isset($SuggestedExRate)){ + echo '<td><input type="hidden" name="SuggestedExRate1" value="'.$SuggestedExRate.'" /></td>'; + } +echo ' + <td colspan="3"><div class="centre"><input type="submit" name="UpdateHeader" value="' . _('Update'). '" /></td> </tr>'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ex...@us...> - 2012-05-14 02:33:28
|
Revision: 5355 http://web-erp.svn.sourceforge.net/web-erp/?rev=5355&view=rev Author: ExsonQu Date: 2012-05-14 02:33:22 +0000 (Mon, 14 May 2012) Log Message: ----------- 14/5/2012 Exson: Fixed bug that when users input a Exchang Rate manually, when ones changed minds and select another currency, it'll show the suggested rate correctly. Modified Paths: -------------- trunk/Payments.php Modified: trunk/Payments.php =================================================================== --- trunk/Payments.php 2012-05-14 02:21:45 UTC (rev 5354) +++ trunk/Payments.php 2012-05-14 02:33:22 UTC (rev 5355) @@ -841,7 +841,7 @@ } if ($_POST['ExRate']==1 AND isset($SuggestedExRate)){ $_POST['ExRate'] = locale_number_format($SuggestedExRate,6); - }elseif(isset($_POST['SuggestedExRate1']) and $_POST['ExRate']==locale_number_format($_POST['SuggestedExRate1'],6) and isset($SuggestedExRate)){ + }elseif($_POST['Currency'] != $_POST['PreviousCurrency'] and isset($SuggestedExRate)){ $_POST['ExRate'] = locale_number_format($SuggestedExRate,6); } @@ -903,12 +903,12 @@ echo '<tr> <td>' . _('Reference / Narrative') . ':</td> <td colspan="2"><input type="text" name="Narrative" maxlength="80" size="82" value="' . $_POST['Narrative'] . '" /> ' . _('(Max. length 80 characters)') . '</td> - </tr>'; -echo '<tr>'; - if(isset($SuggestedExRate)){ - echo '<td><input type="hidden" name="SuggestedExRate1" value="'.$SuggestedExRate.'" /></td>'; - } -echo ' + </tr> + + + <td><input type="hidden" name="PreviousCurrency" value="'.$_POST['Currency'].'" /></td> + + <td colspan="3"><div class="centre"><input type="submit" name="UpdateHeader" value="' . _('Update'). '" /></div></td> </tr>'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ex...@us...> - 2012-05-14 02:33:28
|
Revision: 5355 http://web-erp.svn.sourceforge.net/web-erp/?rev=5355&view=rev Author: ExsonQu Date: 2012-05-14 02:33:22 +0000 (Mon, 14 May 2012) Log Message: ----------- 14/5/2012 Exson: Fixed bug that when users input a Exchang Rate manually, when ones changed minds and select another currency, it'll show the suggested rate correctly. Modified Paths: -------------- trunk/Payments.php Modified: trunk/Payments.php =================================================================== --- trunk/Payments.php 2012-05-14 02:21:45 UTC (rev 5354) +++ trunk/Payments.php 2012-05-14 02:33:22 UTC (rev 5355) @@ -841,7 +841,7 @@ } if ($_POST['ExRate']==1 AND isset($SuggestedExRate)){ $_POST['ExRate'] = locale_number_format($SuggestedExRate,6); - }elseif(isset($_POST['SuggestedExRate1']) and $_POST['ExRate']==locale_number_format($_POST['SuggestedExRate1'],6) and isset($SuggestedExRate)){ + }elseif($_POST['Currency'] != $_POST['PreviousCurrency'] and isset($SuggestedExRate)){ $_POST['ExRate'] = locale_number_format($SuggestedExRate,6); } @@ -903,12 +903,12 @@ echo '<tr> <td>' . _('Reference / Narrative') . ':</td> <td colspan="2"><input type="text" name="Narrative" maxlength="80" size="82" value="' . $_POST['Narrative'] . '" /> ' . _('(Max. length 80 characters)') . '</td> - </tr>'; -echo '<tr>'; - if(isset($SuggestedExRate)){ - echo '<td><input type="hidden" name="SuggestedExRate1" value="'.$SuggestedExRate.'" /></td>'; - } -echo ' + </tr> + + + <td><input type="hidden" name="PreviousCurrency" value="'.$_POST['Currency'].'" /></td> + + <td colspan="3"><div class="centre"><input type="submit" name="UpdateHeader" value="' . _('Update'). '" /></div></td> </tr>'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <te...@us...> - 2012-09-04 04:29:22
|
Revision: 5622 http://web-erp.svn.sourceforge.net/web-erp/?rev=5622&view=rev Author: tehonu Date: 2012-09-04 04:29:17 +0000 (Tue, 04 Sep 2012) Log Message: ----------- Increase precision of exchange rate for countries with big currency numbers Modified Paths: -------------- trunk/Payments.php Modified: trunk/Payments.php =================================================================== --- trunk/Payments.php 2012-09-04 04:06:44 UTC (rev 5621) +++ trunk/Payments.php 2012-09-04 04:29:17 UTC (rev 5622) @@ -836,14 +836,14 @@ } if ($_SESSION['PaymentDetail' . $identifier]->AccountCurrency!=$_SESSION['PaymentDetail' . $identifier]->Currency AND isset($_SESSION['PaymentDetail' . $identifier]->AccountCurrency)){ if (isset($SuggestedExRate)){ - $SuggestedExRateText = '<b>' . _('Suggested rate:') . ' ' . locale_number_format($SuggestedExRate,6) . '</b>'; + $SuggestedExRateText = '<b>' . _('Suggested rate:') . ' ' . locale_number_format($SuggestedExRate,8) . '</b>'; } else { $SuggestedExRateText =''; } if ($_POST['ExRate']==1 AND isset($SuggestedExRate)){ - $_POST['ExRate'] = locale_number_format($SuggestedExRate,6); + $_POST['ExRate'] = locale_number_format($SuggestedExRate,8); }elseif($_POST['Currency'] != $_POST['PreviousCurrency'] and isset($SuggestedExRate)){ - $_POST['ExRate'] = locale_number_format($SuggestedExRate,6); + $_POST['ExRate'] = locale_number_format($SuggestedExRate,8); } echo '<tr> @@ -856,7 +856,7 @@ if ($_SESSION['PaymentDetail' . $identifier]->AccountCurrency!=$_SESSION['CompanyRecord']['currencydefault'] AND isset($_SESSION['PaymentDetail' . $identifier]->AccountCurrency)){ if (isset($SuggestedFunctionalExRate)){ - $SuggestedFunctionalExRateText = '<b>' . _('Suggested rate:') . ' ' . locale_number_format($SuggestedFunctionalExRate,6) . '</b>'; + $SuggestedFunctionalExRateText = '<b>' . _('Suggested rate:') . ' ' . locale_number_format($SuggestedFunctionalExRate,8) . '</b>'; } else { $SuggestedFunctionalExRateText =''; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <te...@us...> - 2012-09-04 04:29:23
|
Revision: 5622 http://web-erp.svn.sourceforge.net/web-erp/?rev=5622&view=rev Author: tehonu Date: 2012-09-04 04:29:17 +0000 (Tue, 04 Sep 2012) Log Message: ----------- Increase precision of exchange rate for countries with big currency numbers Modified Paths: -------------- trunk/Payments.php Modified: trunk/Payments.php =================================================================== --- trunk/Payments.php 2012-09-04 04:06:44 UTC (rev 5621) +++ trunk/Payments.php 2012-09-04 04:29:17 UTC (rev 5622) @@ -836,14 +836,14 @@ } if ($_SESSION['PaymentDetail' . $identifier]->AccountCurrency!=$_SESSION['PaymentDetail' . $identifier]->Currency AND isset($_SESSION['PaymentDetail' . $identifier]->AccountCurrency)){ if (isset($SuggestedExRate)){ - $SuggestedExRateText = '<b>' . _('Suggested rate:') . ' ' . locale_number_format($SuggestedExRate,6) . '</b>'; + $SuggestedExRateText = '<b>' . _('Suggested rate:') . ' ' . locale_number_format($SuggestedExRate,8) . '</b>'; } else { $SuggestedExRateText =''; } if ($_POST['ExRate']==1 AND isset($SuggestedExRate)){ - $_POST['ExRate'] = locale_number_format($SuggestedExRate,6); + $_POST['ExRate'] = locale_number_format($SuggestedExRate,8); }elseif($_POST['Currency'] != $_POST['PreviousCurrency'] and isset($SuggestedExRate)){ - $_POST['ExRate'] = locale_number_format($SuggestedExRate,6); + $_POST['ExRate'] = locale_number_format($SuggestedExRate,8); } echo '<tr> @@ -856,7 +856,7 @@ if ($_SESSION['PaymentDetail' . $identifier]->AccountCurrency!=$_SESSION['CompanyRecord']['currencydefault'] AND isset($_SESSION['PaymentDetail' . $identifier]->AccountCurrency)){ if (isset($SuggestedFunctionalExRate)){ - $SuggestedFunctionalExRateText = '<b>' . _('Suggested rate:') . ' ' . locale_number_format($SuggestedFunctionalExRate,6) . '</b>'; + $SuggestedFunctionalExRateText = '<b>' . _('Suggested rate:') . ' ' . locale_number_format($SuggestedFunctionalExRate,8) . '</b>'; } else { $SuggestedFunctionalExRateText =''; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <te...@us...> - 2013-08-20 01:48:50
|
Revision: 6260 http://sourceforge.net/p/web-erp/reponame/6260 Author: tehonu Date: 2013-08-20 01:48:47 +0000 (Tue, 20 Aug 2013) Log Message: ----------- Added ORDER BY accountname (If accountcode is not shown to user, order should be by name) Modified Paths: -------------- trunk/Payments.php Modified: trunk/Payments.php =================================================================== --- trunk/Payments.php 2013-08-19 13:06:10 UTC (rev 6259) +++ trunk/Payments.php 2013-08-20 01:48:47 UTC (rev 6260) @@ -763,7 +763,8 @@ bankaccounts.accountcode, bankaccounts.currcode FROM bankaccounts INNER JOIN chartmaster - ON bankaccounts.accountcode=chartmaster.accountcode"; + ON bankaccounts.accountcode=chartmaster.accountcode + ORDER BY bankaccountname"; $ErrMsg = _('The bank accounts could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve the bank accounts was'); |
From: <te...@us...> - 2013-08-22 01:52:30
|
Revision: 6286 http://sourceforge.net/p/web-erp/reponame/6286 Author: tehonu Date: 2013-08-22 01:52:26 +0000 (Thu, 22 Aug 2013) Log Message: ----------- Fixed bug preventing payments in foreigh currency. Solution provided by Tim. Modified Paths: -------------- trunk/Payments.php Modified: trunk/Payments.php =================================================================== --- trunk/Payments.php 2013-08-21 15:41:07 UTC (rev 6285) +++ trunk/Payments.php 2013-08-22 01:52:26 UTC (rev 6286) @@ -913,9 +913,7 @@ if (!isset($_POST['Narrative'])) { $_POST['Narrative']=''; } -if (!isset($_POST['Currency'])){ - $_POST['Currency'] = $_SESSION['CompanyRecord']['currencydefault']; -} + echo '<tr> <td>' . _('Reference / Narrative') . ':</td> <td colspan="2"><input type="text" name="Narrative" maxlength="80" size="82" value="' . stripslashes($_POST['Narrative'] ) . '" /> ' . _('(Max. length 80 characters)') . '</td> |
From: <ice...@us...> - 2013-10-14 04:17:49
|
Revision: 6352 http://sourceforge.net/p/web-erp/reponame/6352 Author: icedlava Date: 2013-10-14 04:17:47 +0000 (Mon, 14 Oct 2013) Log Message: ----------- Payments.php - SQL error due to incorrect variable name, fixed. Modified Paths: -------------- trunk/Payments.php Modified: trunk/Payments.php =================================================================== --- trunk/Payments.php 2013-10-12 16:40:02 UTC (rev 6351) +++ trunk/Payments.php 2013-10-14 04:17:47 UTC (rev 6352) @@ -124,7 +124,7 @@ } if (isset($_GET['Amount']) AND is_numeric($_GET['Amount'])){ $_SESSION['PaymentDetail' . $identifier]->Amount = filter_number_format($_GET['Amount']); - } + } } } @@ -165,8 +165,8 @@ if (isset($_POST['Currency']) AND $_POST['Currency']!=''){ /* Payment currency is the currency that is being paid */ $_SESSION['PaymentDetail' . $identifier]->Currency=$_POST['Currency']; //payment currency - - + + if ($_SESSION['PaymentDetail' . $identifier]->AccountCurrency==$_SESSION['CompanyRecord']['currencydefault']){ $_POST['FunctionalExRate']=1; $_SESSION['PaymentDetail' . $identifier]->FunctionalExRate=1; @@ -188,8 +188,8 @@ $SuggestedFunctionalExRate = $myrow[0]; } - - + + if ($_POST['Currency']==$_SESSION['PaymentDetail' . $identifier]->AccountCurrency){ /* if the currency being paid is the same as the bank account currency then default ex rate to 1 */ $_POST['ExRate']=1; @@ -634,8 +634,8 @@ $SupplierResult = DB_query($SupplierSQL, $db); $SupplierRow = DB_fetch_array($SupplierResult); $TransSQL = "SELECT id FROM supptrans WHERE type=22 AND transno='" . $TransNo . "'"; - $TransResult = DB_query($IdSQL, $db); - $TransRow = DB_fetch_array($IdResult); + $TransResult = DB_query($TransSQL, $db); + $TransRow = DB_fetch_array($TransResult); echo '<br /><a href="' . $RootPath . '/SupplierAllocations.php?AllocTrans=' . $TransRow['id'] . '">' . _('Allocate this payment') . '</a>'; echo '<br /><a href="' . $RootPath . '/Payments.php?SupplierID=' . $LastSupplier . '">' . _('Enter another Payment for') . ' ' . $SupplierRow['suppname'] . '</a>'; } else { @@ -1135,4 +1135,4 @@ echo '</form>'; include('includes/footer.inc'); -?> \ No newline at end of file +?> |
From: <ex...@us...> - 2014-11-20 11:39:02
|
Revision: 6994 http://sourceforge.net/p/web-erp/reponame/6994 Author: exsonqu Date: 2014-11-20 11:38:52 +0000 (Thu, 20 Nov 2014) Log Message: ----------- 20/11/14 Exson: Fixed the pop up error when input account no in Payments.php by align the js function with applying it. The fixes are mismatched before. Hope it's the last time. Modified Paths: -------------- trunk/Payments.php Modified: trunk/Payments.php =================================================================== --- trunk/Payments.php 2014-11-20 01:23:59 UTC (rev 6993) +++ trunk/Payments.php 2014-11-20 11:38:52 UTC (rev 6994) @@ -967,12 +967,12 @@ if (isset($_POST['GLManualCode'])) { echo '<tr> <td>' . _('Enter GL Account Manually') . ':</td> - <td><input type="text" name="GLManualCode" maxlength="12" size="12" onchange="return inArray(this.value, GLCode.options,\'' . _('The account code') . ' \' + this.value + \' ' . _('doesnt exist') . '\')" value="'. $_POST['GLManualCode'] .'" /></td> + <td><input type="text" name="GLManualCode" maxlength="12" size="12" onchange="return inArray(this, GLCode.options,\'' . _('The account code') . ' \' + this.value + \' ' . _('doesnt exist') . '\')" value="'. $_POST['GLManualCode'] .'" /></td> </tr>'; } else { echo '<tr> <td>' . _('Enter GL Account Manually') . ':</td> - <td><input type="text" name="GLManualCode" maxlength="12" size="12" onchange="return inArray(this.value, GLCode.options,\'' . _('The account code') . ' \' + this.value + \' ' . _('doesnt exist') . '\')" /></td> + <td><input type="text" name="GLManualCode" maxlength="12" size="12" onchange="return inArray(this, GLCode.options,\'' . _('The account code') . ' \' + this.value + \' ' . _('doesnt exist') . '\')" /></td> </tr>'; } @@ -1142,4 +1142,4 @@ echo '</form>'; include('includes/footer.inc'); -?> \ No newline at end of file +?> |
From: <ex...@us...> - 2015-04-01 09:50:34
|
Revision: 7252 http://sourceforge.net/p/web-erp/reponame/7252 Author: exsonqu Date: 2015-04-01 09:50:32 +0000 (Wed, 01 Apr 2015) Log Message: ----------- 01/04/15 Exson: Fixed the bug that when delete one gl item from the payment details, the bank account related setting will disappeared in Payments.php. Reported by Steven. Modified Paths: -------------- trunk/Payments.php Modified: trunk/Payments.php =================================================================== --- trunk/Payments.php 2015-04-01 01:39:31 UTC (rev 7251) +++ trunk/Payments.php 2015-04-01 09:50:32 UTC (rev 7252) @@ -627,6 +627,15 @@ } elseif (isset($_GET['Delete'])){ /* User hit delete the receipt entry from the batch */ $_SESSION['PaymentDetail' . $identifier]->Remove_GLItem($_GET['Delete']); + //recover the bank account relative setting + $_POST['BankAccount'] = $_SESSION['PaymentDetail'.$identifier]->Account; + $_POST['DatePaid'] = $_SESSION['PaymentDetail'.$identifier]->DatePaid; + $_POST['Currency'] = $_SESSION['PaymentDetail'.$identifier]->Currency; + $_POST['ExRate'] = $_SESSION['PaymentDetail'.$identifier]->ExRate; + $_POST['FunctionalExRate'] = $_SESSION['PaymentDetail'.$identifier]->FunctionalExRate; + $_POST['PaymentType'] = $_SESSION['PaymentDetail'.$identifier]->Paymenttype; + $_POST['BankTransRef'] = $_SESSION['PaymentDetail'.$identifier]->BankTransRef; + $_POST['Narrative'] = $_SESSION['PaymentDetail'.$identifier]->Narrative; } elseif (isset($_POST['Process']) AND !$BankAccountEmpty){ //user hit submit a new GL Analysis line into the payment |