Fixed page update after customer/branch change.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Mon, 10 Nov 2008 22:31:21 +0000 (22:31 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Mon, 10 Nov 2008 22:31:21 +0000 (22:31 +0000)
CHANGELOG.txt
sales/includes/ui/sales_order_ui.inc

index 267c770654b4239c8000a0f2909a022335a1d343..0a162c8649ddac45cd4663d0acba216e7a51208c 100644 (file)
@@ -28,8 +28,8 @@ $ /admin/db/maintenance_db.inc
 $ /gl/manage/bank_accounts.php
 # Fixed for MySQL <4.0.18, removed bank_trans_types
 $ /sql/alter2.1.sql
-# Fixed hangups on ajax update of nonexistent element.
-$ /js/utils.js
+# Fixed page update after branch/customer change.
+$ /sales/includes/ui/sales_order_ui.inc
 
 10-Nov-2008 Joe Hunt
 ! changing the default.css style sheets to handle the new navibar/buttons
index ae2bd96471b46aa8bf830d7d441d5f667f80da56..49cc8b736f99d30aae61f4525991c82a75789897 100644 (file)
@@ -211,17 +211,21 @@ function display_order_header(&$order, $editable, $date_text, $display_tax_group
                                $_POST['deliver_to'] = $order->deliver_to;
                                $_POST['delivery_address'] = $order->delivery_address;
                                $_POST['phone'] = $order->phone;
-                               $_POST['cash'] = $order->cash;
-                               if ($order->trans_type == 10)
-                               {
-                                       $_POST['delivery_date'] = $order->due_date;
-                                       $Ajax->activate('delivery_date');
+                               if (get_post('cash') !== $order->cash) {
+                                       $_POST['cash'] = $order->cash;
+                                       $Ajax->activate('delivery');
+                                       $Ajax->activate('cash');
+                               } else {
+                                       if ($order->trans_type == 10)
+                                       {
+                                               $_POST['delivery_date'] = $order->due_date;
+                                               $Ajax->activate('delivery_date');
+                                       }
+                                       $Ajax->activate('Location');
+                                       $Ajax->activate('deliver_to');
+                                       $Ajax->activate('phone');
+                                       $Ajax->activate('delivery_address');
                                }
-                               $Ajax->activate('Location');
-                               $Ajax->activate('deliver_to');
-                               $Ajax->activate('phone');
-                               $Ajax->activate('delivery_address');
-                               $Ajax->activate('cash');
                                // change prices if necessary
                                // what about discount in template case?
                                if ($old_order->customer_currency != $order->customer_currency) {