X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fui%2Fui_view.inc;h=00684612e5834ea968d097228d176c4e988235f0;hb=28e5f95d81850e496e1b0387126e7bb836da61c5;hp=f578f5372ca38fea59eea8c54820f0556abc1a22;hpb=e0db00493c88d889692fcc47cee33dba60bee2f5;p=fa-stable.git diff --git a/includes/ui/ui_view.inc b/includes/ui/ui_view.inc index f578f537..00684612 100644 --- a/includes/ui/ui_view.inc +++ b/includes/ui/ui_view.inc @@ -439,28 +439,50 @@ function display_supp_trans_tax_details($tax_items, $columns) //-------------------------------------------------------------------------------------- -function display_edit_tax_items($taxes, $columns, $tax_included, $leftspan=0) +function display_edit_tax_items($taxes, $columns, $tax_included, $rightspan=0, $editable=false) { $total = 0; foreach ($taxes as $taxitem) - { - if ($taxitem['Value'] != 0) { - if ($tax_included) - { - label_row(_("Included") . " " . $taxitem['tax_type_name'] - . " " . number_format2($taxitem['Value'],user_price_dec()), "", "colspan=$columns align=right", "align=right",$leftspan); - } - else - { - label_row($taxitem['tax_type_name'], - number_format2($taxitem['Value'],user_price_dec()), "colspan=$columns align=right", "align=right",$leftspan); - $total += round2($taxitem['Value'], user_price_dec()); - } - } - } - - return $total; + { + $amount = isset($taxitem['Override']) ? $taxitem['Override'] : $taxitem['Value']; + if ($taxitem['Value'] != 0){ + if ($editable) { + if (!isset($_POST['mantax['.$taxitem['tax_type_id'].']'])) + $_POST['mantax['.$taxitem['tax_type_id'].']'] = price_format($amount); + start_row(); + if ($tax_included) { + $colspan = $columns-1; + label_cell(_("Included") . " " . $taxitem['tax_type_name'].":", + "colspan={$colspan} align='right'"); + amount_cells(null, 'mantax['.$taxitem['tax_type_id'].']', + null, "colspan=$columns align=right", '', user_price_dec()); + } else { + label_cell($taxitem['tax_type_name'], "colspan=$columns align='right'"); + amount_cells(null, 'mantax['.$taxitem['tax_type_id'].']', + null, "colspan=$columns align=right", null, user_price_dec()); + $total += round2($amount, user_price_dec()); + } + if ($rightspan) + label_cell('', "colspan ='$rightspan'"); + end_row(); + } else { + $value = number_format2($taxitem['Value'],user_price_dec()); + if ($tax_included) + { + label_row(_("Included") . " " . $taxitem['tax_type_name'] + . " " . $value , "", "colspan=$columns align=right", "align=right", $rightspan); + } + else + { + label_row($taxitem['tax_type_name'], + $value, "colspan=$columns align=right", "align=right", $rightspan); + $total += round2($taxitem['Value'], user_price_dec()); + } + } + } + } + return $total; } //--------------------------------------------------------------------------------------