From: <tim...@us...> - 2009-11-18 14:21:53
|
Revision: 3046 http://web-erp.svn.sourceforge.net/web-erp/?rev=3046&view=rev Author: tim_schofield Date: 2009-11-18 14:21:39 +0000 (Wed, 18 Nov 2009) Log Message: ----------- Provide for better error handling when price lists and customer types are not setup. Modified Paths: -------------- trunk/Customers.php trunk/doc/Change.log.html Modified: trunk/Customers.php =================================================================== --- trunk/Customers.php 2009-11-18 13:13:36 UTC (rev 3045) +++ trunk/Customers.php 2009-11-18 14:21:39 UTC (rev 3046) @@ -394,6 +394,34 @@ /*If the page was called without $_POST['DebtorNo'] passed to page then assume a new customer is to be entered show a form with a Debtor Code field other wise the form showing the fields with the existing entries against the customer will show for editing with only a hidden DebtorNo field*/ +/* First check that all the necessary items have been setup */ + + $SetupErrors=0; //Count errors + $sql='SELECT COUNT(typeabbrev) + FROM salestypes'; + $result=DB_query($sql, $db); + $myrow=DB_fetch_row($result); + if ($myrow[0]==0) { + prnMsg( _('In order to create a new customer you must first set up at least one sales type/price list').'<br />'. + _('Click').' '.'<a target="_blank" href="' . $rootpath . '/SalesTypes.php">' . _('here').' ' . '</a>'._('to set up your price lists'),'warning').'<br />'; + $SetupErrors += 1; + } + $sql='SELECT COUNT(typeid) + FROM debtortype'; + $result=DB_query($sql, $db); + $myrow=DB_fetch_row($result); + if ($myrow[0]==0) { + prnMsg( _('In order to create a new customer you must first set up at least one customer type').'<br />'. + _('Click').' '.'<a target="_blank" href="' . $rootpath . '/CustomerTypes.php">' . _('here').' ' . '</a>'._('to set up your customer types'),'warning'); + $SetupErrors += 1; + } + + if ($SetupErrors>0) { + echo '<br /><div class=centre><a href="'.$_SERVER['PHP_SELF'] .'" >'._('Click here to continue').'</a></div>'; + include('includes/footer.inc'); + exit; + } + echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '>'; echo "<input type='Hidden' name='New' value='Yes'>"; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2009-11-18 13:13:36 UTC (rev 3045) +++ trunk/doc/Change.log.html 2009-11-18 14:21:39 UTC (rev 3046) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>18/11/09 Tim: Customers.php - Provide for better error handling when price lists and customer types are not setup. <p>18/11/09 Tim: Customers.php - Provide option to just view a customers details <p>18/11/09 Tim: PDFReceipt.php - Provide option to print a customer receipt <p>17/11/09 Bryan Nielsen: Factors.php - Correction first factor does not show in amend list This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |