A bug in Direct Invoice (wrong invoice date) has been fixed
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Fri, 3 Aug 2007 23:42:08 +0000 (23:42 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Fri, 3 Aug 2007 23:42:08 +0000 (23:42 +0000)
sales/includes/db/sales_order_db.inc

index c6408bd9688cf19fa73aee2b6cd0e6e754f9622b..7254a9667ad26295e25fd4294416a432d2eee2c5 100644 (file)
@@ -6,7 +6,10 @@ function add_sales_order($order)
 {
        begin_transaction();
 
-       $del_date = date2sql($order->delivery_date);
+       if ($order->direct_invoice)
+               $del_date = date2sql($order->orig_order_date);
+       else    
+               $del_date = date2sql($order->delivery_date);
 
        $sql = "INSERT INTO ".TB_PREF."sales_orders (debtor_no, branch_code, customer_ref, Comments, ord_date, 
                order_type, ship_via, deliver_to, delivery_address, contact_phone,