Transaction references extended with parametrized patterns, added check_reference...
[fa-stable.git] / sales / includes / cart_class.inc
index dbfd51061b186a34ff5eb05779166f18f2263237..3bfb9526f1e6c0fddb33a4c2dc4577bde022fdca 100644 (file)
@@ -135,7 +135,8 @@ class cart
                        $type = get_child_type($this->trans_type);
 
                $this->trans_type = $type;
-               $this->reference = $Refs->get_next($this->trans_type);
+               $this->reference = $Refs->get_next($this->trans_type, null, array('date' => $this->document_date,
+                       'customer' => $this->customer_id, 'branch' => $this->Branch));
                if ($type == ST_CUSTCREDIT)
                    $this->src_date = $this->document_date;
 
@@ -244,7 +245,8 @@ class cart
                                $this->document_date = new_doc_date();
                                if (!is_date_in_fiscalyear($this->document_date))
                                        $this->document_date = end_fiscalyear();
-                               $this->reference = $Refs->get_next($this->trans_type);
+                               $this->reference = $Refs->get_next($this->trans_type, null, array('date' => Today(),
+                                       'customer' => $this->customer_id));
                                if ($type != ST_SALESORDER && $type != ST_SALESQUOTE) // Added 2.1 Joe Hunt 2008-11-12
                                {
                                        $dim = get_company_pref('use_dimension');