From: <tim...@us...> - 2010-05-24 17:48:26
|
Revision: 3466 http://web-erp.svn.sourceforge.net/web-erp/?rev=3466&view=rev Author: tim_schofield Date: 2010-05-24 17:48:19 +0000 (Mon, 24 May 2010) Log Message: ----------- Added telephone, email and fax fields to Suppliers and Customers Pages. Ability to add/edit the records. Modified Paths: -------------- trunk/CustomerBranches.php trunk/Customers.php trunk/Suppliers.php trunk/doc/Change.log.html Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2010-05-17 17:14:40 UTC (rev 3465) +++ trunk/CustomerBranches.php 2010-05-24 17:48:19 UTC (rev 3466) @@ -348,7 +348,7 @@ contactname, phoneno, faxno, - email, + custbranch.email, taxgroups.taxgroupdescription, custbranch.branchcode, custbranch.disabletrans Modified: trunk/Customers.php =================================================================== --- trunk/Customers.php 2010-05-17 17:14:40 UTC (rev 3465) +++ trunk/Customers.php 2010-05-24 17:48:19 UTC (rev 3466) @@ -88,8 +88,33 @@ prnMsg( _('The Line 6 of the address must be fifteen characters or less long'),'error'); $Errors[$i] = 'Address6'; $i++; - } elseif (!is_numeric($_POST['CreditLimit'])) { + } + elseif (strlen($_POST['Phone']) >25) { $InputError = 1; + prnMsg(_('The telephone number must be 25 characters or less long'),'error'); + $Errors[$i] = 'Telephone'; + $i++; + } + elseif (strlen($_POST['Fax']) >25) { + $InputError = 1; + prnMsg(_('The fax number must be 25 characters or less long'),'error'); + $Errors[$i] = 'Fax'; + $i++; + } + elseif (strlen($_POST['Email']) >55) { + $InputError = 1; + prnMsg(_('The email address must be 55 characters or less long'),'error'); + $Errors[$i] = 'Email'; + $i++; + } + elseif (strlen($_POST['Email'])>0 and !IsEmailAddress($_POST['Email'])) { + $InputError = 1; + prnMsg(_('The email address is not correctly formed'),'error'); + $Errors[$i] = 'Email'; + $i++; + } + elseif (!is_numeric($_POST['CreditLimit'])) { + $InputError = 1; prnMsg( _('The credit limit must be numeric'),'error'); $Errors[$i] = 'CreditLimit'; $i++; @@ -146,6 +171,9 @@ address4='" . $_POST['Address4'] . "', address5='" . $_POST['Address5'] . "', address6='" . $_POST['Address6'] . "', + telephone='".$_POST['Phone']."', + fax = '".$_POST['Fax']."', + email = '".$_POST['Email']."', currcode='" . $_POST['CurrCode'] . "', clientsince='$SQL_ClientSince', holdreason='" . $_POST['HoldReason'] . "', @@ -177,6 +205,9 @@ address4='" . $_POST['Address4'] . "', address5='" . $_POST['Address5'] . "', address6='" . $_POST['Address6'] . "', + telephone='".$_POST['Phone']."', + fax = '".$_POST['Fax']."', + email = '".$_POST['Email']."', clientsince='$SQL_ClientSince', holdreason='" . $_POST['HoldReason'] . "', paymentterms='" . $_POST['PaymentTerms'] . "', @@ -220,6 +251,9 @@ address4, address5, address6, + telephone, + fax, + email, currcode, clientsince, holdreason, @@ -241,6 +275,9 @@ '" . $_POST['Address4'] . "', '" . $_POST['Address5'] . "', '" . $_POST['Address6'] . "', + '".$_POST['Phone']."', + '".$_POST['Fax']."', + '".$_POST['Email']."', '" . $_POST['CurrCode'] . "', '" . $SQL_ClientSince . "', " . $_POST['HoldReason'] . ", @@ -338,6 +375,9 @@ unset($_POST['Address4']); unset($_POST['Address5']); unset($_POST['Address6']); + unset($_POST['Phone']); + unset($_POST['Fax']); + unset($_POST['Email']); unset($_POST['HoldReason']); unset($_POST['PaymentTerms']); unset($_POST['Discount']); @@ -403,7 +443,7 @@ $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 />'; + _('Click').' '.'<a target="_blank" href="' . $rootpath . '/SalesTypes.php">' . _('here').' ' . '</a>'._('to set up your price lists'),'warning').'<br />'; $SetupErrors += 1; } $sql='SELECT COUNT(typeid) @@ -415,13 +455,13 @@ _('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'>"; @@ -438,6 +478,12 @@ echo '<tr><td>' . _('Customer Name') . ':</td> <td><input tabindex=2 type="Text" name="CustName" size=42 maxlength=40></td></tr>'; + echo '<tr><td>' . _('Telephone') . ':</td> + <td><input tabindex=2 type="Text" name="Phone" size=30 maxlength=40></td></tr>'; + echo '<tr><td>' . _('Facsimile') . ':</td> + <td><input tabindex=2 type="Text" name="Fax" size=30 maxlength=40></td></tr>'; + echo '<tr><td>' . _('Email Address') . ':</td> + <td><input tabindex=2 type="Text" name="Email" size=30 maxlength=40></td></tr>'; echo '<tr><td>' . _('Address Line 1 (Street)') . ':</td> <td><input tabindex=3 type="Text" name="Address1" size=42 maxlength=40></td></tr>'; echo '<tr><td>' . _('Address Line 2 (Suburb/City)') . ':</td> @@ -465,7 +511,7 @@ while ($myrow = DB_fetch_array($result)) { echo '<option value="'. $myrow['typeabbrev'] . '">' . $myrow['sales_type'] . '</option>'; - } //end while loop + } //end while loopre DB_data_seek($result,0); echo '</select></td></tr>'; } @@ -590,6 +636,9 @@ address4, address5, address6, + telephone, + fax, + email, currcode, salestype, clientsince, @@ -609,14 +658,12 @@ $ErrMsg = _('The customer details could not be retrieved because'); $result = DB_query($sql,$db,$ErrMsg); - $myrow = DB_fetch_array($result); - /* if $AutoDebtorNo in config.php has not been set or if it has been set to a number less than one, then display the DebtorNo */ if ($_SESSION['AutoDebtorNo']== 0 ) { echo '<tr><td>' . _('Customer Code') . ":</td> - <td>" . $DebtorNo . "</td></tr>"; + <td>" . $DebtorNo. "</td></tr>"; } $_POST['CustName'] = $myrow['name']; $_POST['Address1'] = $myrow['address1']; @@ -625,6 +672,9 @@ $_POST['Address4'] = $myrow['address4']; $_POST['Address5'] = $myrow['address5']; $_POST['Address6'] = $myrow['address6']; + $_POST['Phone'] = $myrow['telephone']; + $_POST['Fax'] = $myrow['fax']; + $_POST['Email'] = $myrow['email']; $_POST['SalesType'] = $myrow['salestype']; $_POST['CurrCode'] = $myrow['currcode']; $_POST['ClientSince'] = ConvertSQLDate($myrow['clientsince']); @@ -654,6 +704,9 @@ } if (isset($_GET['Modify'])) { echo '<tr><td>' . _('Customer Name') . ':</td><td>' . $_POST['CustName'] . '</td></tr>'; + echo '<tr><td>' . _('Telephone') . ':</td><td>' . $_POST['Phone'] . '</td></tr>'; + echo '<tr><td>' . _('Facsimile') . ':</td><td>' . $_POST['Fax'] . '</td></tr>'; + echo '<tr><td>' . _('Email Address') . ':</td><td>' . $_POST['Email'] . '</td></tr>'; echo '<tr><td>' . _('Address Line 1 (Street)') . ':</td><td>' . $_POST['Address1'] . '</td></tr>'; echo '<tr><td>' . _('Address Line 2 (Suburb/City)') . ':</td><td>' . $_POST['Address2'] . '</td></tr>'; echo '<tr><td>' . _('Address Line 3 (State/Province)') . ':</td><td>' . $_POST['Address3'] . '</td></tr>'; @@ -664,6 +717,12 @@ } else { echo '<tr><td>' . _('Customer Name') . ':</td> <td><input ' . (in_array('CustName',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="CustName" value="' . $_POST['CustName'] . '" size=42 maxlength=40></td></tr>'; + echo '<tr><td>' . _('Telephone') . ':</td> + <td><input ' . (in_array('Phone',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="Phone" value="' . $_POST['Phone'] . '" size=42 maxlength=40></td></tr>'; + echo '<tr><td>' . _('Facsimile') . ':</td> + <td><input ' . (in_array('Fax',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="Fax" value="' . $_POST['Fax'] . '" size=42 maxlength=40></td></tr>'; + echo '<tr><td>' . _('Email Address') . ':</td> + <td><input ' . (in_array('Email',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="Email" value="' . $_POST['Email'] . '" size=42 maxlength=40></td></tr>'; echo '<tr><td>' . _('Address Line 1 (Street)') . ':</td> <td><input ' . (in_array('Address1',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="Address1" size=42 maxlength=40 value="' . $_POST['Address1'] . '"></td></tr>'; echo '<tr><td>' . _('Address Line 2 (Suburb/City)') . ':</td> @@ -739,7 +798,7 @@ echo '<tr><td>' . _('Tax Reference') . ':</td> <td><input type="Text" name="TaxRef" size=22 maxlength=20 value="' . $_POST['TaxRef'] . '"></td></tr>'; } - + if (isset($_GET['Modify'])) { $result=DB_query('SELECT terms FROM paymentterms WHERE termsindicator='.$_POST['PaymentTerms'],$db); $myrow=DB_fetch_array($result); @@ -815,7 +874,7 @@ } echo '</select></td></tr>'; } - + if (isset($_GET['Modify'])) { if ($_POST['CustomerPOLine']==0){ echo '<tr><td>' . _('Invoice Addressing') . ":</td><td>"._('Address to HO')."</td></tr>"; Modified: trunk/Suppliers.php =================================================================== --- trunk/Suppliers.php 2010-05-17 17:14:40 UTC (rev 3465) +++ trunk/Suppliers.php 2010-05-24 17:48:19 UTC (rev 3466) @@ -346,6 +346,30 @@ $Errors[$i]='ID'; $i++; } + if (strlen($_POST['Phone']) >25) { + $InputError = 1; + prnMsg(_('The telephone number must be 25 characters or less long'),'error'); + $Errors[$i] = 'Telephone'; + $i++; + } + if (strlen($_POST['Fax']) >25) { + $InputError = 1; + prnMsg(_('The fax number must be 25 characters or less long'),'error'); + $Errors[$i] = 'Fax'; + $i++; + } + if (strlen($_POST['Email']) >55) { + $InputError = 1; + prnMsg(_('The email address must be 55 characters or less long'),'error'); + $Errors[$i] = 'Email'; + $i++; + } + if (strlen($_POST['Email'])>0 and !IsEmailAddress($_POST['Email'])) { + $InputError = 1; + prnMsg(_('The email address is not correctly formed'),'error'); + $Errors[$i] = 'Email'; + $i++; + } if (strlen($_POST['BankRef']) > 12) { $InputError = 1; prnMsg(_('The bank reference text must be less than 12 characters long'),'error'); @@ -438,6 +462,9 @@ address2='" . $_POST['Address2'] . "', address3='" . $_POST['Address3'] . "', address4='" . $_POST['Address4'] . "', + telephone='".$_POST['Phone']."', + fax = '".$_POST['Fax']."', + email = '".$_POST['Email']."', currcode='" . $_POST['CurrCode'] . "', suppliersince='$SQL_SupplierSince', paymentterms='" . $_POST['PaymentTerms'] . "', @@ -460,6 +487,9 @@ address2='" . $_POST['Address2'] . "', address3='" . $_POST['Address3'] . "', address4='" . $_POST['Address4'] . "', + telephone='".$_POST['Phone']."', + fax = '".$_POST['Fax']."', + email = '".$_POST['Email']."', suppliersince='$SQL_SupplierSince', paymentterms='" . $_POST['PaymentTerms'] . "', bankpartics='" . $_POST['BankPartics'] . "', @@ -476,7 +506,7 @@ $ErrMsg = _('The supplier could not be updated because'); $DbgMsg = _('The SQL that was used to update the supplier but failed was'); - + // echo $sql; $result = DB_query($sql, $db, $ErrMsg, $DbgMsg); prnMsg(_('The supplier master record for') . ' ' . $SupplierID . ' ' . _('has been updated'),'success'); @@ -489,6 +519,9 @@ address2, address3, address4, + telephone, + fax, + email, currcode, suppliersince, paymentterms, @@ -507,6 +540,9 @@ '" . $_POST['Address2'] . "', '" . $_POST['Address3'] . "', '" . $_POST['Address4'] . "', + '".$_POST['Phone']."', + '".$_POST['Fax']."', + '".$_POST['Email']."', '" . $_POST['CurrCode'] . "', '" . $SQL_SupplierSince . "', '" . $_POST['PaymentTerms'] . "', @@ -533,6 +569,9 @@ unset($_POST['Address2']); unset($_POST['Address3']); unset($_POST['Address4']); + unset($_POST['Phone']); + unset($_POST['Fax']); + unset($_POST['Email']); unset($_POST['CurrCode']); unset($SQL_SupplierSince); unset($_POST['PaymentTerms']); @@ -610,6 +649,9 @@ echo '<table>'; echo '<tr><td>' . _('Supplier Code') . ":</td><td><input type='text' name='SupplierID' size=11 maxlength=10></td></tr>"; echo '<tr><td>' . _('Supplier Name') . ":</td><td><input type='text' name='SuppName' size=42 maxlength=40></td></tr>"; + echo '<tr><td>' . _('Telephone') . ":</td><td><input type='text' name='Phone' size=30 maxlength=40></td></tr>"; + echo '<tr><td>' . _('Facsimile') . ":</td><td><input type='text' name='Fax' size=30 maxlength=40></td></tr>"; + echo '<tr><td>' . _('Email Address') . ":</td><td><input type='text' name='Email' size=30 maxlength=40></td></tr>"; echo '<tr><td>' . _('Address Line 1 (Street)') . ":</td><td><input type='text' name='Address1' size=42 maxlength=40></td></tr>"; echo '<tr><td>' . _('Address Line 2 (Suburb/City)') . ":</td><td><input type='text' name='Address2' size=42 maxlength=40></td></tr>"; echo '<tr><td>' . _('Address Line 3 (State/Province)') . ":</td><td><input type='text' name='Address3' size=42 maxlength=40></td></tr>"; @@ -701,6 +743,9 @@ address2, address3, address4, + telephone, + fax, + email, currcode, suppliersince, paymentterms, @@ -723,6 +768,9 @@ $_POST['Address3'] = stripcslashes($myrow['address3']); $_POST['Address4'] = stripcslashes($myrow['address4']); $_POST['CurrCode'] = stripcslashes($myrow['currcode']); + $_POST['Phone'] = $myrow['telephone']; + $_POST['Fax'] = $myrow['fax']; + $_POST['Email'] = $myrow['email']; $_POST['SupplierSince'] = ConvertSQLDate($myrow['suppliersince']); $_POST['PaymentTerms'] = $myrow['paymentterms']; $_POST['BankPartics'] = stripcslashes($myrow['bankpartics']); @@ -742,6 +790,9 @@ } echo '<tr><td>' . _('Supplier Name') . ':</td><td><input '.(in_array('Name',$Errors) ? 'class="inputerror"' : '').' type="text" name="SuppName" VALUE="' . $_POST['SuppName'] . '" size=42 maxlength=40></td></tr>'; + echo '<tr><td>' . _('Telephone') . ':</td><td><input '.(in_array('Name',$Errors) ? 'class="inputerror"' : '').' type="text" name="Phone" VALUE="' . $_POST['Phone'] . '" size=42 maxlength=40></td></tr>'; + echo '<tr><td>' . _('Facsimile') . ':</td><td><input '.(in_array('Name',$Errors) ? 'class="inputerror"' : '').' type="text" name="Fax" VALUE="' . $_POST['Fax'] . '" size=42 maxlength=40></td></tr>'; + echo '<tr><td>' . _('Email Address') . ':</td><td><input '.(in_array('Name',$Errors) ? 'class="inputerror"' : '').' type="text" name="Email" VALUE="' . $_POST['Email'] . '" size=42 maxlength=40></td></tr>'; echo '<tr><td>' . _('Address Line 1 (Street)') . ':</td><td><input type="text" name="Address1" VALUE="' . $_POST['Address1'] . '" size=42 maxlength=40></td></tr>'; echo '<tr><td>' . _('Address Line 2 (Suburb/City)') . ':</td><td><input type="text" name="Address2" VALUE="' . $_POST['Address2'] . '" size=42 maxlength=40></td></tr>'; echo '<tr><td>' . _('Address Line 3 (State/Province)') . ':</td><td><input type="text" name="Address3" VALUE="' . $_POST['Address3'] . '" size=42 maxlength=40></td></tr>'; @@ -837,3 +888,4 @@ include('includes/footer.inc'); ?> + Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-05-17 17:14:40 UTC (rev 3465) +++ trunk/doc/Change.log.html 2010-05-24 17:48:19 UTC (rev 3466) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<P>24/05/10 Simon Peter Otandeka: Added telephone, email and fax fields to Suppliers and Customers Pages. Ability to add/edit the records.</p> <P>16/05/10 Phil: javascripts/MiscFunctions.js - not my field ... but could not resist adding some indentation - I struggle at the best of times with javascript but this was a shocker to read!! Hope I didnt mess up anything</p> <P>16/05/10 Phil: reworked PDFRemittanceAdvices.php - somehow missed from tcpdf work to print utf-8 pdfs</p> <p>16/05/10 Phil: reworked PDFPriceList to use the new effective dates fields and print out effective prices as at a specified date - showing effective dates on the report - also ditched includes/PDFPriceListPageHeader.php in favour of a PageHeader() function inside PDFPriceList.php. Also made the script work with tcpdf - not sure how it was missed before?</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |