Changed so Invoice Template gets the current day instead of original day.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Sun, 15 Jun 2008 11:47:28 +0000 (11:47 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Sun, 15 Jun 2008 11:47:28 +0000 (11:47 +0000)
CHANGELOG.txt
sales/sales_order_entry.php

index 97b43e0b08da645276c2e61c2c8d1503763f7a69..1faac9080957c4e3e257ddce5ee6a9df62a50f0c 100644 (file)
@@ -19,6 +19,10 @@ Legend:
 ! -> Note
 $ -> Affected files
 
+15-Jun-2008 Joe Hunt
+# Changed so Invoice Template gets the current day instead of original day.
+$ /sales/sales_order_entry.php
+
 15-Jun-2008 Joe Hunt
 # Bug in tax_types_list (spec_id)
 $ /includes/ui/ui_lists.inc
index 6c82c0987c389aced16347fccdaea9733a6129d9..9aa99e2045ff3b2011d73b9e5f2470dce6e85f00 100644 (file)
@@ -187,7 +187,7 @@ function copy_from_cart()
 
 function line_start_focus() {
   global       $Ajax;
-  
+
   $Ajax->activate('items_table');
   $Ajax->addFocus(true, '_stock_id_edit');
   set_focus('_stock_id_edit');
@@ -301,7 +301,7 @@ function handle_update_item()
 {
        if ($_POST['UpdateItem'] != '' && check_item_data()) {
                $_SESSION['Items']->update_cart_item($_POST['LineNo'],
-                input_num('qty'), input_num('price'), 
+                input_num('qty'), input_num('price'),
                 input_num('Disc') / 100 );
        }
   copy_from_cart();
@@ -324,7 +324,7 @@ function handle_delete_item($line_no)
 
 function handle_new_item()
 {
-  
+
        if (!check_item_data()) {
                        return;
        }
@@ -382,17 +382,18 @@ function create_cart($type, $trans_no)
                $doc = new Cart(30, array($trans_no));
                $doc->trans_type = $type;
                $doc->trans_no = 0;
+               $doc->document_date = Today(); // 2006-06-15. Added so Invoices and Deliveries get current day
                if ($type == 10)
                        $doc->due_date = get_invoice_duedate($doc->customer_id, $doc->document_date);
                else
-                       $doc->due_date = $doc->document_date = Today();
+                       $doc->due_date = $doc->document_date;
                $doc->reference = references::get_next($doc->trans_type);
                $doc->Comments='';
                foreach($doc->line_items as $line_no => $line) {
                        $doc->line_items[$line_no]->qty_done = 0;
                }
                $_SESSION['Items'] = $doc;
-       } else 
+       } else
                $_SESSION['Items'] = new Cart($type,array($trans_no));
        copy_from_cart();
 }
@@ -467,7 +468,7 @@ if ($customer_error == "") {
                    _('Validate changes and update document'), true);
        }
 
-       submit_center_last('CancelOrder', $cancelorder, 
+       submit_center_last('CancelOrder', $cancelorder,
           _('Cancels document entry or removes sales order when editing an old document'));
 } else {
        display_error($customer_error);