changed so the due date is automatic updated when changing customer in direct invoice.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Thu, 19 Jun 2008 14:06:34 +0000 (14:06 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Thu, 19 Jun 2008 14:06:34 +0000 (14:06 +0000)
CHANGELOG.txt
sales/includes/ui/sales_order_ui.inc

index bd3e45fc5732dddeb031e428abedfa1a1a45d38e..d2962f2f991448b8a8be5ed5f3ab3f4e05dd1a7b 100644 (file)
@@ -19,6 +19,10 @@ Legend:
 ! -> Note
 $ -> Affected files
 
+19-Jun-2008 Joe Hunt
+! changed so the due date is updated when changing customer in direct invoice.
+$ /sales/includes/ui/sales_order_ui.inc
+
 19-Jun-2008 Joe Hunt
 # Minor layout bug at Credit Shipping Costs in customer_credit_invoice.php
 $ /sales/customer_credit_invoice.php
index f836a020875cde6338b5b6abe9e8b93ea2f9df2f..3b0489e352e8000db7a3b8a48be480d78602c117 100644 (file)
@@ -62,6 +62,8 @@ function get_customer_details_to_order(&$order, $customer_id, $branch_id)
                $order->set_location($myrow["default_location"], $myrow["location_name"]);
                $order->set_delivery($myrow["default_ship_via"], $myrow["br_name"],
                $address);
+               if ($order->trans_type == 10)
+                       $order->due_date = get_invoice_duedate($customer_id, $order->document_date);
        }
 
        return $ret_error;
@@ -203,6 +205,11 @@ 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;
+                               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');