From: <dai...@us...> - 2011-05-23 10:14:15
|
Revision: 4572 http://web-erp.svn.sourceforge.net/web-erp/?rev=4572&view=rev Author: daintree Date: 2011-05-23 10:14:06 +0000 (Mon, 23 May 2011) Log Message: ----------- various Modified Paths: -------------- trunk/Areas.php trunk/AuditTrail.php trunk/BankMatching.php trunk/BankReconciliation.php trunk/ContractBOM.php trunk/CreditStatus.php trunk/CustomerBranches.php trunk/CustomerInquiry.php trunk/CustomerReceipt.php trunk/DailySalesInquiry.php trunk/FTP_RadioBeacon.php trunk/FreightCosts.php trunk/GLTransInquiry.php trunk/GoodsReceived.php trunk/PO_Header.php trunk/PO_Items.php trunk/PO_SelectOSPurchOrder.php trunk/PaymentMethods.php trunk/PaymentTerms.php trunk/SelectProduct.php trunk/StockQties_csv.php trunk/SuppInvGRNs.php trunk/SuppTransGLAnalysis.php trunk/SupplierAllocations.php trunk/SupplierInvoice.php trunk/UpgradeDatabase.php trunk/WWW_Access.php trunk/doc/Change.log trunk/includes/DefinePOClass.php trunk/includes/DefineSuppAllocsClass.php trunk/includes/DefineSuppTransClass.php trunk/includes/PO_ReadInOrder.inc trunk/includes/footer.inc trunk/index.php Removed Paths: ------------- trunk/SystemCheck.php Modified: trunk/Areas.php =================================================================== --- trunk/Areas.php 2011-05-16 10:46:50 UTC (rev 4571) +++ trunk/Areas.php 2011-05-23 10:14:06 UTC (rev 4572) @@ -1,7 +1,6 @@ <?php -/* $Revision: 1.22 $ */ + /* $Id$*/ -//$PageSecurity = 3; include('includes/session.inc'); @@ -163,7 +162,7 @@ echo '<td>' . $myrow[0] . '</td> <td>' . $myrow[1] . '</td>'; echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedArea=' . $myrow[0] . '">' . _('Edit') . '</a></td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedArea=' . $myrow[0] . '&delete=yes">' . _('Delete') . '</a></td>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedArea=' . $myrow[0] . '&delete=yes" onclick="return confirm(\'' . _('Are you sure you wish to delete this sales area?') . '\');">' . _('Delete') . '</a></td>'; echo '<td><a href="SelectCustomer.php'. '?Area=' . $myrow[0] . '">' . _('View Customers from this Area') . '</a></td>'; } //END WHILE LIST LOOP Modified: trunk/AuditTrail.php =================================================================== --- trunk/AuditTrail.php 2011-05-16 10:46:50 UTC (rev 4571) +++ trunk/AuditTrail.php 2011-05-23 10:14:06 UTC (rev 4572) @@ -30,7 +30,7 @@ echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<table class=selection>'; +echo '<table class="selection">'; echo '<tr><td>'. _('From Date') . ' ' . $_SESSION['DefaultDateFormat'] .'</td> <td><input tabindex="1" type=text class=date alt="'.$_SESSION['DefaultDateFormat'].'" name="FromDate" size="11" maxlength="10" value=' .$_POST['FromDate'].'></td></tr>'; @@ -40,7 +40,7 @@ // Show user selections echo '<tr><td>'. _('User ID'). '</td> <td><select tabindex="3" name="SelectedUser">'; -echo '<option value="ALL">' . _('ALL') . '</option>'; +echo '<option value="ALL">' . _('All') . '</option>'; while ($users = DB_fetch_row($UserResult)) { if (isset($_POST['SelectedUser']) and $users[0]==$_POST['SelectedUser']) { echo '<option selected value="' . $users[0] . '">' . $users[0] . '</option>'; @@ -53,7 +53,7 @@ // Show table selections echo '<tr><td>'. _('Table '). '</td> <td><select tabindex="4" name="SelectedTable">'; -echo '<option value="ALL">' . _('ALL') . '</option>'; +echo '<option value="ALL">' . _('All') . '</option>'; while ($tables = DB_fetch_row($TableResult)) { if (isset($_POST['SelectedTable']) and $tables[0]==$_POST['SelectedTable']) { echo '<option selected value=' . $tables[0] . '>' . $tables[0] . '</option>'; @@ -176,7 +176,7 @@ for ($i=1; $i<sizeof($_SESSION['SQLString']['fields']); $i++) { if (isset($_SESSION['SQLString']['values'][$i]) and (trim(str_replace("'","",$_SESSION['SQLString']['values'][$i])) != "") & (trim($_SESSION['SQLString']['fields'][$i]) != 'password') & - (trim($_SESSION['SQLString']['fields'][$i]) != "www_users.password")) { + (trim($_SESSION['SQLString']['fields'][$i]) != 'www_users.password')) { echo '<tr bgcolor="' . $RowColour . '">'; echo '<td></td> <td></td> Modified: trunk/BankMatching.php =================================================================== --- trunk/BankMatching.php 2011-05-16 10:46:50 UTC (rev 4571) +++ trunk/BankMatching.php 2011-05-23 10:14:06 UTC (rev 4572) @@ -1,10 +1,8 @@ <?php -/* $Revision: 1.23 $ */ + /* $Id$*/ -//$PageSecurity = 7; - -include("includes/session.inc"); +include('includes/session.inc'); $title = _('Bank Account Matching'); include('includes/header.inc'); @@ -29,9 +27,16 @@ exit; } +if (isset($_GET['Account'])) { + $_POST['BankAccount']=$_GET['Account']; + $_POST['ShowTransactions']=true; + $_POST['Ostg_or_All']='Ostg'; + $_POST['First20_or_All']='All'; +} + if (isset($_POST['Update']) AND $_POST['RowCounter']>1){ for ($Counter=1;$Counter <= $_POST['RowCounter']; $Counter++){ - if (isset($_POST["Clear_" . $Counter]) and $_POST["Clear_" . $Counter]==True){ + if (isset($_POST['Clear_' . $Counter]) AND $_POST['Clear_' . $Counter]==True){ /*Get amount to be cleared */ $sql = "SELECT amount, exrate @@ -79,13 +84,13 @@ echo '<table class=selection><tr>'; echo '<td align=left>' . _('Bank Account') . ':</td><td colspan=3><select tabindex="1" name="BankAccount">'; -$sql = 'SELECT accountcode, bankaccountname FROM bankaccounts'; +$sql = "SELECT accountcode, bankaccountname FROM bankaccounts"; $resultBankActs = DB_query($sql,$db); while ($myrow=DB_fetch_array($resultBankActs)){ if (isset($_POST['BankAccount']) and $myrow['accountcode']==$_POST['BankAccount']){ - echo "<option selected Value='" . $myrow['accountcode'] . "'>" . $myrow['bankaccountname']; + echo '<option selected value="' . $myrow['accountcode'] . '">' . $myrow['bankaccountname'] . '</option>'; } else { - echo "<option Value='" . $myrow['accountcode'] . "'>" . $myrow['bankaccountname']; + echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['bankaccountname'] . '</option>'; } } @@ -95,12 +100,12 @@ $_POST['BeforeDate'] = Date($_SESSION['DefaultDateFormat']); } if (!isset($_POST['AfterDate']) OR !Is_Date($_POST['AfterDate'])){ - $_POST['AfterDate'] = Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date("m")-3,Date("d"),Date("y"))); + $_POST['AfterDate'] = Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m')-3,Date('d'),Date('y'))); } // Change to allow input of FROM DATE and then TO DATE, instead of previous back-to-front method, add datepicker echo '<tr><td>' . _('Show') . ' ' . $TypeName . ' ' . _('from') . ':</td> - <td><input tabindex="3" type="text" name="AfterDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" size="12" maxlength="10" onChange="isDate(this, this.value, '."'".$_SESSION['DefaultDateFormat']."'".')" Value="' . $_POST['AfterDate'] . '"></td></tr>'; + <td><input tabindex="3" type="text" name="AfterDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" size="12" maxlength="10" onChange="isDate(this, this.value, '."'".$_SESSION['DefaultDateFormat']."'".')" value="' . $_POST['AfterDate'] . '"></td></tr>'; echo '<td>' . _('to') . ':</td> <td><input tabindex="2" type="text" name="BeforeDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" size="12" maxlength="10" onChange="isDate(this, this.value, '."'".$_SESSION['DefaultDateFormat']."'".')" Value="' . $_POST['BeforeDate'] . '"></td>'; @@ -108,29 +113,29 @@ <td><select tabindex="4" name="Ostg_or_All">'; if ($_POST['Ostg_or_All']=='All'){ - echo '<option selected Value="All">' . _('Show all') . ' ' . $TypeName . ' ' . _('in the date range'); - echo '<option Value="Ostdg">' . _('Show unmatched') . ' ' . $TypeName . ' ' . _('only'); + echo '<option selected value="All">' . _('Show all') . ' ' . $TypeName . ' ' . _('in the date range') . '</option>'; + echo '<option value="Ostdg">' . _('Show unmatched') . ' ' . $TypeName . ' ' . _('only') . '</option>'; } else { - echo '<option Value="All">' . _('Show all') . ' ' . $TypeName . ' ' . _('in the date range'); - echo '<option selected Value="Ostdg">' . _('Show unmatched') . ' ' . $TypeName . ' ' . _('only'); + echo '<option Value="All">' . _('Show all') . ' ' . $TypeName . ' ' . _('in the date range') . '</option>'; + echo '<option selected Value="Ostdg">' . _('Show unmatched') . ' ' . $TypeName . ' ' . _('only') . '</option>'; } echo '</select></td></tr>'; echo '<tr><td colspan=3>' . _('Choose to display only the first 20 matching') . ' ' . $TypeName . ' ' . _('or all') . ' ' . $TypeName . ' ' . _('meeting the criteria') . ':</td><td><select tabindex="5" name="First20_or_All">'; if ($_POST['First20_or_All']=='All'){ - echo '<option selected Value="All">' . _('Show all') . ' ' . $TypeName . ' ' . _('in the date range'); - echo '<option Value="First20">' . _('Show only the first 20') . ' ' . $TypeName; + echo '<option selected Value="All">' . _('Show all') . ' ' . $TypeName . ' ' . _('in the date range') . '</option>'; + echo '<option Value="First20">' . _('Show only the first 20') . ' ' . $TypeName . '</option>'; } else { - echo '<option Value="All">' . _('Show all') . ' ' . $TypeName . ' ' . _('in the date range'); - echo '<option selected Value="First20">' . _('Show only the first 20') . ' ' . $TypeName; + echo '<option Value="All">' . _('Show all') . ' ' . $TypeName . ' ' . _('in the date range') . '</option>'; + echo '<option selected Value="First20">' . _('Show only the first 20') . ' ' . $TypeName . '</option>'; } echo '</select></td></tr>'; echo '</table><br><div class="centre"><input tabindex="6" type=submit name="ShowTransactions" VALUE="' . _('Show selected') . ' ' . $TypeName . '">'; -echo "<p><a href='$rootpath/BankReconciliation.php?" . SID . "'>" . _('Show reconciliation') . '</a></div>'; -echo '<hr>'; +echo '<p><a href="' . $rootpath . '/BankReconciliation.php">' . _('Show reconciliation') . '</a></div>'; +echo '<hr />'; $InputError=0; if (!Is_Date($_POST['BeforeDate'])){ @@ -151,7 +156,7 @@ $SQLBeforeDate = FormatDateForSQL($_POST['BeforeDate']); $SQLAfterDate = FormatDateForSQL($_POST['AfterDate']); - if ($_POST["Ostg_or_All"]=='All'){ + if ($_POST['Ostg_or_All']=='All'){ if ($Type=='Payments'){ $sql = "SELECT banktransid, ref, @@ -163,7 +168,7 @@ WHERE amount <0 AND transdate >= '". $SQLAfterDate . "' AND transdate <= '" . $SQLBeforeDate . "' - AND bankact='" .$_POST["BankAccount"] . "' + AND bankact='" .$_POST['BankAccount'] . "' ORDER BY transdate"; } else { /* Type must == Receipts */ @@ -192,7 +197,7 @@ WHERE amount <0 AND transdate >= '". $SQLAfterDate . "' AND transdate <= '" . $SQLBeforeDate . "' - AND bankact=" .$_POST["BankAccount"] . " + AND bankact=" .$_POST['BankAccount'] . " AND ABS(amountcleared - (amount / exrate)) > 0.009 ORDER BY transdate"; } else { /* Type must == Receipts */ @@ -206,12 +211,12 @@ WHERE amount >0 AND transdate >= '". $SQLAfterDate . "' AND transdate <= '" . $SQLBeforeDate . "' - AND bankact='" .$_POST["BankAccount"] . "' + AND bankact='" .$_POST['BankAccount'] . "' AND ABS(amountcleared - (amount / exrate)) > 0.009 ORDER BY transdate"; } } - if ($_POST["First20_or_All"]!='All'){ + if ($_POST['First20_or_All']!='All'){ $sql = $sql . " LIMIT 20"; } @@ -219,13 +224,13 @@ $PaymentsResult = DB_query($sql, $db, $ErrMsg); $TableHeader = '<tr><th>'. _('Ref'). '</th> - <th>' . $TypeName . '</th> - <th>' . _('Date') . '</th> - <th>' . _('Amount') . '</th> - <th>' . _('Outstanding') . '</th> - <th colspan=3>' . _('Clear') . ' / ' . _('Unclear') . '</th> - </tr>'; - echo '<table cellpadding=2 class=selection>' . $TableHeader; + <th>' . $TypeName . '</th> + <th>' . _('Date') . '</th> + <th>' . _('Amount') . '</th> + <th>' . _('Outstanding') . '</th> + <th colspan=3>' . _('Clear') . ' / ' . _('Unclear') . '</th> + </tr>'; + echo '<table cellpadding=2 class="selection">' . $TableHeader; $j = 1; //page length counter @@ -238,24 +243,23 @@ $Outstanding = $myrow['amt']- $myrow['amountcleared']; if (ABS($Outstanding)<0.009){ /*the payment is cleared dont show the check box*/ - printf("<tr bgcolor='#CCCEEE'> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> - <td colspan=2>%s</td> - <td><input type='checkbox' name='Unclear_%s'><input type=hidden name='BankTrans_%s' VALUE=%s></td> - </tr>", - $myrow['ref'], - $myrow['banktranstype'], - $DisplayTranDate, - number_format($myrow['amt'],2), - number_format($Outstanding,2), - _('Unclear'), - $i, - $i, - $myrow['banktransid']); + pprintf('<tr bgcolor="#CCCEEE"> + <td>%s</td> + <td>%s</td> + <td class=number>%s</td> + <td class=number>%s</td> + <td colspan=2>%s</td> + <td><input type="checkbox" name="Unclear_%s"><input type="hidden" name="BankTrans_%s" value=%s></td> + </tr>', + $myrow['ref'], + $myrow['banktranstype'], + $DisplayTranDate, + number_format($myrow['amt'],2), + number_format($Outstanding,2), + _('Unclear'), + $i, + $i, + $myrow['banktransid']); } else{ if ($k==1){ @@ -265,15 +269,14 @@ echo '<tr class="OddTableRows">'; $k=1; } - - printf("<td>%s</td> + printf('<td>%s</td> <td>%s</td> <td>%s</td> <td class=number>%s</td> <td class=number>%s</td> - <td><input type='checkbox' name='Clear_%s'><input type=hidden name='BankTrans_%s' VALUE=%s></td> - <td colspan=2><input type='text' maxlength=15 size=15 class=number name='AmtClear_%s'></td> - </tr>", + <td><input type="checkbox" name="Clear_%s"><input type=hidden name="BankTrans_%s" value=%s></td> + <td colspan=2><input type="text" maxlength=15 size=15 class="number" name="AmtClear_%s"></td> + </tr>', $myrow['ref'], $myrow['banktranstype'], $DisplayTranDate, @@ -296,10 +299,11 @@ } //end of while loop - echo '</table><br><div class="centre"><input type=hidden name="RowCounter" value=' . $i . '><input type=submit name="Update" VALUE="' . _('Update Matching') . '"></div>'; - + echo '</table> + <br /> + <div class="centre"><input type=hidden name="RowCounter" value=' . $i . '> + <input type=submit name="Update" value="' . _('Update Matching') . '"></div>'; } - echo '</form>'; include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/BankReconciliation.php =================================================================== --- trunk/BankReconciliation.php 2011-05-16 10:46:50 UTC (rev 4571) +++ trunk/BankReconciliation.php 2011-05-23 10:14:06 UTC (rev 4572) @@ -1,29 +1,33 @@ <?php -/* $Revision: 1.15 $ */ /* $Id$*/ -//$PageSecurity = 7; - include ('includes/session.inc'); $title = _('Bank Reconciliation'); include('includes/header.inc'); -echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '">'; +echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; +if (isset($_GET['Account'])) { + $_POST['BankAccount']=$_GET['Account']; + $_POST['ShowRec']=true; +} + if (isset($_POST['PostExchangeDifference']) and is_numeric($_POST['DoExchangeDifference'])){ - if (!is_numeric($_POST['BankStatmentBalance'])){ + if (!is_numeric($_POST['BankStatementBalance'])){ prnMsg(_('The entry in the bank statement balance is not numeric. The balance on the bank statement should be entered. The exchange difference has not been calculated and no general ledger journal has been created'),'warn'); - echo '<p>' . $_POST['BankStatmentBalance']; + echo '<p>' . $_POST['BankStatementBalance']; } else { /* Now need to get the currency of the account and the current table ex rate */ - $SQL = "SELECT rate, bankaccountname - FROM bankaccounts INNER JOIN currencies - ON bankaccounts.currcode=currencies.currabrev + $SQL = "SELECT rate, + bankaccountname + FROM bankaccounts INNER JOIN currencies + ON bankaccounts.currcode=currencies.currabrev WHERE bankaccounts.accountcode = '" . $_POST['BankAccount']."'"; $ErrMsg = _('Could not retrieve the exchange rate for the selected bank account'); @@ -33,7 +37,7 @@ $BankAccountName = $CurrencyRow[1]; $CalculatedBalance = $_POST['DoExchangeDifference']; - $ExchangeDifference = ($CalculatedBalance - $_POST['BankStatmentBalance'])/$ExRate; + $ExchangeDifference = ($CalculatedBalance - $_POST['BankStatementBalance'])/$ExRate; include ('includes/SQL_CommonFunctions.inc'); $ExDiffTransNo = GetNextTransNo(36,$db); @@ -84,20 +88,22 @@ } //end if the bank statement balance was numeric } +echo '<table class="selection">'; +$SQL = "SELECT bankaccountname, accountcode FROM bankaccounts"; -echo '<table>'; - -$SQL = 'SELECT bankaccountname, accountcode FROM bankaccounts'; - $ErrMsg = _('The bank accounts could not be retrieved by the SQL because'); $DbgMsg = _('The SQL used to retrieve the bank accounts was'); $AccountsResults = DB_query($SQL,$db,$ErrMsg,$DbgMsg); -echo '<tr><td>' . _('Bank Account') . ':</td><td><select tabindex="1" name="BankAccount">'; +echo '<tr><td>' . _('Bank Account') . ':</td> + <td><select tabindex="1" name="BankAccount">'; if (DB_num_rows($AccountsResults)==0){ - echo '</select></td></tr></table><p>' . _('Bank Accounts have not yet been defined') . '. ' . _('You must first') . "<a href='" . $rootpath . "/BankAccounts.php'>" . _('define the bank accounts') . '</a>' . ' ' . _('and general ledger accounts to be affected') . '.'; + echo '</select></td> + </tr> + </table> + <p>' . _('Bank Accounts have not yet been defined') . '. ' . _('You must first') . '<a href="' . $rootpath . '/BankAccounts.php">' . _('define the bank accounts') . '</a>' . ' ' . _('and general ledger accounts to be affected') . '.'; include('includes/footer.inc'); exit; } else { @@ -116,20 +122,24 @@ include ('includes/GLPostings.inc'); -echo '</table><p><div class="centre"><input type=submit tabindex="2" name="ShowRec" value="' . _('Show bank reconciliation statement') . '"></div><br>'; +echo '</table><p><div class="centre"><input type=submit tabindex="2" name="ShowRec" value="' . _('Show bank reconciliation statement') . '"></div><br />'; if (isset($_POST['ShowRec']) OR isset($_POST['DoExchangeDifference'])){ /*Get the balance of the bank account concerned */ - $sql = "SELECT MAX(period) FROM chartdetails WHERE accountcode='" . $_POST['BankAccount']."'"; + $sql = "SELECT MAX(period) + FROM chartdetails + WHERE accountcode='" . $_POST['BankAccount']."'"; $PrdResult = DB_query($sql, $db); $myrow = DB_fetch_row($PrdResult); $LastPeriod = $myrow[0]; $SQL = "SELECT bfwd+actual AS balance - FROM chartdetails WHERE period='" . $LastPeriod . "' AND accountcode='" . $_POST['BankAccount']."'"; + FROM chartdetails + WHERE period='" . $LastPeriod . "' + AND accountcode='" . $_POST['BankAccount']."'"; $ErrMsg = _('The bank account balance could not be returned by the SQL because'); $BalanceResult = DB_query($SQL,$db,$ErrMsg); @@ -141,9 +151,9 @@ $SQL = "SELECT rate, bankaccounts.currcode, bankaccounts.bankaccountname - FROM bankaccounts INNER JOIN currencies - ON bankaccounts.currcode=currencies.currabrev - WHERE bankaccounts.accountcode = '" . $_POST['BankAccount']."'"; + FROM bankaccounts INNER JOIN currencies + ON bankaccounts.currcode=currencies.currabrev + WHERE bankaccounts.accountcode = '" . $_POST['BankAccount']."'"; $ErrMsg = _('Could not retrieve the currency and exchange rate for the selected bank account'); $CurrencyResult = DB_query($SQL,$db); $CurrencyRow = DB_fetch_row($CurrencyResult); @@ -151,13 +161,13 @@ $BankCurrCode = $CurrencyRow[1]; $BankAccountName = $CurrencyRow[2]; - echo '<table class=selection> - <tr class=EvenTableRows><td colspan=6><b>' . $BankAccountName . ' ' . _('Balance as at') . ' ' . Date($_SESSION['DefaultDateFormat']); + echo '<table class="selection"> + <tr class="EvenTableRows"><td colspan=6><b>' . $BankAccountName . ' ' . _('Balance as at') . ' ' . Date($_SESSION['DefaultDateFormat']); if ($_SESSION['CompanyRecord']['currencydefault']!=$BankCurrCode){ echo ' (' . $BankCurrCode . ' @ ' . $ExRate .')'; } echo '</b></td> - <td valign=bottom class=number><b>' . number_format($Balance*$ExRate,2) . '</b></td></tr>'; + <td valign=bottom class="number"><b>' . number_format($Balance*$ExRate,2) . '</b></td></tr>'; $SQL = "SELECT amount/exrate AS amt, amountcleared, @@ -181,13 +191,13 @@ echo '<tr><td colspan=6><b>' . _('Add back unpresented cheques') . ':</b></td></tr>'; $TableHeader = '<tr> - <th>' . _('Date') . '</th> - <th>' . _('Type') . '</th> - <th>' . _('Number') . '</th> - <th>' . _('Reference') . '</th> - <th>' . _('Orig Amount') . '</th> - <th>' . _('Outstanding') . '</th> - </tr>'; + <th>' . _('Date') . '</th> + <th>' . _('Type') . '</th> + <th>' . _('Number') . '</th> + <th>' . _('Reference') . '</th> + <th>' . _('Orig Amount') . '</th> + <th>' . _('Outstanding') . '</th> + </tr>'; echo $TableHeader; @@ -307,7 +317,7 @@ if (isset($_POST['DoExchangeDifference'])){ echo '<input type="hidden" name="DoExchangeDifference" value=' . $FXStatementBalance . '>'; echo '<tr><td colspan=6>' . _('Enter the actual bank statement balance') . ' (' . $BankCurrCode . ')</b></td> - <td class=number><input type="text" name="BankStatmentBalance" maxlength=15 size=15 value=' . $_POST['BankStatmentBalance'] . '><td></tr>'; + <td class=number><input type="text" name="BankStatementBalance" maxlength=15 size=15 value=' . $_POST['BankStatementBalance'] . '><td></tr>'; echo '<tr><td colspan=7 align="center"><input type="submit" name="PostExchangeDifference" value="' . _('Calculate and Post Exchange Difference') . '" onclick="return confirm(\'' . _('This will create a general ledger journal to write off the exchange difference in the current balance of the account. It is important that the exchange rate above reflects the current value of the bank account currency') . ' - ' . _('Are You Sure?') . '\');"></td></tr>'; } @@ -323,8 +333,15 @@ echo '</table>'; } -echo '<p><div class="centre"><a tabindex="4" href="' . $rootpath . '/BankMatching.php?' . SID . '&Type=Payments">' . _('Match off cleared payments') . '</a>'; -echo '<br><a tabindex="5" href="' . $rootpath . '/BankMatching.php?' . SID . '&Type=Receipts">' . _('Match off cleared deposits') . '</a></div>'; + +if (isset($_POST['BankAccount'])) { + echo '<p><div class="centre"><a tabindex="4" href="' . $rootpath . '/BankMatching.php?Type=Payments&Account='.$_POST['BankAccount'].'">' . _('Match off cleared payments') . '</a>'; + echo '<br /><a tabindex="5" href="' . $rootpath . '/BankMatching.php?Type=Receipts&Account='.$_POST['BankAccount'].'">' . _('Match off cleared deposits') . '</a></div>'; +} else { + echo '<p><div class="centre"><a tabindex="4" href="' . $rootpath . '/BankMatching.php?Type=Payments">' . _('Match off cleared payments') . '</a>'; + echo '<br /><a tabindex="5" href="' . $rootpath . '/BankMatching.php?Type=Receipts">' . _('Match off cleared deposits') . '</a></div>'; +} + echo '</form>'; include('includes/footer.inc'); ?> Modified: trunk/ContractBOM.php =================================================================== --- trunk/ContractBOM.php 2011-05-16 10:46:50 UTC (rev 4571) +++ trunk/ContractBOM.php 2011-05-23 10:14:06 UTC (rev 4572) @@ -290,11 +290,11 @@ $result1 = DB_query($sql,$db,$ErrMsg,$DbgMsg); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Print') . '" alt="" />' . ' ' . _('Search For Stock Items') . '</p>'; - echo '<table class="selection"><tr>'; + echo '<table class="selection"> + <tr></tr> + <tr><td><select name="StockCat">'; - echo ':</tr><tr><td><select name="StockCat">'; - - echo '<option selected="True" value="All">' . _('All').'</option>'; + echo '<option selected="true" value="All">' . _('All').'</option>'; while ($myrow1 = DB_fetch_array($result1)) { if (isset($_POST['StockCat']) and $_POST['StockCat']==$myrow1['categoryid']){ echo '<option selected value="'. $myrow1['categoryid'] . '">' . $myrow1['categorydescription'].'</option>'; Modified: trunk/CreditStatus.php =================================================================== --- trunk/CreditStatus.php 2011-05-16 10:46:50 UTC (rev 4571) +++ trunk/CreditStatus.php 2011-05-23 10:14:06 UTC (rev 4572) @@ -214,14 +214,15 @@ echo '<input type="hidden" name="SelectedReason" value="' . $SelectedReason . '">'; echo '<input type="hidden" name="ReasonCode" value="' . $_POST['ReasonCode'] . '">'; - echo '<table class="selection"><tr><td>'. _('Status Code') .':</td><td>'; - echo $_POST['ReasonCode'] . '</td></tr>'; + echo '<table class="selection"> + <tr><td>'. _('Status Code') .':</td> + <td>' . $_POST['ReasonCode'] . '</td></tr>'; } else { //end of if $SelectedReason only do the else when a new record is being entered if (!isset($_POST['ReasonCode'])) { $_POST['ReasonCode'] = ''; } - echo '<br><table class=selection> + echo '<br /><table class="selection"> <tr> <td>'. _('Status Code') .':</td> <td><input ' . (in_array('ReasonCode',$Errors) ? 'class="inputerror"' : '' ) . ' tabindex=1 type="text" name="ReasonCode" value="'. $_POST['ReasonCode'] .'" size=3 maxlength=2></td> Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2011-05-16 10:46:50 UTC (rev 4571) +++ trunk/CustomerBranches.php 2011-05-23 10:14:06 UTC (rev 4572) @@ -396,8 +396,7 @@ <td>%s</td> <td>%s</td> <td><a href="%s?DebtorNo=%s&SelectedBranch=%s">%s</td> - <td><a href="%s?DebtorNo=%s&SelectedBranch=%s&delete=yes" onclick=\'return confirm("' . - _('Are you sure you wish to delete this branch?') . '");\'>%s</td></tr>', + <td><a href="%s?DebtorNo=%s&SelectedBranch=%s&delete=yes" onclick=\'return confirm("' . _('Are you sure you wish to delete this branch?') . '");\'>%s</td></tr>', $myrow[10], $myrow[2], $myrow[5], @@ -590,42 +589,42 @@ exit; } - echo '<input type=hidden name="DebtorNo" value="'. $DebtorNo . '">'; + echo '<input type=hidden name="DebtorNo" value="'. $DebtorNo . '" />'; echo '<tr><td>'._('Branch Name').':</td>'; if (!isset($_POST['BrName'])) {$_POST['BrName']='';} - echo '<td><input tabindex=2 type="Text" name="BrName" size=41 maxlength=40 value="'. $_POST['BrName'].'"></td></tr>'; + echo '<td><input tabindex=2 type="text" name="BrName" size=41 maxlength=40 value="'. $_POST['BrName'].'"></td></tr>'; echo '<tr><td>'._('Branch Contact').':</td>'; if (!isset($_POST['ContactName'])) {$_POST['ContactName']='';} - echo '<td><input tabindex=3 type="Text" name="ContactName" size=41 maxlength=40 value="'. $_POST['ContactName'].'"></td></tr>'; + echo '<td><input tabindex=3 type="text" name="ContactName" size=41 maxlength=40 value="'. $_POST['ContactName'].'"></td></tr>'; echo '<tr><td>'._('Street Address 1 (Street)').':</td>'; if (!isset($_POST['BrAddress1'])) {$_POST['BrAddress1']='';} - echo '<td><input tabindex=4 type="Text" name="BrAddress1" size=41 maxlength=40 value="'. $_POST['BrAddress1'].'"></td></tr>'; + echo '<td><input tabindex=4 type="text" name="BrAddress1" size=41 maxlength=40 value="'. $_POST['BrAddress1'].'"></td></tr>'; echo '<tr><td>'._('Street Address 2 (Suburb/City)').':</td>'; if (!isset($_POST['BrAddress2'])) {$_POST['BrAddress2']='';} - echo '<td><input tabindex=5 type="Text" name="BrAddress2" size=41 maxlength=40 value="'. $_POST['BrAddress2'].'"></td></tr>'; + echo '<td><input tabindex=5 type="text" name="BrAddress2" size=41 maxlength=40 value="'. $_POST['BrAddress2'].'"></td></tr>'; echo '<tr><td>'._('Street Address 3 (State)').':</td>'; if (!isset($_POST['BrAddress3'])) {$_POST['BrAddress3']='';} - echo '<td><input tabindex=6 type="Text" name="BrAddress3" size=41 maxlength=40 value="'. $_POST['BrAddress3'].'"></td></tr>'; + echo '<td><input tabindex=6 type="text" name="BrAddress3" size=41 maxlength=40 value="'. $_POST['BrAddress3'].'"></td></tr>'; echo '<tr><td>'._('Street Address 4 (Postal Code)').':</td>'; if (!isset($_POST['BrAddress4'])) {$_POST['BrAddress4']='';} - echo '<td><input tabindex=7 type="Text" name="BrAddress4" size=31 maxlength=40 value="'. $_POST['BrAddress4'].'"></td></tr>'; + echo '<td><input tabindex=7 type="text" name="BrAddress4" size=31 maxlength=40 value="'. $_POST['BrAddress4'].'"></td></tr>'; echo '<tr><td>'._('Street Address 5').':</td>'; if (!isset($_POST['BrAddress5'])) {$_POST['BrAddress5']='';} - echo '<td><input tabindex=8 type="Text" name="BrAddress5" size=21 maxlength=20 value="'. $_POST['BrAddress5'].'"></td></tr>'; + echo '<td><input tabindex=8 type="text" name="BrAddress5" size=21 maxlength=20 value="'. $_POST['BrAddress5'].'"></td></tr>'; echo '<tr><td>'._('Street Address 6').':</td>'; if (!isset($_POST['BrAddress6'])) {$_POST['BrAddress6']='';} - echo '<td><input tabindex=9 type="Text" name="BrAddress6" size=16 maxlength=15 value="'. $_POST['BrAddress6'].'"></td></tr>'; + echo '<td><input tabindex=9 type="text" name="BrAddress6" size=16 maxlength=15 value="'. $_POST['BrAddress6'].'"></td></tr>'; echo '<tr><td>'._('Special Instructions').':</td>'; if (!isset($_POST['specialinstructions'])) {$_POST['specialinstructions']='';} - echo '<td><input tabindex=10 type="Text" name="specialinstructions" size=56 value="'. $_POST['specialinstructions'].'"></td></tr>'; + echo '<td><input tabindex=10 type="text" name="specialinstructions" size=56 value="'. $_POST['specialinstructions'].'"></td></tr>'; echo '<tr><td>'._('Default days to deliver').':</td>'; if (!isset($_POST['EstDeliveryDays'])) {$_POST['EstDeliveryDays']=0;} - echo '<td><input ' .(in_array('EstDeliveryDays',$Errors) ? 'class="inputerror"' : '' ) .' tabindex=11 type="Text" class=number name="EstDeliveryDays" size=4 maxlength=2 value='. $_POST['EstDeliveryDays'].'></td></tr>'; + echo '<td><input ' .(in_array('EstDeliveryDays',$Errors) ? 'class="inputerror"' : '' ) .' tabindex=11 type="text" class=number name="EstDeliveryDays" size=4 maxlength=2 value='. $_POST['EstDeliveryDays'].'></td></tr>'; echo '<tr><td>'._('Forward Date After (day in month)').':</td>'; if (!isset($_POST['FwdDate'])) {$_POST['FwdDate']=0;} - echo '<td><input ' .(in_array('FwdDate',$Errors) ? 'class="inputerror"' : '' ) .' tabindex=12 type="Text" class=number name="FwdDate" size=4 maxlength=2 value='. $_POST['FwdDate'].'></td></tr>'; + echo '<td><input ' .(in_array('FwdDate',$Errors) ? 'class="inputerror"' : '' ) .' tabindex=12 type="text" class=number name="FwdDate" size=4 maxlength=2 value='. $_POST['FwdDate'].'></td></tr>'; echo '<tr><td>'._('Salesperson').':</td>'; echo '<td><select tabindex=13 name="Salesman">'; Modified: trunk/CustomerInquiry.php =================================================================== --- trunk/CustomerInquiry.php 2011-05-16 10:46:50 UTC (rev 4571) +++ trunk/CustomerInquiry.php 2011-05-23 10:14:06 UTC (rev 4572) @@ -131,7 +131,7 @@ echo '<br /><font color=RED size=4><b>' . _('ACCOUNT ON HOLD') . '</font></b><br />'; } -echo '<table class=selection width=70%> +echo '<table class="selection" width="70%"> <tr> <th width=20%>' . _('Total Balance') . '</th> <th width=20%>' . _('Current') . '</th> @@ -149,11 +149,12 @@ echo '<br /><div class="centre"><form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo _('Show all transactions after') . ': <input tabindex=1 type=text class="date" alt="' .$_SESSION['DefaultDateFormat']. '" id="datepicker" name="TransAfterDate" Value="' . $_POST['TransAfterDate'] . '" maxlength =10 size=12>' . '<input tabindex=2 type="submit" name="Refresh Inquiry" value="' . _('Refresh Inquiry') . '"></div></form><br />'; +echo _('Show all transactions after') . ': <input tabindex=1 type="text" class="date" alt="' .$_SESSION['DefaultDateFormat']. '" id="datepicker" name="TransAfterDate" Value="' . $_POST['TransAfterDate'] . '" maxlength =10 size=12>' . '<input tabindex=2 type="submit" name="Refresh Inquiry" value="' . _('Refresh Inquiry') . '"></div> +</form> +<br />'; $DateAfterCriteria = FormatDateForSQL($_POST['TransAfterDate']); - $SQL = "SELECT systypes.typename, debtortrans.id, debtortrans.type, Modified: trunk/CustomerReceipt.php =================================================================== --- trunk/CustomerReceipt.php 2011-05-16 10:46:50 UTC (rev 4571) +++ trunk/CustomerReceipt.php 2011-05-23 10:14:06 UTC (rev 4572) @@ -700,7 +700,7 @@ /*set up the form whatever */ -echo '<form action="' . $_SERVER['PHP_SELF'] . '?Type='.$_GET['Type'] . '" method=post name=form1>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '?Type='.$_GET['Type'] . '" method="post" name="form1">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; /*show the batch header details and the entries in the batch so far */ Modified: trunk/DailySalesInquiry.php =================================================================== --- trunk/DailySalesInquiry.php 2011-05-16 10:46:50 UTC (rev 4571) +++ trunk/DailySalesInquiry.php 2011-05-23 10:14:06 UTC (rev 4572) @@ -1,10 +1,7 @@ <?php -/* $Revision: 1.00$ */ /* $Id$*/ -//$PageSecurity = 2; - include('includes/session.inc'); $title = _('Daily Sales Inquiry'); include('includes/header.inc'); @@ -25,7 +22,7 @@ $_POST['MonthToShow'] = GetPeriod(Date($_SESSION['DefaultDateFormat']),$db); } -$PeriodsResult = DB_query('SELECT periodno, lastdate_in_period FROM periods',$db); +$PeriodsResult = DB_query("SELECT periodno, lastdate_in_period FROM periods",$db); while ($PeriodRow = DB_fetch_array($PeriodsResult)){ if ($_POST['MonthToShow']==$PeriodRow['periodno']) { @@ -38,7 +35,7 @@ echo '</select></td>'; echo '<td>' . _('Salesperson') . ':</td><td><select tabindex=2 name="Salesperson">'; -$SalespeopleResult = DB_query('SELECT salesmancode, salesmanname FROM salesman',$db); +$SalespeopleResult = DB_query("SELECT salesmancode, salesmanname FROM salesman",$db); if (!isset($_POST['Salesperson'])){ $_POST['Salesperson'] = 'All'; echo '<option selected value="All">' . _('All') . '</option>'; Modified: trunk/FTP_RadioBeacon.php =================================================================== --- trunk/FTP_RadioBeacon.php 2011-05-16 10:46:50 UTC (rev 4571) +++ trunk/FTP_RadioBeacon.php 2011-05-23 10:14:06 UTC (rev 4572) @@ -14,30 +14,30 @@ some details of the order for confirming before producing the file for ftp */ $SQL = "SELECT salesorders.orderno, - debtorsmaster.name, - custbranch.brname, - salesorders.customerref, - salesorders.orddate, - salesorders.deliverto, - salesorders.deliverydate, - sum(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)) as ordervalue, - datepackingslipprinted, - printedpackingslip - FROM salesorders, - salesorderdetails, - debtorsmaster, - custbranch - WHERE salesorders.orderno = salesorderdetails.orderno - AND salesorders.debtorno = debtorsmaster.debtorno - AND debtorsmaster.debtorno = custbranch.debtorno - AND salesorderdetails.completed=0 - AND salesorders.fromstkloc = '". $_SESSION['RadioBeaconStockLocation'] . "' - GROUP BY salesorders.orderno, - salesorders.debtorno, - salesorders.branchcode, - salesorders.customerref, - salesorders.orddate, - salesorders.deliverto"; + debtorsmaster.name, + custbranch.brname, + salesorders.customerref, + salesorders.orddate, + salesorders.deliverto, + salesorders.deliverydate, + sum(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)) as ordervalue, + datepackingslipprinted, + printedpackingslip + FROM salesorders, + salesorderdetails, + debtorsmaster, + custbranch + WHERE salesorders.orderno = salesorderdetails.orderno + AND salesorders.debtorno = debtorsmaster.debtorno + AND debtorsmaster.debtorno = custbranch.debtorno + AND salesorderdetails.completed=0 + AND salesorders.fromstkloc = '". $_SESSION['RadioBeaconStockLocation'] . "' + GROUP BY salesorders.orderno, + salesorders.debtorno, + salesorders.branchcode, + salesorders.customerref, + salesorders.orddate, + salesorders.deliverto"; $ErrMsg = _('No orders were returned because'); $SalesOrdersResult = DB_query($SQL,$db,$ErrMsg); @@ -146,33 +146,33 @@ /*Now get the order header info */ $sql = "SELECT salesorders.debtorno, - customerref, - comments, - orddate, - deliverydate, - deliverto, - deladd1, - deladd2, - deladd3, - deladd4, - deladd5, - deladd6, - contactphone, - contactemail, - name, - address1, - address2, - address3, - address4, - address5, - address6, - printedpackingslip, - datepackingslipprinted - FROM salesorders, - debtorsmaster - WHERE salesorders.debtorno=debtorsmaster.debtorno - AND salesorders.fromstkloc = '". $_SESSION['RadioBeaconStockLocation'] . "' - AND salesorders.orderno='" . $_GET['OrderNo'] . "'"; + customerref, + comments, + orddate, + deliverydate, + deliverto, + deladd1, + deladd2, + deladd3, + deladd4, + deladd5, + deladd6, + contactphone, + contactemail, + name, + address1, + address2, + address3, + address4, + address5, + address6, + printedpackingslip, + datepackingslipprinted + FROM salesorders, + debtorsmaster + WHERE salesorders.debtorno=debtorsmaster.debtorno + AND salesorders.fromstkloc = '". $_SESSION['RadioBeaconStockLocation'] . "' + AND salesorders.orderno='" . $_GET['OrderNo'] . "'"; $ErrMsg = _('There was a problem retrieving the order header details for Order Number') . ' ' . $_GET['OrderNo'] . ' ' . _('from the database'); Modified: trunk/FreightCosts.php =================================================================== --- trunk/FreightCosts.php 2011-05-16 10:46:50 UTC (rev 4571) +++ trunk/FreightCosts.php 2011-05-23 10:14:06 UTC (rev 4572) @@ -32,13 +32,13 @@ $sql = "SELECT shippername, shipper_id FROM shippers"; $ShipperResults = DB_query($sql,$db); - echo '<table class=selection> + echo '<table class="selection"> <tr> <td>' . _('Select A Freight Company to set up costs for') . '</td> <td><select name="ShipperID">'; while ($myrow = DB_fetch_array($ShipperResults)){ - echo '<option value=' . $myrow['shipper_id'] . '>' . $myrow['shippername'] . '</option>'; + echo '<option value="' . $myrow['shipper_id'] . '">' . $myrow['shippername'] . '</option>'; } echo '</select></td></tr> <tr> @@ -51,12 +51,12 @@ $LocationResults = DB_query($sql,$db); while ($myrow = DB_fetch_array($LocationResults)){ - echo '<option value=' . $myrow['loccode'] . '>' . $myrow['locationname']; + echo '<option value=' . $myrow['loccode'] . '>' . $myrow['locationname'] . '</option>'; } echo '</select></td></tr> </table> - <br><div class="centre"><input type="submit" value="' . _('Accept') . '" name="Accept"></div> + <br /><div class="centre"><input type="submit" value="' . _('Accept') . '" name="Accept"></div> </form>'; } else { @@ -198,7 +198,7 @@ $result = DB_query($sql,$db); - echo '<br><table class=selection>'; + echo '<br /><table class=selection>'; $TableHeader = '<tr> <th>' . _('Destination') . '</th> <th>' . _('Cubic Rate') . '</th> @@ -307,8 +307,8 @@ $_POST['MinimumChg'] = 0; } - echo '<input type="hidden" name="LocationFrom" value="' . $LocationFrom . '">'; - echo '<input type="hidden" name="ShipperID" value="' . $ShipperID . '">'; + echo '<input type="hidden" name="LocationFrom" value="' . $LocationFrom . '" />'; + echo '<input type="hidden" name="ShipperID" value="' . $ShipperID . '" />'; if (!isset($_POST['Destination'])) {$_POST['Destination']='';} if (!isset($_POST['CubRate'])) {$_POST['CubRate']='';} @@ -316,7 +316,7 @@ if (!isset($_POST['MAXKGs'])) {$_POST['MAXKGs']='';} if (!isset($_POST['MAXCub'])) {$_POST['MAXCub']='';} - echo '<br><table class=selection>'; + echo '<br /><table class=selection>'; echo '<tr><th colspan=2><font size=4 color=blue>' . _('For Deliveries From') . ' ' . $LocationName . ' ' . _('using') . ' ' . $ShipperName . '</font></th></tr>'; echo'<tr><td>' . _('Destination') . ':</td> @@ -334,7 +334,7 @@ echo '<tr><td>' . _('Minimum Charge (0 is N/A)') . ':</a></td> <td><input type="text" name="MinimumChg" class="number" size=6 maxlength=5 value="' . $_POST['MinimumChg'] . '"></td></tr>'; - echo '</table><br>'; + echo '</table><br />'; echo '<div class="centre"><input type="submit" name="submit" value="' . _('Enter Information') . '"></div>'; Modified: trunk/GLTransInquiry.php =================================================================== --- trunk/GLTransInquiry.php 2011-05-16 10:46:50 UTC (rev 4571) +++ trunk/GLTransInquiry.php 2011-05-23 10:14:06 UTC (rev 4572) @@ -1,16 +1,12 @@ <?php /* $Id$*/ -/* $Revision: 1.16 $ */ -//$PageSecurity = 8; - include ('includes/session.inc'); $title = _('General Ledger Transaction Inquiry'); include('includes/header.inc'); -// Page Border -$menuUrl = '<a href="'. $rootpath . '/index.php?&Application=GL'. SID .'">' . _('General Ledger Menu') . '</a></div>'; +$menuUrl = '<a href="'. $rootpath . '/index.php?&Application=GL">' . _('General Ledger Menu') . '</a></div>'; if ( !isset($_GET['TypeID']) OR !isset($_GET['TransNo']) ) { @@ -52,22 +48,22 @@ </tr>'; $SQL = "SELECT gltrans.type, - gltrans.trandate, - gltrans.periodno, - gltrans.account, - gltrans.narrative, - gltrans.amount, - gltrans.posted, - chartmaster.accountname, - periods.lastdate_in_period - FROM gltrans, - chartmaster, - periods - WHERE gltrans.account = chartmaster.accountcode - AND periods.periodno=gltrans.periodno - AND gltrans.type= '" . $_GET['TypeID'] . "' - AND gltrans.typeno = '" . $_GET['TransNo'] . "' - ORDER BY gltrans.counterindex"; + gltrans.trandate, + gltrans.periodno, + gltrans.account, + gltrans.narrative, + gltrans.amount, + gltrans.posted, + chartmaster.accountname, + periods.lastdate_in_period + FROM gltrans, + chartmaster, + periods + WHERE gltrans.account = chartmaster.accountcode + AND periods.periodno=gltrans.periodno + AND gltrans.type= '" . $_GET['TypeID'] . "' + AND gltrans.typeno = '" . $_GET['TransNo'] . "' + ORDER BY gltrans.counterindex"; $TransResult = DB_query($SQL,$db); $Posted = _('Yes'); @@ -78,17 +74,17 @@ $DetailResult = false; if ( $TransRow['amount'] > 0) { - $DebitAmount = number_format($TransRow['amount'],2); + $DebitAmount = number_format($TransRow['amount'],$_SESSION['CompanyRecord']['decimalplaces']); $DebitTotal += $TransRow['amount']; $CreditAmount = ' '; } else { - $CreditAmount = number_format(-$TransRow['amount'],2); + $CreditAmount = number_format(-$TransRow['amount'],$_SESSION['CompanyRecord']['decimalplaces']); $CreditTotal += $TransRow['amount']; $DebitAmount = ' '; } if ( $TransRow['account'] == $_SESSION['CompanyRecord']['debtorsact'] ) { - $URL = $rootpath . '/CustomerInquiry.php?' . SID . '&CustomerID='; + $URL = $rootpath . '/CustomerInquiry.php?CustomerID='; $date = '&TransAfterDate=' . $TranDate; $DetailSQL = "SELECT debtortrans.debtorno, @@ -103,7 +99,7 @@ AND debtortrans.transno = '" . $_GET['TransNo']. "'"; $DetailResult = DB_query($DetailSQL,$db); } elseif ( $TransRow['account'] == $_SESSION['CompanyRecord']['creditorsact'] ) { - $URL = $rootpath . '/SupplierInquiry.php?' . SID . '&SupplierID='; + $URL = $rootpath . '/SupplierInquiry.php?SupplierID='; $date = '&FromDate=' . $TranDate; $DetailSQL = "SELECT supptrans.supplierno, @@ -118,7 +114,7 @@ AND supptrans.transno = '" . $_GET['TransNo'] . "'"; $DetailResult = DB_query($DetailSQL,$db); } else { - $URL = $rootpath . '/GLAccountInquiry.php?' . SID . '&Account=' . $TransRow['account']; + $URL = $rootpath . '/GLAccountInquiry.php?Account=' . $TransRow['account']; if( strlen($TransRow['narrative'])==0 ) { $TransRow['narrative'] = ' '; @@ -156,10 +152,10 @@ } } else { if ($TransRow['account'] == $_SESSION['CompanyRecord']['debtorsact']) { - $Credit = number_format(-($DetailRow[1] + $DetailRow[2]) / $DetailRow[3],2); + $Credit = number_format(-($DetailRow[1] + $DetailRow[2]) / $DetailRow[3],$_SESSION['CompanyRecord']['decimalplaces']); $Debit = ' '; } else { - $Credit = number_format(($DetailRow[1] + $DetailRow[2]) / $DetailRow[3],2); + $Credit = number_format(($DetailRow[1] + $DetailRow[2]) / $DetailRow[3],$_SESSION['CompanyRecord']['decimalplaces']); $Debit = ' '; } } @@ -187,8 +183,8 @@ echo '<tr bgcolor="#FFFFFF"> <td class=number colspan=3><b>' . _('Total') . '</b></td> - <td class=number>' . number_format(($DebitTotal),2) . '</td> - <td class=number>' . number_format((-$CreditTotal),2) . '</td> + <td class=number>' . number_format(($DebitTotal),$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class=number>' . number_format((-$CreditTotal),$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td colspan=2> </td> </tr>'; echo '</table><p>'; @@ -196,7 +192,7 @@ } -echo '</td></tr></table>'; // end Page Border +echo '</td></tr></table>'; include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/GoodsReceived.php =================================================================== --- trunk/GoodsReceived.php 2011-05-16 10:46:50 UTC (rev 4571) +++ trunk/GoodsReceived.php 2011-05-23 10:14:06 UTC (rev 4572) @@ -135,8 +135,8 @@ $DisplaySupplierQtyRec = number_format($LnItm->QtyReceived/$LnItm->ConversionFactor,$LnItm->DecimalPlaces); $DisplayQtyOrd = number_format($LnItm->Quantity,$LnItm->DecimalPlaces); $DisplayQtyRec = number_format($LnItm->QtyReceived,$LnItm->DecimalPlaces); - $DisplayLineTotal = number_format($LineTotal,2); - $DisplayPrice = number_format($LnItm->Price,2); + $DisplayLineTotal = number_format($LineTotal,$_SESSION['PO'.$identifier]->CurrDecimalPlaces); + $DisplayPrice = number_format($LnItm->Price,$_SESSION['PO'.$identifier]->CurrDecimalPlaces); //Now Display LineItem @@ -178,7 +178,7 @@ }//foreach(LineItem) echo '<script>defaultControl(document.forms[0].RecvQty_'.$LnItm->LineNo.');</script>'; - $DisplayTotal = number_format($_SESSION['PO'.$identifier]->Total,2); + $DisplayTotal = number_format($_SESSION['PO'.$identifier]->Total,$_SESSION['PO'.$identifier]->CurrDecimalPlaces); if ($_SESSION['ShowValueOnGRN']==1) { echo '<tr><td colspan="11" class=number><b>' . _('Total value of goods received'). '</b></td> <td class=number><b>'. $DisplayTotal. '</b></td> @@ -316,8 +316,7 @@ } echo '<div class="centre"><a href="' . $rootpath . '/PO_SelectOSPurchOrder.php">'. _('Select a different purchase order for receiving goods against').'</a></div>'; - echo '<div class="centre"><a href="' . $rootpath . '/GoodsReceived.php?PONumber=' . - $_SESSION['PO'.$identifier]->OrderNumber . '">'. _('Re-read the updated purchase order for receiving goods against'). '</a></div>'; + echo '<div class="centre"><a href="' . $rootpath . '/GoodsReceived.php?PONumber=' . $_SESSION['PO'.$identifier]->OrderNumber . '">'. _('Re-read the updated purchase order for receiving goods against'). '</a></div>'; unset($_SESSION['PO'.$identifier]->LineItems); unset($_SESSION['PO'.$identifier]); unset($_POST['ProcessGoodsReceived']); @@ -514,17 +513,17 @@ AND serialno = '" . $Item->BundleRef . "'"; } else { $SQL = "INSERT INTO stockserialitems (stockid, - loccode, - serialno, - qualitytext, - expirationdate, - quantity) - VALUES ('" . $OrderLine->StockID . "', - '" . $_SESSION['PO'.$identifier]->Location . "', - '" . $Item->BundleRef . "', - '', - '" . FormatDateForSQL($Item->ExpiryDate) . "', - '" . $Item->BundleQty . "')"; + loccode, + serialno, + qualitytext, + expirationdate, + quantity) + VALUES ('" . $OrderLine->StockID . "', + '" . $_SESSION['PO'.$identifier]->Location . "', + '" . $Item->BundleRef . "', + '', + '" . FormatDateForSQL($Item->ExpiryDate) . "', + '" . $Item->BundleQty . "')"; } $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item record could not be inserted because'); @@ -535,15 +534,15 @@ /** now insert the serial stock movement **/ $SQL = "INSERT INTO stockserialmoves (stockmoveno, - stockid, - serialno, - moveqty) - VALUES ( - '" . $StkMoveNo . "', - '" . $OrderLine->StockID . "', - '" . $Item->BundleRef . "', - '" . $Item->BundleQty . "' - )"; + stockid, + serialno, + moveqty) + VALUES ( + '" . $StkMoveNo . "', + '" . $OrderLine->StockID . "', + '" . $Item->BundleRef . "', + '" . $Item->BundleQty . "' + )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock movement record could not be inserted because'); $DbgMsg = _('The following SQL to insert the serial stock movement records was used'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); @@ -557,30 +556,31 @@ /*first validate the AssetID and if it doesn't exist treat it like a normal nominal item */ $CheckAssetExistsResult = DB_query("SELECT assetid, - datepurchased, - costact - FROM fixedassets INNER JOIN fixedassetcategories - ON fixedassets.assetcategoryid=fixedassetcategories.categoryid - WHERE assetid='" . $OrderLine->AssetID . "'",$db); + datepurchased, + costact + FROM fixedassets + INNER JOIN fixedassetcategories + ON fixedassets.assetcategoryid=fixedassetcategories.categoryid + WHERE assetid='" . $OrderLine->AssetID . "'",$db); if (DB_num_rows($CheckAssetExistsResult)==1){ //then work with the assetid provided /*Need to add a fixedassettrans for the cost of the asset being received */ $SQL = "INSERT INTO fixedassettrans (assetid, - transtype, - transno, - transdate, - periodno, - inputdate, - fixedassettranstype, - amount) - VALUES ('" . $OrderLine->AssetID . "', - 25, - '" . $GRN . "', - '" . $_POST['DefaultReceivedDate'] . "', - '" . $PeriodNo . "', - '" . Date('Y-m-d') . "', - 'cost', - '" . $CurrentStandardCost * $OrderLine->ReceiveQty . "')"; + transtype, + transno, + transdate, + periodno, + inputdate, + fixedassettranstype, + amount) + VALUES ('" . $OrderLine->AssetID . "', + 25, + '" . $GRN . "', + '" . $_POST['DefaultReceivedDate'] . "', + '" . $PeriodNo . "', + '" . Date('Y-m-d') . "', + 'cost', + '" . $CurrentStandardCost * $OrderLine->ReceiveQty . "')"; $ErrMsg = _('CRITICAL ERROR! NOTE DOWN THIS ERROR AND SEEK ASSISTANCE The fixed asset transaction could not be inserted because'); $DbgMsg = _('The following SQL to insert the fixed asset transaction record was used'); $Result = DB_query($SQL,$db,$ErrMsg, $DbgMsg, true); @@ -594,12 +594,13 @@ /* it is a new addition as the date is set to 0000-00-00 when the asset record is created * before any cost is added to the asset */ - $SQL = "UPDATE fixedassets SET datepurchased='" . $_POST['DefaultReceivedDate'] . "', - cost = cost + " . ($CurrentStandardCost * $OrderLine->ReceiveQty) . " - WHERE assetid = '" . $OrderLine->AssetID . "'"; + $SQL = "UPDATE fixedassets + SET datepurchased='" . $_POST['DefaultReceivedDate'] . "', + cost = cost + " . ($CurrentStandardCost * $OrderLine->ReceiveQty) . " + WHERE assetid = '" . $OrderLine->AssetID . "'"; } else { $SQL = "UPDATE fixedassets SET cost = cost + " . ($CurrentStandardCost * $OrderLine->ReceiveQty) . " - WHERE assetid = '" . $OrderLine->AssetID . "'"; + WHERE assetid = '" . $OrderLine->AssetID . "'"; } $ErrMsg = _('CRITICAL ERROR! NOTE DOWN THIS ERROR AND SEEK ASSISTANCE. The fixed asset cost and date purchased was not able to be updated because:'); $DbgMsg = _('The following SQL was used to attempt the update of the cost and the date the asset was purchased'); @@ -614,23 +615,23 @@ /*first the debit using the GLCode in the PO detail record entry*/ $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES ( - 25, - '" . $GRN . "', - '" . $_POST['DefaultReceivedDate'] . "', - '" . $PeriodNo . "', - '" . $OrderLine->GLCode . "', - 'PO: " . $_SESSION['PO'.$identifier]->OrderNo . " " . $_SESSION['PO'.$identifier]->SupplierID . " - " . $OrderLine->StockID - . " - " . $OrderLine->ItemDescription . " x " . $OrderLine->ReceiveQty . " @ " . - number_format($CurrentStandardCost,2) . "', - '" . $CurrentStandardCost * $OrderLine->ReceiveQty . "' - )"; + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES ( + 25, + '" . $GRN . "', + '" . $_POST['DefaultReceivedDate'] . "', + '" . $PeriodNo . "', + '" . $OrderLine->GLCode . "', + 'PO: " . $_SESSION['PO'.$identifier]->OrderNo . " " . $_SESSION['PO'.$identifier]->SupplierID . " - " . $OrderLine->StockID + . " - " . $OrderLine->ItemDescription . " x " . $OrderLine->ReceiveQty . " @ " . + number_format($CurrentStandardCost,2) . "', + '" . $CurrentStandardCost * $OrderLine->ReceiveQty . "' + )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The purchase GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the purchase GLTrans record was used'); @@ -640,22 +641,22 @@ /*now the GRN suspense entry*/ $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES (25, - '" . $GRN . "', - '" . $_POST['DefaultReceivedDate'] . "', - '" . $PeriodNo . "', - '" . $_SESSION['CompanyRecord']['grnact'] . "', - '" . _('PO'.$identifier) . ': ' . $_SESSION['PO'.$identifier]->OrderNo . ' ' . $_SESSION['PO'.$identifier]->SupplierID . ' - ' . - $OrderLine->StockID . ' - ' . $OrderLine->ItemDescription . ' x ' . - $OrderLine->ReceiveQty . ' @ ' . number_format($UnitCost,2) . "', - '" . -$UnitCost * $OrderLine->ReceiveQty . "' - )"; + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES (25, + '" . $GRN . "', + '" . $_POST['DefaultReceivedDate'] . "', + '" . $PeriodNo . "', + '" . $_SESSION['CompanyRecord']['grnact'] . "', + '" . _('PO'.$identifier) . ': ' . $_SESSION['PO'.$identifier]->OrderNo . ' ' . $_SESSION['PO'.$identifier]->SupplierID . ' - ' . + $OrderLine->StockID . ' - ' . $OrderLine->ItemDescription . ' x ' . + $OrderLine->ReceiveQty . ' @ ' . number_format($UnitCost,2) . "', + '" . -$UnitCost * $OrderLine->ReceiveQty . "' + )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GRN suspense side of the GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GRN Suspense GLTrans record was used'); Modified: trunk/PO_Header.php =================================================================== --- trunk/PO_Header.php 2011-05-16 10:46:50 UTC (rev 4571) +++ trunk/PO_Header.php 2011-05-23 10:14:06 UTC (rev 4572) @@ -146,8 +146,8 @@ $AllowPrint=0; } $SQL = "UPDATE purchorders SET status='" . $_POST['Status']. "', - stat_comment='" . $_SESSION['PO'.$identifier]->StatusComments ."', - allowprint='".$AllowPrint."' + stat_comment='" . $_SESSION['PO'.$identifier]->StatusComments ."', + allowprint='".$AllowPrint."' WHERE purchorders.orderno ='" . $_SESSION['ExistingOrder'] ."'"; $ErrMsg = _('The order status could not be updated because'); @@ -172,8 +172,10 @@ $_SESSION['PO'.$identifier]->GLLink = $_SESSION['CompanyRecord']['gllink_stock']; /* set the SupplierID we got */ $_SESSION['PO'.$identifier]->SupplierID = $_GET['SelectedSupplier']; + $_SESSION['PO'.$identifier]->DeliveryDate = DateAdd(date($_SESSION['DefaultDateFormat']), 'd', $_GET['LeadTime']); $_SESSION['RequireSupplierSelection'] = 0; $_POST['Select'] = $_GET['SelectedSupplier']; + /* * the item (it's item code) that should be purchased @@ -219,8 +221,8 @@ $_SESSION['PO'.$identifier]->AllowPrintPO=1; $sql = "UPDATE purchorders - SET purchorders.allowprint='1' - WHERE purchorders.orderno='" . $_SESSION['PO'.$identifier]->OrderNo ."'"; + SET purchorders.allowprint='1' + WHERE purchorders.orderno='" . $_SESSION['PO'.$identifier]->OrderNo ."'"; $ErrMsg = _('An error occurred updating the purchase order to allow reprints') . '. ' . _('The error says'); $UpdateResult = DB_query($sql,$db,$ErrMsg); @@ -365,6 +367,7 @@ $_POST['SuppDelAdd4']=$_SESSION['PO'.$identifier]->SuppDelAdd4; $_POST['SuppDelAdd5']=$_SESSION['PO'.$identifier]->SuppDelAdd5; $_POST['SuppD... [truncated message content] |