|
From: <rc...@us...> - 2015-05-21 21:05:20
|
Revision: 7312
http://sourceforge.net/p/web-erp/reponame/7312
Author: rchacon
Date: 2015-05-21 21:05:18 +0000 (Thu, 21 May 2015)
Log Message:
-----------
Adjust CustomerAccount.php for direct printing.
Modified Paths:
--------------
trunk/CustomerAccount.php
trunk/doc/Change.log
Modified: trunk/CustomerAccount.php
===================================================================
--- trunk/CustomerAccount.php 2015-05-21 16:58:25 UTC (rev 7311)
+++ trunk/CustomerAccount.php 2015-05-21 21:05:18 UTC (rev 7312)
@@ -1,6 +1,6 @@
<?php
/* $Id: CustomerAccount.php 7004 2014-11-24 15:56:19Z rchacon $*/
-/* This script is <create a description for script table>. */
+/* Shows customer account/statement on screen rather than PDF. */
include('includes/session.inc');
$Title = _('Customer Account');// Screen identification.
@@ -29,7 +29,7 @@
$result = DB_query($sql,$ErrMsg);
if(DB_num_rows($result)>0) {
while($myrow = DB_fetch_array($result)) {
- if ($_SESSION['SalesmanLogin'] == $myrow['salesman']){
+ if ($_SESSION['SalesmanLogin'] == $myrow['salesman']) {
$ViewAllowed = true;
}
}
@@ -38,7 +38,7 @@
include('includes/footer.inc');
exit;
}
- if (!$ViewAllowed){
+ if (!$ViewAllowed) {
prnMsg(_('You have no authority to review this customer account'),'error');
include('includes/footer.inc');
exit;
@@ -54,7 +54,7 @@
/*now get all the settled transactions which were allocated this month */
$ErrMsg = _('There was a problem retrieving the transactions that were settled over the course of the last month for'). ' ' . $CustomerID . ' ' . _('from the database');
-if ($_SESSION['Show_Settled_LastMonth']==1){
+if ($_SESSION['Show_Settled_LastMonth']==1) {
$sql = "SELECT DISTINCT debtortrans.id,
debtortrans.type,
systypes.typename,
@@ -80,7 +80,7 @@
$SetldTrans=DB_query($sql, $ErrMsg);
$NumberOfRecordsReturned = DB_num_rows($SetldTrans);
- while ($myrow=DB_fetch_array($SetldTrans)){
+ while ($myrow=DB_fetch_array($SetldTrans)) {
$Transactions[] = $myrow;
}
} else {
@@ -114,7 +114,7 @@
$sql .= " ORDER BY debtortrans.id";
$OstdgTrans=DB_query($sql, $ErrMsg);
-while ($myrow=DB_fetch_array($OstdgTrans)){
+while ($myrow=DB_fetch_array($OstdgTrans)) {
$Transactions[] = $myrow;
}
@@ -212,36 +212,40 @@
$CustomerRecord = DB_fetch_array($CustomerResult);
-echo '<div class="toplink">
+echo '<div class="noprint toplink">
<a href="', $RootPath, '/SelectCustomer.php">', _('Back to Customer Screen'), '</a>
</div>';
echo '<table width="100%">
- <tr>
- <th colspan="2">' . _('Customer Statement For'), ': ', stripslashes($CustomerID), ' - ', $CustomerRecord['name'], '</th>
- </tr>
- <tr><td colspan="2">' . $CustomerRecord['address1'] . '</td></tr>
- <tr><td colspan="2">' . $CustomerRecord['address2'] . '</td></tr>
- <tr><td colspan="2">' . $CustomerRecord['address3'] . ' ' . $CustomerRecord['address4'] . ' ' . $CustomerRecord['address5'] . ' ' . $CustomerRecord['address6'] . '</td></tr>
- <tr><th>' . _('All amounts stated in'), ':</th><td>', $CustomerRecord['currency'] . '</td></tr>
- <tr><th>' . _('Terms'), ':</th><td>', $CustomerRecord['terms'] . '</th></tr>
- <tr><th>' . _('Credit Limit'), ':</th><td>', locale_number_format($CustomerRecord['creditlimit'], 0) . '</td></tr>
- <tr><th>' . _('Credit Status'), ':</th><td>', $CustomerRecord['reasondescription'] . '</td></tr>
- </table>';
+ <tr><th colspan="2">', _('Customer Statement For'), ': ', stripslashes($CustomerID), ' - ', $CustomerRecord['name'], '</th></tr>
+ <tr><td colspan="2">', $CustomerRecord['address1'], '</td></tr>';
+if($CustomerRecord['address2']!='') {// If not empty, output this line.
+ echo '<tr><td colspan="2">', $CustomerRecord['address2'], '</td></tr>';
+}
+if($CustomerRecord['address3']!='') {// If not empty, output this line.
+ echo '<tr><td colspan="2">', $CustomerRecord['address3'], '</td></tr>';
+}
+echo ' <tr><td colspan="2">', $CustomerRecord['address4'], '</td></tr>
+ <tr><td colspan="2">', $CustomerRecord['address5'], ' ', $CustomerRecord['address6'], '</td></tr>
+ <tr><th>', _('All amounts stated in'), ':</th><td>', $CustomerRecord['currency'], '</td></tr>
+ <tr><th>', _('Terms'), ':</th><td>', $CustomerRecord['terms'], '</th></tr>
+ <tr><th>', _('Credit Limit'), ':</th><td>', locale_number_format($CustomerRecord['creditlimit'], 0), '</td></tr>
+ <tr><th>', _('Credit Status'), ':</th><td>', $CustomerRecord['reasondescription'], '</td></tr>
+ </table>';
if ($CustomerRecord['dissallowinvoices'] != 0) {
- echo '<br /><font color="red" size="4"><b>', _('ACCOUNT ON HOLD'), '</font></b><br />';
+ echo '<br /><b><font color="red" size="4">', _('ACCOUNT ON HOLD'), '</font></b><br />';
}
-echo '<form onSubmit="return VerifyForm(this);" action="', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'), '" method="post" class="noPrint">
- <input type="hidden" name="FormID" value="', $_SESSION['FormID'], '" />';
-echo _('Show all transactions after'), ':<input tabindex="1" type="text" required="required" class="date" alt="', $_SESSION['DefaultDateFormat'], '" id="datepicker" name="TransAfterDate" value="', $_POST['TransAfterDate'], '" minlength="0" maxlength="10" size="12" />';
-
-echo '<input tabindex="3" type="submit" name="Refresh Inquiry" value="', _('Refresh Inquiry'), '" />
+echo '<br /><form onSubmit="return VerifyForm(this);" action="', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'), '" method="post" class="centre noprint">
+ <input name="FormID" type="hidden" value="', $_SESSION['FormID'], '" />',
+ _('Show all transactions after'), ':<input alt="', $_SESSION['DefaultDateFormat'], '" class="date" id="datepicker" maxlength="10" minlength="0" name="TransAfterDate" required="required" size="12" tabindex="1" type="text" value="', $_POST['TransAfterDate'], '" />',
+ '<input name="Refresh Inquiry" tabindex="3" type="submit" value="', _('Refresh Inquiry'), '" />
</form>';
/* Show a table of the invoices returned by the SQL. */
-echo '<table class="selection">
+echo '<br /><table class="selection">
+ <thead>
<tr>
<th class="ascending">', _('Type'), '</th>
<th class="ascending">', _('Number'), '</th>
@@ -254,11 +258,9 @@
<th>', _('Credits'), '</th>
<th>', _('Allocated'), '</th>
<th>', _('Balance'), '</th>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- </tr>';
+ <th class="noprint" colspan="4"> </th>
+ </tr>
+ </thead><tbody>';
$k = 0; //row colour counter
$OutstandingOrSettled = '';
@@ -269,11 +271,11 @@
}
foreach ($Transactions as $MyRow) {
- if ($MyRow['settled']==1 AND $OutstandingOrSettled==''){
- echo '<tr><th colspan="10">' . _('TRANSACTIONS SETTLED SINCE') . ' ' . $_POST['TransAfterDate'] . '</th></tr>';
+ if ($MyRow['settled']==1 AND $OutstandingOrSettled=='') {
+ echo '<tr><th colspan="11">', _('TRANSACTIONS SETTLED SINCE'), ' ', $_POST['TransAfterDate'], '</th><th class="noprint" colspan="4"> </th></tr>';
$OutstandingOrSettled='Settled';
} elseif (($OutstandingOrSettled=='Settled' OR $OutstandingOrSettled=='') AND $MyRow['settled']==0) {
- echo '<tr><th colspan="10">' . _('OUTSTANDING TRANSACTIONS') . ' ' . $_POST['TransAfterDate'] . '</th></tr>';
+ echo '<tr><th colspan="11">', _('OUTSTANDING TRANSACTIONS'), ' ', $_POST['TransAfterDate'], '</th><th class="noprint" colspan="4"> </th></tr>';
$OutstandingOrSettled='Outstanding';
}
@@ -291,65 +293,51 @@
if ($MyRow['type']==10) { //its an invoice
echo '<td>', _($MyRow['typename']), '</td>
- <td>', $MyRow['transno'], '</td>
+ <td class="number">', $MyRow['transno'], '</td>
<td>', ConvertSQLDate($MyRow['trandate']), '</td>
<td>', $MyRow['branchcode'], '</td>
<td>', $MyRow['reference'], '</td>
<td style="width:200px">', $MyRow['invtext'], '</td>
- <td>', $MyRow['order_'], '</td>
+ <td class="number">', $MyRow['order_'], '</td>
<td class="number">', locale_number_format($MyRow['totalamount'], $CustomerRecord['decimalplaces']), '</td>
- <td></td>
+ <td> </td>
<td class="number">', locale_number_format($MyRow['alloc'], $CustomerRecord['decimalplaces']), '</td>
<td class="number">', locale_number_format($MyRow['balance'], $CustomerRecord['decimalplaces']), '</td>
- <td>
- <a href="', $RootPath, '/PrintCustTrans.php?FromTransNo=', $MyRow['transno'], '&InvOrCredit=Invoice">', _('HTML '), '
- <img src="', $RootPath, '/css/', $Theme, '/images/preview.png" title="', _('Click to preview the invoice'), '" alt="" />
- </a>
+ <td class="noprint" title="', _('Click to preview the invoice'), '">
+ <a href="', $RootPath, '/PrintCustTrans.php?FromTransNo=', $MyRow['transno'], '&InvOrCredit=Invoice"><img alt="" src="', $RootPath, '/css/', $Theme, '/images/preview.png" /> ', _('HTML'), '</a>
</td>
- <td>
- <a href="', $RootPath, '/', $PrintCustomerTransactionScript, '?FromTransNo=', $MyRow['transno'], '&InvOrCredit=Invoice&PrintPDF=True">' . _('PDF ') . '
- <img src="', $RootPath, '/css/', $Theme, '/images/pdf.png" title="', _('Click for PDF'), '" alt="" />
- </a>
+ <td class="noprint" title="', _('Click for PDF'), '">
+ <a href="', $RootPath, '/', $PrintCustomerTransactionScript, '?FromTransNo=', $MyRow['transno'], '&InvOrCredit=Invoice&PrintPDF=True"><img alt="" src="', $RootPath, '/css/', $Theme, '/images/pdf.png" /> ', _('PDF'), '</a>
</td>
- <td>
- <a href="', $RootPath, '/EmailCustTrans.php?FromTransNo=', $MyRow['transno'], '&InvOrCredit=Invoice">', _('Email ') . '
- <img src="', $RootPath, '/css/', $Theme, '/images/email.png" title="', _('Click to email the invoice'), '" alt="" />
- </a>
+ <td class="noprint" title="', _('Click to email the invoice'), '">
+ <a href="', $RootPath, '/EmailCustTrans.php?FromTransNo=', $MyRow['transno'], '&InvOrCredit=Invoice"><img alt="" src="', $RootPath, '/css/', $Theme, '/images/email.png" />', _('Email'), '</a>
</td>
- <td></td>
+ <td class="noprint"> </td>
</tr>';
} elseif ($MyRow['type'] == 11) {
echo '<td>', _($MyRow['typename']), '</td>
- <td>', $MyRow['transno'], '</td>
+ <td class="number">', $MyRow['transno'], '</td>
<td>', ConvertSQLDate($MyRow['trandate']), '</td>
<td>', $MyRow['branchcode'], '</td>
<td>', $MyRow['reference'], '</td>
<td style="width:200px">', $MyRow['invtext'], '</td>
- <td>', $MyRow['order_'], '</td>
- <td></td>
+ <td class="number">', $MyRow['order_'], '</td>
+ <td> </td>
<td class="number">', locale_number_format($MyRow['totalamount'], $CustomerRecord['decimalplaces']), '</td>
<td class="number">', locale_number_format($MyRow['alloc'], $CustomerRecord['decimalplaces']), '</td>
<td class="number">', locale_number_format($MyRow['balance'], $CustomerRecord['decimalplaces']), '</td>
- <td>
- <a href="', $RootPath, '/PrintCustTrans.php?FromTransNo=', $MyRow['transno'], '&InvOrCredit=Credit">', _('HTML '), '
- <img src="', $RootPath, '/css/', $Theme, '/images/preview.png" title="', _('Click to preview the credit note'), '" />
- </a>
+ <td class="noprint" title="', _('Click to preview the credit note'), '">
+ <a href="', $RootPath, '/PrintCustTrans.php?FromTransNo=', $MyRow['transno'], '&InvOrCredit=Credit"><img alt="" src="', $RootPath, '/css/', $Theme, '/images/preview.png" />', _('HTML'), '</a>
</td>
- <td>
- <a href="', $RootPath, '/', $PrintCustomerTransactionScript, '?FromTransNo=', $MyRow['transno'], '&InvOrCredit=Credit&PrintPDF=True">', _('PDF '), '
- <img src="', $RootPath, '/css/', $Theme, '/images/pdf.png" title="', _('Click for PDF'), '" alt="" />
- </a>
+ <td class="noprint" title="', _('Click for PDF'), '">
+ <a href="', $RootPath, '/', $PrintCustomerTransactionScript, '?FromTransNo=', $MyRow['transno'], '&InvOrCredit=Credit&PrintPDF=True"><img alt="" src="', $RootPath, '/css/', $Theme, '/images/pdf.png" />', _('PDF'), '</a>
</td>
- <td>
- <a href="', $RootPath, '/EmailCustTrans.php?FromTransNo=', $MyRow['transno'], '&InvOrCredit=Credit">', _('Email'), '
- <img src="', $RootPath, '/css/', $Theme, '/images/email.png" title="', _('Click to email the credit note'), '" alt="" />
- </a>
+ <td class="noprint" title="', _('Click to email the credit note'), '">
+ <a href="', $RootPath, '/EmailCustTrans.php?FromTransNo=', $MyRow['transno'], '&InvOrCredit=Credit"><img alt="" src="', $RootPath, '/css/', $Theme, '/images/email.png" />', _('Email'), '</a>
</td>
- <td>
- <a href="', $RootPath, '/CustomerAllocations.php?AllocTrans=', $MyRow['id'], '">', _('Allocation'), '
- <img src="', $RootPath, '/css/', $Theme, '/images/allocation.png" title="', _('Click to allocate funds'), '" alt="" />
- </a>
+ <td class="noprint" title="', _('Click to allocate funds'), '">
+ <a href="', $RootPath, '/CustomerAllocations.php?AllocTrans=', $MyRow['id'], '"><img alt="" src="', $RootPath, '/css/', $Theme, '/images/allocation.png" />', _('Allocation'), '</a>
</td>
</tr>';
@@ -358,24 +346,22 @@
* - Is receipt
*/
echo '<td>', _($MyRow['typename']), '</td>
- <td>', $MyRow['transno'], '</td>
+ <td class="number">', $MyRow['transno'], '</td>
<td>', ConvertSQLDate($MyRow['trandate']), '</td>
<td>', $MyRow['branchcode'], '</td>
<td>', $MyRow['reference'], '</td>
<td style="width:200px">', $MyRow['invtext'], '</td>
- <td>', $MyRow['order_'], '</td>
- <td></td>
+ <td class="number">', $MyRow['order_'], '</td>
+ <td> </td>
<td class="number">', locale_number_format($MyRow['totalamount'], $CustomerRecord['decimalplaces']), '</td>
<td class="number">', locale_number_format($MyRow['alloc'], $CustomerRecord['decimalplaces']), '</td>
<td class="number">', locale_number_format($MyRow['balance'], $CustomerRecord['decimalplaces']), '</td>
- <td>
- <a href="', $RootPath, '/CustomerAllocations.php?AllocTrans=', $MyRow['id'], '">', _('Allocation'), '
- <img src="', $RootPath, '/css/', $Theme, '/images/allocation.png" title="', _('Click to allocate funds'), '" alt="" />
- </a>
+ <td class="noprint" title="', _('Click to allocate funds'), '">
+ <a href="', $RootPath, '/CustomerAllocations.php?AllocTrans=', $MyRow['id'], '"><img alt="" src="', $RootPath, '/css/', $Theme, '/images/allocation.png" />', _('Allocation'), '</a>
</td>
- <td></td>
- <td></td>
- <td></td>
+ <td class="noprint"> </td>
+ <td class="noprint"> </td>
+ <td class="noprint"> </td>
</tr>';
} elseif ($MyRow['type'] == 12 and $MyRow['totalamount'] > 0) {
@@ -384,45 +370,43 @@
* - User cannot view GL transactions
*/
echo '<td>', _($MyRow['typename']), '</td>
- <td>', $MyRow['transno'], '</td>
+ <td class="number">', $MyRow['transno'], '</td>
<td>', ConvertSQLDate($MyRow['trandate']), '</td>
<td>', $MyRow['branchcode'], '</td>
<td>', $MyRow['reference'], '</td>
<td style="width:200px">', $MyRow['invtext'], '</td>
- <td>', $MyRow['order_'], '</td>
+ <td class="number">', $MyRow['order_'], '</td>
<td class="number">', locale_number_format($MyRow['totalamount'], $CustomerRecord['decimalplaces']), '</td>
- <td></td>
+ <td> </td>
<td class="number">', locale_number_format($MyRow['alloc'], $CustomerRecord['decimalplaces']), '</td>
<td class="number">', locale_number_format($MyRow['balance'], $CustomerRecord['decimalplaces']), '</td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
+ <td class="noprint"> </td>
+ <td class="noprint"> </td>
+ <td class="noprint"> </td>
+ <td class="noprint"> </td>
</tr>';
}
}
//end of while loop
-echo '</table>';
+echo '</tbody></table>
+ <br />
+ <table class="selection" width="70%">
+ <tr>
+ <th style="width:20%">', _('Total Balance'), '</th>
+ <th style="width:20%">', _('Current'), '</th>
+ <th style="width:20%">', _('Now Due'), '</th>
+ <th style="width:20%">', $_SESSION['PastDueDays1'], '-', $_SESSION['PastDueDays2'], ' ', _('Days Overdue'), '</th>
+ <th style="width:20%">', _('Over'), ' ', $_SESSION['PastDueDays2'], ' ', _('Days Overdue'), '</th>
+ </tr>
+ <tr>
+ <td class="number">', locale_number_format($CustomerRecord['balance'], $CustomerRecord['decimalplaces']), '</td>
+ <td class="number">', locale_number_format(($CustomerRecord['balance'] - $CustomerRecord['due']), $CustomerRecord['decimalplaces']), '</td>
+ <td class="number">', locale_number_format(($CustomerRecord['due'] - $CustomerRecord['overdue1']), $CustomerRecord['decimalplaces']), '</td>
+ <td class="number">', locale_number_format(($CustomerRecord['overdue1'] - $CustomerRecord['overdue2']), $CustomerRecord['decimalplaces']), '</td>
+ <td class="number">', locale_number_format($CustomerRecord['overdue2'], $CustomerRecord['decimalplaces']), '</td>
+ </tr>
+ </table>';
-echo '<table class="selection" width="70%">
- <tr>
- <th style="width:20%">', _('Total Balance'), '</th>
- <th style="width:20%">', _('Current'), '</th>
- <th style="width:20%">', _('Now Due'), '</th>
- <th style="width:20%">', $_SESSION['PastDueDays1'], '-', $_SESSION['PastDueDays2'], ' ' . _('Days Overdue'), '</th>
- <th style="width:20%">', _('Over'), ' ', $_SESSION['PastDueDays2'], ' ', _('Days Overdue'), '</th>
- </tr>';
-
-echo '<tr>
- <td class="number">', locale_number_format($CustomerRecord['balance'], $CustomerRecord['decimalplaces']), '</td>
- <td class="number">', locale_number_format(($CustomerRecord['balance'] - $CustomerRecord['due']), $CustomerRecord['decimalplaces']), '</td>
- <td class="number">', locale_number_format(($CustomerRecord['due'] - $CustomerRecord['overdue1']), $CustomerRecord['decimalplaces']), '</td>
- <td class="number">', locale_number_format(($CustomerRecord['overdue1'] - $CustomerRecord['overdue2']), $CustomerRecord['decimalplaces']), '</td>
- <td class="number">', locale_number_format($CustomerRecord['overdue2'], $CustomerRecord['decimalplaces']), '</td>
- </tr>
-</table>';
-
-
include('includes/footer.inc');
?>
\ No newline at end of file
Modified: trunk/doc/Change.log
===================================================================
--- trunk/doc/Change.log 2015-05-21 16:58:25 UTC (rev 7311)
+++ trunk/doc/Change.log 2015-05-21 21:05:18 UTC (rev 7312)
@@ -1,5 +1,6 @@
webERP Change Log
+21/5/15 RChacon: Adjust CustomerAccount.php for direct printing.
19/5/15 RChacon: Add documentation and help for users in Locations.php and ManualInventory.html.
17/5/15 Version 4.12.3
|