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;
//-------------------------------------------------------------------------
//
// $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 */
// 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
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) {