X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fui%2Fui_view.inc;h=1d4f1fc1788ac6b6416e42b2ef72a2f40cb31b8c;hb=2e181b13aa722a43e78b897404912d6b13a0a937;hp=0de82dfed682fa1788392f0372626c8b31e4fb65;hpb=33ba3d43d75c04080dd0d49067bafd2188fd04b1;p=fa-stable.git diff --git a/includes/ui/ui_view.inc b/includes/ui/ui_view.inc index 0de82dfe..1d4f1fc1 100644 --- a/includes/ui/ui_view.inc +++ b/includes/ui/ui_view.inc @@ -1,13 +1,13 @@ . + See the License here . ***********************************************************************/ include_once($path_to_root . "/admin/db/voiding_db.inc"); include_once($path_to_root . "/includes/types.inc"); @@ -444,7 +444,7 @@ function display_supp_trans_tax_details($tax_items, $columns) $tax = number_format2(abs($tax_item['amount']),user_price_dec()); if ($tax_item['included_in_price']) label_row(_("Included") . " " . $tax_item['tax_type_name'] . " (" . $tax_item['rate'] . "%) " . - _("Amount:") . ": $tax", "colspan=$columns align=right", "align=right"); + _("Amount") . ": $tax", "colspan=$columns align=right", "align=right"); else label_row($tax_item['tax_type_name'] . " (" . $tax_item['rate'] . "%)", $tax, "colspan=$columns align=right", "align=right"); @@ -468,7 +468,7 @@ function display_edit_tax_items($taxes, $columns, $tax_included, $leftspan=0) { label_row($taxitem['tax_type_name'] . " (" . $taxitem['rate'] . "%)", number_format2($taxitem['Value'],user_price_dec()), "colspan=$columns align=right", "align=right",$leftspan); - $total += $taxitem['Value']; + $total += round2($taxitem['Value'], user_price_dec()); } } @@ -510,6 +510,8 @@ function display_allocations($alloc_result, $total) label_cell(systypes::name($alloc_row['type'])); label_cell(get_trans_view_str($alloc_row['type'],$alloc_row['trans_no'])); label_cell(sql2date($alloc_row['tran_date'])); + $alloc_row['Total'] = round2($alloc_row['Total'], user_price_dec()); + $alloc_row['amt'] = round2($alloc_row['amt'], user_price_dec()); amount_cell($alloc_row['Total']); //amount_cell($alloc_row['Total'] - $alloc_row['PrevAllocs'] - $alloc_row['amt']); amount_cell($alloc_row['Total'] - $alloc_row['amt']); @@ -524,6 +526,7 @@ function display_allocations($alloc_result, $total) end_row(); start_row(); label_cell(_("Left to Allocate:"), "align=right colspan=5"); + $total = round2($total, user_price_dec()); amount_cell($total - $total_allocated); end_row(); @@ -576,12 +579,15 @@ function display_quick_entries(&$cart, $id, $base, $type, $descr='') case "=": // post current base amount to GL account $part = $base; break; - case "-": // post amount to GL account and reduce base - $part = $qe_line['amount']; $base -= $part; + case "a": // post amount to GL account and reduce base + $part = $qe_line['amount']; break; - case "+": // post amount to GL account and increase base + case "a+": // post amount to GL account and increase base $part = $qe_line['amount']; $base += $part; break; + case "a-": // post amount to GL account and reduce base + $part = $qe_line['amount']; $base -= $part; + break; case "%": // store acc*amount% to GL account $part = round2($base * $qe_line['amount'] / 100, user_price_dec()); break; @@ -600,19 +606,20 @@ function display_quick_entries(&$cart, $id, $base, $type, $descr='') $tax_total = 0; foreach ($taxes as $index => $item_tax) { if(substr($qe_line['action'],0,1) != 'T') - $tax = round($base * $item_tax['rate'] + $tax = round2($base * $item_tax['rate'] / ($item_tax['rate'] + 100), user_price_dec()); else - $tax = round($base * $item_tax['rate'] / 100, user_price_dec()); + $tax = round2($base * $item_tax['rate'] / 100, user_price_dec()); - $gl_code = $type != QE_DEPOSIT - ? $item_tax['purchasing_gl_code'] : $item_tax['sales_gl_code']; + $gl_code = ($type == QE_DEPOSIT || ($type == QE_JOURNAL && $base < 0)) + ? $item_tax['sales_gl_code'] : $item_tax['purchasing_gl_code']; $tax_total += $tax; if ($type != QE_SUPPINV) $cart->add_gl_item($gl_code, $qe_line['dimension_id'], $qe_line['dimension2_id'], $tax, $qe['description']); - else { + else + { $acc_name = get_gl_account_name($gl_code); $cart->add_gl_codes_to_trans($gl_code, $acc_name, $qe_line['dimension_id'], @@ -628,11 +635,12 @@ function display_quick_entries(&$cart, $id, $base, $type, $descr='') if ($type != QE_SUPPINV) $cart->add_gl_item($qe_line['dest_id'], $qe_line['dimension_id'], $qe_line['dimension2_id'], $part, $qe['description']); - else { - $acc_name = get_gl_account_name($qe_line['dest_id']); - $cart->add_gl_codes_to_trans($qe_line['dest_id'], - $acc_name, $qe_line['dimension_id'], - $qe_line['dimension2_id'], $part, $qe['description']); + else + { + $acc_name = get_gl_account_name($qe_line['dest_id']); + $cart->add_gl_codes_to_trans($qe_line['dest_id'], + $acc_name, $qe_line['dimension_id'], + $qe_line['dimension2_id'], $part, $qe['description']); } } } @@ -705,30 +713,6 @@ function get_js_date_picker() global $comp_path, $go_debug; $fpath = $comp_path.'/'.user_company().'/js_cache/'.'date_picker.js'; - $js = " -"; - add_js_source($js); - if (!file_exists($fpath) || $go_debug) { global $dateseps, $date_system;