From: <rc...@us...> - 2014-08-30 23:06:11
|
Revision: 6858 http://sourceforge.net/p/web-erp/reponame/6858 Author: rchacon Date: 2014-08-30 23:06:07 +0000 (Sat, 30 Aug 2014) Log Message: ----------- Standardizes page_title_text to main-menu-option, standardizes bottom tax-menu, adds $ViewTopic and $BookMark, completes table header columns, formats data columns in Tax* scripts. Modified Paths: -------------- trunk/TaxAuthorities.php trunk/TaxAuthorityRates.php trunk/TaxCategories.php trunk/TaxGroups.php trunk/TaxProvinces.php trunk/doc/Change.log trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po Modified: trunk/TaxAuthorities.php =================================================================== --- trunk/TaxAuthorities.php 2014-08-30 15:03:16 UTC (rev 6857) +++ trunk/TaxAuthorities.php 2014-08-30 23:06:07 UTC (rev 6858) @@ -8,8 +8,8 @@ include('includes/header.inc'); echo '<p class="page_title_text"><img alt="" src="' . $RootPath . '/css/' . $Theme . '/images/maintenance.png" title="' . - _('Tax Authorities') . '" />' . ' ' . - _('Tax Authorities') . '</p>'; + _('Tax Authorities Maintenance') . '" />' . ' ' . + _('Tax Authorities Maintenance') . '</p>'; if(isset($_POST['SelectedTaxAuthID'])) { $SelectedTaxAuthID =$_POST['SelectedTaxAuthID']; @@ -143,14 +143,14 @@ echo '<table class="selection"> <tr> <th class="ascending" >' . _('ID') . '</th> - <th class="ascending" >' . _('Description') . '</th> + <th class="ascending" >' . _('Tax Authority') . '</th> <th class="ascending" >' . _('Input Tax') . '<br />' . _('GL Account') . '</th> <th class="ascending" >' . _('Output Tax') . '<br />' . _('GL Account') . '</th> <th class="ascending" >' . _('Bank') . '</th> <th class="ascending" >' . _('Bank Account') . '</th> <th class="ascending" >' . _('Bank Act Type') . '</th> <th class="ascending" >' . _('Bank Swift') . '</th> - <th colspan="4">' . _('Maintenance') . '</th> + <th colspan="4"> </th> </tr>'; $k=0; while($myrow = DB_fetch_row($result)) { @@ -331,6 +331,12 @@ </div> </form>'; +echo '<br /> + <div class="centre"> + <a href="' . $RootPath . '/TaxGroups.php">' . _('Tax Group Maintenance') . '</a><br /> + <a href="' . $RootPath . '/TaxProvinces.php">' . _('Dispatch Tax Province Maintenance') . '</a><br /> + <a href="' . $RootPath . '/TaxCategories.php">' . _('Tax Category Maintenance') . '</a> + </div>'; + include('includes/footer.inc'); - ?> Modified: trunk/TaxAuthorityRates.php =================================================================== --- trunk/TaxAuthorityRates.php 2014-08-30 15:03:16 UTC (rev 6857) +++ trunk/TaxAuthorityRates.php 2014-08-30 23:06:07 UTC (rev 6858) @@ -8,8 +8,8 @@ include('includes/header.inc'); echo '<p class="page_title_text"><img alt="" src="' . $RootPath . '/css/' . $Theme . '/images/maintenance.png" title="' . - _('Tax Rates') . '" />' . ' ' . - _('Tax Rates') . '</p>'; + _('Tax Rates Maintenance') . '" />' . ' ' . + _('Tax Rates Maintenance') . '</p>'; if(isset($_POST['TaxAuthority'])) { $TaxAuthority = $_POST['TaxAuthority']; @@ -106,25 +106,24 @@ $myrow['dispatchtaxprovince'] . '_' . $myrow['taxcatid'], locale_number_format($myrow['taxrate']*100,2)); }// End of while loop. - echo '</table><br /><div class="centre"> + echo '</table><br /> + <div class="centre"> <input type="submit" name="UpdateRates" value="' . _('Update Rates') . '" />'; -//end if tax taxcatid/rates to show + //end if tax taxcatid/rates to show } else { echo '<div class="centre">'; prnMsg(_('There are no tax rates to show - perhaps the dispatch tax province records have not yet been created?'),'warn'); - } +echo '</div>';// Closes Submit or prnMsg division. -echo ' <br /> - <br /> - <a href="' . $RootPath . '/TaxAuthorities.php">' . _('Tax Authorities') . '</a><br /> - <a href="' . $RootPath . '/TaxGroups.php">' . _('Tax Groupings') . '</a><br /> - <a href="' . $RootPath . '/TaxCategories.php">' . _('Tax Categories') . '</a><br /> - <a href="' . $RootPath . '/TaxProvinces.php">' . _('Dispatch Tax Provinces') . '</a> - </div> - </div> - </form>'; +echo '<br /> + <div class="centre"> + <a href="' . $RootPath . '/TaxAuthorities.php">' . _('Tax Authorities Maintenance') . '</a><br /> + <a href="' . $RootPath . '/TaxGroups.php">' . _('Tax Group Maintenance') . '</a><br /> + <a href="' . $RootPath . '/TaxProvinces.php">' . _('Dispatch Tax Province Maintenance') . '</a><br /> + <a href="' . $RootPath . '/TaxCategories.php">' . _('Tax Category Maintenance') . '</a> + </div>'; -include( 'includes/footer.inc' ); +include('includes/footer.inc'); ?> Modified: trunk/TaxCategories.php =================================================================== --- trunk/TaxCategories.php 2014-08-30 15:03:16 UTC (rev 6857) +++ trunk/TaxCategories.php 2014-08-30 23:06:07 UTC (rev 6858) @@ -8,8 +8,8 @@ include('includes/header.inc'); echo '<p class="page_title_text"><img alt="" src="' . $RootPath . '/css/' . $Theme . '/images/maintenance.png" title="' . - _('Tax Categories') . '" />' . ' ' . - _('Tax Categories') . '</p>'; + _('Tax Category Maintenance') . '" />' . ' ' . + _('Tax Category Maintenance') . '</p>'; if( isset($_GET['SelectedTaxCategory']) ) $SelectedTaxCategory = $_GET['SelectedTaxCategory']; @@ -165,8 +165,8 @@ echo '<table class="selection"> <tr> - <th class="ascending">' . _('Tax Categories') . '</th> - <th colspan="2">' . _('Maintenance') . '</th> + <th class="ascending">' . _('Tax Category') . '</th> + <th colspan="2"> </th> </tr>'; $k = 0;// Row counter to determine background colour. @@ -250,5 +250,12 @@ } //end if record deleted no point displaying form to add record +echo '<br /> + <div class="centre"> + <a href="' . $RootPath . '/TaxAuthorities.php">' . _('Tax Authorities and Rates Maintenance') . '</a><br /> + <a href="' . $RootPath . '/TaxGroups.php">' . _('Tax Group Maintenance') . '</a><br /> + <a href="' . $RootPath . '/TaxProvinces.php">' . _('Dispatch Tax Province Maintenance') . '</a> + </div>'; + include('includes/footer.inc'); ?> Modified: trunk/TaxGroups.php =================================================================== --- trunk/TaxGroups.php 2014-08-30 15:03:16 UTC (rev 6857) +++ trunk/TaxGroups.php 2014-08-30 23:06:07 UTC (rev 6858) @@ -2,27 +2,30 @@ /* $Id$*/ include('includes/session.inc'); - $Title = _('Tax Groups'); +$ViewTopic = 'Tax';// Filename in ManualContents.php's TOC. +$BookMark = 'TaxGroups';// Anchor's id in the manual's html document. include('includes/header.inc'); +echo '<p class="page_title_text"><img alt="" src="' . $RootPath . '/css/' . $Theme . + '/images/maintenance.png" title="' . + _('Tax Group Maintenance') . '" />' . ' ' . + _('Tax Group Maintenance') . '</p>'; -if (isset($_GET['SelectedGroup'])){ +if(isset($_GET['SelectedGroup'])) { $SelectedGroup = $_GET['SelectedGroup']; -} elseif (isset($_POST['SelectedGroup'])){ +} elseif(isset($_POST['SelectedGroup'])) { $SelectedGroup = $_POST['SelectedGroup']; } -echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $Title . '</p><br />'; +if(isset($_POST['submit']) OR isset($_GET['remove']) OR isset($_GET['add']) ) { -if (isset($_POST['submit']) OR isset($_GET['remove']) OR isset($_GET['add']) ) { - //initialise no input errors assumed initially before we test $InputError = 0; /* actions to take once the user has clicked the submit button ie the page has called itself with some user input */ //first off validate inputs sensible - if (isset($_POST['GroupName']) AND mb_strlen($_POST['GroupName'])<4){ + if(isset($_POST['GroupName']) AND mb_strlen($_POST['GroupName'])<4) { $InputError = 1; prnMsg(_('The Group description entered must be at least 4 characters long'),'error'); } @@ -30,7 +33,7 @@ // if $_POST['GroupName'] then it is a modification of a tax group name // else it is either an add or remove of taxgroup unset($sql); - if (isset($_POST['GroupName']) ){ // Update or Add a tax group + if(isset($_POST['GroupName']) ) { // Update or Add a tax group if(isset($SelectedGroup)) { // Update a tax group $sql = "UPDATE taxgroups SET taxgroupdescription = '". $_POST['GroupName'] ."' WHERE taxgroupid = '".$SelectedGroup . "'"; @@ -41,7 +44,7 @@ $result = DB_query("SELECT taxgroupid FROM taxgroups WHERE taxgroupdescription='" . $_POST['GroupName'] . "'",$db); - if (DB_num_rows($result)==1){ + if(DB_num_rows($result)==1) { prnMsg( _('A new tax group could not be added because a tax group already exists for') . ' ' . $_POST['GroupName'],'warn'); unset($sql); } else { @@ -53,7 +56,7 @@ } unset($_POST['GroupName']); unset($SelectedGroup); - } elseif (isset($SelectedGroup) ) { + } elseif(isset($SelectedGroup) ) { $TaxAuthority = $_GET['TaxAuthority']; if( isset($_GET['add']) ) { // adding a tax authority to a tax group $sql = "INSERT INTO taxgrouptaxes ( taxgroupid, @@ -65,7 +68,7 @@ $ErrMsg = _('The addition of the tax failed because'); $SuccessMsg = _('The tax was added.'); - } elseif ( isset($_GET['remove']) ) { // remove a taxauthority from a tax group + } elseif( isset($_GET['remove']) ) { // remove a taxauthority from a tax group $sql = "DELETE FROM taxgrouptaxes WHERE taxgroupid = '".$SelectedGroup."' AND taxauthid = '".$TaxAuthority . "'"; @@ -77,20 +80,20 @@ unset($_GET['TaxAuthority']); } // Need to exec the query - if (isset($sql) AND $InputError != 1 ) { + if(isset($sql) AND $InputError != 1 ) { $result = DB_query($sql,$db,$ErrMsg); if( $result ) { prnMsg( $SuccessMsg,'success'); } } -} elseif (isset($_POST['UpdateOrder'])) { +} elseif(isset($_POST['UpdateOrder'])) { //A calculation order update $sql = "SELECT taxauthid FROM taxgrouptaxes WHERE taxgroupid='" . $SelectedGroup . "'"; $Result = DB_query($sql,$db,_('Could not get tax authorities in the selected tax group')); - while ($myrow=DB_fetch_row($Result)){ + while($myrow=DB_fetch_row($Result)) { - if (is_numeric($_POST['CalcOrder_' . $myrow[0]]) AND $_POST['CalcOrder_' . $myrow[0]] <5){ + if(is_numeric($_POST['CalcOrder_' . $myrow[0]]) AND $_POST['CalcOrder_' . $myrow[0]] <5) { $sql = "UPDATE taxgrouptaxes SET calculationorder='" . $_POST['CalcOrder_' . $myrow[0]] . "', @@ -111,23 +114,22 @@ $Result = DB_query($sql,$db,_('Could not get tax authorities in the selected tax group')); - if (DB_num_rows($Result)>0){ + if(DB_num_rows($Result)>0) { $myrow=DB_fetch_array($Result); - if ($myrow['taxontax']==1){ + if($myrow['taxontax']==1) { prnMsg(_('It is inappropriate to set tax on tax where the tax is the first in the calculation order. The system has changed it back to no tax on tax for this tax authority'),'warning'); $Result = DB_query("UPDATE taxgrouptaxes SET taxontax=0 WHERE taxgroupid='" . $SelectedGroup . "' AND taxauthid='" . $myrow['taxauthid'] . "'",$db); } } -} elseif (isset($_GET['Delete'])) { +} elseif(isset($_GET['Delete'])) { /* PREVENT DELETES IF DEPENDENT RECORDS IN 'custbranch, suppliers */ - $sql= "SELECT COUNT(*) FROM custbranch WHERE taxgroupid='" . $_GET['SelectedGroup'] . "'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { + if($myrow[0]>0) { prnMsg( _('Cannot delete this tax group because some customer branches are setup using it'),'warn'); echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('customer branches referring to this tax group'); } else { @@ -135,7 +137,7 @@ WHERE taxgroupid='" . $_GET['SelectedGroup'] . "'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { + if($myrow[0]>0) { prnMsg( _('Cannot delete this tax group because some suppliers are setup using it'),'warn'); echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('suppliers referring to this tax group'); } else { @@ -153,7 +155,7 @@ unset($_GET['GroupName']); } -if (!isset($SelectedGroup)) { +if(!isset($SelectedGroup)) { /* If its the first time the page has been displayed with no parameters then none of the above are true and the list of tax groups will be displayed with links to delete or edit each. These will call the same page again and allow update/input or deletion of tax group taxes*/ @@ -171,11 +173,12 @@ <tr> <th class="ascending" >' . _('Group No') . '</th> <th class="ascending" >' . _('Tax Group') . '</th> + <th colspan="2" > </th> </tr>'; $k=0; //row colour counter - while ($myrow = DB_fetch_array($result)) { - if ($k==1){ + while($myrow = DB_fetch_array($result)) { + if($k==1) { echo '<tr class="EvenTableRows">'; $k=0; } else { @@ -183,7 +186,7 @@ $k=1; } - printf('<td>%s</td> + printf('<td class="number">%s</td> <td>%s</td> <td><a href="%s&SelectedGroup=%s">' . _('Edit') . '</a></td> <td><a href="%s&SelectedGroup=%s&Delete=1&GroupID=%s" onclick="return confirm(\'' . _('Are you sure you wish to delete this tax group?') . '\');">' . _('Delete') . '</a></td> @@ -201,14 +204,13 @@ } } //end of ifs and buts! - -if (isset($SelectedGroup)) { +if(isset($SelectedGroup)) { echo '<div class="centre"> <a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">' . _('Review Existing Groups') . '</a> </div>'; } -if (isset($SelectedGroup)) { +if(isset($SelectedGroup)) { //editing an existing role $sql = "SELECT taxgroupid, @@ -216,7 +218,7 @@ FROM taxgroups WHERE taxgroupid='" . $SelectedGroup . "'"; $result = DB_query($sql, $db); - if ( DB_num_rows($result) == 0 ) { + if( DB_num_rows($result) == 0 ) { prnMsg( _('The selected tax group is no longer available.'),'warn'); } else { $myrow = DB_fetch_array($result); @@ -233,11 +235,11 @@ } echo '<table class="selection">'; -if (!isset($_POST['GroupName'])) { +if(!isset($_POST['GroupName'])) { $_POST['GroupName']=''; } echo '<tr><td>' . _('Tax Group') . ':</td> - <td><input pattern="(?!^ +$)[^><+-]{4,}" title="'._('The group name must be more 4 and less than 40 characters and cannot be left blank').'" placeholder="'._('4 to 40 legal characters').'" type="text" name="GroupName" size="40" maxlength="40" value="' . $_POST['GroupName'] . '" /></td>'; + <td><input pattern="(?!^ +$)[^><+-] {4,}" title="'._('The group name must be more 4 and less than 40 characters and cannot be left blank').'" placeholder="'._('4 to 40 legal characters').'" type="text" name="GroupName" size="40" maxlength="40" value="' . $_POST['GroupName'] . '" /></td>'; echo '<td><input type="submit" name="submit" value="' . _('Enter Group') . '" /></td> </tr> </table> @@ -245,9 +247,7 @@ </div> </form>'; - -if (isset($SelectedGroup)) { - +if(isset($SelectedGroup)) { $sql = "SELECT taxid, description as taxname FROM taxauthorities @@ -269,14 +269,14 @@ $TaxAuthsUsed = array(); //this array just holds the taxauthid of all authorities in the group $TaxAuthRow = array(); //this array holds all the details of the tax authorities in the group $i=1; - while ($myrow=DB_fetch_array($UsedResult)){ + while($myrow=DB_fetch_array($UsedResult)) { $TaxAuthsUsed[$i] = $myrow['taxauthid']; $TaxAuthRow[$i] = $myrow; $i++; } /* the order and tax on tax will only be an issue if more than one tax authority in the group */ - if (count($TaxAuthsUsed)>0) { + if(count($TaxAuthsUsed)>0) { echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">'; echo '<div>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> @@ -292,7 +292,7 @@ </tr>'; $k=0; //row colour counter for ($i=1;$i < count($TaxAuthRow)+1;$i++) { - if ($k==1){ + if($k==1) { echo '<tr class="OddTableRows">'; $k=0; } else { @@ -300,14 +300,14 @@ $k=1; } - if ($TaxAuthRow[$i]['calculationorder']==0){ + if($TaxAuthRow[$i]['calculationorder']==0) { $TaxAuthRow[$i]['calculationorder'] = $i; } echo '<td>' . $TaxAuthRow[$i]['taxname'] . '</td> - <td><input type="text" class="integer" pattern="[1-4]{1}" title="'._('The input must be positive integer and less than 5').'" name="CalcOrder_' . $TaxAuthRow[$i]['taxauthid'] . '" value="' . $TaxAuthRow[$i]['calculationorder'] . '" size="2" maxlength="2" style="width: 100%" /></td> + <td><input type="text" class="integer" pattern="[1-4] {1}" title="'._('The input must be positive integer and less than 5').'" name="CalcOrder_' . $TaxAuthRow[$i]['taxauthid'] . '" value="' . $TaxAuthRow[$i]['calculationorder'] . '" size="2" maxlength="2" style="width: 100%" /></td> <td><select name="TaxOnTax_' . $TaxAuthRow[$i]['taxauthid'] . '" style="width: 100%">'; - if ($TaxAuthRow[$i]['taxontax']==1){ + if($TaxAuthRow[$i]['taxontax']==1) { echo '<option selected="selected" value="1">' . _('Yes') . '</option>'; echo '<option value="0">' . _('No') . '</option>'; } else { @@ -324,61 +324,57 @@ <input type="submit" name="UpdateOrder" value="' . _('Update Order') . '" /> </div>'; } + echo '</div></form>'; - echo '</div> - </form>'; + if(DB_num_rows($Result)>0 ) { + echo '<br /><table class="selection"> + <tr> + <th colspan="4">' . _('Assigned Taxes') . '</th> + <th rowspan="2"> </th> + <th colspan="2">' . _('Available Taxes') . '</th> + </tr> + <tr> + <th>' . _('Tax Auth ID') . '</th> + <th>' . _('Tax Authority Name') . '</th> + <th>' . _('Calculation Order') . '</th> + <th>' . _('Tax on Prior Tax(es)') . '</th> + <th>' . _('Tax Auth ID') . '</th> + <th>' . _('Tax Authority Name') . '</th> + </tr>'; - if (DB_num_rows($Result)>0 ) { - echo '<br />'; - echo '<table class="selection"> - <tr> - <th colspan="4">' . _('Assigned Taxes') . '</th> - <th></th> - <th colspan="2">' . _('Available Taxes') . '</th> - </tr> - <tr> - <th>' . _('Tax Auth ID') . '</th> - <th>' . _('Tax Authority Name') . '</th> - <th>' . _('Calculation Order') . '</th> - <th>' . _('Tax on Prior Tax(es)') . '</th> - <th></th> - <th>' . _('Tax Auth ID') . '</th> - <th>' . _('Tax Authority Name') . '</th> - </tr>'; - } else { - echo '<br /> - <div class="centre">' . - _('There are no tax authorities defined to allocate to this tax group').' - </div>'; + echo '<br /><div class="centre">' . + _('There are no tax authorities defined to allocate to this tax group') . + '</div>'; } $k=0; //row colour counter while($AvailRow = DB_fetch_array($Result)) { - - if ($k==1){ + if($k==1) { echo '<tr class="EvenTableRows">'; $k=0; } else { echo '<tr class="OddTableRows">'; $k=1; } + $TaxAuthUsedPointer = array_search($AvailRow['taxid'],$TaxAuthsUsed); - if ($TaxAuthUsedPointer){ - - if ($TaxAuthRow[$TaxAuthUsedPointer]['taxontax'] ==1){ + if($TaxAuthUsedPointer) { + if($TaxAuthRow[$TaxAuthUsedPointer]['taxontax'] ==1) { $TaxOnTax = _('Yes'); } else { $TaxOnTax = _('No'); } - printf('<td>%s</td> + printf(' + <td class="number">%s</td> <td>%s</td> + <td class="number">%s</td> <td>%s</td> - <td>%s</td> - <td><a href="%sSelectedGroup=%s&remove=1&TaxAuthority=%s" onclick="return confirm(\'' . _('Are you sure you wish to remove this tax authority from the group?') . '\');">' . _('Remove') . '</a></td> - <td> </td> + <td class="centre"><a href="%sSelectedGroup=%s&remove=1&TaxAuthority=%s" onclick="return confirm(\'' . + _('Are you sure you wish to remove this tax authority from the group?') . '\');">' . _('Remove') . '</a></td> + <td class="number"> </td> <td> </td>', $AvailRow['taxid'], $AvailRow['taxname'], @@ -390,26 +386,32 @@ ); } else { - printf('<td> </td> + printf(' + <td class="number"> </td> <td> </td> + <td class="number"> </td> <td> </td> - <td> </td> - <td> </td> - <td>%s</td> - <td>%s</td> - <td><a href="%sSelectedGroup=%s&add=1&TaxAuthority=%s">' . _('Add') . '</a></td>', - $AvailRow['taxid'], - $AvailRow['taxname'], + <td class="centre"><a href="%sSelectedGroup=%s&add=1&TaxAuthority=%s">' . + _('Add') . '</a></td> + <td class="number">%s</td> + <td>%s</td>', htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?', $SelectedGroup, - $AvailRow['taxid'] ); + $AvailRow['taxid'], + $AvailRow['taxid'], + $AvailRow['taxname']); } echo '</tr>'; } echo '</table>'; - } +echo '<br /> + <div class="centre"> + <a href="' . $RootPath . '/TaxAuthorities.php">' . _('Tax Authorities and Rates Maintenance') . '</a><br /> + <a href="' . $RootPath . '/TaxProvinces.php">' . _('Dispatch Tax Province Maintenance') . '</a><br /> + <a href="' . $RootPath . '/TaxCategories.php">' . _('Tax Category Maintenance') . '</a> + </div>'; + include('includes/footer.inc'); - ?> Modified: trunk/TaxProvinces.php =================================================================== --- trunk/TaxProvinces.php 2014-08-30 15:03:16 UTC (rev 6857) +++ trunk/TaxProvinces.php 2014-08-30 23:06:07 UTC (rev 6858) @@ -2,21 +2,21 @@ /* $Id$*/ include('includes/session.inc'); - $Title = _('Dispatch Tax Provinces'); - +$ViewTopic = 'Tax';// Filename in ManualContents.php's TOC. +$BookMark = 'TaxProvinces';// Anchor's id in the manual's html document. include('includes/header.inc'); +echo '<p class="page_title_text"><img alt="" src="' . $RootPath . '/css/' . $Theme . + '/images/maintenance.png" title="' . + _('Dispatch Tax Province Maintenance') . '" />' . ' ' . + _('Dispatch Tax Province Maintenance') . '</p>'; -echo '<p class="page_title_text"> - <img src="'.$RootPath.'/css/'.$Theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $Title.' - </p>'; - -if ( isset($_GET['SelectedTaxProvince']) ) +if( isset($_GET['SelectedTaxProvince']) ) $SelectedTaxProvince = $_GET['SelectedTaxProvince']; -elseif (isset($_POST['SelectedTaxProvince'])) +elseif(isset($_POST['SelectedTaxProvince'])) $SelectedTaxProvince = $_POST['SelectedTaxProvince']; -if (isset($_POST['submit'])) { +if(isset($_POST['submit'])) { //initialise no input errors assumed initially before we test @@ -27,16 +27,16 @@ //first off validate inputs sensible - if (ContainsIllegalCharacters($_POST['TaxProvinceName'])) { + if(ContainsIllegalCharacters($_POST['TaxProvinceName'])) { $InputError = 1; prnMsg( _('The tax province name cannot contain any of the illegal characters'),'error'); } - if (trim($_POST['TaxProvinceName']) == '') { + if(trim($_POST['TaxProvinceName']) == '') { $InputError = 1; prnMsg( _('The tax province name may not be empty'), 'error'); } - if ($_POST['SelectedTaxProvince']!='' AND $InputError !=1) { + if($_POST['SelectedTaxProvince']!='' AND $InputError !=1) { /*SelectedTaxProvince 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*/ // Check the name does not clash @@ -45,7 +45,7 @@ AND taxprovincename " . LIKE . " '" . $_POST['TaxProvinceName'] . "'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); - if ( $myrow[0] > 0 ) { + if( $myrow[0] > 0 ) { $InputError = 1; prnMsg( _('The tax province cannot be renamed because another with the same name already exists.'),'error'); } else { @@ -53,7 +53,7 @@ $sql = "SELECT taxprovincename FROM taxprovinces WHERE taxprovinceid = '" . $SelectedTaxProvince . "'"; $result = DB_query($sql,$db); - if ( DB_num_rows($result) != 0 ) { + if( DB_num_rows($result) != 0 ) { // This is probably the safest way there is $myrow = DB_fetch_row($result); $OldTaxProvinceName = $myrow[0]; @@ -62,7 +62,7 @@ WHERE taxprovincename ".LIKE." '".$OldTaxProvinceName."'"; $ErrMsg = _('Could not update tax province'); $result = DB_query($sql,$db, $ErrMsg); - if (!$result){ + if(!$result) { prnMsg(_('Tax province name changed'),'success'); } } else { @@ -70,14 +70,14 @@ prnMsg( _('The tax province no longer exists'),'error'); } } - } elseif ($InputError !=1) { + } elseif($InputError !=1) { /*SelectedTaxProvince is null cos no item selected on first time round so must be adding a record*/ $sql = "SELECT count(*) FROM taxprovinces WHERE taxprovincename " .LIKE. " '".$_POST['TaxProvinceName'] ."'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); - if ( $myrow[0] > 0 ) { + if( $myrow[0] > 0 ) { $InputError = 1; prnMsg( _('The tax province cannot be created because another with the same name already exists'),'error'); @@ -98,7 +98,7 @@ $result = DB_query($sql,$db, $ErrMsg); } - if (!$result){ + if(!$result) { prnMsg(_('Errors were encountered adding this tax province'),'error'); } else { prnMsg(_('New tax province added'),'success'); @@ -108,14 +108,14 @@ unset ($_POST['SelectedTaxProvince']); unset ($_POST['TaxProvinceName']); -} elseif (isset($_GET['delete'])) { +} elseif(isset($_GET['delete'])) { //the link to delete a selected record was clicked instead of the submit button // PREVENT DELETES IF DEPENDENT RECORDS IN 'stockmaster' // Get the original name of the tax province the ID is just a secure way to find the tax province $sql = "SELECT taxprovincename FROM taxprovinces WHERE taxprovinceid = '" . $SelectedTaxProvince . "'"; $result = DB_query($sql,$db); - if ( DB_num_rows($result) == 0 ) { + if( DB_num_rows($result) == 0 ) { // This is probably the safest way there is prnMsg( _('Cannot delete this tax province because it no longer exists'),'warn'); } else { @@ -124,7 +124,7 @@ $sql= "SELECT COUNT(*) FROM locations WHERE taxprovinceid = '" . $SelectedTaxProvince . "'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { + if($myrow[0]>0) { prnMsg( _('Cannot delete this tax province because at least one stock location is defined to be inside this province'),'warn'); echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('stock locations that refer to this tax province') . '</font>'; } else { @@ -142,15 +142,15 @@ unset ($_POST['TaxProvinceName']); } - if (!isset($SelectedTaxProvince)) { +if(!isset($SelectedTaxProvince)) { /* An tax province could be posted when one has been edited and is being updated - or GOT when selected for modification - SelectedTaxProvince will exist because it was sent with the page in a GET . - If its the first time the page has been displayed with no parameters - then none of the above are true and the list of account groups 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*/ +or GOT when selected for modification +SelectedTaxProvince will exist because it was sent with the page in a GET . +If its the first time the page has been displayed with no parameters +then none of the above are true and the list of account groups 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*/ $sql = "SELECT taxprovinceid, taxprovincename @@ -162,13 +162,14 @@ echo '<table class="selection"> <tr> - <th class="ascending">' . _('Tax Provinces') . '</th> + <th class="ascending">' . _('Tax Province') . '</th> + <th colspan="2"> </th> </tr>'; $k=0; //row colour counter - while ($myrow = DB_fetch_row($result)) { + while($myrow = DB_fetch_row($result)) { - if ($k==1){ + if($k==1) { echo '<tr class="EvenTableRows">'; $k=0; } else { @@ -186,20 +187,20 @@ } //end of ifs and buts! -if (isset($SelectedTaxProvince)) { +if(isset($SelectedTaxProvince)) { echo '<div class="centre"> <a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">' . _('Review Tax Provinces') . '</a> </div> - <br />'; +<br />'; } -if (! isset($_GET['delete'])) { +if(! isset($_GET['delete'])) { echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">'; - echo '<div>'; +echo '<div>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - if (isset($SelectedTaxProvince)) { + if(isset($SelectedTaxProvince)) { //editing an existing section $sql = "SELECT taxprovinceid, @@ -208,7 +209,7 @@ WHERE taxprovinceid='" . $SelectedTaxProvince . "'"; $result = DB_query($sql, $db); - if ( DB_num_rows($result) == 0 ) { + if( DB_num_rows($result) == 0 ) { prnMsg( _('Could not retrieve the requested tax province, please try again.'),'warn'); unset($SelectedTaxProvince); } else { @@ -236,17 +237,15 @@ </div>'; echo '</div> - </form>'; +</form>'; } //end if record deleted no point displaying form to add record -echo '<div class="centre"> - <br /> - <a href="' . $RootPath . '/TaxAuthorities.php">' . _('Edit/Review Tax Authorities') . '</a> - <br /> - <a href="' . $RootPath . '/TaxGroups.php">' . _('Edit/Review Tax Groupings') . '</a> - <br /> - <a href="' . $RootPath . '/TaxCategories.php">' . _('Edit/Review Tax Categories') . '</a> +echo '<br /> + <div class="centre"> + <a href="' . $RootPath . '/TaxAuthorities.php">' . _('Tax Authorities and Rates Maintenance') . '</a><br /> + <a href="' . $RootPath . '/TaxGroups.php">' . _('Tax Group Maintenance') . '</a><br /> + <a href="' . $RootPath . '/TaxCategories.php">' . _('Tax Category Maintenance') . '</a> </div>'; include('includes/footer.inc'); Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2014-08-30 15:03:16 UTC (rev 6857) +++ trunk/doc/Change.log 2014-08-30 23:06:07 UTC (rev 6858) @@ -1,5 +1,6 @@ webERP Change Log +31/8/14 RChacon: Standardizes page_title_text to main-menu-option, standardizes bottom tax-menu, adds $ViewTopic and $BookMark, completes table header columns, formats data columns in Tax* scripts. 30/8/14 RChacon: In TaxAuthorities.php, adds $ViewTopic and $BookMark, completes table headings, formats number columns to fix sort order, and minor improvements. 30/8/14 Phil: WorkOrderEntry.php didn't handle no item returned from search correctly - fixed. 29/8/14 RChacon: In TaxAuthorityRates.php and TaxCategories.php: adds $ViewTopic and $BookMark; Uses gettext() to translate 'Exempt', 'Freight' and 'Handling'. Modified: trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo =================================================================== (Binary files differ) Modified: trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po 2014-08-30 15:03:16 UTC (rev 6857) +++ trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po 2014-08-30 23:06:07 UTC (rev 6858) @@ -8,7 +8,7 @@ "Project-Id-Version: webERP 4.11.3\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2014-08-29 11:25-0600\n" -"PO-Revision-Date: 2014-08-29 11:35-0600\n" +"PO-Revision-Date: 2014-08-30 16:53-0600\n" "Last-Translator: Rafael Chacon <raf...@gm...>\n" "Language-Team: TecnoSoluciones.com <web...@te...>\n" "Language: es_ES\n" @@ -8788,7 +8788,7 @@ #: CustomerBranches.php:415 CustomerBranches.php:866 SupplierCredit.php:265 #: Suppliers.php:840 Suppliers.php:1094 TaxGroups.php:173 TaxGroups.php:239 msgid "Tax Group" -msgstr "Grupo de Impuestos" +msgstr "Grupo de impuestos" #: CustomerBranches.php:416 msgid "Enabled?" @@ -16527,7 +16527,7 @@ #: Locations.php:400 Locations.php:620 TaxAuthorityRates.php:87 msgid "Tax Province" -msgstr "Jurisdicción Fiscal" +msgstr "Jurisdicción fiscal" #: Locations.php:423 #, php-format @@ -35888,7 +35888,7 @@ #: TaxAuthorityRates.php:138 TaxCategories.php:6 TaxCategories.php:167 msgid "Tax Categories" -msgstr "Clases de Impuestos" +msgstr "Clases de impuestos" #: TaxAuthorityRates.php:140 TaxProvinces.php:6 msgid "Dispatch Tax Provinces" |