X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=purchasing%2Fallocations%2Fsupplier_allocate.php;h=428bfdc6e4ce7ec78b4a6fb762f6e7cd574b8f53;hb=0f465ad5e73c6683a5102bde63821a6f6a1c3f3a;hp=1e9e418d9be76f985af37bf2904422f21f7c6569;hpb=21e89f70ea48388bf055dfc40831296f841dc158;p=fa-stable.git diff --git a/purchasing/allocations/supplier_allocate.php b/purchasing/allocations/supplier_allocate.php index 1e9e418d..428bfdc6 100644 --- a/purchasing/allocations/supplier_allocate.php +++ b/purchasing/allocations/supplier_allocate.php @@ -21,12 +21,12 @@ include_once($path_to_root . "/sales/includes/sales_db.inc"); //include_once($path_to_root . "/purchasing/includes/ui/supp_alloc_ui.inc"); $js = ""; -if ($use_popup_windows) +if ($SysPrefs->use_popup_windows) $js .= get_js_open_window(900, 500); add_js_file('allocate.js'); -page(_("Allocate Supplier Payment or Credit Note"), false, false, "", $js); +page(_($help_context = "Allocate Supplier Payment or Credit Note"), false, false, "", $js); //-------------------------------------------------------------------------------- @@ -37,7 +37,7 @@ function clear_allocations() unset($_SESSION['alloc']->allocs); unset($_SESSION['alloc']); } - session_register("alloc"); + //session_register("alloc"); } //-------------------------------------------------------------------------------- @@ -47,17 +47,27 @@ function edit_allocations_for_transaction($type, $trans_no) start_form(); - display_heading(_("Allocation of") . " " . $systypes_array[$_SESSION['alloc']->type] . " # " . $_SESSION['alloc']->trans_no); + $cart = $_SESSION['alloc']; - display_heading($_SESSION['alloc']->person_name); + display_heading(_("Allocation of") . " " . $systypes_array[$cart->type] . " # " . $cart->trans_no); - display_heading2(_("Date:") . " " . $_SESSION['alloc']->date_ . ""); - display_heading2(_("Total:") . " " . price_format(-$_SESSION['alloc']->amount) . ""); + display_heading($cart->person_name); + display_heading2(_("Date:") . " " . $cart->date_ . ""); + + display_heading2(_("Total:"). " " . price_format(-$cart->bank_amount).' '.$cart->currency.""); + + if (floatcmp($cart->bank_amount, $cart->amount)) + { + $total = _("Amount to be settled:") . " " . price_format(-$cart->amount).' '.$cart->person_curr.""; + if ($cart->currency != $cart->person_curr) + $total .= sprintf(" (%s %s/%s)", exrate_format($cart->bank_amount/$cart->amount), $cart->currency, $cart->person_curr); + display_heading2($total); + } echo "
"; div_start('alloc_tbl'); - if (count($_SESSION['alloc']->allocs) > 0) + if (count($cart->allocs) > 0) { show_allocatable(true); @@ -100,7 +110,7 @@ if (isset($_POST['Cancel'])) if (isset($_GET['trans_no']) && isset($_GET['trans_type'])) { - $_SESSION['alloc'] = new allocation($_GET['trans_type'], $_GET['trans_no']); + $_SESSION['alloc'] = new allocation($_GET['trans_type'], $_GET['trans_no'], @$_GET['supplier_id'], PT_SUPPLIER); } if (get_post('UpdateDisplay')) @@ -118,4 +128,3 @@ if (isset($_SESSION['alloc'])) end_page(); -?> \ No newline at end of file