Crediting an invoice in transactions shows wrong invoice date.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Thu, 7 Mar 2013 21:51:57 +0000 (22:51 +0100)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Thu, 7 Mar 2013 21:51:57 +0000 (22:51 +0100)
sales/includes/cart_class.inc

index 6a014d5aba85425fbc9f5df77e3ef5b0461a165e..4b01809feba94a838edcec70a395ef0c93241c61 100644 (file)
@@ -104,6 +104,9 @@ class cart
 
                $this->trans_type = $type;
                $this->reference = $Refs->get_next($this->trans_type);
+               if ($type == ST_CUSTCREDIT)
+                   $this->src_date = $this->document_date;
+
                $this->document_date = new_doc_date();
 
                for($line_no = 0; $line_no < count($this->line_items); $line_no++) {
@@ -124,9 +127,6 @@ class cart
                        $this->due_date = get_invoice_duedate($this->payment, $this->document_date);
                }
 
-               if ($type == ST_CUSTCREDIT)
-                   $this->src_date = $this->document_date;
-
                $this->src_docs = $this->trans_no;
                $this->trans_no = 0;
        }