Stable merged into unstable again (due to failure on binary file during previous...
[fa-stable.git] / sales / includes / cart_class.inc
index cc7d15675b660a8437f6f08c7e8fbd94c0d6d58c..062d9bad732a49529f6b417d2af54dce4e625a9f 100644 (file)
@@ -64,7 +64,9 @@ class cart
        var $tax_group_array = null; // saves db queries
        var $price_factor;       // ditto for price calculations
 
-       var     $pos;                   // user assigned POS (contains cash accont number/name)
+       var     $pos;                   // user assigned POS
+       var $cash_account;
+       var $account_name;
        var $cash_discount;     // not used as of FA 2.1
        var $dimension_id;
        var $dimension2_id;
@@ -75,8 +77,8 @@ class cart
        //-------------------------------------------------------------------------
        //
        //  $trans_no==0 => open new/direct document
-       //  $trans_no!=0 && $prep_child==false => update with parent constarints for reedition
-       //  $trans_no!=0 && $prep_child==true => prepare for child doc entry
+       //  $trans_no!=0 && $no_edit==false => update with parent constarints for reedition
+       //  $trans_no!=0 && $no_edit==true => read only: for view, or later child doc entry
        //
        function Cart($type, $trans_no=0, $prep_child=false) {
                /*Constructor function initialises a new shopping cart */
@@ -241,7 +243,7 @@ class cart
        // Writing new/modified sales document to database.
        // Makes parent documents for direct delivery/invoice by recurent call.
        // $policy - 0 or 1:  writeoff/return for IV, back order/cancel for DN
-       function write($policy=0) { 
+       function write($policy=0) {
                begin_transaction(); // prevents partial database changes in case of direct delivery/invoice
                if (count($this->src_docs) == 0 && ($this->trans_type == ST_SALESINVOICE || $this->trans_type == ST_CUSTDELIVERY)) {
                        // this is direct document - first add parent
@@ -482,7 +484,7 @@ class cart
        function get_shipping_tax()
        {
 
-               $tax_items = get_shipping_tax_as_array();
+               $tax_items = get_shipping_tax_as_array($this->tax_group_id);
                $tax_rate = 0;
                if ($tax_items != null) {
                        foreach ($tax_items as $item_tax) {