<?php
-
+/**********************************************************************
+ Copyright (C) FrontAccounting, LLC.
+ Released under the terms of the GNU Affero General Public License,
+ AGPL, as published by the Free Software Foundation, either version
+ 3 of the License, or (at your option) any later version.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License here <http://www.gnu.org/licenses/agpl-3.0.html>.
+***********************************************************************/
/* Definition of the cart class
this class can hold all the information for:
var $trans_type; // invoice, order, delivery note ...
var $trans_no = array();// array (num1=>ver1,..) or 0 for new
var $so_type = 0; // for sales order: simple=0 template=1
-
+ var $cart_id; // used to detect multi-tab edition conflits
var $line_items; //array of objects of class line_details
var $src_docs = array(); // array of arrays(num1=>ver1,...) or 0 for no src
$this->dimension_id = 0;
$this->dimension2_id = 0;
$this->read($type, $trans_no, $view );
+ $this->cart_id = uniqid('');
}
//-------------------------------------------------------------------------
if ($this->cash) {
$this->Location = $pos['pos_location'];
$this->location_name = $pos['location_name'];
- $this->cash_account = $pos['account_code'];
+ $this->cash_account = $pos['pos_account'];
$this->account_name = $pos['bank_account_name'];
}
} else
return 0;
}
- function update_cart_item($line_no, $qty, $price, $disc)
+ function update_cart_item($line_no, $qty, $price, $disc, $description="")
{
+ if ($description != "")
+ $this->line_items[$line_no]->item_description = $description;
$this->line_items[$line_no]->quantity = $qty;
$this->line_items[$line_no]->qty_dispatched = $qty;
$this->line_items[$line_no]->price = $price;