|
From: <dai...@us...> - 2016-08-15 09:51:52
|
Revision: 7589
http://sourceforge.net/p/web-erp/reponame/7589
Author: daintree
Date: 2016-08-15 09:51:49 +0000 (Mon, 15 Aug 2016)
Log Message:
-----------
fix customer statements and link to email from select customer script
Modified Paths:
--------------
trunk/PrintCustStatements.php
trunk/SelectCustomer.php
Modified: trunk/PrintCustStatements.php
===================================================================
--- trunk/PrintCustStatements.php 2016-08-14 13:26:17 UTC (rev 7588)
+++ trunk/PrintCustStatements.php 2016-08-15 09:51:49 UTC (rev 7589)
@@ -33,11 +33,14 @@
$_POST['ToCust'] = $_GET['ToCust'];
}
-If (isset($_POST['PrintPDF']) AND isset($_POST['FromCust']) AND $_POST['FromCust']!=''){
+if (isset($_GET['EmailOrPrint'])){
+ $_POST['EmailOrPrint'] = $_GET['EmailOrPrint'];
+}
+if (isset($_POST['PrintPDF']) AND isset($_POST['FromCust']) AND $_POST['FromCust']!=''){
$_POST['FromCust'] = mb_strtoupper($_POST['FromCust']);
- If (!isset($_POST['ToCust'])){
+ if (!isset($_POST['ToCust'])){
$_POST['ToCust'] = $_POST['FromCust'];
} else {
$_POST['ToCust'] = mb_strtoupper($_POST['ToCust']);
@@ -79,8 +82,7 @@
$Title = _('Print Statements') . ' - ' . _('No Customers Found');
require('includes/header.inc');
echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . _('Print Customer Account Statements') . '</p>';
- prnMsg( _('There were no Customers matching your selection of '). $_POST['FromCust']. ' - '.
- $_POST['ToCust'].'.' , 'error');
+ prnMsg( _('There were no Customers matching your selection of ') . $_POST['FromCust'] . ' - ' . $_POST['ToCust'] . '.' , 'error');
include('includes/footer.inc');
exit();
}
@@ -504,14 +506,24 @@
} /* end loop to print statements */
if (isset($pdf) AND $_POST['EmailOrPrint']=='print'){
- $pdf->OutputD($_SESSION['DatabaseName'] . '_CustStatements_' . date('Y-m-d') . '.pdf');
- $pdf->__destruct();
+ $pdf->OutputD($_SESSION['DatabaseName'] . '_CustStatements_' . date('Y-m-d') . '.pdf');
+ $pdf->__destruct();
} elseif (!isset($pdf)) {
$Title = _('Print Statements') . ' - ' . _('No Statements Found');
- include('includes/header.inc');
- echo '<br /><br /><br />' . prnMsg( _('There were no statements to print') );
- echo '<br /><br /><br />';
- include('includes/footer.inc');
+ if ($_POST['EmailOrPrint']=='print') {
+ include('includes/header.inc');
+ echo '<br />
+ <br />
+ <br />' . prnMsg( _('There were no statements to print');
+ } else {
+ echo '<br />
+ <br />
+ <br />' . prnMsg( _('There were no statements to email');
+ }
+ echo'<br />
+ <br />
+ <br />';
+ include('includes/footer.inc');
}
} else { /*The option to print PDF was not hit */
@@ -527,8 +539,8 @@
echo '<div>';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
- echo '<table class="selection">';
- echo '<tr>
+ echo '<table class="selection">
+ <tr>
<td>' , _('Starting Customer statement to print (Customer code)') , '</td>
<td><input type="text" maxlength="10" size="8" name="FromCust" value="0" /></td></tr>
<tr>
Modified: trunk/SelectCustomer.php
===================================================================
--- trunk/SelectCustomer.php 2016-08-14 13:26:17 UTC (rev 7588)
+++ trunk/SelectCustomer.php 2016-08-15 09:51:49 UTC (rev 7589)
@@ -198,15 +198,15 @@
echo '<a href="', $RootPath, '/CustomerInquiry.php?CustomerID=', urlencode($_SESSION['CustomerID']), '">' . _('Customer Transaction Inquiries') . '</a><br />';
echo '<a href="', $RootPath, '/CustomerAccount.php?CustomerID=', urlencode($_SESSION['CustomerID']), '">' . _('Customer Account statement on screen') . '</a><br />';
echo '<a href="', $RootPath, '/Customers.php?DebtorNo=', urlencode($_SESSION['CustomerID']), '&Modify=No">' . _('View Customer Details') . '</a><br />';
- echo '<a href="', $RootPath, '/PrintCustStatements.php?FromCust=', urlencode($_SESSION['CustomerID']), '&ToCust=', urlencode($_SESSION['CustomerID']), '&PrintPDF=Yes">' . _('Print Customer Statement') . '</a><br />';
- echo '<a href="', $RootPath, '/EmailCustStatements.php?FromCust=', urlencode($_SESSION['CustomerID']), '&ToCust=', urlencode($_SESSION['CustomerID']), '&PrintPDF=Yes">' . _('Email Customer Statement') . '</a><br />';
+ echo '<a href="', $RootPath, '/PrintCustStatements.php?FromCust=', urlencode($_SESSION['CustomerID']), '&ToCust=', urlencode($_SESSION['CustomerID']), '&EmailOrPrint=print&PrintPDF=Yes">' . _('Print Customer Statement') . '</a><br />';
+ echo '<a title="' . _('One of the customer\'s contacts must have an email address and be flagged as the address to send the customer statement to for this function to work') . '" href="', $RootPath, '/PrintCustStatements.php?FromCust=', urlencode($_SESSION['CustomerID']), '&ToCust=', urlencode($_SESSION['CustomerID']), '&EmailOrPrint=email&PrintPDF=Yes">' . _('Email Customer Statement') . '</a><br />';
echo '<a href="', $RootPath, '/SelectCompletedOrder.php?SelectedCustomer=', urlencode($_SESSION['CustomerID']), '">' . _('Order Inquiries') . '</a><br />';
echo '<a href="', $RootPath, '/CustomerPurchases.php?DebtorNo=', urlencode($_SESSION['CustomerID']), '">' . _('Show purchases from this customer') . '</a><br />';
wikiLink('Customer', $_SESSION['CustomerID']);
echo '</td><td valign="top" class="select">';
// Customer transactions options:
echo '<a href="', $RootPath, '/SelectSalesOrder.php?SelectedCustomer=', urlencode($_SESSION['CustomerID']), '">' . _('Modify Outstanding Sales Orders') . '</a><br />';
- echo '<a href="', $RootPath, '/CustomerAllocations.php?DebtorNo=', urlencode($_SESSION['CustomerID']), '">' . _('Allocate Receipts OR Credit Notes') . '</a><br />';
+ echo '<a title="' . _('This allows the deposits received from the customer to be matched against invoices') . '" href="', $RootPath, '/CustomerAllocations.php?DebtorNo=', urlencode($_SESSION['CustomerID']), '">' . _('Allocate Receipts OR Credit Notes') . '</a><br />';
if(isset($_SESSION['CustomerID']) AND isset($_SESSION['BranchCode'])) {
echo '<a href="', $RootPath, '/CounterSales.php?DebtorNo=', urlencode($_SESSION['CustomerID']), '&BranchNo=' . $_SESSION['BranchCode'] . '">' . _('Create a Counter Sale for this Customer') . '</a><br />';
}
|