X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=taxes%2Ftax_groups.php;h=cac3520b090dc3dff03c2f87afcb0c019597faa7;hb=5c17df61be0c76370e2438f932acca23cd4efa31;hp=bf888159043376a45cfdcb14c72bec0f5d09707f;hpb=46c5f7a65a7659a44ae8254c63152074363d3987;p=fa-stable.git diff --git a/taxes/tax_groups.php b/taxes/tax_groups.php index bf888159..cac3520b 100644 --- a/taxes/tax_groups.php +++ b/taxes/tax_groups.php @@ -40,24 +40,7 @@ if ($Mode=='ADD_ITEM' || $Mode=='UPDATE_ITEM') display_error(_("The tax group name cannot be empty.")); set_focus('name'); } - /* Editable rate has been removed 090920 Joe Hunt - else - { - // make sure any entered rates are valid - for ($i = 0; $i < 5; $i++) - { - if (isset($_POST['tax_type_id' . $i]) && - $_POST['tax_type_id' . $i] != ALL_NUMERIC && - !check_num('rate' . $i, 0)) - { - display_error( _("An entered tax rate is invalid or less than zero.")); - $input_error = 1; - set_focus('rate'); - break; - } - } - } - */ + if ($input_error != 1) { @@ -65,18 +48,12 @@ if ($Mode=='ADD_ITEM' || $Mode=='UPDATE_ITEM') $taxes = array(); $rates = array(); - for ($i = 0; $i < 5; $i++) - { - if (isset($_POST['tax_type_id' . $i]) && - $_POST['tax_type_id' . $i] != ANY_NUMERIC) - { - $taxes[] = $_POST['tax_type_id' . $i]; - $rates[] = get_tax_type_default_rate($_POST['tax_type_id' . $i]); - //Editable rate has been removed 090920 Joe Hunt - //$rates[] = input_num('rate' . $i); - } - } - + while (($id = find_submit('tax_type_id'))!=-1) + { + $taxes[] = $id; + $rates[] = get_tax_type_default_rate($id); + unset($_POST['tax_type_id' . $id]); + } if ($selected_id != -1) { update_tax_group($selected_id, $_POST['name'], $_POST['tax_shipping'], $taxes, @@ -134,7 +111,8 @@ if ($Mode == 'RESET') $selected_id = -1; $sav = get_post('show_inactive'); unset($_POST); - $_POST['show_inactive'] = $sav; + if($sav) + $_POST['show_inactive'] = $sav; } //----------------------------------------------------------------------------------- @@ -160,10 +138,6 @@ while ($myrow = db_fetch($result)) else label_cell(_("No")); - /*for ($i=0; $i< 5; $i++) - if ($myrow["type" . $i] != ALL_NUMERIC) - echo "