X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sales%2Fallocations%2Fcustomer_allocation_main.php;h=2cbce6a0e01f76ef3bc561a89197eee341970c46;hb=fd59c60718609c1bf3240a303030167a4f1b1885;hp=20baf5cace8b7002ffda2d6527091886b8308ef3;hpb=da8311619dd73feae101d246a1957b972e00cbd2;p=fa-stable.git diff --git a/sales/allocations/customer_allocation_main.php b/sales/allocations/customer_allocation_main.php index 20baf5ca..2cbce6a0 100644 --- a/sales/allocations/customer_allocation_main.php +++ b/sales/allocations/customer_allocation_main.php @@ -12,6 +12,13 @@ if ($use_popup_windows) page(_("Customer Allocations"), false, false, "", $js); //-------------------------------------------------------------------------------- +if ($ret = context_restore()) { + if(isset($ret['customer_id'])) + $_POST['customer_id'] = $ret['customer_id']; +} +if (isset($_POST['_customer_id_editor'])) { + context_call($path_to_root.'/sales/manage/customers.php?debtor_no='.$_POST['customer_id'] ); +} function display_allocatable_transactions() { @@ -24,7 +31,7 @@ function display_allocatable_transactions() { unset($_SESSION['alloc']->allocs); unset($_SESSION['alloc']); - } + } if (!isset($_POST['customer_id'])) $_POST['customer_id'] = get_global_customer(); @@ -36,7 +43,7 @@ function display_allocatable_transactions() set_global_customer($_POST['customer_id']); - if (isset($_POST['customer_id']) && ($_POST['customer_id'] == reserved_words::get_all())) + if (isset($_POST['customer_id']) && ($_POST['customer_id'] == reserved_words::get_all())) { unset($_POST['customer_id']); } @@ -56,12 +63,12 @@ function display_allocatable_transactions() $customer_id = $_POST['customer_id']; $trans_items = get_allocatable_from_cust_transactions($customer_id, $settled); - + div_start('alloc_tbl'); start_table($table_style); if (!isset($_POST['customer_id'])) $th = array(_("Transaction Type"), _("#"), _("Reference"), _("Date"), _("Customer"), _("Currency"), _("Total"), _("Left To Allocate"), ""); - else + else $th = array(_("Transaction Type"), _("#"), _("Reference"), _("Date"), _("Total"), _("Left To Allocate"), ""); table_header($th); @@ -70,12 +77,12 @@ function display_allocatable_transactions() while ($myrow = db_fetch($trans_items)) { - if ($myrow["settled"] == 1) + if ($myrow["settled"] == 1) { start_row("class='settledbg'"); $has_settled_items = true; - } - else + } + else { alt_table_row_color($k); } @@ -90,12 +97,10 @@ function display_allocatable_transactions() label_cell($myrow["DebtorName"]); label_cell($myrow["curr_code"]); } - amount_cell(-$myrow["Total"]); - amount_cell(-$myrow["Total"] - $myrow["alloc"]); - if (-$myrow["Total"] - $myrow["alloc"] != 0.0) - label_cell("" . _("Allocate") . ""); - else - label_cell(""); + amount_cell($myrow["Total"]); + amount_cell($myrow["Total"] - $myrow["alloc"]); + label_cell("" . _("Allocate") . ""); end_row(); } @@ -106,12 +111,14 @@ function display_allocatable_transactions() if (db_num_rows($trans_items) == 0) display_note(_("There are no allocations to be done."), 1, 2); - + div_end(); end_form(); } //-------------------------------------------------------------------------------- - +if (get_post('_ShowSettled_update')) { + $Ajax->activate('alloc_tbl'); +} display_allocatable_transactions(); //--------------------------------------------------------------------------------