From: Janusz Dobrowolski Date: Fri, 7 Mar 2008 21:00:14 +0000 (+0000) Subject: Changed name tax type uniqueness constraint to (name, rate) X-Git-Tag: v2.4.2~19^2~2214 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=6aa1c92689c443607b28bf36cd3d4fa22c0ba491;p=fa-stable.git Changed name tax type uniqueness constraint to (name, rate) --- diff --git a/includes/ui/ui_lists.inc b/includes/ui/ui_lists.inc index 687c035e..e2c79201 100644 --- a/includes/ui/ui_lists.inc +++ b/includes/ui/ui_lists.inc @@ -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); } diff --git a/taxes/item_tax_types.php b/taxes/item_tax_types.php index f274556d..55175b70 100644 --- a/taxes/item_tax_types.php +++ b/taxes/item_tax_types.php @@ -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(); }