|
From: <dai...@us...> - 2011-05-14 11:24:31
|
Revision: 4566
http://web-erp.svn.sourceforge.net/web-erp/?rev=4566&view=rev
Author: daintree
Date: 2011-05-14 11:24:22 +0000 (Sat, 14 May 2011)
Log Message:
-----------
various
Modified Paths:
--------------
trunk/COGSGLPostings.php
trunk/ContractBOM.php
trunk/CreditStatus.php
trunk/CustomerBranches.php
trunk/CustomerInquiry.php
trunk/CustomerReceipt.php
trunk/DailyBankTransactions.php
trunk/FTP_RadioBeacon.php
trunk/FreightCosts.php
trunk/POReport.php
trunk/PageSecurity.php
trunk/Prices.php
trunk/StockQties_csv.php
trunk/StockTransfers.php
trunk/SupplierCredit.php
trunk/TaxCategories.php
trunk/doc/Change.log
Modified: trunk/COGSGLPostings.php
===================================================================
--- trunk/COGSGLPostings.php 2011-05-13 10:50:42 UTC (rev 4565)
+++ trunk/COGSGLPostings.php 2011-05-14 11:24:22 UTC (rev 4566)
@@ -92,7 +92,7 @@
</tr>';
$k=0; //row colour counter
- while ($myrow = DB_fetch_row($result)) {
+ while ($myrow = DB_fetch_array($result)) {
if ($k==1){
echo '<tr class="EvenTableRows">';
$k=0;
@@ -106,24 +106,24 @@
<td>%s</td>
<td>%s</td>
<td><a href="%sSelectedCOGSPostingID=%s">' . _('Edit') . '</td>
- <td><a href="%sSelectedCOGSPostingID=%s&delete=yes">'. _('Delete') . '</td></tr>',
- $myrow[1],
- $myrow[2],
- $myrow[3],
- $myrow[4],
+ <td><a href="%sSelectedCOGSPostingID=%s&delete=yes" onclick="return confirm(\'' . _('Are you sure you wish to delete this COGS GL posting record?') . '\');">'. _('Delete') . '</td></tr>',
+ $myrow['area'],
+ $myrow['stkcat'],
+ $myrow['salestype'],
+ $myrow['accountname'],
$_SERVER['PHP_SELF'] . '?',
- $myrow[0],
+ $myrow['id'],
$_SERVER['PHP_SELF']. '?',
- $myrow[0]);
+ $myrow['id']);
}//end while
echo '</table>';
}
$sql = "SELECT cogsglpostings.id,
- cogsglpostings.area,
- cogsglpostings.stkcat,
- cogsglpostings.salestype
- FROM cogsglpostings";
+ cogsglpostings.area,
+ cogsglpostings.stkcat,
+ cogsglpostings.salestype
+ FROM cogsglpostings";
$result = DB_query($sql,$db);
@@ -147,7 +147,7 @@
$result = DB_query($sql,$db);
}
- $sql = "SELECT accountcode FROM chartmaster WHERE accountcode ='1' ";
+ $sql = "SELECT accountcode FROM chartmaster WHERE accountcode ='1'";
$result = DB_query($sql,$db);
if (DB_num_rows($result)==0){
/* account number 1 is not used, so insert a new account */
@@ -195,7 +195,7 @@
<th>' . _('GL Account') . '</th>
</tr>';
$k = 0;
- while ($myrow = DB_fetch_row($result)) {
+ while ($myrow = DB_fetch_array($result)) {
if ($k==1){
echo '<tr class="EvenTableRows">';
$k=0;
@@ -211,14 +211,14 @@
<td><a href="%sSelectedCOGSPostingID=%s">' . _('Edit') . '</td>
<td><a href="%sSelectedCOGSPostingID=%s&delete=yes">' . _('Delete') . '</td>
</tr>',
- $myrow[1],
- $myrow[2],
- $myrow[3],
- $myrow[4],
+ $myrow['area'],
+ $myrow['stkcat'],
+ $myrow['salestype'],
+ $myrow['salestype'],
$_SERVER['PHP_SELF'] . '?',
- $myrow[0],
+ $myrow['id'],
$_SERVER['PHP_SELF'] . '?',
- $myrow[0]);
+ $myrow['id']);
}//END WHILE LIST LOOP
echo '</table>';
@@ -305,7 +305,7 @@
echo '</select></td></tr>
<tr><td>' . _('Sales Type') . ' / ' . _('Price List') . ':</td>
<td><select tabindex=3 name="SalesType">
- <option VALUE="AN">' . _('Any Other') . '</option>';
+ <option value="AN">' . _('Any Other') . '</option>';
while ($myrow = DB_fetch_array($result)) {
if (isset($_POST['SalesType']) and $myrow['typeabbrev']==$_POST['SalesType']) {
Modified: trunk/ContractBOM.php
===================================================================
--- trunk/ContractBOM.php 2011-05-13 10:50:42 UTC (rev 4565)
+++ trunk/ContractBOM.php 2011-05-14 11:24:22 UTC (rev 4566)
@@ -323,8 +323,7 @@
<td><input type="text" name="StockCode" size="15" maxlength="18" value="' . $_POST['StockCode'] . '" /></td>
</tr>
<tr><td></td>
- <td><font size="3"><b>' . _('OR') . ' </b></font><font size="2"><a target="_blank" href="'.$rootpath.'/Stocks.php?' . SID .
- '">' . _('Create a New Stock Item') . '</a></font></td></tr>
+ <td><font size="3"><b>' . _('OR') . ' </b></font><font size="2"><a target="_blank" href="'.$rootpath.'/Stocks.php">' . _('Create a New Stock Item') . '</a></font></td></tr>
</table><br />
<div class="centre"><input type="submit" name="Search" value="' . _('Search Now') . '" />
</div><br />';
Modified: trunk/CreditStatus.php
===================================================================
--- trunk/CreditStatus.php 2011-05-13 10:50:42 UTC (rev 4565)
+++ trunk/CreditStatus.php 2011-05-14 11:24:22 UTC (rev 4566)
@@ -1,8 +1,7 @@
<?php
-/* $Revision: 1.16 $ */
+
/* $Id$*/
-//$PageSecurity = 3;
include('includes/session.inc');
$title = _('Credit Status Code Maintenance');
include('includes/header.inc');
@@ -127,7 +126,7 @@
} else {
//only delete if used in neither customer or supplier accounts
- $sql="DELETE FROM holdreasons WHERE reasoncode=$SelectedReason";
+ $sql="DELETE FROM holdreasons WHERE reasoncode='" . $SelectedReason . "'";
$result = DB_query($sql,$db);
prnMsg(_('This credit status code has been deleted'),'success');
}
@@ -154,9 +153,9 @@
<th>'. _('Disallow Invoices') .'</th>';
$k=0; //row colour counter
- while ($myrow=DB_fetch_row($result)) {
+ while ($myrow=DB_fetch_array($result)) {
- if ($myrow[2]==0) {
+ if ($myrow['dissallowinvoices']==0) {
$DissallowText = _('Invoice OK');
} else {
$DissallowText = '<b>'. _('NO INVOICING') .'</b>';
@@ -169,20 +168,20 @@
$k=1;
}
- printf("<td>%s</td>
- <td>%s</td>
- <td>%s</td>
- <td><a href=\"%s?SelectedReason=%s\">" . _('Edit') . "</a></td>
- <td><a href=\"%s?SelectedReason=%s&delete=1\">". _('Delete') .'</a></td>
- </tr>',
- $myrow[0],
- $myrow[1],
- $DissallowText,
- $_SERVER['PHP_SELF'],
- $myrow[0],
- $_SERVER['PHP_SELF'],
- $myrow[0]);
-
+ printf('<td>%s</td>
+ <td>%s</td>
+ <td>%s</td>
+ <td><a href="%s?SelectedReason=%s">' . _('Edit') . '</a></td>
+ <td><a href="%s?SelectedReason=%s&delete=1" onclick="return confirm(\'' . _('Are you sure you wish to delete this credit stuatus record?') . '\');">'. _('Delete') .'</a></td>
+ </tr>',
+ $myrow['reasoncode'],
+ $myrow['reasondescription'],
+ $DissallowText,
+ $_SERVER['PHP_SELF'],
+ $myrow['reasoncode'],
+ $_SERVER['PHP_SELF'],
+ $myrow['reasoncode']);
+
} //END WHILE LIST LOOP
echo '</table>';
@@ -213,9 +212,9 @@
$_POST['ReasonDescription'] = $myrow['reasondescription'];
$_POST['DisallowInvoices'] = $myrow['dissallowinvoices'];
- 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 '<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>';
} else { //end of if $SelectedReason only do the else when a new record is being entered
@@ -224,10 +223,9 @@
}
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>
- </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>
+ </tr>';
}
if (!isset($_POST['ReasonDescription'])) {
@@ -247,4 +245,4 @@
echo '</table><br><div class="centre"><input tabindex=4 type="submit" name="submit" value="' . _('Enter Information') . '"></div></form>';
} //end if record deleted no point displaying form to add record
include('includes/footer.inc');
-?>
+?>
\ No newline at end of file
Modified: trunk/CustomerBranches.php
===================================================================
--- trunk/CustomerBranches.php 2011-05-13 10:50:42 UTC (rev 4565)
+++ trunk/CustomerBranches.php 2011-05-14 11:24:22 UTC (rev 4566)
@@ -97,8 +97,8 @@
$row = DB_fetch_array($resultgeo);
$api_key = $row['geocode_key'];
$map_host = $row['map_host'];
- define("MAPS_HOST", $map_host);
- define("KEY", $api_key);
+ define('MAPS_HOST', $map_host);
+ define('KEY', $api_key);
if ($map_host=="") {
// check that some sane values are setup already in geocode tables, if not skip the geocoding but add the record anyway.
echo '<div class="warn">' . _('Warning - Geocode Integration is enabled, but no hosts are setup. Go to Geocode Setup') . '</div>';
@@ -417,8 +417,12 @@
$DebtorNo,
urlencode($myrow[1]),
_('Delete Branch'));
- if ($myrow[11]){ $TotalDisable++; }
- else { $TotalEnable++; }
+
+ if ($myrow[11]){
+ $TotalDisable++;
+ }else {
+ $TotalEnable++;
+ }
} while ($myrow = DB_fetch_row($result));
//END WHILE LIST LOOP
@@ -628,9 +632,9 @@
while ($myrow = DB_fetch_array($result)) {
if (isset($_POST['Salesman']) and $myrow['salesmancode']==$_POST['Salesman']) {
- echo '<option selected VALUE=';
+ echo '<option selected value=';
} else {
- echo '<option VALUE=';
+ echo '<option value=';
}
echo $myrow['salesmancode'] . '>' . $myrow['salesmanname'];
@@ -654,11 +658,11 @@
echo '<td><select tabindex=14 name="Area">';
while ($myrow = DB_fetch_array($result)) {
if (isset($_POST['Area']) and $myrow['areacode']==$_POST['Area']) {
- echo '<option selected VALUE=';
+ echo '<option selected value="';
} else {
- echo '<option VALUE=';
+ echo '<option value="';
}
- echo $myrow['areacode'] . '>' . $myrow['areadescription'];
+ echo $myrow['areacode'] . '">' . $myrow['areadescription'];
} //end while loop
@@ -666,7 +670,7 @@
echo '</select></td></tr>';
DB_data_seek($result,0);
- $sql = 'SELECT loccode, locationname FROM locations';
+ $sql = "SELECT loccode, locationname FROM locations";
$result = DB_query($sql,$db);
if (DB_num_rows($result)==0){
@@ -682,11 +686,11 @@
while ($myrow = DB_fetch_array($result)) {
if (isset($_POST['DefaultLocation']) and $myrow['loccode']==$_POST['DefaultLocation']) {
- echo '<option selected value=';
+ echo '<option selected value="';
} else {
- echo '<option value=';
+ echo '<option value="';
}
- echo $myrow['loccode'] . '>' . $myrow['locationname'] . '</option>';
+ echo $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>';
} //end while loop
@@ -714,11 +718,11 @@
while ($myrow = DB_fetch_array($result)) {
if (isset($_POST['TaxGroup']) and $myrow['taxgroupid']==$_POST['TaxGroup']) {
- echo '<option selected VALUE=';
+ echo '<option selected value="';
} else {
- echo '<option VALUE=';
+ echo '<option value="';
}
- echo $myrow['taxgroupid'] . '>' . $myrow['taxgroupdescription'] . '</option>';
+ echo $myrow['taxgroupid'] . '">' . $myrow['taxgroupdescription'] . '</option>';
} //end while loop
@@ -779,7 +783,7 @@
if (!isset($_POST['CustBranchCode'])) {$_POST['CustBranchCode']='';}
echo '<td><input tabindex=27 type="Text" name="CustBranchCode" size=31 maxlength=30 value="'. $_POST['CustBranchCode'].'"></td></tr>';
echo '</table>';
- echo '<br /><div class="centre"><input tabindex=28 type="Submit" name="submit" value="' . _('Enter Branch') . '"></div>';
+ echo '<br /><div class="centre"><input tabindex=28 type="submit" name="submit" value="' . _('Enter Branch') . '"></div>';
echo '</form>';
} //end if record deleted no point displaying form to add record
Modified: trunk/CustomerInquiry.php
===================================================================
--- trunk/CustomerInquiry.php 2011-05-13 10:50:42 UTC (rev 4565)
+++ trunk/CustomerInquiry.php 2011-05-14 11:24:22 UTC (rev 4566)
@@ -1,12 +1,9 @@
<?php
-/* $Revision: 1.30 $ */
/* $Id$*/
include('includes/SQL_CommonFunctions.inc');
-//$PageSecurity = 1;
-
include('includes/session.inc');
$title = _('Customer Inquiry');
include('includes/header.inc');
@@ -15,7 +12,7 @@
if(!isset($_GET['CustomerID']) AND !isset($_SESSION['CustomerID'])){
prnMsg(_('To display the enquiry a customer must first be selected from the customer selection screen'),'info');
- echo '<br><div class="centre"><a href="'. $rootpath . '/SelectCustomer.php?' . SID . '">' . _('Select a Customer to Inquire On') . '</a><br></div>';
+ echo '<br /><div class="centre"><a href="'. $rootpath . '/SelectCustomer.php?' . SID . '">' . _('Select a Customer to Inquire On') . '</a><br /></div>';
include('includes/footer.inc');
exit;
} else {
@@ -37,6 +34,7 @@
$SQL = "SELECT debtorsmaster.name,
currencies.currency,
+ currencies.decimalplaces,
paymentterms.terms,
debtorsmaster.creditlimit,
holdreasons.dissallowinvoices,
@@ -93,18 +91,21 @@
$NIL_BALANCE = True;
- $SQL = "SELECT debtorsmaster.name, currencies.currency, paymentterms.terms,
- debtorsmaster.creditlimit, holdreasons.dissallowinvoices, holdreasons.reasondescription
- FROM debtorsmaster,
- paymentterms,
- holdreasons,
- currencies
- WHERE
- debtorsmaster.paymentterms = paymentterms.termsindicator
- AND debtorsmaster.currcode = currencies.currabrev
- AND debtorsmaster.holdreason = holdreasons.reasoncode
- AND debtorsmaster.debtorno = '" . $CustomerID . "'";
-
+ $SQL = "SELECT debtorsmaster.name,
+ currencies.currency,
+ currencies.decimalplaces,
+ paymentterms.terms,
+ debtorsmaster.creditlimit,
+ holdreasons.dissallowinvoices,
+ holdreasons.reasondescription
+ FROM debtorsmaster INNER JOIN paymentterms
+ ON debtorsmaster.paymentterms = paymentterms.termsindicator
+ INNER JOIN holdreasons
+ ON debtorsmaster.holdreason = holdreasons.reasoncode
+ INNER JOIN currencies
+ debtorsmaster.currcode = currencies.currabrev
+ WHERE debtorsmaster.debtorno = '" . $CustomerID . "'";
+
$ErrMsg =_('The customer details could not be retrieved by the SQL because');
$CustomerResult = DB_query($SQL,$db,$ErrMsg);
@@ -123,33 +124,32 @@
echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' .
_('Customer') . '" alt="" />' . ' ' . _('Customer') . ' : ' . $CustomerRecord['name'] . ' - (' . _('All amounts stated in') .
- ' ' . $CustomerRecord['currency'] . ')<br><br>' . _('Terms') . ' : ' . $CustomerRecord['terms'] . '<br>' . _('Credit Limit') .
+ ' ' . $CustomerRecord['currency'] . ')<br /><br />' . _('Terms') . ' : ' . $CustomerRecord['terms'] . '<br />' . _('Credit Limit') .
': ' . number_format($CustomerRecord['creditlimit'],0) . ' ' . _('Credit Status') . ': ' . $CustomerRecord['reasondescription'] . '</p>';
if ($CustomerRecord['dissallowinvoices']!=0){
- echo '<br><font color=RED size=4><b>' . _('ACCOUNT ON HOLD') . '</font></b><br>';
+ 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>
- <th width=20%>" . _('Now Due') . "</th>
- <th width=20%>" . $_SESSION['PastDueDays1'] . "-" . $_SESSION['PastDueDays2'] . ' ' . _('Days Overdue') . "</th>
- <th width=20%>" . _('Over') . ' ' . $_SESSION['PastDueDays2'] . ' ' . _('Days Overdue') . '</th></tr>';
+ <th width=20%>' . _('Total Balance') . '</th>
+ <th width=20%>' . _('Current') . '</th>
+ <th width=20%>' . _('Now Due') . '</th>
+ <th width=20%>' . $_SESSION['PastDueDays1'] . '-' . $_SESSION['PastDueDays2'] . ' ' . _('Days Overdue') . '</th>
+ <th width=20%>' . _('Over') . ' ' . $_SESSION['PastDueDays2'] . ' ' . _('Days Overdue') . '</th></tr>';
-echo '<tr><td class=number>' . number_format($CustomerRecord['balance'],2) . '</td>
- <td class=number>' . number_format(($CustomerRecord['balance'] - $CustomerRecord['due']),2) . '</td>
- <td class=number>' . number_format(($CustomerRecord['due']-$CustomerRecord['overdue1']),2) . '</td>
- <td class=number>' . number_format(($CustomerRecord['overdue1']-$CustomerRecord['overdue2']) ,2) . '</td>
- <td class=number>' . number_format($CustomerRecord['overdue2'],2) . '</td>
+echo '<tr><td class=number>' . number_format($CustomerRecord['balance'],$CustomerRecord['decimalplaces']) . '</td>
+ <td class=number>' . number_format(($CustomerRecord['balance'] - $CustomerRecord['due']),$CustomerRecord['decimalplaces']) . '</td>
+ <td class=number>' . number_format(($CustomerRecord['due']-$CustomerRecord['overdue1']),$CustomerRecord['decimalplaces']) . '</td>
+ <td class=number>' . number_format(($CustomerRecord['overdue1']-$CustomerRecord['overdue2']) ,$CustomerRecord['decimalplaces']) . '</td>
+ <td class=number>' . number_format($CustomerRecord['overdue2'],$CustomerRecord['decimalplaces']) . '</td>
</tr>
</table>';
-echo "<br><div class='centre'><form action='" . $_SERVER['PHP_SELF'] . "' method=post>";
+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']);
@@ -186,21 +186,22 @@
echo '<table class="selection" cellpadding="2" colspan="7">';
$tableheader = '<tr>
- <th>' . _('Type') . '</th>
- <th>' . _('Number') . '</th>
- <th>' . _('Date') . '</th>
- <th>' . _('Branch') . '</th>
- <th>' . _('Reference') . '</th>
- <th>' . _('Comments') . '</th>
- <th>' . _('Order') . '</th>
- <th>' . _('Total') . '</th>
- <th>' . _('Allocated') . '</th>
- <th>' . _('Balance') . '</th>
- <th>' . _('More Info') . '</th>
- <th>' . _('More Info') . '</th>
- <th>' . _('More Info') . '</th>
- <th>' . _('More Info') . '</th>
- <th>' . _('More Info') . '</th></tr>';
+ <th>' . _('Type') . '</th>
+ <th>' . _('Number') . '</th>
+ <th>' . _('Date') . '</th>
+ <th>' . _('Branch') . '</th>
+ <th>' . _('Reference') . '</th>
+ <th>' . _('Comments') . '</th>
+ <th>' . _('Order') . '</th>
+ <th>' . _('Total') . '</th>
+ <th>' . _('Allocated') . '</th>
+ <th>' . _('Balance') . '</th>
+ <th>' . _('More Info') . '</th>
+ <th>' . _('More Info') . '</th>
+ <th>' . _('More Info') . '</th>
+ <th>' . _('More Info') . '</th>
+ <th>' . _('More Info') . '</th>
+ </tr>';
echo $tableheader;
@@ -225,25 +226,26 @@
}
$BaseFormatString = '<td>%s</td>
- <td>%s</td>
- <td>%s</td>
- <td>%s</td>
- <td>%s</td>
- <td width="200">%s</td>
- <td>%s</td>
- <td class=number>%s</td>
- <td class=number>%s</td>
- <td class=number>%s</td>';
+ <td>%s</td>
+ <td>%s</td>
+ <td>%s</td>
+ <td>%s</td>
+ <td width="200">%s</td>
+ <td>%s</td>
+ <td class=number>%s</td>
+ <td class=number>%s</td>
+ <td class=number>%s</td>';
+
- $CreditInvoiceFormatString = '<td><a href="%s/Credit_Invoice.php?InvoiceNumber=%s">' . _('Credit ') .'<IMG SRC="%s/credit.gif" title="' . _('Click to credit the invoice') . '"></a></td>';
+ $CreditInvoiceFormatString = '<td><a href="%s/Credit_Invoice.php?InvoiceNumber=%s">' . _('Credit ') .'<img src="%s/credit.gif" title="' . _('Click to credit the invoice') . '"></a></td>';
- $PreviewInvoiceFormatString = '<td><a href="%s/PrintCustTrans.php?FromTransNo=%s&InvOrCredit=Invoice">' . _('HTML ') . '<IMG SRC="%s/preview.gif" title="' . _('Click to preview the invoice') . '"></a></td>
- <td><a href="%s/%s?FromTransNo=%s&InvOrCredit=Invoice&PrintPDF=True">' . _('PDF ') . '<IMG SRC="%s/css/' . $theme . '/images/pdf.png" title="' . _('Click for PDF') . '"></a></td>
- <td><a href="%s/EmailCustTrans.php?FromTransNo=%s&InvOrCredit=Invoice">' . _('Email ') . '<IMG SRC="%s/email.gif" title="' . _('Click to email the invoice') . '"></a></td>';
+ $PreviewInvoiceFormatString = '<td><a href="%s/PrintCustTrans.php?FromTransNo=%s&InvOrCredit=Invoice">' . _('HTML ') . '<img src="%s/preview.gif" title="' . _('Click to preview the invoice') . '"></a></td>
+ <td><a href="%s/%s?FromTransNo=%s&InvOrCredit=Invoice&PrintPDF=True">' . _('PDF ') . '<img src="%s/css/' . $theme . '/images/pdf.png" title="' . _('Click for PDF') . '"></a></td>
+ <td><a href="%s/EmailCustTrans.php?FromTransNo=%s&InvOrCredit=Invoice">' . _('Email ') . '<img src="%s/email.gif" title="' . _('Click to email the invoice') . '"></a></td>';
$PreviewCreditFormatString = '<td><a href="%s/PrintCustTrans.php?FromTransNo=%s&InvOrCredit=Credit">' . _('HTML ') . ' <IMG SRC="%s/preview.gif" title="' . _('Click to preview the credit note') . '"></a></td>
- <td><a href="%s/%s?FromTransNo=%s&InvOrCredit=Credit&PrintPDF=True">' . _('PDF ') . '<IMG SRC="%s/css/' . $theme . '/images/pdf.png" title="' . _('Click for PDF') . '"></a></td>
- <td><a href="%s/EmailCustTrans.php?FromTransNo=%s&InvOrCredit=Credit">' . _('Email') . ' <IMG SRC="%s/email.gif" title="' . _('Click to email the credit note') . '"></a></td>';
+ <td><a href="%s/%s?FromTransNo=%s&InvOrCredit=Credit&PrintPDF=True">' . _('PDF ') . '<img src="%s/css/' . $theme . '/images/pdf.png" title="' . _('Click for PDF') . '"></a></td>
+ <td><a href="%s/EmailCustTrans.php?FromTransNo=%s&InvOrCredit=Credit">' . _('Email') . ' <img src="%s/email.gif" title="' . _('Click to email the credit note') . '"></a></td>';
/* assumed allowed page security token 3 allows the user to create credits for invoices */
if (in_array(3,$_SESSION['AllowedPageSecurityTokens']) && $myrow['type']==10){
@@ -255,7 +257,7 @@
/* format string with GL inquiry options and for invoice to be credited */
printf($BaseFormatString . $CreditInvoiceFormatString . $PreviewInvoiceFormatString .
- '<td><a href="%s/GLTransInquiry.php?%s&TypeID=%s&TransNo=%s">' . _('View GL Entries') . ' <IMG SRC="' .$rootpath. '/css/'.$theme.'/images/gl.png" title="' . _('View the GL Entries') . '"></a></td>
+ '<td><a href="%s/GLTransInquiry.php?TypeID=%s&TransNo=%s">' . _('View GL Entries') . ' <img src="' .$rootpath. '/css/'.$theme.'/images/gl.png" title="' . _('View the GL Entries') . '"></a></td>
</tr>',
//$BaseFormatString parameters
$myrow['typename'],
@@ -265,9 +267,9 @@
$myrow['reference'],
$myrow['invtext'],
$myrow['order_'],
- number_format($myrow['totalamount'],2),
- number_format($myrow['allocated'],2),
- number_format($myrow['totalamount']-$myrow['allocated'],2),
+ number_format($myrow['totalamount'],$CustomerRecord['decimalplaces']),
+ number_format($myrow['allocated'],$CustomerRecord['decimalplaces']),
+ number_format($myrow['totalamount']-$myrow['allocated'],$CustomerRecord['decimalplaces']),
//$CreditInvoiceFormatString parameters
$rootpath,
$myrow['transno'],
@@ -279,13 +281,12 @@
$rootpath,
$PrintCustomerTransactionScript,
$myrow['transno'],
- $rootpath.'/css/'.$theme.'/images',
$rootpath,
+ $rootpath,
$myrow['transno'],
$rootpath.'/css/'.$theme.'/images',
//Parameter for string for GL Trans Inquiries
$rootpath,
- SID,
$myrow['type'],
$myrow['transno']);
} else { //user does not have privileges to see GL inquiry stuff
@@ -299,9 +300,9 @@
$myrow['reference'],
$myrow['invtext'],
$myrow['order_'],
- number_format($myrow['totalamount'],2),
- number_format($myrow['allocated'],2),
- number_format($myrow['totalamount']-$myrow['allocated'],2),
+ number_format($myrow['totalamount'],$CustomerRecord['decimalplaces']),
+ number_format($myrow['allocated'],$CustomerRecord['decimalplaces']),
+ number_format($myrow['totalamount']-$myrow['allocated'],$CustomerRecord['decimalplaces']),
//CreditInvoiceFormatString parameters
$rootpath,
$myrow['transno'],
@@ -313,8 +314,8 @@
$rootpath,
$PrintCustomerTransactionScript,
$myrow['transno'],
- $rootpath.'/css/'.$theme.'/images',
$rootpath,
+ $rootpath,
$myrow['transno'],
$rootpath.'/css/'.$theme.'/images');
}
@@ -332,9 +333,9 @@
$myrow['reference'],
$myrow['invtext'],
$myrow['order_'],
- number_format($myrow['totalamount'],2),
- number_format($myrow['allocated'],2),
- number_format($myrow['totalamount']-$myrow['allocated'],2),
+ number_format($myrow['totalamount'],$CustomerRecord['decimalplaces']),
+ number_format($myrow['allocated'],$CustomerRecord['decimalplaces']),
+ number_format($myrow['totalamount']-$myrow['allocated'],$CustomerRecord['decimalplaces']),
//$PreviewInvoiceFormatString parameters
$rootpath,
$myrow['transno'],
@@ -342,8 +343,8 @@
$rootpath,
$PrintCustomerTransactionScript,
$myrow['transno'],
- $rootpath.'/css/'.$theme.'/images',
$rootpath,
+ $rootpath,
$myrow['transno'],
$rootpath.'/css/'.$theme.'/images');
@@ -351,8 +352,8 @@
if ($_SESSION['CompanyRecord']['gllink_debtors']== 1 AND in_array(8,$_SESSION['AllowedPageSecurityTokens'])){
printf($BaseFormatString .
$PreviewCreditFormatString .
- "<td><a href='%s/CustomerAllocations.php?AllocTrans=%s'>" . _('Allocation') . "<IMG SRC='" .$rootpath."/css/".$theme."/images/allocation.png' title='" . _('Click to allocate funds') . "'></a></td>
- <td><a href='%s/GLTransInquiry.php?%sTypeID=%s&TransNo=%s'>" . _('View GL Entries') . ' <a><IMG SRC="' .$rootpath.'/css/'.$theme.'/images/gl.png" title="' . _('View the GL Entries') . '"></a></td></tr>',
+ '<td><a href="%s/CustomerAllocations.php?AllocTrans=%s">' . _('Allocation') . '<img src="' .$rootpath .'/css/' . $theme .'/images/allocation.png" title="' . _('Click to allocate funds') . '"></a></td>
+ <td><a href="%s/GLTransInquiry.php?TypeID=%s&TransNo=%s">' . _('View GL Entries') . ' <a><img src="' .$rootpath.'/css/'.$theme.'/images/gl.png" title="' . _('View the GL Entries') . '"></a></td></tr>',
//$BaseFormatString parameters
$myrow['typename'],
$myrow['transno'],
@@ -361,9 +362,9 @@
$myrow['reference'],
$myrow['invtext'],
$myrow['order_'],
- number_format($myrow['totalamount'],2),
- number_format($myrow['allocated'],2),
- number_format($myrow['totalamount']-$myrow['allocated'],2),
+ number_format($myrow['totalamount'],$CustomerRecord['decimalplaces']),
+ number_format($myrow['allocated'],$CustomerRecord['decimalplaces']),
+ number_format($myrow['totalamount']-$myrow['allocated'],$CustomerRecord['decimalplaces']),
//$PreviewCreditFormatString parameters
$rootpath,
$myrow['transno'],
@@ -371,22 +372,21 @@
$rootpath,
$PrintCustomerTransactionScript,
$myrow['transno'],
- $rootpath.'/css/'.$theme.'/images',
$rootpath,
+ $rootpath,
$myrow['transno'],
$rootpath.'/css/'.$theme.'/images',
// hand coded format string for Allocations and GLTrans Inquiry parameters
$rootpath,
$myrow['id'],
$rootpath,
- SID,
$myrow['type'],
$myrow['transno']);
} else {
printf($BaseFormatString .
$PreviewCreditFormatString .
- "<td><a href='%s/CustomerAllocations.php?AllocTrans=%s'>" . _('Allocation') . "<IMG SRC='%s/allocation.png' title='" . _('Click to allocate funds') . "'></a></td>
- </tr>",
+ '<td><a href="%s/CustomerAllocations.php?AllocTrans=%s">' . _('Allocation') . '<img src="%s/allocation.png" title="' . _('Click to allocate funds') . '"></a></td>
+ </tr>',
$myrow['typename'],
$myrow['transno'],
ConvertSQLDate($myrow['trandate']),
@@ -394,9 +394,9 @@
$myrow['reference'],
$myrow['invtext'],
$myrow['order_'],
- number_format($myrow['totalamount'],2),
- number_format($myrow['allocated'],2),
- number_format($myrow['totalamount']-$myrow['allocated'],2),
+ number_format($myrow['totalamount'],$CustomerRecord['decimalplaces']),
+ number_format($myrow['allocated'],$CustomerRecord['decimalplaces']),
+ number_format($myrow['totalamount']-$myrow['allocated'],$CustomerRecord['decimalplaces']),
//$PreviewCreditFormatString parameters
$rootpath,
$myrow['transno'],
@@ -404,8 +404,8 @@
$rootpath,
$PrintCustomerTransactionScript,
$myrow['transno'],
- $rootpath.'/css/'.$theme.'/images',
$rootpath,
+ $rootpath,
$myrow['transno'],
$rootpath.'/css/'.$theme.'/images',
//Parameters for hand coded string to show allocations
@@ -418,9 +418,9 @@
//If security token 8 in the allowed page security tokens then assumed ok for GL trans inquiries
if ($_SESSION['CompanyRecord']['gllink_debtors']== 1 AND in_array(8,$_SESSION['AllowedPageSecurityTokens'])){
printf($BaseFormatString .
- "<td><a href='%s/CustomerAllocations.php?AllocTrans=%s'>" . _('Allocation') . "<IMG SRC='" .$rootpath."/css/".$theme."/images/allocation.png' title='" . _('Click to allocate funds') . "'></a></td>
- <td><a href='%s/GLTransInquiry.php?%s&TypeID=%s&TransNo=%s'>" . _('View GL Entries') . " <IMG SRC='" .$rootpath."/css/".$theme."/images/gl.png' title='" . _('View the GL Entries') . "'></a></td>
- </tr>",
+ '<td><a href="%s/CustomerAllocations.php?AllocTrans=%s">' . _('Allocation') . '<img src="' .$rootpath . '/css/' . $theme .'/images/allocation.png" title="' . _('Click to allocate funds') . '"></a></td>
+ <td><a href="%s/GLTransInquiry.php?TypeID=%s&TransNo=%s">' . _('View GL Entries') . ' <img src="' .$rootpath . '/css/' . $theme .'/images/gl.png" title="' . _('View the GL Entries') . '"></a></td>
+ </tr>',
$myrow['typename'],
$myrow['transno'],
ConvertSQLDate($myrow['trandate']),
@@ -428,19 +428,18 @@
$myrow['reference'],
$myrow['invtext'],
$myrow['order_'],
- number_format($myrow['totalamount'],2),
- number_format($myrow['allocated'],2),
- number_format($myrow['totalamount']-$myrow['allocated'],2),
+ number_format($myrow['totalamount'],$CustomerRecord['decimalplaces']),
+ number_format($myrow['allocated'],$CustomerRecord['decimalplaces']),
+ number_format($myrow['totalamount']-$myrow['allocated'],$CustomerRecord['decimalplaces']),
$rootpath,
$myrow['id'],
$rootpath,
- SID,
$myrow['type'],
$myrow['transno']);
} else { //no permission for GLTrans Inquiries
printf($BaseFormatString .
- "<td><a href='%s/CustomerAllocations.php?AllocTrans=%s'>" . _('Allocation') . "<IMG SRC='" .$rootpath."/css/".$theme."/images/allocation.png' title='" . _('Click to allocate funds') . "'></a></td>
- </tr>",
+ '<td><a href="%s/CustomerAllocations.php?AllocTrans=%s">' . _('Allocation') . '<img src="' .$rootpath . '/css/' . $theme .'/images/allocation.png" title="' . _('Click to allocate funds') . '"></a></td>
+ </tr>',
$myrow['typename'],
$myrow['transno'],
ConvertSQLDate($myrow['trandate']),
@@ -448,9 +447,9 @@
$myrow['reference'],
$myrow['invtext'],
$myrow['order_'],
- number_format($myrow['totalamount'],2),
- number_format($myrow['allocated'],2),
- number_format($myrow['totalamount']-$myrow['allocated'],2),
+ number_format($myrow['totalamount'],$CustomerRecord['decimalplaces']),
+ number_format($myrow['allocated'],$CustomerRecord['decimalplaces']),
+ number_format($myrow['totalamount']-$myrow['allocated'],$CustomerRecord['decimalplaces']),
$rootpath,
$myrow['id']);
}
@@ -459,7 +458,7 @@
//If security token 8 in the allowed page security tokens then assumed ok for GL trans inquiries
if ($_SESSION['CompanyRecord']['gllink_debtors']== 1 AND in_array(8,$_SESSION['AllowedPageSecurityTokens'])){
printf($BaseFormatString .
- '<td><a href="%s/GLTransInquiry.php?%s&TypeID=%s&TransNo=%s">' . _('View GL Entries') . ' <a></td></tr>',
+ '<td><a href="%s/GLTransInquiry.php?TypeID=%s&TransNo=%s">' . _('View GL Entries') . ' <a></td></tr>',
$myrow['typename'],
$myrow['transno'],
ConvertSQLDate($myrow['trandate']),
@@ -467,11 +466,10 @@
$myrow['reference'],
$myrow['invtext'],
$myrow['order_'],
- number_format($myrow['totalamount'],2),
- number_format($myrow['allocated'],2),
- number_format($myrow['totalamount']-$myrow['allocated'],2),
+ number_format($myrow['totalamount'],$CustomerRecord['decimalplaces']),
+ number_format($myrow['allocated'],$CustomerRecord['decimalplaces']),
+ number_format($myrow['totalamount']-$myrow['allocated'],$CustomerRecord['decimalplaces']),
$rootpath,
- SID,
$myrow['type'],
$myrow['transno']);
} else { //no permission for GLTrans Inquiries
@@ -483,15 +481,15 @@
$myrow['reference'],
$myrow['invtext'],
$myrow['order_'],
- number_format($myrow['totalamount'],2),
- number_format($myrow['allocated'],2),
- number_format($myrow['totalamount']-$myrow['allocated'],2));
+ number_format($myrow['totalamount'],$CustomerRecord['decimalplaces']),
+ number_format($myrow['allocated'],$CustomerRecord['decimalplaces']),
+ number_format($myrow['totalamount']-$myrow['allocated'],$CustomerRecord['decimalplaces']));
}
} else {
//If security token 8 in the allowed page security tokens then assumed ok for GL trans inquiries
if ($_SESSION['CompanyRecord']['gllink_debtors']== 1 AND in_array(8,$_SESSION['AllowedPageSecurityTokens'])){
printf($BaseFormatString .
- '<td><a href="%s/GLTransInquiry.php?%s&TypeID=%s&TransNo=%s">' . _('View GL Entries') . ' <a></td></tr>',
+ '<td><a href="%s/GLTransInquiry.php?TypeID=%s&TransNo=%s">' . _('View GL Entries') . ' <a></td></tr>',
$myrow['typename'],
$myrow['transno'],
ConvertSQLDate($myrow['trandate']),
@@ -499,11 +497,10 @@
$myrow['reference'],
$myrow['invtext'],
$myrow['order_'],
- number_format($myrow['totalamount'],2),
- number_format($myrow['allocated'],2),
- number_format($myrow['totalamount']-$myrow['allocated'],2),
+ number_format($myrow['totalamount'],$CustomerRecord['decimalplaces']),
+ number_format($myrow['allocated'],$CustomerRecord['decimalplaces']),
+ number_format($myrow['totalamount']-$myrow['allocated'],$CustomerRecord['decimalplaces']),
$rootpath,
- SID,
$myrow['type'],
$myrow['transno']);
} else {
@@ -515,9 +512,9 @@
$myrow['reference'],
$myrow['invtext'],
$myrow['order_'],
- number_format($myrow['totalamount'],2),
- number_format($myrow['allocated'],2),
- number_format($myrow['totalamount']-$myrow['allocated'],2));
+ number_format($myrow['totalamount'],$CustomerRecord['decimalplaces']),
+ number_format($myrow['allocated'],$CustomerRecord['decimalplaces']),
+ number_format($myrow['totalamount']-$myrow['allocated'],$CustomerRecord['decimalplaces']));
}
}
@@ -526,4 +523,4 @@
echo '</table>';
include('includes/footer.inc');
-?>
+?>
\ No newline at end of file
Modified: trunk/CustomerReceipt.php
===================================================================
--- trunk/CustomerReceipt.php 2011-05-13 10:50:42 UTC (rev 4565)
+++ trunk/CustomerReceipt.php 2011-05-14 11:24:22 UTC (rev 4566)
@@ -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/DailyBankTransactions.php
===================================================================
--- trunk/DailyBankTransactions.php 2011-05-13 10:50:42 UTC (rev 4565)
+++ trunk/DailyBankTransactions.php 2011-05-14 11:24:22 UTC (rev 4566)
@@ -1,6 +1,7 @@
<?php
-//$PageSecurity = 8; now from Database Scripts table
+/* $Id: DailyBankTransactions.php 4556 2011-04-26 11:03:36Z daintree $ */
+
include ('includes/session.inc');
$title = _('Bank Transactions Inquiry');
include('includes/header.inc');
@@ -9,23 +10,24 @@
_('Search') . '" alt="" />' . ' ' . $title.'</p>';
if (!isset($_POST['Show'])) {
- echo '<form action=' . $_SERVER['PHP_SELF'] . '?' . SID . ' method=post>';
+ echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
echo '<table class=selection>';
- $SQL = 'SELECT bankaccountname,
- bankaccounts.accountcode,
- bankaccounts.currcode
- FROM bankaccounts,
- chartmaster
- WHERE bankaccounts.accountcode=chartmaster.accountcode';
+ $SQL = "SELECT bankaccountname,
+ bankaccounts.accountcode,
+ bankaccounts.currcode
+ FROM bankaccounts,
+ chartmaster
+ WHERE bankaccounts.accountcode=chartmaster.accountcode";
$ErrMsg = _('The bank accounts could not be retrieved 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 name="BankAccount">';
+ echo '<tr><td>' . _('Bank Account') . ':</td>
+ <td><select name="BankAccount">';
if (DB_num_rows($AccountsResults)==0){
echo '</select></td></tr></table><p>';
@@ -60,30 +62,33 @@
echo '</form>';
} else {
$SQL = "SELECT bankaccountname,
- bankaccounts.currcode
- FROM bankaccounts
- WHERE bankaccounts.accountcode='" . $_POST['BankAccount'] . "'";
+ bankaccounts.currcode,
+ currencies.decimalplaces
+ FROM bankaccounts
+ INNER JOIN currencies
+ ON bankaccounts.currcode = currencies.currabrev
+ WHERE bankaccounts.accountcode='" . $_POST['BankAccount'] . "'";
$BankResult = DB_query($SQL,$db,_('Could not retrieve the bank account details'));
$sql="SELECT banktrans.currcode,
- banktrans.amount,
- banktrans.functionalexrate,
- banktrans.exrate,
- banktrans.banktranstype,
- banktrans.transdate,
- bankaccounts.bankaccountname,
- systypes.typename,
- systypes.typeid
- FROM banktrans
- INNER JOIN bankaccounts
- ON banktrans.bankact=bankaccounts.accountcode
- INNER JOIN systypes
- ON banktrans.type=systypes.typeid
- WHERE bankact='".$_POST['BankAccount']."'
- AND transdate>='" . FormatDateForSQL($_POST['FromTransDate']) . "'
- AND transdate<='" . FormatDateForSQL($_POST['ToTransDate']) . "'
- ORDER BY banktrans.transdate";
+ banktrans.amount,
+ banktrans.functionalexrate,
+ banktrans.exrate,
+ banktrans.banktranstype,
+ banktrans.transdate,
+ bankaccounts.bankaccountname,
+ systypes.typename,
+ systypes.typeid
+ FROM banktrans
+ INNER JOIN bankaccounts
+ ON banktrans.bankact=bankaccounts.accountcode
+ INNER JOIN systypes
+ ON banktrans.type=systypes.typeid
+ WHERE bankact='".$_POST['BankAccount']."'
+ AND transdate>='" . FormatDateForSQL($_POST['FromTransDate']) . "'
+ AND transdate<='" . FormatDateForSQL($_POST['ToTransDate']) . "'
+ ORDER BY banktrans.transdate";
$result = DB_query($sql, $db);
if (DB_num_rows($result)==0) {
prnMsg(_('There are no transactions for this account in the date range selected'), 'info');
@@ -94,15 +99,15 @@
<th colspan=7><font size=3 color=blue>' . _('Account Transactions For').' '.$BankDetailRow['bankaccountname'].' '._('Between').' '.$_POST['FromTransDate'] . ' ' . _('and') . ' ' . $_POST['ToTransDate'] . '</font></th>
</tr>';
echo '<tr>
- <th>' . ('Date') . '</th>
- <th>'._('Transaction type').'</th>
- <th>'._('Type').'</th>
- <th>'._('Reference').'</th>
- <th>'._('Amount in').' '.$BankDetailRow['currcode'].'</th>
- <th>'._('Running Total').' '.$BankDetailRow['currcode'].'</th>
- <th>'._('Amount in').' '.$_SESSION['CompanyRecord']['currencydefault'].'</th>
- <th>'._('Running Total').' '.$_SESSION['CompanyRecord']['currencydefault'].'</th>
- </tr>';
+ <th>' . ('Date') . '</th>
+ <th>'._('Transaction type').'</th>
+ <th>'._('Type').'</th>
+ <th>'._('Reference').'</th>
+ <th>'._('Amount in').' '.$BankDetailRow['currcode'].'</th>
+ <th>'._('Running Total').' '.$BankDetailRow['currcode'].'</th>
+ <th>'._('Amount in').' '.$_SESSION['CompanyRecord']['currencydefault'].'</th>
+ <th>'._('Running Total').' '.$_SESSION['CompanyRecord']['currencydefault'].'</th>
+ </tr>';
$AccountCurrTotal=0;
$LocalCurrTotal =0;
@@ -113,20 +118,20 @@
$LocalCurrTotal += $myrow['amount']/$myrow['functionalexrate']/$myrow['exrate'];
echo '<tr>
- <td>'. ConvertSQLDate($myrow['transdate']) . '</td>
- <td>'.$myrow['typename'].'</td>
- <td>'.$myrow['banktranstype'].'</td>
- <td>'.$myrow['ref'].'</td>
- <td class=number>'.number_format($myrow['amount'],2).'</td>
- <td class=number>'.number_format($AccountCurrTotal,2).'</td>
- <td class=number>'.number_format($myrow['amount']/$myrow['functionalexrate']/$myrow['exrate'],2).'</td>
- <td class=number>'.number_format($LocalCurrTotal,2).'</td>
- </tr>';
+ <td>'. ConvertSQLDate($myrow['transdate']) . '</td>
+ <td>'.$myrow['typename'].'</td>
+ <td>'.$myrow['banktranstype'].'</td>
+ <td>'.$myrow['ref'].'</td>
+ <td class=number>'.number_format($myrow['amount'],$BankDetailRow['decimalplaces']).'</td>
+ <td class=number>'.number_format($AccountCurrTotal,$BankDetailRow['decimalplaces']).'</td>
+ <td class=number>'.number_format($myrow['amount']/$myrow['functionalexrate']/$myrow['exrate'],$_SESSION['CompanyRecord']['decimalplaces']).'</td>
+ <td class=number>'.number_format($LocalCurrTotal,$_SESSION['CompanyRecord']['decimalplaces']).'</td>
+ </tr>';
}
echo '</table>';
} //end if no bank trans in the range to show
- echo '<form action=' . $_SERVER['PHP_SELF'] . '?' . SID . ' method=post>';
+ echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
echo '<br><div class="centre"><input type="submit" name="Return" value="' . _('Select Another Date'). '"></div>';
echo '</form>';
Modified: trunk/FTP_RadioBeacon.php
===================================================================
--- trunk/FTP_RadioBeacon.php 2011-05-13 10:50:42 UTC (rev 4565)
+++ trunk/FTP_RadioBeacon.php 2011-05-14 11:24:22 UTC (rev 4566)
@@ -1,10 +1,9 @@
<?php
-/* $Revision: 1.10 $ */
+
/* $Id$*/
/*Variables required to configure this script must be set in config.php */
-//$PageSecurity = 2;
include('includes/session.inc');
$title=_('FTP order to Radio Beacon');
include('includes/header.inc');
@@ -47,17 +46,17 @@
echo '<table cellpadding=2 colspan=7 WIDTH=100%>';
$TableHeader = '<tr>
- <td class=tableheader>' . _('Modify') . '</td>
- <td class=tableheader>' . _('Send to') . '<br>' . _('Radio Beacon') . '</td>
- <td class=tableheader>' . _('Customer') . '</td>
- <td class=tableheader>' . _('Branch') . '</td>
- <td class=tableheader>' . _('Cust Order') . ' #</td>
- <td class=tableheader>' . _('Order Date') . '</td>
- <td class=tableheader>' . _('Req Del Date') . '</td>
- <td class=tableheader>' . _('Delivery To') . '</td>
- <td class=tableheader>' . _('Order Total') . '</td>
- <td class=tableheader>' . _('Last Send') . '</td>
- </tr>';
+ <td class=tableheader>' . _('Modify') . '</td>
+ <td class=tableheader>' . _('Send to') . '<br />' . _('Radio Beacon') . '</td>
+ <td class=tableheader>' . _('Customer') . '</td>
+ <td class=tableheader>' . _('Branch') . '</td>
+ <td class=tableheader>' . _('Cust Order') . ' #</td>
+ <td class=tableheader>' . _('Order Date') . '</td>
+ <td class=tableheader>' . _('Req Del Date') . '</td>
+ <td class=tableheader>' . _('Delivery To') . '</td>
+ <td class=tableheader>' . _('Order Total') . '</td>
+ <td class=tableheader>' . _('Last Send') . '</td>
+ </tr>';
echo $TableHeader;
@@ -72,7 +71,7 @@
$k=1;
}
- $FTPDispatchNote = $_SERVER['PHP_SELF'] . '?' . SID . '&OrderNo=' . $myrow['orderno'];
+ $FTPDispatchNote = $_SERVER['PHP_SELF'] . '?OrderNo=' . $myrow['orderno'];
$FormatedDelDate = ConvertSQLDate($myrow['deliverydate']);
$FormatedOrderDate = ConvertSQLDate($myrow['orddate']);
$FormatedOrderValue = number_format($myrow['ordervalue'],2);
@@ -80,48 +79,48 @@
$ModifyPage = $rootpath . 'SelectOrderItems.php?' . SID . '&ModifyOrderNumber=' . $myrow['orderno'];
if ($myrow['printedpackingslip'] ==1){
- printf("<td><font size=2><a href='%s'>%s</a></font></td>
- <td><font color=RED size=2>" . _('Already') . '<br>' . _('Sent') . "</font></td>
- <td><font size=2>%s</font></td>
- <td><font size=2>%s</font></td>
- <td><font size=2>%s</font></td>
- <td><font size=2>%s</font></td>
- <td><font size=2>%s</font></td>
- <td><font size=2>%s</font></td>
- <td class=number><font size=2>%s</font></td>
- <td><font size=2>%s</font></td></tr>",
- $ModifyPage,
- $myrow['orderno'],
- $myrow['name'],
- $myrow['brname'],
- $myrow['customerref'],
- $FormatedOrderDate,
- $FormatedDelDate,
- $myrow['deliverto'],
- $FormatedOrderValue,
- $FormatedDateLastSent);
+ printf('<td><font size=2><a href="%s">%s</a></font></td>
+ <td><font color=RED size=2>' . _('Already') . '<br />' . _('Sent') . '</font></td>
+ <td><font size=2>%s</font></td>
+ <td><font size=2>%s</font></td>
+ <td><font size=2>%s</font></td>
+ <td><font size=2>%s</font></td>
+ <td><font size=2>%s</font></td>
+ <td><font size=2>%s</font></td>
+ <td class=number><font size=2>%s</font></td>
+ <td><font size=2>%s</font></td></tr>',
+ $ModifyPage,
+ $myrow['orderno'],
+ $myrow['name'],
+ $myrow['brname'],
+ $myrow['customerref'],
+ $FormatedOrderDate,
+ $FormatedDelDate,
+ $myrow['deliverto'],
+ $FormatedOrderValue,
+ $FormatedDateLastSent);
} else {
- printf("<td><font size=2><a href='%s'>%s</a></font></td>
- <td><font size=2><a href='%s'>" . _('Send') . "</a></font></td>
- <td><font size=2>%s</font></td>
- <td><font size=2>%s</font></td>
- <td><font size=2>%s</font></td>
- <td><font size=2>%s</font></td>
- <td><font size=2>%s</font></td>
- <td><font size=2>%s</font></td>
- <td class=number><font size=2>%s</font></td>
- <td><font size=2>%s</font></td></tr>",
- $ModifyPage,
- $myrow['orderno'],
- $FTPDispatchNote,
- $myrow['name'],
- $myrow['brname'],
- $myrow['customerref'],
- $FormatedOrderDate,
- $FormatedDelDate,
- $myrow['deliverto'],
- $FormatedOrderValue,
- $FormatedDateLastSent);
+ printf('<td><font size=2><a href="%s">%s</a></font></td>
+ <td><font size=2><a href="%s">' . _('Send') . '</a></font></td>
+ <td><font size=2>%s</font></td>
+ <td><font size=2>%s</font></td>
+ <td><font size=2>%s</font></td>
+ <td><font size=2>%s</font></td>
+ <td><font size=2>%s</font></td>
+ <td><font size=2>%s</font></td>
+ <td class=number><font size=2>%s</font></td>
+ <td><font size=2>%s</font></td></tr>',
+ $ModifyPage,
+ $myrow['orderno'],
+ $FTPDispatchNote,
+ $myrow['name'],
+ $myrow['brname'],
+ $myrow['customerref'],
+ $FormatedOrderDate,
+ $FormatedDelDate,
+ $myrow['deliverto'],
+ $FormatedOrderValue,
+ $FormatedDateLastSent);
}
$j++;
if ($j == 12){
@@ -173,7 +172,7 @@
debtorsmaster
WHERE salesorders.debtorno=debtorsmaster.debtorno
AND salesorders.fromstkloc = '". $_SESSION['RadioBeaconStockLocation'] . "'
- AND salesorders.orderno=" . $_GET['OrderNo'];
+ AND salesorders.orderno='" . $_GET['OrderNo'] . "'";
$ErrMsg = _('There was a problem retrieving the order header details for Order Number') . ' ' . $_GET['OrderNo'] . ' ' . _('from the database');
@@ -183,24 +182,24 @@
$myrow = DB_fetch_array($result);
if ($myrow['printedpackingslip']==1){
- prnMsg(_('Order Number') . ' ' . $_GET['OrderNo'] . ' ' . _('has previously been sent to Radio Beacon') . '. ' . _('It was sent on') . ' ' . ConvertSQLDate($myrow['datepackingslipprinted']) . '<br>' . _('To re-send the order with the balance not previously dispatched and invoiced the order must be modified to allow a reprint (or re-send)') . '.<br>' . _('This check is there to ensure that duplication of dispatches to the customer are avoided'),'warn');
- echo "<p><a href='$rootpath/SelectOrderItems.php?" . SID . "&ModifyOrderNumber=" . $_GET['OrderNo'] . "'>" . _('Modify the order to allow a re-send or reprint') . ' (' . _('Select Delivery Details') . ')' . '</a>';
- echo "<p><a href='$rootpath/index.php'>" . _('Back to the menu') . '</a>';
+ prnMsg(_('Order Number') . ' ' . $_GET['OrderNo'] . ' ' . _('has previously been sent to Radio Beacon') . '. ' . _('It was sent on') . ' ' . ConvertSQLDate($myrow['datepackingslipprinted']) . '<br />' . _('To re-send the order with the balance not previously dispatched and invoiced the order must be modified to allow a reprint (or re-send)') . '.<br />' . _('This check is there to ensure that duplication of dispatches to the customer are avoided'),'warn');
+ echo '<p><a href="' . $rootpath . '/SelectOrderItems.php?ModifyOrderNumber=' . $_GET['OrderNo'] . '">' . _('Modify the order to allow a re-send or reprint') . ' (' . _('Select Delivery Details') . ')' . '</a>';
+ echo '<p><a href="' . $rootpath/index.php . '">' . _('Back to the menu') . '</a>';
include('includes/footer.inc');
exit;
}
/*Now get the line items */
$sql = "SELECT stkcode,
- description,
- quantity,
- units,
- qtyinvoiced,
- unitprice
- FROM salesorderdetails,
- stockmaster
- WHERE salesorderdetails.stkcode=stockmaster.stockid
- AND salesorderdetails.orderno=" . $_GET['OrderNo'];
+ description,
+ quantity,
+ units,
+ qtyinvoiced,
+ unitprice
+ FROM salesorderdetails,
+ stockmaster
+ WHERE salesorderdetails.stkcode=stockmaster.stockid
+ AND salesorderdetails.orderno=" . $_GET['OrderNo'];
$ErrMsg = _('There was a problem retrieving the line details for order number') . ' ' . $_GET['OrderNo'] . ' ' . _('from the database because');
$result=DB_query($sql,$db, $ErrMsg);
@@ -267,18 +266,18 @@
$conn_id = ftp_connect($_SESSION['RadioBeaconFTP_server']); // login with username and password
$login_result = ftp_login($conn_id, $_SESSION['RadioBeaconFTP_user_name'], $_SESSION['RadioBeaconFTP_user_pass']); // check connection
if ((!$conn_id) || (!$login_result)) {
- echo '<br>' . _('Ftp connection has failed');
- echo '<br>' . _('Attempted to connect to') . ' ' . $_SESSION['RadioBeaconFTP_server'] . ' ' . _('for user') . ' ' . $_SESSION['RadioBeaconFTP_user_name'];
+ echo '<br />' . _('Ftp connection has failed');
+ echo '<br />' . _('Attempted to connect to') . ' ' . $_SESSION['RadioBeaconFTP_server'] . ' ' . _('for user') . ' ' . $_SESSION['RadioBeaconFTP_user_name'];
die;
} else {
- echo '<br>' . _('Connected to Radio Beacon FTP server at') . ' ' . $_SESSION['RadioBeaconFTP_server'] . ' ' . _('with user name') . ' ' . $_SESSION['RadioBeaconFTP_user_name'];
+ echo '<br />' . _('Connected to Radio Beacon FTP server at') . ' ' . $_SESSION['RadioBeaconFTP_server'] . ' ' . _('with user name') . ' ' . $_SESSION['RadioBeaconFTP_user_name'];
} // upload the file
$upload = ftp_put($conn_id, $FilePrefix . $FileNumber . '.txt', $FileName, FTP_ASCII); // check upload status
if (!$upload) {
prnMsg(_('FTP upload has failed'),'success');
exit;
} else {
- echo '<br>' . _('Uploaded') . ' ' . $FileName . ' ' . _('to') . ' ' . $_SESSION['RadioBeaconFTP_server'];
+ echo '<br />' . _('Uploaded') . ' ' . $FileName . ' ' . _('to') . ' ' . $_SESSION['RadioBeaconFTP_server'];
} // close the FTP stream
ftp_quit($conn_id);
@@ -286,7 +285,7 @@
$sql = "UPDATE salesorders SET printedpackingslip=1, datepackingslipprinted='" . Date('Y-m-d') . "' WHERE salesorders.orderno=" . $_GET['OrderNo'];
$result = DB_query($sql,$db);
- echo '<p>' . _('Order Number') . ' ' . $_GET['OrderNo'] . ' ' . _('has been sent via FTP to Radio Beacon a copy of the file that was sent is held on the server at') . '<br>' . $FileName;
+ echo '<p>' . _('Order Number') . ' ' . $_GET['OrderNo'] . ' ' . _('has been sent via FTP to Radio Beacon a copy of the file that was sent is held on the server at') . '<br />' . $FileName;
} else { /*perhaps several order headers returned or none (more likely) */
Modified: trunk/FreightCosts.php
===================================================================
--- trunk/FreightCosts.php 2011-05-13 10:50:42 UTC (rev 4565)
+++ trunk/FreightCosts.php 2011-05-14 11:24:22 UTC (rev 4566)
@@ -1,17 +1,11 @@
<?php
/* $Id$*/
-/* $Revision: 1.14 $ */
-//$PageSecurity = 11;
include('includes/session.inc');
$title = _('Freight Costs Set Up');
include('includes/header.inc');
-?>
-
-<?php
-
if (isset($_GET['LocationFrom'])){
$LocationFrom = $_GET['LocationFrom'];
} elseif (isset($_POST['LocationFrom'])){
@@ -33,32 +27,37 @@
if (!isset($LocationFrom) OR !isset($ShipperID)) {
- 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'] . '" />';
- $sql = 'SELECT shippername, shipper_id FROM shippers';
+ $sql = "SELECT shippername, shipper_id FROM shippers";
$ShipperResults = DB_query($sql,$db);
echo '<table class=selection>
<tr>
- <td>' . _('Select A Freight Company to set up costs for') . "</td>
- <td><select name='ShipperID'>";
+ <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'];
+ echo '<option value=' . $myrow['shipper_id'] . '>' . $myrow['shippername'] . '</option>';
}
echo '</select></td></tr>
<tr>
- <td>' . _('Select the warehouse') . ' (' . _('ship from location') . ")</td>
- <td><select name='LocationFrom'>";
+ <td>' . _('Select the warehouse') . ' (' . _('ship from location') . ')</td>
+ <td><select name="LocationFrom">';
- $sql = 'SELECT loccode, locationname FROM locations';
+ $sql = "SELECT loccode,
+ locationname
+ FROM locations";
$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'];
}
- echo "</select></td></tr></table><br><div class='centre'><input type=submit value='" . _('Accept') . "' name='Accept'></div></form>";
+ echo '</select></td></tr>
+ </table>
+ <br><div class="centre"><input type="submit" value="' . _('Accept') . '" name="Accept"></div>
+ </form>';
} else {
@@ -115,8 +114,7 @@
if (isset($SelectedFreightCost) AND $InputError !=1) {
$sql = "UPDATE freightcosts
- SET
- locationfrom='".$LocationFrom."',
+ SET locationfrom='".$LocationFrom."',
destination='" . $_POST['Destination'] . "',
shipperid='" . $ShipperID . "',
cubrate='" . $_POST['CubRate'] . "',
@@ -133,28 +131,27 @@
/*Selected freight cost is null cos no item selected on first time round so must be adding a record must be submitting new entries */
- $sql = "INSERT INTO freightcosts (
- locationfrom,
- destination,
- shipperid,
- cubrate,
- kgrate,
- maxkgs,
- maxcub,
- fixedprice,
- minimumchg)
- VALUES (
- '".$LocationFrom."',
- '" . $_POST['Destination'] . "',
- '" . $ShipperID . "',
- '" . $_POST['CubRate'] . "',
- '" . $_POST['KGRate'] . "',
- '" . $_POST['MAXKGs'] . "',
- '" . $_POST['MAXCub'] . "',
- '" . $_POST['FixedPrice'] ."',
- '" . $_POST['MinimumChg'] . "'
- )";
-
+ $sql = "INSERT INTO freightcosts (locationfrom,
+ destination,
+ shipperid,
+ cubrate,
+ kgrate,
+ maxkgs,
+ maxcub,
+ fixedprice,
+ minimumchg)
+ VALUES (
+ '".$LocationFrom."',
+ '" . $_POST['Destination'] . "',
+ '" . $ShipperID . "',
+ '" . $_POST['CubRate'] . "',
+ '" . $_POST['KGRate'] . "',
+ '" . $_POST['MAXKGs'] . "',
+ '" . $_POST['MAXCub'] . "',
+ '" . $_POST['FixedPrice'] ."',
+ '" . $_POST['MinimumChg'] . "'
+ )";
+
$msg = _('Freight cost record inserted');
}
@@ -187,30 +184,30 @@
$sql = "SELECT shipcostfromid,
- destination,
- cubrate,
- kgrate,
- maxkgs,
- maxcub,
- fixedprice,
- minimumchg
- FROM freightcosts
- WHERE freightcosts.locationfrom = '".$LocationFrom. "'
- AND freightcosts.shipperid = '" . $ShipperID . "'
- ORDER BY destination";
-
+ destination,
+ cubrate,
+ kgrate,
+ maxkgs,
+ maxcub,
+ fixedprice,
+ minimumchg
+ FROM freightcosts
+ WHERE freightcosts.locationfrom = '".$LocationFrom. "'
+ AND freightcosts.shipperid = '" . $ShipperID . "'
+ ORDER BY destination";
+
$result = DB_query($sql,$db);
echo '<br><table class=selection>';
- $TableHeader = "<tr>
- <th>" . _('Destination') . "</th>
- <th>" . _('Cubic Rate') . "</th>
- <th>" . _('KG Rate') . "</th>
- <th>" . _('MAX KGs') . "</th>
- <th>" . _('MAX Volume') . "</th>
- <th>" . _('Fixed Price') . "</th>
- <th>" . _('Minimum Charge') . "</th>
- </tr>";
+ $TableHeader = '<tr>
+ <th>' . _('Destination') . '</th>
+ <th>' . _('Cubic Rate') . '</th>
+ <th>' . _('KG Rate') . '</th>
+ <th>' . _('MAX KGs') . '</th>
+ <th>' . _('MAX Volume') . '</th>
+ <th>' . _('Fixed Price') . '</th>
+ <th>' . _('Minimum Charge') . '</th>
+ </tr>';
echo $TableHeader;
@@ -233,15 +230,15 @@
}
- printf("<td>%s</td>
+ printf('<td>%s</td>
<td class=number>%s</td>
<td class=number>%s</td>
<td class=number>%s</td>
<td class=number>%s</td>
<td class=number>%s</td>
<td class=number>%s</td>
- <td><a href=\"%s&SelectedFreightCost=%s&LocationFrom=%s&ShipperID=%s\">" . _('Edit') . "</td>
- <td><a href=\"%s&SelectedFreightCost=%s&LocationFrom=%s&ShipperID=%s&delete=yes\">" . _('Delete') . "</td></tr>",
+ <td><a href="%s&SelectedFreightCost=%s&LocationFrom=%s&ShipperID=%s">' . _('Edit') . '</td>
+ <td><a href="%s&SelectedFreightCost=%s&LocationFrom=%s&ShipperID=%s&delete=yes" onclick="return confirm(\'' . _('Are you sure you wish to delete this freight cost') . '\');">' . _('Delete') . '</td></tr>',
$myrow[1],
$myrow[2],
$myrow[3],
@@ -249,11 +246,11 @@
$myrow[5],
$myrow[6],
$myrow[7],
- $_SERVER['PHP_SELF'] . '?' . SID,
+ $_SERVER['PHP_SELF'] . '?',
$myrow[0],
$LocationFrom,
$ShipperID,
- $_SERVER['PHP_SELF'] . '?' . SID,
+ $_SERVER['PHP_SELF'] . '?',
$myrow[0],
$LocationFrom,
$ShipperID);
@@ -267,28 +264,28 @@
//end of ifs and buts!
if (isset($SelectedFreightCost)) {
- echo "<div class='centre'><a href='" . $_SERVER['PHP_SELF'] . "?" . SID . '&LocationFrom=' . $LocationFrom . '&ShipperID=' . $ShipperID . "'>" . _('Show all freight costs for') . ' ' . $ShipperName . ' ' . _('from') . ' ' . $LocationName . '</a></div>';
+ echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?LocationFrom=' . $LocationFrom . '&ShipperID=' . $ShipperID . '">' . _('Show all fr...
[truncated message content] |