X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=purchasing%2Fincludes%2Fui%2Finvoice_ui.inc;h=b3957fd8cf66bf3f46e6ee780b9ddecdee41d1bb;hb=7fccb1e0c3c04305a4b1c220e29a41c7d2aac5ba;hp=c5eafa8039f8188b66015f546cf63526d42cd42c;hpb=ddadb47f2620ce6902ad4694ce6512568862ba05;p=fa-stable.git diff --git a/purchasing/includes/ui/invoice_ui.inc b/purchasing/includes/ui/invoice_ui.inc index c5eafa80..b3957fd8 100644 --- a/purchasing/includes/ui/invoice_ui.inc +++ b/purchasing/includes/ui/invoice_ui.inc @@ -55,13 +55,13 @@ function copy_to_trans(&$supp_trans) function invoice_header(&$supp_trans) { - global $Ajax, $table_style, $Refs; + global $Ajax, $Refs; // if vars have been lost, recopy if (!isset($_POST['tran_date'])) copy_from_trans($supp_trans); - start_outer_table("$table_style width=98%", 5); + start_outer_table(TABLESTYLE2, "width=95%"); table_section(1); @@ -118,6 +118,8 @@ function invoice_header(&$supp_trans) table_section(3, "33%"); + set_global_supplier($_POST['supplier_id']); + $supplier_currency = get_supplier_currency($supp_trans->supplier_id); $company_currency = get_company_currency(); @@ -137,26 +139,26 @@ function invoice_header(&$supp_trans) function invoice_totals(&$supp_trans) { - global $table_style, $table_style2; - copy_to_trans($supp_trans); - start_table("$table_style width=95%"); - label_row(_("Sub-total:"), price_format( $supp_trans->ov_amount), "align=right", "align=right"); + $dim = get_company_pref('use_dimension'); + $colspan = ($dim == 2 ? 7 : ($dim == 1 ? 6 : 5)); + start_table(TABLESTYLE, "width=95%"); + label_row(_("Sub-total:"), price_format( $supp_trans->ov_amount), "colspan=$colspan align=right", "align=right"); $taxes = $supp_trans->get_taxes($supp_trans->tax_group_id); - $tax_total = display_edit_tax_items($taxes, 1, 0); // tax_included==0 (we are the company) + $tax_total = display_edit_tax_items($taxes, $colspan, 0); // tax_included==0 (we are the company) $display_total = price_format($supp_trans->ov_amount + $tax_total); if ($supp_trans->is_invoice) - label_row(_("Invoice Total:"), $display_total, "align=right style='font-weight:bold;'", "align=right style='font-weight:bold;'"); + label_row(_("Invoice Total:"), $display_total, "colspan=$colspan align=right style='font-weight:bold;'", "align=right style='font-weight:bold;'"); else label_row(_("Credit Note Total"), - $display_total, "align=right style='font-weight:bold;color:red;'", "nowrap align=right style='font-weight:bold;color:red;'"); + $display_total, "colspan=$colspan align=right style='font-weight:bold;color:red;'", "nowrap align=right style='font-weight:bold;color:red;'"); end_table(1); - start_table($table_style2); + start_table(TABLESTYLE2); textarea_row(_("Memo:"), "Comments", null, 50, 3); end_table(1); } @@ -164,13 +166,11 @@ function invoice_totals(&$supp_trans) //-------------------------------------------------------------------------------------------------- function display_gl_controls(&$supp_trans, $k) { - global $table_style; - $accs = get_supplier_accounts($supp_trans->supplier_id); $_POST['gl_code'] = $accs['purchase_account']; alt_table_row_color($k); - gl_all_accounts_list('gl_code', null, true, true); + echo gl_all_accounts_list('gl_code', null, true, true); $dim = get_company_pref('use_dimension'); if ($dim >= 1) dimensions_list_cells(null, 'dimension_id', null, true, " ", false, 1); @@ -197,20 +197,18 @@ function display_gl_controls(&$supp_trans, $k) function display_gl_items(&$supp_trans, $mode=0) { - global $table_style, $path_to_root, $Ajax; + global $path_to_root, $Ajax; // if displaying in form, and no items, exit if (($mode == 2 || $mode == 3) && count($supp_trans->gl_codes) == 0) return 0; - start_outer_table("width=95%"); - if ($supp_trans->is_invoice) $heading = _("GL Items for this Invoice"); else $heading = _("GL Items for this Credit Note"); - start_outer_table("width=100%"); + start_outer_table(TABLESTYLE, "width=95%"); if ($mode == 1) { @@ -219,7 +217,7 @@ function display_gl_items(&$supp_trans, $mode=0) { echo "