X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=purchasing%2Fincludes%2Fui%2Finvoice_ui.inc;h=ae71ad8a649aa89789c3c65cebd5340e6ab72da3;hb=dc292b0592ea1035129904f5af26037f2e91c4d2;hp=c551697fe1c1a7ea0115cb1d2704f4a1f1409029;hpb=1944920ea7a791d476e6f67d19f70f18985a52ee;p=fa-stable.git diff --git a/purchasing/includes/ui/invoice_ui.inc b/purchasing/includes/ui/invoice_ui.inc index c551697f..ae71ad8a 100644 --- a/purchasing/includes/ui/invoice_ui.inc +++ b/purchasing/includes/ui/invoice_ui.inc @@ -45,7 +45,7 @@ function copy_to_trans(&$supp_trans) foreach ( $supp_trans->gl_codes as $gl_line) { ////////// 2009-08-18 Joe Hunt - if (!is_tax_account($gl_line->gl_code)) + if (!is_tax_account($gl_line->gl_code) || $supp_trans->tax_included) $supp_trans->ov_amount += $gl_line->amount; } } @@ -253,7 +253,7 @@ function display_gl_items(&$supp_trans, $mode=0) $th[] = ""; } table_header($th); - $total_gl_value=0; + $total_gl_value=$total = 0; $i = $k = 0; if (count($supp_trans->gl_codes) > 0) @@ -286,10 +286,13 @@ function display_gl_items(&$supp_trans, $mode=0) } end_row(); /////////// 2009-08-18 Joe Hunt - if ($mode > 1 && !is_tax_account($entered_gl_code->gl_code)) - $total_gl_value += $entered_gl_code->amount; + if ($mode > 1) { + if ($supp_trans->tax_included || !is_tax_account($entered_gl_code->gl_code)) + $total_gl_value += $entered_gl_code->amount; + } else $total_gl_value += $entered_gl_code->amount; + $total += $entered_gl_code->amount; $i++; if ($i > 15) { @@ -302,7 +305,7 @@ function display_gl_items(&$supp_trans, $mode=0) if ($mode == 1) display_gl_controls($supp_trans, $k); $colspan = ($dim == 2 ? 4 : ($dim == 1 ? 3 : 2)); - label_row(_("Total"), price_format($total_gl_value), + label_row(_("Total"), price_format($total), "colspan=".$colspan." align=right", "nowrap align=right", ($mode==1?3:1)); end_table(1);