Added dimension entries in delivery and invoice forms
[fa-stable.git] / sales / allocations / customer_allocation_main.php
index 8d85e42317e8713d9aef77f8c3e93012d9de1548..2cbce6a0e01f76ef3bc561a89197eee341970c46 100644 (file)
@@ -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()
 {
@@ -56,7 +63,7 @@ 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"),
@@ -92,11 +99,8 @@ function display_allocatable_transactions()
                }
                amount_cell($myrow["Total"]);
        amount_cell($myrow["Total"] - $myrow["alloc"]);
-       if ($myrow["Total"] - $myrow["alloc"] != 0.0)
-               label_cell("<a href='$path_to_root/sales/allocations/customer_allocate.php?trans_no="
+               label_cell("<a href='$path_to_root/sales/allocations/customer_allocate.php?trans_no="
                                        .$myrow["trans_no"] . "&trans_type=" . $myrow["type"]  . "'>" . _("Allocate") . "</a>");
-       else
-               label_cell("");
        end_row();
        }
 
@@ -107,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();
 
 //--------------------------------------------------------------------------------