From: <rc...@us...> - 2015-05-10 01:01:54
|
Revision: 7295 http://sourceforge.net/p/web-erp/reponame/7295 Author: rchacon Date: 2015-05-10 01:01:51 +0000 (Sun, 10 May 2015) Log Message: ----------- Minor changes: add info. Modified Paths: -------------- trunk/CustomerBranches.php trunk/doc/Manual/ManualAccountsReceivable.html Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2015-05-09 11:12:08 UTC (rev 7294) +++ trunk/CustomerBranches.php 2015-05-10 01:01:51 UTC (rev 7295) @@ -1,37 +1,36 @@ <?php - /* $Id$*/ +/* Defines the details of customer branches such as delivery address and contact details - also sales area, representative etc.*/ include('includes/session.inc'); -$Title = _('Customer Branches'); -/* webERP manual links before header.inc */ -$ViewTopic= 'AccountsReceivable'; -$BookMark = 'NewCustomerBranch'; +$Title = _('Customer Branches');// Screen identification. +$ViewTopic= 'AccountsReceivable';// Filename's id in ManualContents.php's TOC. +$BookMark = 'NewCustomerBranch';// Anchor's id in the manual's html document. include('includes/header.inc'); + include('includes/CountriesArray.php'); -if (isset($_GET['DebtorNo'])) { +if(isset($_GET['DebtorNo'])) { $DebtorNo = mb_strtoupper($_GET['DebtorNo']); -} else if (isset($_POST['DebtorNo'])){ +} else if(isset($_POST['DebtorNo'])) { $DebtorNo = mb_strtoupper($_POST['DebtorNo']); } -if (!isset($DebtorNo)) { +if(!isset($DebtorNo)) { prnMsg(_('This page must be called with the debtor code of the customer for whom you wish to edit the branches for').'. - <br />' . _('When the pages is called from within the system this will always be the case').' <br />' . + <br />' . _('When the pages is called from within the system this will always be the case').' <br />' . _('Select a customer first then select the link to add/edit/delete branches'),'warn'); include('includes/footer.inc'); exit; } - -if (isset($_GET['SelectedBranch'])){ +if(isset($_GET['SelectedBranch'])) { $SelectedBranch = mb_strtoupper($_GET['SelectedBranch']); -} else if (isset($_POST['SelectedBranch'])){ +} else if(isset($_POST['SelectedBranch'])) { $SelectedBranch = mb_strtoupper($_POST['SelectedBranch']); } -if (isset($Errors)) { +if(isset($Errors)) { unset($Errors); } @@ -39,7 +38,7 @@ $Errors = array(); $InputError = 0; -if (isset($_POST['submit'])) { +if(isset($_POST['submit'])) { $i=1; @@ -50,53 +49,53 @@ $_POST['BranchCode'] = mb_strtoupper($_POST['BranchCode']); - if ($_SESSION['SalesmanLogin'] != '') { + if($_SESSION['SalesmanLogin'] != '') { $_POST['Salesman'] = $_SESSION['SalesmanLogin']; } - if (ContainsIllegalCharacters($_POST['BranchCode']) OR mb_strstr($_POST['BranchCode'],' ')) { + if(ContainsIllegalCharacters($_POST['BranchCode']) OR mb_strstr($_POST['BranchCode'],' ')) { $InputError = 1; - prnMsg(_('The Branch code cannot contain any of the following characters')." - & \' < >",'error'); + prnMsg(_('The Branch code cannot contain any of the following characters')." - & \' < >",'error'); $Errors[$i] = 'BranchCode'; $i++; } - if (mb_strlen($_POST['BranchCode'])==0) { + if(mb_strlen($_POST['BranchCode'])==0) { $InputError = 1; prnMsg(_('The Branch code must be at least one character long'),'error'); $Errors[$i] = 'BranchCode'; $i++; } - if (!is_numeric($_POST['FwdDate'])) { + if(!is_numeric($_POST['FwdDate'])) { $InputError = 1; prnMsg(_('The date after which invoices are charged to the following month is expected to be a number and a recognised number has not been entered'),'error'); $Errors[$i] = 'FwdDate'; $i++; } - if ($_POST['FwdDate'] >30) { + if($_POST['FwdDate'] >30) { $InputError = 1; prnMsg(_('The date (in the month) after which invoices are charged to the following month should be a number less than 31'),'error'); $Errors[$i] = 'FwdDate'; $i++; } - if (!is_numeric(filter_number_format($_POST['EstDeliveryDays']))) { + if(!is_numeric(filter_number_format($_POST['EstDeliveryDays']))) { $InputError = 1; prnMsg(_('The estimated delivery days is expected to be a number and a recognised number has not been entered'),'error'); $Errors[$i] = 'EstDeliveryDays'; $i++; } - if (filter_number_format($_POST['EstDeliveryDays']) >60) { + if(filter_number_format($_POST['EstDeliveryDays']) >60) { $InputError = 1; prnMsg(_('The estimated delivery days should be a number of days less than 60') . '. ' . _('A package can be delivered by seafreight anywhere in the world normally in less than 60 days'),'error'); $Errors[$i] = 'EstDeliveryDays'; $i++; } - if (!isset($_POST['EstDeliveryDays'])) { + if(!isset($_POST['EstDeliveryDays'])) { $_POST['EstDeliveryDays']=1; } - if (!isset($Latitude)) { + if(!isset($Latitude)) { $Latitude=0.0; $Longitude=0.0; } - if ($_SESSION['geocode_integration']==1 ){ + if($_SESSION['geocode_integration']==1 ) { // Get the lat/long from our geocoding host $SQL = "SELECT * FROM geocode_param WHERE 1"; $ErrMsg = _('An error occurred in retrieving the information'); @@ -106,9 +105,9 @@ $map_host = $row['map_host']; define('MAPS_HOST', $map_host); define('KEY', $api_key); - if ($map_host=="") { + 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>'; + echo '<div class="warn">' . _('Warning - Geocode Integration is enabled, but no hosts are setup. Go to Geocode Setup') . '</div>'; } else { $address = $_POST['BrAddress1'] . ', ' . $_POST['BrAddress2'] . ', ' . $_POST['BrAddress3'] . ', ' . $_POST['BrAddress4']; $base_url = 'http://' . MAPS_HOST . '/maps/geo?output=xml&key=' . KEY; @@ -121,7 +120,7 @@ $Longitude = $CoordinatesSplit[0]; $Status = $xml->Response->Status->code; - if (strcmp($Status, '200') == 0) { + if(strcmp($Status, '200') == 0) { // Successful geocode $Geocode_Pending = false; $Coordinates = $xml->Response->Placemark->Point->Coordinates; @@ -137,7 +136,7 @@ } } } - if (isset($SelectedBranch) AND $InputError !=1) { + if(isset($SelectedBranch) AND $InputError !=1) { /*SelectedBranch could also exist if submit had not been clicked this code would not run in this case cos submit is false of course see the delete code below*/ @@ -172,13 +171,13 @@ deliverblind='" . $_POST['DeliverBlind'] . "' WHERE branchcode = '".$SelectedBranch."' AND debtorno='".$DebtorNo."'"; - if ($_SESSION['SalesmanLogin'] != '') { + if($_SESSION['SalesmanLogin'] != '') { $SQL .= " AND custbranch.salesman='" . $_SESSION['SalesmanLogin'] . "'"; } $msg = $_POST['BrName'] . ' '._('branch has been updated.'); - } else if ($InputError !=1) { + } else if($InputError !=1) { /*Selected branch is null cos no item selected on first time round so must be adding a record must be submitting new entries in the new Customer Branches form */ @@ -251,11 +250,11 @@ //run the SQL from either of the above possibilites $ErrMsg = _('The branch record could not be inserted or updated because'); - if ($InputError==0) { + if($InputError==0) { $result = DB_query($SQL, $ErrMsg); } - if (DB_error_no() ==0 AND $InputError==0) { + if(DB_error_no() ==0 AND $InputError==0) { prnMsg($msg,'success'); unset($_POST['BranchCode']); unset($_POST['BrName']); @@ -287,7 +286,7 @@ unset($_POST['DeliverBlind']); unset($SelectedBranch); } -} else if (isset($_GET['delete'])) { +} else if(isset($_GET['delete'])) { //the link to delete a selected record was clicked instead of the submit button // PREVENT DELETES IF DEPENDENT RECORDS IN 'DebtorTrans' @@ -296,7 +295,7 @@ $result = DB_query($SQL); $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { + if($myrow[0]>0) { prnMsg(_('Cannot delete this branch because customer transactions have been created to this branch') . '<br />' . _('There are').' ' . $myrow[0] . ' '._('transactions with this Branch Code'),'error'); @@ -306,7 +305,7 @@ $result = DB_query($SQL); $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { + if($myrow[0]>0) { prnMsg(_('Cannot delete this branch because sales analysis records exist for it'),'error'); echo '<br />' . _('There are').' ' . $myrow[0] . ' '._('sales analysis records with this Branch Code/customer'); @@ -316,7 +315,7 @@ $result = DB_query($SQL); $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { + if($myrow[0]>0) { prnMsg(_('Cannot delete this branch because sales orders exist for it') . '. ' . _('Purge old sales orders first'),'warn'); echo '<br />' . _('There are').' ' . $myrow[0] . ' '._('sales orders for this Branch/customer'); } else { @@ -326,7 +325,7 @@ $result = DB_query($SQL); $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { + if($myrow[0]>0) { prnMsg(_('Cannot delete this branch because users exist that refer to it') . '. ' . _('Purge old users first'),'warn'); echo '<br />' . _('There are') . ' ' . $myrow[0] . ' '._('users referring to this Branch/customer'); } else { @@ -335,8 +334,8 @@ $result = DB_query($SQL); $myrow = DB_fetch_row($result); - - if ($myrow[0]>0) { + + if($myrow[0]>0) { prnMsg(_('Cannot delete this branch because contract have been created that refer to it') . '. ' . _('Purge old contracts first'),'warn'); echo '<br />' . _('There are') . ' ' . $myrow[0] . ' '._('contracts referring to this branch/customer'); } else { @@ -345,17 +344,17 @@ $result = DB_query($SQL); $myrow = DB_fetch_row($result); - - if ($myrow[0]==1) { + + if($myrow[0]==1) { prnMsg(_('Cannot delete this branch because it is the only branch defined for this customer.'),'warn'); } else { $SQL="DELETE FROM custbranch WHERE branchcode='" . $SelectedBranch . "' AND debtorno='" . $DebtorNo . "'"; - if ($_SESSION['SalesmanLogin'] != '') { + if($_SESSION['SalesmanLogin'] != '') { $SQL .= " AND custbranch.salesman='" . $_SESSION['SalesmanLogin'] . "'"; } $ErrMsg = _('The branch record could not be deleted') . ' - ' . _('the SQL server returned the following message'); $result = DB_query($SQL,$ErrMsg); - if (DB_error_no()==0){ + if(DB_error_no()==0) { prnMsg(_('Branch Deleted'),'success'); } } @@ -366,7 +365,7 @@ } //end ifs to test if the branch can be deleted } -if (!isset($SelectedBranch)){ +if(!isset($SelectedBranch)) { /* It could still be the second time the page has been run and a record has been selected for modification - SelectedBranch will exist because it was sent with the new call. If its the first time the page has been displayed with no parameters then none of the above are true and the list of branches will be displayed with links to delete or edit each. These will call the same page again and allow update/input or deletion of the records*/ @@ -390,8 +389,8 @@ INNER JOIN taxgroups ON custbranch.taxgroupid=taxgroups.taxgroupid WHERE custbranch.debtorno = '".$DebtorNo."'"; - - if ($_SESSION['SalesmanLogin'] != '') { + + if($_SESSION['SalesmanLogin'] != '') { $SQL .= " AND custbranch.salesman='" . $_SESSION['SalesmanLogin'] . "'"; } @@ -399,9 +398,11 @@ $myrow = DB_fetch_row($result); $TotalEnable = 0; $TotalDisable = 0; - if ($myrow) { - echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/customer.png" title="' . _('Customer') . '" alt="" /> - ' . ' ' . _('Branches defined for'). ' '. $DebtorNo . ' - ' . $myrow[0] . '</p>'; + if($myrow) { + echo '<p class="page_title_text"><img alt="" src="', $RootPath, '/css/', $Theme, + '/images/customer.png" title="',// Icon image. + _('Customer'), '" /> ',// Icon title. + _('Branches defined for'), ' ', $DebtorNo, ' - ', $myrow[0], '</p>';// Page title. echo '<table class="selection"> <tr> <th class="ascending">' . _('Code') . '</th> @@ -418,7 +419,7 @@ $k=0; do { - if ($k==1){ + if($k==1) { echo '<tr class="EvenTableRows">'; $k=0; } else { @@ -458,14 +459,14 @@ urlencode($myrow[1]), _('Delete Branch')); - if ($myrow[10]){ + if($myrow[10]) { $TotalDisable++; }else { $TotalEnable++; } - } while ($myrow = DB_fetch_row($result)); //END WHILE LIST LOOP + echo '</table> <br /> <table class="selection"> @@ -489,7 +490,7 @@ $result = DB_query($SQL); $myrow = DB_fetch_row($result); - echo '<div class="page_help_text">' . _('No Branches are defined for').' - '.$myrow[0]. '. ' . _('You must have a minimum of one branch for each Customer. Please add a branch now.') . '</div>'; + echo '<div class="page_help_text">' . _('No Branches are defined for').' - '.$myrow[0]. '. ' . _('You must have a minimum of one branch for each Customer. Please add a branch now.') . '</div>'; $_POST['BranchCode'] = mb_substr($DebtorNo,0,10); $_POST['BrName'] = $myrow[0]; $_POST['BrAddress1'] = $myrow[1]; @@ -502,12 +503,12 @@ } } -if (!isset($_GET['delete'])) { +if(!isset($_GET['delete'])) { echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') .'">'; echo '<div>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - if (isset($SelectedBranch)) { + if(isset($SelectedBranch)) { //editing an existing branch $SQL = "SELECT branchcode, @@ -541,30 +542,30 @@ FROM custbranch WHERE branchcode='".$SelectedBranch."' AND debtorno='".$DebtorNo."'"; - - if ($_SESSION['SalesmanLogin'] != '') { + + if($_SESSION['SalesmanLogin'] != '') { $SQL .= " AND custbranch.salesman='" . $_SESSION['SalesmanLogin'] . "'"; } $result = DB_query($SQL); $myrow = DB_fetch_array($result); - if ($InputError==0) { + if($InputError==0) { $_POST['BranchCode'] = $myrow['branchcode']; - $_POST['BrName'] = $myrow['brname']; - $_POST['BrAddress1'] = $myrow['braddress1']; - $_POST['BrAddress2'] = $myrow['braddress2']; - $_POST['BrAddress3'] = $myrow['braddress3']; - $_POST['BrAddress4'] = $myrow['braddress4']; - $_POST['BrAddress5'] = $myrow['braddress5']; - $_POST['BrAddress6'] = $myrow['braddress6']; - $_POST['SpecialInstructions'] = $myrow['specialinstructions']; - $_POST['BrPostAddr1'] = $myrow['brpostaddr1']; - $_POST['BrPostAddr2'] = $myrow['brpostaddr2']; - $_POST['BrPostAddr3'] = $myrow['brpostaddr3']; - $_POST['BrPostAddr4'] = $myrow['brpostaddr4']; - $_POST['BrPostAddr5'] = $myrow['brpostaddr5']; - $_POST['EstDeliveryDays'] = locale_number_format($myrow['estdeliverydays'],0); + $_POST['BrName'] = $myrow['brname']; + $_POST['BrAddress1'] = $myrow['braddress1']; + $_POST['BrAddress2'] = $myrow['braddress2']; + $_POST['BrAddress3'] = $myrow['braddress3']; + $_POST['BrAddress4'] = $myrow['braddress4']; + $_POST['BrAddress5'] = $myrow['braddress5']; + $_POST['BrAddress6'] = $myrow['braddress6']; + $_POST['SpecialInstructions'] = $myrow['specialinstructions']; + $_POST['BrPostAddr1'] = $myrow['brpostaddr1']; + $_POST['BrPostAddr2'] = $myrow['brpostaddr2']; + $_POST['BrPostAddr3'] = $myrow['brpostaddr3']; + $_POST['BrPostAddr4'] = $myrow['brpostaddr4']; + $_POST['BrPostAddr5'] = $myrow['brpostaddr5']; + $_POST['EstDeliveryDays'] = locale_number_format($myrow['estdeliverydays'],0); $_POST['FwdDate'] =$myrow['fwddate']; $_POST['ContactName'] = $myrow['contactname']; $_POST['Salesman'] =$myrow['salesman']; @@ -585,7 +586,7 @@ echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/customer.png" title="' . _('Customer') . '" alt="" /> ' . ' ' . _('Change Details for Branch'). ' '. $SelectedBranch . '</p>'; - if (isset($SelectedBranch)) { + if(isset($SelectedBranch)) { echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?DebtorNo=' . $DebtorNo. '">' . _('Show all branches defined for'). ' '. $DebtorNo . '</a></div>'; } echo '<br /> @@ -602,10 +603,10 @@ } else { //end of if $SelectedBranch only do the else when a new record is being entered - /* SETUP ANY $_GET VALUES THAT ARE PASSED. This really is just used coming from the Customers.php when a new customer is created. + /* SETUP ANY $_GET VALUES THAT ARE PASSED. This really is just used coming from the Customers.php when a new customer is created. Maybe should only do this when that page is the referrer? */ - if (isset($_GET['BranchCode'])){ + if(isset($_GET['BranchCode'])) { $SQL="SELECT name, address1, address2, @@ -619,7 +620,7 @@ $result = DB_query($SQL); $myrow = DB_fetch_array($result); $_POST['BranchCode'] = $_GET['BranchCode']; - $_POST['BrName'] = $myrow['name']; + $_POST['BrName'] = $myrow['name']; $_POST['BrAddress1'] = $myrow['addrsss1']; $_POST['BrAddress2'] = $myrow['addrsss2']; $_POST['BrAddress3'] = $myrow['addrsss3']; @@ -627,14 +628,14 @@ $_POST['BrAddress5'] = $myrow['addrsss5']; $_POST['BrAddress6'] = $myrow['addrsss6']; } - if (!isset($_POST['BranchCode'])) { + if(!isset($_POST['BranchCode'])) { $_POST['BranchCode']=''; } echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/customer.png" title="' . _('Customer') . '" alt="" />' . ' ' . _('Add a Branch') . '</p>'; echo '<table class="selection"> <tr> <td>' . _('Branch Code'). ':</td> - <td><input data-type="no-illegal-chars" ' . (in_array('BranchCode',$Errors) ? 'class="inputerror"' : '' ) . ' tabindex="1" type="text" name="BranchCode" required="required" title ="'._('Up to 10 characters for the branch code. The following characters are prohibited:') . ' \' " + . & \\ > <" placeholder="'._('alpha-numeric').'" size="12" maxlength="10" value="' . $_POST['BranchCode'] . '" /></td> + <td><input data-type="no-illegal-chars" ' . (in_array('BranchCode',$Errors) ? 'class="inputerror"' : '' ) . ' tabindex="1" type="text" name="BranchCode" required="required" title ="'._('Up to 10 characters for the branch code. The following characters are prohibited:') . ' \' " + . & \\ > <" placeholder="'._('alpha-numeric').'" size="12" maxlength="10" value="' . $_POST['BranchCode'] . '" /></td> </tr>'; $_POST['DeliverBlind'] = $_SESSION['DefaultBlindPackNote']; } @@ -646,61 +647,61 @@ echo _('Branch Name').':</td>'; - if (!isset($_POST['BrName'])) {$_POST['BrName']='';} + if(!isset($_POST['BrName'])) {$_POST['BrName']='';} echo '<td><input tabindex="2" type="text" autofocus="autofocus" required="required" name="BrName" title="' . _('The branch name should identify the particular delivery address of the customer and must be entered') . '" minlength="5" size="41" maxlength="40" value="'. $_POST['BrName'].'" /></td> </tr>'; echo '<tr> <td>' . _('Branch Contact').':</td>'; - if (!isset($_POST['ContactName'])) {$_POST['ContactName']='';} + if(!isset($_POST['ContactName'])) {$_POST['ContactName']='';} echo '<td><input tabindex="3" type="text" name="ContactName" required="required" size="41" maxlength="40" value="'. $_POST['ContactName'].'" /></td> </tr>'; echo '<tr><td>' . _('Street Address 1 (Street)').':</td>'; - if (!isset($_POST['BrAddress1'])) { + if(!isset($_POST['BrAddress1'])) { $_POST['BrAddress1']=''; } echo '<td><input tabindex="4" type="text" name="BrAddress1" size="41" maxlength="40" value="'. $_POST['BrAddress1'].'" /></td> </tr> <tr> <td>' . _('Street Address 2 (Street)').':</td>'; - if (!isset($_POST['BrAddress2'])) { + if(!isset($_POST['BrAddress2'])) { $_POST['BrAddress2']=''; } echo '<td><input tabindex="5" type="text" name="BrAddress2" size="41" maxlength="40" value="'. $_POST['BrAddress2'].'" /></td> </tr> <tr> <td>' . _('Street Address 3 (Suburb/City)').':</td>'; - if (!isset($_POST['BrAddress3'])) { + if(!isset($_POST['BrAddress3'])) { $_POST['BrAddress3']=''; } echo '<td><input tabindex="6" type="text" name="BrAddress3" size="41" maxlength="40" value="'. $_POST['BrAddress3'].'" /></td> </tr> <tr> <td>' . _('Street Address 4 (State/Province)').':</td>'; - if (!isset($_POST['BrAddress4'])) { + if(!isset($_POST['BrAddress4'])) { $_POST['BrAddress4']=''; } echo '<td><input tabindex="7" type="text" name="BrAddress4" size="51" maxlength="50" value="'. $_POST['BrAddress4'].'" /></td> </tr> <tr> <td>' . _('Street Address 5 (Postal Code)').':</td>'; - if (!isset($_POST['BrAddress5'])) { + if(!isset($_POST['BrAddress5'])) { $_POST['BrAddress5']=''; } echo '<td><input tabindex="8" type="text" name="BrAddress5" size="21" maxlength="20" value="'. $_POST['BrAddress5'].'" /></td> </tr> <tr> <td>' . _('Country').':</td>'; - if (!isset($_POST['BrAddress6'])) { + if(!isset($_POST['BrAddress6'])) { $_POST['BrAddress6']=''; } echo '<td><select name="BrAddress6">'; - foreach ($CountriesArray as $CountryEntry => $CountryName){ - if (isset($_POST['BrAddress6']) AND ($_POST['BrAddress6'] == $CountryName)){ - echo '<option selected="selected" value="' . $CountryName . '">' . $CountryName . '</option>'; - }elseif (!isset($_POST['BrAddress6']) AND $CountryName == "") { - echo '<option selected="selected" value="' . $CountryName . '">' . $CountryName . '</option>'; + foreach ($CountriesArray as $CountryEntry => $CountryName) { + if(isset($_POST['BrAddress6']) AND ($_POST['BrAddress6'] == $CountryName)) { + echo '<option selected="selected" value="' . $CountryName . '">' . $CountryName . '</option>'; + }elseif(!isset($_POST['BrAddress6']) AND $CountryName == "") { + echo '<option selected="selected" value="' . $CountryName . '">' . $CountryName . '</option>'; } else { - echo '<option value="' . $CountryName . '">' . $CountryName . '</option>'; + echo '<option value="' . $CountryName . '">' . $CountryName . '</option>'; } } echo '</select></td> @@ -708,27 +709,27 @@ echo '<tr> <td>' . _('Special Instructions').':</td>'; - if (!isset($_POST['SpecialInstructions'])) { + if(!isset($_POST['SpecialInstructions'])) { $_POST['SpecialInstructions']=''; } echo '<td><input tabindex="10" type="text" name="SpecialInstructions" size="56" value="'. $_POST['SpecialInstructions'].'" /></td> </tr> <tr> <td>' . _('Default days to deliver').':</td>'; - if (!isset($_POST['EstDeliveryDays'])) { + if(!isset($_POST['EstDeliveryDays'])) { $_POST['EstDeliveryDays']=0; } - echo '<td><input ' .(in_array('EstDeliveryDays',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="11" type="text" class="integer" name="EstDeliveryDays" size="4" maxlength="2" value="'. $_POST['EstDeliveryDays'].'" /></td> + echo '<td><input ' .(in_array('EstDeliveryDays',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="11" type="text" class="integer" name="EstDeliveryDays" size="4" maxlength="2" value="'. $_POST['EstDeliveryDays'].'" /></td> </tr> <tr> <td>' . _('Forward Date After (day in month)').':</td>'; - if (!isset($_POST['FwdDate'])) { + if(!isset($_POST['FwdDate'])) { $_POST['FwdDate']=0; } - echo '<td><input ' .(in_array('FwdDate',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="12" class="integer" name="FwdDate" size="4" maxlength="2" value="'. $_POST['FwdDate'].'" /></td> + echo '<td><input ' .(in_array('FwdDate',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="12" class="integer" name="FwdDate" size="4" maxlength="2" value="'. $_POST['FwdDate'].'" /></td> </tr>'; - if ($_SESSION['SalesmanLogin'] != '') { + if($_SESSION['SalesmanLogin'] != '') { echo '<tr> <td>' . _('Salesperson').':</td><td>'; echo $_SESSION['UsersRealName']; @@ -744,7 +745,7 @@ $result = DB_query($SQL); - if (DB_num_rows($result)==0){ + if(DB_num_rows($result)==0) { echo '</table>'; prnMsg(_('There are no sales people defined as yet') . ' - ' . _('customer branches must be allocated to a sales person') . '. ' . _('Please use the link below to define at least one sales person'),'error'); echo '<p align="center"><a href="' . $RootPath . '/SalesPeople.php">' . _('Define Sales People') . '</a>'; @@ -757,7 +758,7 @@ <td><select tabindex="13" name="Salesman">'; while ($myrow = DB_fetch_array($result)) { - if (isset($_POST['Salesman']) AND $myrow['salesmancode']==$_POST['Salesman']) { + if(isset($_POST['Salesman']) AND $myrow['salesmancode']==$_POST['Salesman']) { echo '<option selected="selected" value="'; } else { echo '<option value="'; @@ -773,7 +774,7 @@ } $SQL = "SELECT areacode, areadescription FROM areas"; $result = DB_query($SQL); - if (DB_num_rows($result)==0){ + if(DB_num_rows($result)==0) { echo '</table>'; prnMsg(_('There are no areas defined as yet') . ' - ' . _('customer branches must be allocated to an area') . '. ' . _('Please use the link below to define at least one sales area'),'error'); echo '<br /><a href="' . $RootPath. '/Areas.php">' . _('Define Sales Areas') . '</a>'; @@ -785,7 +786,7 @@ <td>' . _('Sales Area').':</td> <td><select tabindex="14" name="Area">'; while ($myrow = DB_fetch_array($result)) { - if (isset($_POST['Area']) AND $myrow['areacode']==$_POST['Area']) { + if(isset($_POST['Area']) AND $myrow['areacode']==$_POST['Area']) { echo '<option selected="selected" value="'; } else { echo '<option value="'; @@ -799,10 +800,10 @@ </tr>'; DB_data_seek($result,0); - $SQL = "SELECT locations.loccode, locationname FROM locations INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1"; + $SQL = "SELECT locations.loccode, locationname FROM locations INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1"; $result = DB_query($SQL); - if (DB_num_rows($result)==0){ + if(DB_num_rows($result)==0) { echo '</table>'; prnMsg(_('There are no stock locations defined as yet') . ' - ' . _('customer branches must refer to a default location where stock is normally drawn from') . '. ' . _('Please use the link below to define at least one stock location'),'error'); echo '<br /><a href="' . $RootPath . '/Locations.php">' . _('Define Stock Locations') . '</a>'; @@ -815,7 +816,7 @@ <td><select tabindex="15" name="DefaultLocation">'; while ($myrow = DB_fetch_array($result)) { - if (isset($_POST['DefaultLocation']) AND $myrow['loccode']==$_POST['DefaultLocation']) { + if(isset($_POST['DefaultLocation']) AND $myrow['loccode']==$_POST['DefaultLocation']) { echo '<option selected="selected" value="'; } else { echo '<option value="'; @@ -828,7 +829,7 @@ </tr> <tr> <td>' . _('Phone Number').':</td>'; - if (!isset($_POST['PhoneNo'])) { + if(!isset($_POST['PhoneNo'])) { $_POST['PhoneNo']=''; } echo '<td><input tabindex="16" type="tel" name="PhoneNo" pattern="[0-9+()\s-]*" size="22" maxlength="20" value="'. $_POST['PhoneNo'].'" /></td> @@ -836,18 +837,18 @@ echo '<tr> <td>' . _('Fax Number').':</td>'; - if (!isset($_POST['FaxNo'])) { + if(!isset($_POST['FaxNo'])) { $_POST['FaxNo']=''; } echo '<td><input tabindex="17" type="tel" name="FaxNo" pattern="[0-9+()\s-]*" size="22" maxlength="20" value="'. $_POST['FaxNo'].'" /></td> </tr>'; - if (!isset($_POST['Email'])) { + if(!isset($_POST['Email'])) { $_POST['Email']=''; } echo '<tr> <td>' . (($_POST['Email']) ? '<a href="Mailto:'.$_POST['Email'].'">' . _('Email').':</a>' : _('Email').':') . '</td>'; - //only display email link if there is an email address + //only display email link if there is an email address echo '<td><input tabindex="18" type="email" name="Email" placeholder="e.g. ex...@do..." size="56" maxlength="55" value="'. $_POST['Email'].'" /></td> </tr>'; @@ -855,7 +856,7 @@ $SQL = "SELECT taxgroupid, taxgroupdescription FROM taxgroups"; $TaxGroupResults = DB_query($SQL); - if (DB_num_rows($TaxGroupResults)==0){ + if(DB_num_rows($TaxGroupResults)==0) { echo '</table>'; prnMsg(_('There are no tax groups defined - these must be set up first before any branches can be set up') . ' <br /><a href="' . $RootPath . '/TaxGroups.php">' . _('Define Tax Groups') . '</a>','error'); @@ -867,7 +868,7 @@ <td><select tabindex="19" name="TaxGroup">'; while ($myrow = DB_fetch_array($TaxGroupResults)) { - if (isset($_POST['TaxGroup']) AND $myrow['taxgroupid']==$_POST['TaxGroup']) { + if(isset($_POST['TaxGroup']) AND $myrow['taxgroupid']==$_POST['TaxGroup']) { echo '<option selected="selected" value="'; } else { echo '<option value="'; @@ -881,7 +882,7 @@ <tr> <td>' . _('Transactions on this branch') . ':</td> <td><select tabindex="20" name="DisableTrans">'; - if (isset($_POST['DisableTrans']) AND $_POST['DisableTrans']==0){ + if(isset($_POST['DisableTrans']) AND $_POST['DisableTrans']==0) { echo '<option selected="selected" value="0">' . _('Enabled') . '</option> <option value="1">' . _('Disabled') . '</option>'; } else { @@ -891,12 +892,12 @@ echo ' </select></td> </tr>'; - - + + $SQL = "SELECT shipper_id, shippername FROM shippers"; $ShipperResults = DB_query($SQL); - if (DB_num_rows($ShipperResults)==0){ + if(DB_num_rows($ShipperResults)==0) { echo '</table>'; prnMsg(_('There are no shippers defined - these must be set up first before any branches can be set up') . ' <br /><a href="' . $RootPath . '/Shippers.php">' . _('Define Shippers') . '</a>','error'); @@ -906,8 +907,8 @@ echo '<tr> <td>' . _('Default freight/shipper method') . ':</td> <td><select tabindex="21" name="DefaultShipVia">'; - while ($myrow=DB_fetch_array($ShipperResults)){ - if (isset($_POST['DefaultShipVia'])and $myrow['shipper_id']==$_POST['DefaultShipVia']){ + while ($myrow=DB_fetch_array($ShipperResults)) { + if(isset($_POST['DefaultShipVia'])and $myrow['shipper_id']==$_POST['DefaultShipVia']) { echo '<option selected="selected" value="' . $myrow['shipper_id'] . '">' . $myrow['shippername'] . '</option>'; }else { echo '<option value="' . $myrow['shipper_id'] . '">' . $myrow['shippername'] . '</option>'; @@ -923,9 +924,9 @@ echo '<tr> <td>' . _('Default Packlist') . ':</td> <td><select tabindex="22" name="DeliverBlind">'; - if ($_POST['DeliverBlind']==2){ + if($_POST['DeliverBlind']==2) { echo '<option value="1">' . _('Show company details and logo') . '</option> - <option selected="selected" value="2">' . _('Hide company details and logo') . '</option>'; + <option selected="selected" value="2">' . _('Hide company details and logo') . '</option>'; } else { echo '<option selected="selected" value="1">' . _('Show company details and logo') . '</option> <option value="2">' . _('Hide company details and logo') . '</option>'; @@ -933,7 +934,7 @@ echo '</select></td> </tr>'; - if (!isset($_POST['BrPostAddr1'])) { // Postal address, line 1. Database: custbranch.brpostaddr1, varchar(40) + if(!isset($_POST['BrPostAddr1'])) {// Postal address, line 1. Database: custbranch.brpostaddr1, varchar(40) $_POST['BrPostAddr1']=''; } echo '<tr> @@ -941,7 +942,7 @@ <td><input tabindex="23" type="text" name="BrPostAddr1" size="41" maxlength="40" value="'. $_POST['BrPostAddr1'].'" /></td> </tr>'; - if (!isset($_POST['BrPostAddr2'])) { // Postal address, line 2. Database: custbranch.brpostaddr2, varchar(40) + if(!isset($_POST['BrPostAddr2'])) {// Postal address, line 2. Database: custbranch.brpostaddr2, varchar(40) $_POST['BrPostAddr2']=''; } echo '<tr> @@ -949,7 +950,7 @@ <td><input tabindex="24" type="text" name="BrPostAddr2" size="41" maxlength="40" value="'. $_POST['BrPostAddr2'].'" /></td> </tr>'; - if (!isset($_POST['BrPostAddr3'])) { // Postal address, line 3. Database: custbranch.brpostaddr3, varchar(40) + if(!isset($_POST['BrPostAddr3'])) {// Postal address, line 3. Database: custbranch.brpostaddr3, varchar(40) $_POST['BrPostAddr3']=''; } echo '<tr> @@ -957,7 +958,7 @@ <td><input tabindex="25" type="text" name="BrPostAddr3" size="41" maxlength="40" value="'. $_POST['BrPostAddr3'].'" /></td> </tr>'; - if (!isset($_POST['BrPostAddr4'])) { // Postal address, line 4. Database: custbranch.brpostaddr4, varchar(40) + if(!isset($_POST['BrPostAddr4'])) {// Postal address, line 4. Database: custbranch.brpostaddr4, varchar(40) $_POST['BrPostAddr4']=''; } echo '<tr> @@ -965,7 +966,7 @@ <td><input tabindex="26" type="text" name="BrPostAddr4" size="41" maxlength="40" value="'. $_POST['BrPostAddr4'].'" /></td> </tr>'; - if (!isset($_POST['BrPostAddr5'])) { // Postal address, line 5. Database: custbranch.brpostaddr5, varchar(20) + if(!isset($_POST['BrPostAddr5'])) {// Postal address, line 5. Database: custbranch.brpostaddr5, varchar(20) $_POST['BrPostAddr5']=''; } echo '<tr> @@ -973,7 +974,7 @@ <td><input tabindex="27" type="text" name="BrPostAddr5" size="21" maxlength="20" value="'. $_POST['BrPostAddr5'].'" /></td> </tr>'; - if (!isset($_POST['CustBranchCode'])) { + if(!isset($_POST['CustBranchCode'])) { $_POST['CustBranchCode']=''; } echo '<tr> @@ -991,4 +992,4 @@ } //end if record deleted no point displaying form to add record include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/doc/Manual/ManualAccountsReceivable.html =================================================================== --- trunk/doc/Manual/ManualAccountsReceivable.html 2015-05-09 11:12:08 UTC (rev 7294) +++ trunk/doc/Manual/ManualAccountsReceivable.html 2015-05-10 01:01:51 UTC (rev 7295) @@ -98,7 +98,6 @@ </div> <h2><a id="NewCustomerBranch">Entering Customer Branches</a></h2> - <p>A customer code entered on its own is insufficient to enter sales orders against. All customers must have at least one branch. The branch records contain the information about the delivery address, the sales area, the tax code, the sales representative and other regional information. New branches can be set up at any time. The first step will always be to select the customer, then to Add/Edit/Delete Customer Branch Records from the Customer menu. There is no limit to the number of branches that can be referenced against a single charge account (customer record). However, branches cannot be transferred between different customers. Only one statement will print per customer, but each invoice will be referenced to the branch it was delivered to.</p> <h3>Branch Name</h3> @@ -123,7 +122,7 @@ <h3>Draw Stock From</h3> -<p>Branches local to a particular warehouse can be associated with the local warehouse by setting this field to the preferred stocking location. This affects the entry of sales orders that default to the stock location entered here. It can be overridden at the time of order entry.</p> +<p>Branches local to a particular warehouse can be associated with the local warehouse by setting this field to the preferred stocking location (see <a href="ManualContents.php?ViewTopic=Inventory#Locations">Inventory Locations Maintenance</a>). This affects the entry of sales orders that default to the stock location entered here. It can be overridden at the time of order entry.</p> <h3>Forward Date From A Day In The Month</h3> |