X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=taxes%2Ftax_groups.php;h=889db60e9b7928af11fb66b7efdf8fb146fb416b;hb=5c2b576cebcb6bf59a23d4f49b7362003f8d1bf1;hp=bf888159043376a45cfdcb14c72bec0f5d09707f;hpb=46c5f7a65a7659a44ae8254c63152074363d3987;p=fa-stable.git diff --git a/taxes/tax_groups.php b/taxes/tax_groups.php index bf888159..889db60e 100644 --- a/taxes/tax_groups.php +++ b/taxes/tax_groups.php @@ -40,52 +40,31 @@ 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) { // create an array of the taxes and array of rates $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); - } - } - + $tax_shippings = array(); + + while (($id = find_submit('tax_type_id'))!=-1) + { + if (check_value('tax_type_id'.$id) != 0) + { + $taxes[] = $id; + $tax_shippings[] = check_value('tax_shipping'.$id); + } + unset($_POST['tax_type_id' . $id]); + unset($_POST['tax_shipping' . $id]); + } if ($selected_id != -1) { - update_tax_group($selected_id, $_POST['name'], $_POST['tax_shipping'], $taxes, - $rates); + update_tax_group($selected_id, $_POST['name'], $taxes, $tax_shippings); display_notification(_('Selected tax group has been updated')); } else { - add_tax_group($_POST['name'], $_POST['tax_shipping'], $taxes, $rates); + add_tax_group($_POST['name'], $taxes, $tax_shippings); display_notification(_('New tax group has been added')); } @@ -134,7 +113,8 @@ if ($Mode == 'RESET') $selected_id = -1; $sav = get_post('show_inactive'); unset($_POST); - $_POST['show_inactive'] = $sav; + if ($sav) + $_POST['show_inactive'] = $sav; } //----------------------------------------------------------------------------------- @@ -143,7 +123,7 @@ $result = get_all_tax_groups(check_value('show_inactive')); start_form(); start_table(TABLESTYLE); -$th = array(_("Description"), _("Shipping Tax"), "", ""); +$th = array(_("Description"), "", ""); inactive_control_column($th); table_header($th); @@ -155,14 +135,6 @@ while ($myrow = db_fetch($result)) alt_table_row_color($k); label_cell($myrow["name"]); - if ($myrow["tax_shipping"]) - label_cell(_("Yes")); - else - label_cell(_("No")); - - /*for ($i=0; $i< 5; $i++) - if ($myrow["type" . $i] != ALL_NUMERIC) - echo "