Changed name tax type uniqueness constraint to (name, rate)
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Fri, 7 Mar 2008 21:00:14 +0000 (21:00 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Fri, 7 Mar 2008 21:00:14 +0000 (21:00 +0000)
includes/ui/ui_lists.inc
taxes/item_tax_types.php

index 687c035eedccf87261123b83182df277975f90f9..e2c79201209ea54fc622c45e2936dd2a98e67ffe 100644 (file)
@@ -1079,7 +1079,7 @@ function stock_units_list_row($label, $name, $value, $enabled=true)
 function tax_types_list($name, $selected_id,
        $none_option=false, $none_option_name=null, $submit_on_change=false)
 {
-       simple_codeandname_list("SELECT id, name FROM ".TB_PREF."tax_types",
+       simple_codeandname_list("SELECT id, CONCAT(name, ' (',rate,'%)') as name FROM ".TB_PREF."tax_types",
                $name, $selected_id, $none_option, $none_option_name, true, $submit_on_change);
 }
 
index f274556d984ab39742d0759f1f17ab8d33591286..55175b709e41effa6cf9906304a8f970a8bb30aa 100644 (file)
@@ -97,14 +97,15 @@ if (isset($_GET['delete']))
 
 //-----------------------------------------------------------------------------------
 
-$result = get_all_item_tax_types();
 
+$result2 = $result = get_all_item_tax_types();
 start_table("$table_style width=30%");
-$th = array(_("Name"), _("Tax exempt"), "", "");
+$th = array(_("Name"), _("Tax exempt"),'','');
+
 table_header($th);
 
 $k = 0;
-while ($myrow = db_fetch($result)) 
+while ($myrow = db_fetch($result2)) 
 {
        
        alt_table_row_color($k);        
@@ -172,7 +173,7 @@ if (!isset($_POST['exempt']) || $_POST['exempt'] == 0)
     display_note(_("Select which taxes this item tax type is exempt from."), 0, 1);
     
     start_table($table_style2);
-    $th = array(_("Tax Name"), _("Is exempt"));
+    $th = array(_("Tax Name"), _("Rate"), _("Is exempt"));
     table_header($th);
        
     $tax_types = get_all_tax_types_simple();           
@@ -183,6 +184,7 @@ if (!isset($_POST['exempt']) || $_POST['exempt'] == 0)
        alt_table_row_color($k);        
     
        label_cell($myrow["name"]);
+       percent_cell($myrow["rate"]);
        check_cells("", 'ExemptTax' . $myrow["id"], null);
        end_row();
     }