Option to suppress tax rates on documents. To be used for tax on tax
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Sat, 26 Jun 2010 08:04:39 +0000 (08:04 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Sat, 26 Jun 2010 08:04:39 +0000 (08:04 +0000)
The tax % should be included in the tax name and the calculated
rate be set as the rate. $suppress_tax_rates in config.php set to 1.
Preparing for 2.3. Beta

CHANGELOG.txt
config.default.php
includes/ui/ui_view.inc
reporting/rep107.php
reporting/rep110.php
update.html

index c5a2f00ea98c4348cd6cfaaa1b4dda1dc761fe2d..ea6d3da9afd2434b880217694558423469ee96ee 100644 (file)
@@ -19,6 +19,17 @@ Legend:
 ! -> Note
 $ -> Affected files
 
+26-Jun-2010 Joe Hunt
+! Option to suppress tax rates on documents. To be used for tax on tax
+  The tax % should be included in the tax name and the calculated
+  rate be set as the rate. $suppress_tax_rates in config.php set to 1.
+$ config.default.php
+  /includes/ui/ui_view.inc
+  /reporting/rep107.php
+  /reporting/rep110.php
++ Preparing for 2.3 Beta
+$ update.html
+  
 26-Jun-2010 Janusz Dobrowolski
 # Fixed sql for child transaction retrieval
 $  /sales/includes/sales_db.inc
index 84c8578f5446537201d96a945b9e8556dd30bd5e..67b1d62767d1b85d13d44bd4d9add0767b6b9bd1 100644 (file)
@@ -57,7 +57,7 @@ if (!isset($path_to_root) || isset($_GET['path_to_root']) || isset($_POST['path_
        // Main Title
        $app_title = "FrontAccounting";
        // application version
-       $version                = "2.3 CVS (m10)";
+       $version                = "2.3 Beta";
         // src-data compatibility check. Do not change.
        $core_version = "2.3";
 
@@ -91,7 +91,7 @@ if (!isset($path_to_root) || isset($_GET['path_to_root']) || isset($_POST['path_
        // $old_style_help = 1; // this setting is depreciated and subject to removal in next FA versions
        //      locally installed wiki module
        // $help_base_url = $path_to_root.'/modules/wiki/index.php?n='._('Help').'.';
-       //      context help feed from frontaccounting.net
+       //      context help feed from frontaccounting.com
        // $help_base_url = 'http://frontaccounting.com/fawiki/index.php?n=Help.';
        //      not used
        $help_base_url = null;
@@ -115,6 +115,9 @@ if (!isset($path_to_root) || isset($_GET['path_to_root']) || isset($_POST['path_
        /* 1 = print Subtotal tax excluded, tax and Total tax included */
        $alternative_tax_include_on_docs = 0;
 
+       /* suppress tax rates on documents. 0 = no, 1 = yes. */
+       $suppress_tax_rates = 0;
+       
        $dateformats    = array("MMDDYYYY", "DDMMYYYY", "YYYYMMDD");
        $dateseps               = array("/", ".", "-", " ");
        $thoseps                = array(",", ".", " ");
index 55881b1d424e6e4bdb8756ce5fe6247991863823..cce5b51d7cfd4c2119517cce3e2d4592a3e2f677 100644 (file)
@@ -374,11 +374,15 @@ function display_debit_or_credit_cells($value)
 
 function display_customer_trans_tax_details($tax_items, $columns)
 {
-       global $alternative_tax_include_on_docs;
+       global $alternative_tax_include_on_docs, $suppress_tax_rates;
        $first = true;
     while ($tax_item = db_fetch($tax_items))
     {
        $tax = number_format2($tax_item['amount'],user_price_dec());
+               if (isset($suppress_tax_rates) && $suppress_tax_rates == 1)
+                       $tax_type_name = $tax_item['tax_type_name'];
+               else
+                       $tax_type_name = $tax_item['tax_type_name']." (".$tax_item['rate']."%) ";
        if ($tax_item['included_in_price'])
        {
                        if (isset($alternative_tax_include_on_docs) && $alternative_tax_include_on_docs == 1)
@@ -386,17 +390,15 @@ function display_customer_trans_tax_details($tax_items, $columns)
                                if ($first)
                                        label_row(_("Total Tax Excluded"), number_format2($tax_item['net_amount'], user_price_dec()),
                                                "colspan=$columns align=right", "align=right");
-                       label_row($tax_item['tax_type_name'] . " (" . $tax_item['rate'] . "%)",
-                               $tax, "colspan=$columns align=right", "align=right");
+                       label_row($tax_type_name, $tax, "colspan=$columns align=right", "align=right");
                        $first = false;
                }
                else
-                       label_row(_("Included") . " " . $tax_item['tax_type_name'] . " (" . $tax_item['rate'] . "%) " .
+                       label_row(_("Included") . " " . $tax_type_name .
                                _("Amount") . ": $tax", "", "colspan=$columns align=right", "align=right");
         }                      
        else
-               label_row($tax_item['tax_type_name'] . " (" . $tax_item['rate'] . "%)",
-                       $tax, "colspan=$columns align=right", "align=right");
+               label_row($tax_type_name, $tax, "colspan=$columns align=right", "align=right");
     }
 }
 
index 11af3b832f90f83c7826ca50812cfc9a87761314..78a59495f1766e6d8818844e78914cb9f026e917 100644 (file)
@@ -32,7 +32,7 @@ print_invoices();
 
 function print_invoices()
 {
-       global $path_to_root, $alternative_tax_include_on_docs;
+       global $path_to_root, $alternative_tax_include_on_docs, $suppress_tax_rates;
        
        include_once($path_to_root . "/reporting/includes/pdf_report.inc");
 
@@ -173,6 +173,11 @@ function print_invoices()
                while ($tax_item = db_fetch($tax_items))
                {
                        $DisplayTax = number_format2($sign*$tax_item['amount'], $dec);
+                       
+                       if (isset($suppress_tax_rates) && $suppress_tax_rates == 1)
+                               $tax_type_name = $tax_item['tax_type_name'];
+                       else
+                               $tax_type_name = $tax_item['tax_type_name']." (".$tax_item['rate']."%) ";
 
                        if ($tax_item['included_in_price'])
                        {
@@ -184,19 +189,16 @@ function print_invoices()
                                                        $rep->TextCol(6, 7,     number_format2($sign*$tax_item['net_amount'], $dec), -2);
                                                        $rep->NewLine();
                                        }
-                                               $rep->TextCol(3, 6, $tax_item['tax_type_name'] . " (" .
-                                                       $tax_item['rate'] . "%)", -2);
+                                               $rep->TextCol(3, 6, $tax_type_name, -2);
                                                $rep->TextCol(6, 7,     $DisplayTax, -2);
                                                $first = false;
                                }
                                else
-                                               $rep->TextCol(3, 7, $doc_Included . " " . $tax_item['tax_type_name'] .
-                                                       " (" . $tax_item['rate'] . "%) " . $doc_Amount . ": " . $DisplayTax, -2);
+                                               $rep->TextCol(3, 7, $doc_Included . " " . $tax_type_name . $doc_Amount . ": " . $DisplayTax, -2);
                                }
                        else
                        {
-                                       $rep->TextCol(3, 6, $tax_item['tax_type_name'] . " (" .
-                                               $tax_item['rate'] . "%)", -2);
+                                       $rep->TextCol(3, 6, $tax_type_name, -2);
                                        $rep->TextCol(6, 7,     $DisplayTax, -2);
                                }
                                $rep->NewLine();
index db7c1c941474c6fc9bd852d29e890fc4d8f0358d..1c9cf7436037078fb9ed26a20a9ac4ecea95ee50 100644 (file)
@@ -34,7 +34,7 @@ print_deliveries();
 
 function print_deliveries()
 {
-       global $path_to_root, $packing_slip, $alternative_tax_include_on_docs;
+       global $path_to_root, $packing_slip, $alternative_tax_include_on_docs, $suppress_tax_rates;
 
        include_once($path_to_root . "/reporting/includes/pdf_report.inc");
 
@@ -169,7 +169,13 @@ function print_deliveries()
                        while ($tax_item = db_fetch($tax_items))
                        {
                                $DisplayTax = number_format2($tax_item['amount'], $dec);
-                               if ($tax_item['included_in_price'])
+                                       if (isset($suppress_tax_rates) && $suppress_tax_rates == 1)
+                                               $tax_type_name = $tax_item['tax_type_name'];
+                                       else
+                                               $tax_type_name = $tax_item['tax_type_name']." (".$tax_item['rate']."%) ";
+                                       if ($tax_item['included_in_price'])
                                {
                                                if (isset($alternative_tax_include_on_docs) && $alternative_tax_include_on_docs == 1)
                                        {
@@ -179,19 +185,16 @@ function print_deliveries()
                                                                $rep->TextCol(6, 7,     number_format2($tax_item['net_amount'], $dec), -2);
                                                                $rep->NewLine();
                                                }
-                                                       $rep->TextCol(3, 6, $tax_item['tax_type_name'] . " (" .
-                                                               $tax_item['rate'] . "%)", -2);
+                                                       $rep->TextCol(3, 6, $tax_type_name, -2);
                                                        $rep->TextCol(6, 7,     $DisplayTax, -2);
                                                        $first = false;
                                        }
                                        else
-                                                       $rep->TextCol(3, 7, $doc_Included . " " . $tax_item['tax_type_name'] .
-                                                               " (" . $tax_item['rate'] . "%) " . $doc_Amount . ": " . $DisplayTax, -2);
+                                                       $rep->TextCol(3, 7, $doc_Included . " " . $tax_type_name . $doc_Amount . ": " . $DisplayTax, -2);
                                        }
                                else
                                {
-                                               $rep->TextCol(3, 6, $tax_item['tax_type_name'] . " (" .
-                                                       $tax_item['rate'] . "%)", -2);
+                                               $rep->TextCol(3, 6, $tax_type_name, -2);
                                                $rep->TextCol(6, 7,     $DisplayTax, -2);
                                        }
                                        $rep->NewLine();
index 1d31aa0f80a1a0e56d3066d01644176af5bbd5e0..dbf6b3abb869095e49f94ac71b754fcbb663a805 100644 (file)
@@ -17,14 +17,16 @@ server overwriting the existing files. From 2.2 RC, your existing configuration
 these files. </li></ul><ol>
         </ol>
 
-      </li><li>Upload all the new files.
-      </li><li>Look into the file, <span style="font-weight: bold; font-style: italic;">config.default.php and compare with your own config.php</span> file. You should update the the following in your config.php:<br /><br /></li><ul><li><small>Change the $version in your <span style="font-weight: bold;">config.php</span> file, about line 59, from "2.X.X" to "2.2.10".</small></li><li><small>Change in line &nbsp;67 to:<br />$power_url &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; = "http://frontaccounting.com";<br /></small><small><br />Change in line 92 to:<br />// $help_base_url = 'http://frontaccounting.com/fawiki/index.php?n=Help.';<br /><br />Paste these 2 lines into line 83:<br />&nbsp;/* default print destination. 0 = PDF/Printer, 1 = Excel */<br />&nbsp;$def_print_destination = 0;<br /><br />if this is an update from 2.2.6, 2.2.7, 2.2.8 , 2.2.9 to 2.2.10&nbsp;</small><small> </small><small>you are<span style="font-weight: bold;"> </span><span style="font-style: italic; font-weight: bold;">done and &nbsp;should ignore the the rest of the items in this note</span>.</small></li><li><small>Copy &nbsp;the 2 lines from config.default file, about line &nbsp;122:<br /><br /><span style="font-family: monospace;">$table_style &nbsp;&nbsp;&nbsp; = "class='tablestyle'";</span><br style="font-family: monospace;" /><span style="font-family: monospace;">$table_style2 &nbsp;&nbsp;&nbsp; = "class='tablestyle2'";</span><br style="font-family: monospace;" /><br />into&nbsp;config.php about line &nbsp;122 and replace these 4 lines:<br /><br /><span style="font-family: monospace;">if (!isset($_SESSION['bordercolor']))</span><br style="font-family: monospace;" /><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; $_SESSION['bordercolor'] = "#8cacbb";</span><br style="font-family: monospace;" /><span style="font-family: monospace;">$table_style &nbsp;&nbsp;&nbsp; = "cellpadding=3 border=1 bordercolor='".$_SESSION['bordercolor']."' class='tablestyle'";</span><br style="font-family: monospace;" /><span style="font-family: monospace;">$table_style2 &nbsp;&nbsp;&nbsp; = "cellpadding=3 border=1 bordercolor='#cccccc' class='tablestyle2'";</span><br style="font-family: monospace;" /><br />If this is an update from 2.2.3, 2.2.4 , 2.2.5 to 2.2.10&nbsp; </small><small>you are<span style="font-weight: bold;"> </span><span style="font-style: italic; font-weight: bold;">done and &nbsp;should ignore the the rest of the items in this note</span>.<br /></small></li><li><small>Copy these 2 lines from <span style="font-weight: bold;">config.default.php</span> about line 80-82 into <span style="font-weight: bold;">config.php</span> about line 80:<br /><br /><span style="font-family: monospace;">/* Show users online discretetely in the footer */</span><br style="font-family: monospace;" /><span style="font-family: monospace;">$show_users_online = 0;</span><br style="font-family: monospace;" /><span style="font-family: monospace;">Change this to 1 if you want to show users online.</span><br style="font-family: monospace;" /></small></li><li><small>Remove these 2 lines from <span style="font-weight: bold;">config.php</span> about line 176-177:<br /><br /><span style="font-family: monospace;">/* default start-up tab (orders/AP/stock/manuf/proj/GL/system) */</span><br style="font-family: monospace;" /><span style="font-family: monospace;">$def_app = "orders";</span><br style="font-family: monospace;" /></small></li><li><small>Copy these 3 lines from config.default.php about line 113-115<br /><br /><span style="font-family: monospace;">// defalt dateformats and dateseps indexes used before user login</span></small><br style="font-family: monospace;" /><small style="font-family: monospace;">$dflt_date_fmt = 0;</small><br style="font-family: monospace;" /><small><span style="font-family: monospace;">$dflt_date_sep = 0;</span><br style="font-family: monospace;" /></small></li><li><small>Copy these 2 lines from <span style="font-weight: bold;">config.default.php</span> about line 211-212:<br /><br /><span style="font-family: monospace;">define("ICON_SUBMIT", "ok.gif");&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // new in 2.2</span><br style="font-family: monospace;" /><span style="font-family: monospace;">define("ICON_ESCAPE", "escape.png");&nbsp;&nbsp;&nbsp; // new in 2.2</span><br style="font-family: monospace;" /></small></li><li><small>And paste them into <span style="font-weight: bold;">config.php</span> about line 209</small></li><li><small>If you use gregorian calendar and have non-workdays on Friday and first day of week = Saturday<br />then you &nbsp;should &nbsp;set this line in <span style="font-weight: bold;">config.php</span> about line&nbsp; 95.<br /></small><pre><small>$date_system = 3;</small></pre></li><li><small>If you want to use FrontAccounting help wiki then set this line in config.php about line 85<br /></small><pre><small>$help_base_url = "http://frontaccounting.net/fawiki?n=Help.";<br /></small></pre></li></ul><li>Rename or remove the /install folder (you have already performed the install
+      </li><li>Upload all the new files.</li><li>If this is an <span style="font-weight: bold;">upgrade from 2.X.X to 2.3</span> go into <span style="font-weight: bold;">Setup tab,&nbsp; Software Upgrade</span>.</li><ul><li>Follow
+the instructions. Check the values depending on your current
+installation. Don't use Force Upgrade unless your installations have
+failed.</li><li>If this is an installation from <span style="font-weight: bold;">2.0 or 2.1</span> you should &nbsp;copy the <span style="font-weight: bold;">config.default.php</span> to <span style="font-weight: bold;">config.php</span> and change your former settings and ingore the next section..</li></ul><li>Look into the file, <span style="font-weight: bold; font-style: italic;">config.default.php and compare with your own config.php</span> file. You should update the the following in your config.php:<br /><br /></li><ul><li><small>Change the $version in your <span style="font-weight: bold;">config.php</span> file, about line 59, from "2.2.X" to "2.3 Beta".</small></li><ul><li><small>Add &nbsp;the following lines into config.php about line 108:<br />&nbsp;/* suppress tax rates on documents. 0 = no, 1 = yes. */<br />&nbsp;$suppress_tax_rates = 0;<br /></small></li></ul><li><small>If this is an update from 2.2.10 or before:<br /></small></li><li><small>Change in line &nbsp;67 to:<br />$power_url &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; = "http://frontaccounting.com";<br /></small><small><br />Change in line 92 to:<br />// $help_base_url = 'http://frontaccounting.com/fawiki/index.php?n=Help.';<br /><br />Paste these 2 lines into line 83:<br />&nbsp;/* default print destination. 0 = PDF/Printer, 1 = Excel */<br />&nbsp;$def_print_destination = 0;<br /><br />if this is an update from 2.2.6, 2.2.7, 2.2.8 , 2.2.9 , 2.2.10 to 2.3&nbsp;</small><small> </small><small>you are<span style="font-weight: bold;"> </span><span style="font-style: italic; font-weight: bold;">done and &nbsp;should ignore the the rest of the items in this note</span>.</small></li><li><small>Copy &nbsp;the 2 lines from config.default file, about line &nbsp;122:<br /><br /><span style="font-family: monospace;">$table_style &nbsp;&nbsp;&nbsp; = "class='tablestyle'";</span><br style="font-family: monospace;" /><span style="font-family: monospace;">$table_style2 &nbsp;&nbsp;&nbsp; = "class='tablestyle2'";</span><br style="font-family: monospace;" /><br />into&nbsp;config.php about line &nbsp;122 and replace these 4 lines:<br /><br /><span style="font-family: monospace;">if (!isset($_SESSION['bordercolor']))</span><br style="font-family: monospace;" /><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; $_SESSION['bordercolor'] = "#8cacbb";</span><br style="font-family: monospace;" /><span style="font-family: monospace;">$table_style &nbsp;&nbsp;&nbsp; = "cellpadding=3 border=1 bordercolor='".$_SESSION['bordercolor']."' class='tablestyle'";</span><br style="font-family: monospace;" /><span style="font-family: monospace;">$table_style2 &nbsp;&nbsp;&nbsp; = "cellpadding=3 border=1 bordercolor='#cccccc' class='tablestyle2'";</span><br style="font-family: monospace;" /><br />If this is an update from 2.2.3, 2.2.4 , 2.2.5 to 2.3&nbsp; </small><small>you are<span style="font-weight: bold;"> </span><span style="font-style: italic; font-weight: bold;">done and &nbsp;should ignore the the rest of the items in this note</span>.<br /></small></li><li><small>Copy these 2 lines from <span style="font-weight: bold;">config.default.php</span> about line 80-82 into <span style="font-weight: bold;">config.php</span> about line 80:<br /><br /><span style="font-family: monospace;">/* Show users online discretetely in the footer */</span><br style="font-family: monospace;" /><span style="font-family: monospace;">$show_users_online = 0;</span><br style="font-family: monospace;" /><span style="font-family: monospace;">Change this to 1 if you want to show users online.</span><br style="font-family: monospace;" /></small></li><li><small>Remove these 2 lines from <span style="font-weight: bold;">config.php</span> about line 176-177:<br /><br /><span style="font-family: monospace;">/* default start-up tab (orders/AP/stock/manuf/proj/GL/system) */</span><br style="font-family: monospace;" /><span style="font-family: monospace;">$def_app = "orders";</span><br style="font-family: monospace;" /></small></li><li><small>Copy these 3 lines from config.default.php about line 113-115<br /><br /><span style="font-family: monospace;">// defalt dateformats and dateseps indexes used before user login</span></small><br style="font-family: monospace;" /><small style="font-family: monospace;">$dflt_date_fmt = 0;</small><br style="font-family: monospace;" /><small><span style="font-family: monospace;">$dflt_date_sep = 0;</span><br style="font-family: monospace;" /></small></li><li><small>Copy these 2 lines from <span style="font-weight: bold;">config.default.php</span> about line 211-212:<br /><br /><span style="font-family: monospace;">define("ICON_SUBMIT", "ok.gif");&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // new in 2.2</span><br style="font-family: monospace;" /><span style="font-family: monospace;">define("ICON_ESCAPE", "escape.png");&nbsp;&nbsp;&nbsp; // new in 2.2</span><br style="font-family: monospace;" /></small></li><li><small>And paste them into <span style="font-weight: bold;">config.php</span> about line 209</small></li><li><small>If you use gregorian calendar and have non-workdays on Friday and first day of week = Saturday<br />then you &nbsp;should &nbsp;set this line in <span style="font-weight: bold;">config.php</span> about line&nbsp; 95.<br /></small><pre><small>$date_system = 3;</small></pre></li><li><small>If you want to use FrontAccounting help wiki then set this line in config.php about line 85<br /></small><pre><small>$help_base_url = "http://frontaccounting.net/fawiki?n=Help.";<br /></small></pre></li></ul><li>Rename or remove the /install folder (you have already performed the install
 process earlier).<br /></li></ul><ol>
 
 
 
     </ol>
-  </li><li><strong>There are no database changes during a major and minor release. Like from 2.2 to 2.2.1 - 2.2.X .</strong></li><li><strong>If you are upgrading from an earlier installation you
+  </li><li><strong>There are no database changes during a major and minor release. Like from 2.3 to 2.3.1 - 2.3.X .</strong></li><li><strong>If you are upgrading from an earlier installation you
 must immediately
 login on company 0, the first company you created, as&nbsp;admin
 (called the superadmin). If you use a theme other than the standard 3,
@@ -34,7 +36,7 @@ later.&nbsp; Go
 to the 'Setup' tab and run 'Software
 Upgrade'.
 Mark the checkbox 'Install' and press 'Upgrade System'. &nbsp;You must
-also do this if you upgrade from 2.2 Beta to 2.2 RC. This will
+also do this if you upgrade from 2.3 Beta to 2.3 RC. This will
 upgrade ALL your companies.<br /></strong></li><li style="font-weight: bold;">If something goes wrong during upgrade, you can enter here again and try 'Force Upgrade', and press 'Upgrade System' again.<br /></li><li style="font-weight: bold;">Enter
 'Setup' tab, 'System and Generel GL Setup'. &nbsp;Set the correct
 Accounts for Retained Earnings, Profit/Loss Year and Bank Charge.<br /></li><li style="font-weight: bold;">Enter