X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=purchasing%2Fincludes%2Fui%2Finvoice_ui.inc;h=d16e8d1392b684402fe0a80d79da9d36bc99c36d;hb=bd8f517d30d1edd3261e26e582ddd9e11c555616;hp=298fcb828f33d9fb665673fad6b7d7f481b0af4f;hpb=90b3d069d96b99671af51726e2953352738abb75;p=fa-stable.git diff --git a/purchasing/includes/ui/invoice_ui.inc b/purchasing/includes/ui/invoice_ui.inc index 298fcb82..d16e8d13 100644 --- a/purchasing/includes/ui/invoice_ui.inc +++ b/purchasing/includes/ui/invoice_ui.inc @@ -20,6 +20,11 @@ function copy_from_trans(&$supp_trans) $_POST['reference'] = $supp_trans->reference; $_POST['supplier_id'] = $supp_trans->supplier_id; $_POST['tax_algorithm'] = $supp_trans->tax_algorithm; + + $_POST['_ex_rate'] = $supp_trans->ex_rate; + if (isset($supp_trans->tax_overrides)) + foreach($supp_trans->tax_overrides as $id => $value) + $_POST['mantax'][$id] = price_format($value); } //-------------------------------------------------------------------------------------------------- @@ -34,7 +39,17 @@ function copy_to_trans(&$supp_trans) if (isset($_POST['tax_algorithm'])) $supp_trans->tax_algorithm = $_POST['tax_algorithm']; - $supp_trans->ov_amount = 0; /* for starters */ + $supp_trans->ex_rate = input_num('_ex_rate', null); + + $supp_trans->ov_amount = $supp_trans->ov_discount = 0; /* for starters */ + if (isset($_POST['mantax'])) { + foreach($_POST['mantax'] as $id => $tax) { + $supp_trans->tax_overrides[$id] = user_numeric($_POST['mantax'][$id]); + } + } + else + unset($supp_trans->tax_overrides); + if (count($supp_trans->grn_items) > 0) { foreach ( $supp_trans->grn_items as $grn) @@ -135,7 +150,7 @@ function invoice_header(&$supp_trans) if ($supplier_currency != $company_currency) { label_row(_("Supplier's Currency:"), "" . $supplier_currency . ""); - exchange_rate_display($supplier_currency, $company_currency, $_POST['tran_date']); + exchange_rate_display($company_currency, $supplier_currency, $_POST['tran_date']); } label_row(_("Tax Group:"), $supp_trans->tax_description); @@ -159,7 +174,7 @@ function invoice_totals(&$supp_trans) 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, $colspan, $supp_trans->tax_included); + $tax_total = display_edit_tax_items($taxes, $colspan, $supp_trans->tax_included, 0, true); $display_total = price_format($supp_trans->ov_amount + $tax_total); @@ -468,7 +483,8 @@ function display_grn_items(&$supp_trans, $mode=0) if ($supp_trans->trans_type == ST_SUPPCREDIT) { echo ""; - date_cells(_("Received between"), 'receive_begin', "", null, -30, 0, 0, "valign=middle"); + date_cells(_("Received between"), 'receive_begin', "", null, + -user_transaction_days(), 0, 0, "valign=middle"); date_cells(_("and"), 'receive_end', '', null, 1, 0, 0, "valign=middle"); submit_cells('RefreshInquiry', _("Search"),'',_('Refresh Inquiry'), true); echo ""; @@ -606,4 +622,3 @@ function get_duedate_from_terms(&$trans) //-------------------------------------------------------------------------------------------------- -?> \ No newline at end of file