Tax algorithm handling on supplier side is reverted as unpractical.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Thu, 19 Mar 2015 19:51:18 +0000 (20:51 +0100)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Wed, 25 Mar 2015 11:49:48 +0000 (12:49 +0100)
16 files changed:
purchasing/includes/db/invoice_db.inc
purchasing/includes/db/po_db.inc
purchasing/includes/db/supp_trans_db.inc
purchasing/includes/db/suppliers_db.inc
purchasing/includes/po_class.inc
purchasing/includes/purchasing_db.inc
purchasing/includes/supp_trans_class.inc
purchasing/includes/ui/invoice_ui.inc
purchasing/includes/ui/po_ui.inc
purchasing/manage/suppliers.php
purchasing/po_entry_items.php
purchasing/supplier_invoice.php
reporting/rep209.php
sql/alter2.4.sql
sql/en_US-demo.sql
sql/en_US-new.sql

index 1cfd451892b2d4d39294de1674ca13c54e72051d..94748d514958aca17fc820bcf9885a140cd64fa3 100644 (file)
@@ -17,7 +17,7 @@ include_once($path_to_root . "/admin/db/attachments_db.inc");
 function read_supplier_details_to_trans(&$supp_trans, $supplier_id)
 {
        $sql = "SELECT supp.supp_name, terms.terms, terms.days_before_due,
-               terms.day_in_following_month, supp.tax_included, supp.tax_algorithm,
+               terms.day_in_following_month, supp.tax_included,
                supp.tax_group_id, tax_group.name AS tax_group_name,
                supp.credit_limit - Sum(IFNULL(IF(trans.type=".ST_SUPPCREDIT.", -1, 1) 
                        * (ov_amount + ov_gst + ov_discount),0)) as cur_credit
@@ -45,7 +45,6 @@ function read_supplier_details_to_trans(&$supp_trans, $supplier_id)
 
     $supp_trans->supplier_id = $supplier_id;
     $supp_trans->tax_included = $myrow['tax_included'];
-    $supp_trans->tax_algorithm = $supp_trans->stored_algorithm = $myrow['tax_algorithm'];
     $supp_trans->supplier_name = $myrow['supp_name'];
        $supp_trans->terms = array( 
                'description' => $myrow['terms'],
@@ -173,8 +172,7 @@ function add_supp_invoice(&$supp_trans) // do not receive as ref because we chan
     /*First insert the invoice into the supp_trans table*/
        $invoice_id = write_supp_trans($trans_type, 0, $supp_trans->supplier_id, $date_, $supp_trans->due_date,
                $supp_trans->reference, $supp_trans->supp_reference,
-               $invoice_items_total, $item_added_tax, $supp_trans->ov_discount, "", 0, $supp_trans->tax_included,
-               $supp_trans->tax_algorithm);
+               $invoice_items_total, $item_added_tax, $supp_trans->ov_discount, "", 0, $supp_trans->tax_included);
 
        if ($trans_no)
                move_trans_attachments($trans_type, $trans_no, $invoice_id);
@@ -471,7 +469,6 @@ function read_supp_invoice($trans_no, $trans_type, &$supp_trans)
                $supp_trans->ov_discount = $trans_row["ov_discount"];
                $supp_trans->ov_gst = $trans_row["ov_gst"];
                $supp_trans->tax_included = $trans_row["tax_included"];
-               $supp_trans->stored_algorithm = $supp_trans->tax_algorithm = $trans_row["tax_algorithm"];
 
                $id = $trans_row["trans_no"];
 
index 9f5a0cc299ad550ec072d3dafe1972d671fb9f7c..65a46c3188adc4d74e5d798c4cbcb15688e6d8a4 100644 (file)
@@ -13,7 +13,7 @@
 
 function get_supplier_details_to_order(&$order, $supplier_id)
 {
-       $sql = "SELECT curr_code, supp_name, tax_group_id, supp.tax_included, supp.tax_algorithm,
+       $sql = "SELECT curr_code, supp_name, tax_group_id, supp.tax_included,
                        supp.credit_limit - Sum(IFNULL(IF(trans.type=".ST_SUPPCREDIT.", -1, 1) 
                                * (ov_amount + ov_gst + ov_discount),0)) as cur_credit,
                                terms.terms, terms.days_before_due, terms.day_in_following_month
@@ -38,7 +38,7 @@ function get_supplier_details_to_order(&$order, $supplier_id)
        $_POST['curr_code'] = $myrow["curr_code"];
 
        $order->set_supplier($supplier_id, $myrow["supp_name"], $myrow["curr_code"], 
-               $myrow["tax_group_id"], $myrow["tax_included"], $myrow["tax_algorithm"]);
+               $myrow["tax_group_id"], $myrow["tax_included"]);
 }
 
 //----------------------------------------------------------------------------------------
@@ -188,7 +188,7 @@ function read_po_header($order_no, &$order)
        $order->order_no = $order_no;
 
        $order->set_supplier($myrow["supplier_id"], $myrow["supp_name"], $myrow["curr_code"],
-               $myrow['tax_group_id'], $myrow["tax_included"], @$myrow["tax_algorithm"]);
+               $myrow['tax_group_id'], $myrow["tax_included"]);
 
                $order->credit = get_current_supp_credit($order->supplier_id);
 
index 35b7c9ab488f12a374a0d3122b3c2f2931ef6c7c..417f97b4c2330194d271a4cef1cf0f576d25281b 100644 (file)
@@ -14,7 +14,7 @@
 //     FIXME - this should be revised for transaction update case.
 //
 function write_supp_trans($type, $trans_no, $supplier_id, $date_, $due_date, $reference, $supp_reference,
-       $amount, $amount_tax, $discount, $err_msg="", $rate=0, $included=0, $tax_algorithm = null)
+       $amount, $amount_tax, $discount, $err_msg="", $rate=0, $included=0)
 {
        $new = $trans_no==0;
        $date = date2sql($date_);
@@ -33,12 +33,11 @@ function write_supp_trans($type, $trans_no, $supplier_id, $date_, $due_date, $re
 
 
        $sql = "INSERT INTO ".TB_PREF."supp_trans (trans_no, type, supplier_id, tran_date, due_date,
-               reference, supp_reference, ov_amount, ov_gst, rate, ov_discount, tax_included, tax_algorithm) ";
+               reference, supp_reference, ov_amount, ov_gst, rate, ov_discount, tax_included) ";
        $sql .= "VALUES (".db_escape($trans_no).", ".db_escape($type)
        .", ".db_escape($supplier_id).", '$date', '$due_date',
                ".db_escape($reference).", ".db_escape($supp_reference).", ".db_escape($amount)
-               .", ".db_escape($amount_tax).", ".db_escape($rate).", ".db_escape($discount).", ".db_escape($included).
-               ", ".db_escape($tax_algorithm, true).")";
+               .", ".db_escape($amount_tax).", ".db_escape($rate).", ".db_escape($discount).", ".db_escape($included).")";
 
        if ($err_msg == "")
                $err_msg = "Cannot insert a supplier transaction record";
index affdb6270e53827840fe9a0d4c27741f9ccca27e..733f5b159b44e85a533abd245fa02dcabd893a0a 100644 (file)
 function add_supplier($supp_name, $supp_ref, $address, $supp_address, $gst_no,
        $website, $supp_account_no, $bank_account, $credit_limit, $dimension_id, $dimension2_id, 
        $curr_code, $payment_terms, $payable_account, $purchase_account, $payment_discount_account, 
-       $notes, $tax_group_id, $tax_included, $tax_algorithm)
+       $notes, $tax_group_id, $tax_included)
 {
        $sql = "INSERT INTO ".TB_PREF."suppliers (supp_name, supp_ref, address, supp_address, gst_no, website,
                supp_account_no, bank_account, credit_limit, dimension_id, dimension2_id, curr_code,
                payment_terms, payable_account, purchase_account, payment_discount_account, notes, 
-               tax_group_id, tax_included, tax_algorithm)
+               tax_group_id, tax_included)
                VALUES (".db_escape($supp_name). ", "
                .db_escape($supp_ref). ", "
                .db_escape($address) . ", "
@@ -37,8 +37,7 @@ function add_supplier($supp_name, $supp_ref, $address, $supp_address, $gst_no,
                .db_escape($payment_discount_account). ", "
                .db_escape($notes). ", "
                .db_escape($tax_group_id). ", "
-               .db_escape($tax_included). ", "
-               .db_escape($tax_algorithm). ")";
+               .db_escape($tax_included). ")";
 
        db_query($sql,"The supplier could not be added");
 }
@@ -46,7 +45,7 @@ function add_supplier($supp_name, $supp_ref, $address, $supp_address, $gst_no,
 function update_supplier($supplier_id, $supp_name, $supp_ref, $address, $supp_address, $gst_no, 
        $website, $supp_account_no, $bank_account, $credit_limit, $dimension_id, $dimension2_id, 
        $curr_code, $payment_terms, $payable_account, $purchase_account, $payment_discount_account, 
-       $notes, $tax_group_id, $tax_included, $tax_algorithm)
+       $notes, $tax_group_id, $tax_included)
 {
        $sql = "UPDATE ".TB_PREF."suppliers SET supp_name=".db_escape($supp_name) . ",
                supp_ref=".db_escape($supp_ref) . ",
@@ -66,8 +65,7 @@ function update_supplier($supplier_id, $supp_name, $supp_ref, $address, $supp_ad
                payment_discount_account=".db_escape($payment_discount_account) . ",
                notes=".db_escape($notes) . ",
                tax_group_id=".db_escape($tax_group_id). ",
-               tax_included=".db_escape($tax_included).",
-               tax_algorithm=".db_escape($tax_algorithm)
+               tax_included=".db_escape($tax_included)
                ." WHERE supplier_id = ".db_escape($supplier_id);
 
        db_query($sql,"The supplier could not be updated");
@@ -182,13 +180,6 @@ function is_new_supplier($id)
        return !key_in_foreign_table($id, $tables, 'supplier_id');
 }
 
-function update_supp_tax_algorithm($supplier_id, $tax_algorithm)
-{
-       $sql = "UPDATE ".TB_PREF."suppliers SET tax_algorithm=".db_escape($tax_algorithm)
-               . " WHERE supplier_id=".db_escape($supplier_id);
-       return db_query($sql, "cannot update supplier's tax calculation algorithm");
-}
-
 function get_supplier_currency($supplier_id)
 {
     $sql = "SELECT curr_code FROM ".TB_PREF."suppliers WHERE supplier_id = ".db_escape($supplier_id);
index 47129816ac1b7501303319d38426d5b708d76b6b..e891e6494332eefd95d7f3decf28aa0561f7c37c 100644 (file)
@@ -32,8 +32,6 @@ class purch_order
        var $tax_group_id;
        var $tax_group_array = null; // saves db queries
        var $tax_included; // type of prices
-       var $tax_algorithm;
-       var $stored_algorithm; // copy to find the change after invoice in processed
        var $terms;
        var $ex_rate;
        var $cash_account;
@@ -54,14 +52,13 @@ class purch_order
                $this->lines_on_order = $this->order_no = $this->supplier_id = 0;
        }
        
-       function set_supplier($supplier_id, $supplier_name, $curr_code, $tax_group_id, $tax_included, $tax_algorithm)
+       function set_supplier($supplier_id, $supplier_name, $curr_code, $tax_group_id, $tax_included)
        {
                $this->supplier_id = $supplier_id;
                $this->supplier_name = $supplier_name;
                $this->curr_code = $curr_code;
                $this->tax_group_id = $tax_group_id;
                $this->tax_included = $tax_included;
-               $this->stored_algorithm = $this->tax_algorithm = $tax_algorithm;
                $this->tax_group_array = get_tax_group_items_as_array($tax_group_id);
        }
        
@@ -153,7 +150,7 @@ class purch_order
                        $prices[] = round($ln_itm->price * ($receival ? $ln_itm->receive_qty : $ln_itm->quantity),  user_price_dec());
                }
                $taxes = get_tax_for_items($items, $prices, $shipping_cost,
-                 $this->tax_group_id, $this->tax_included,  $this->tax_group_array, $this->tax_algorithm);
+                 $this->tax_group_id, $this->tax_included,  $this->tax_group_array);
 
        // Adjustment for swiss franken, we always have 5 rappen = 1/20 franken
            if ($this->curr_code == 'CHF') {
@@ -185,7 +182,7 @@ class purch_order
 
                if (!$this->tax_included ) {
                        $taxes = get_tax_for_items($items, $prices, 0, $this->tax_group_id,
-                       $this->tax_included,  $this->tax_group_array, $this->tax_algorithm);
+                       $this->tax_included,  $this->tax_group_array);
 
                        foreach($taxes as $tax)
                                $total += round($tax['Value'], $dec);
index 5182313a5b7c0e1f682b8d8c207ddea7f82da4ef..5aa8be944b32b883f3e61a74803a47e1132fa292 100644 (file)
@@ -189,8 +189,6 @@ function add_direct_supp_trans($cart)
        $inv->reference = $ref;
        $inv->supp_reference = $cart->supp_ref;
        $inv->tax_included = $cart->tax_included;
-       $inv->tax_algorithm = $cart->tax_algorithm;
-       $inv->stored_algorithm = $cart->stored_algorithm;
        $supp = get_supplier($cart->supplier_id);
        $inv->tax_group_id = $supp['tax_group_id'];
        $inv->ov_amount = $inv->ov_gst = $inv->ov_discount = 0;
@@ -203,7 +201,7 @@ function add_direct_supp_trans($cart)
        }
        $inv->tax_overrides = $cart->tax_overrides;
        if (!$inv->tax_included) {
-               $taxes = $inv->get_taxes($inv->tax_group_id, 0, false, $inv->tax_algorithm);
+               $taxes = $inv->get_taxes($inv->tax_group_id, 0, false);
                foreach( $taxes as $taxitem) {
                        $total += isset($taxitem['Override']) ? $taxitem['Override'] : $taxitem['Value'];
                }
@@ -212,10 +210,6 @@ function add_direct_supp_trans($cart)
 
        $inv_no = add_supp_invoice($inv);
 
-       // presume supplier data need correction
-       if ($inv->stored_algorithm != $inv->tax_algorithm)
-               update_supp_tax_algorithm($inv->supplier_id, $inv->tax_algorithm);
-
        if ($cart->cash_account) {
                $pmt_no = write_supp_payment(0, $inv->supplier_id, $cart->cash_account, $inv->tran_date, $Refs->get_next(ST_SUPPAYMENT), 
                        $total, 0, _('Payment for:').$inv->supp_reference .' ('.$type_shortcuts[ST_SUPPINVOICE].$inv_no.')');
index 99fe1934f7fcf65a183362c7e97fc4be72a53963..00226d9fc5d2c078c67c19c296518853dd822c61 100644 (file)
@@ -43,8 +43,6 @@ class supp_trans
        var $ov_gst;
        var $gl_codes_counter=0;
        var $credit = 0;
-       var $tax_algorithm;
-       var $stored_algorithm;
        var $currency;
        var $tax_overrides = array();           // array of taxes manually inserted during sales invoice entry
 
@@ -145,7 +143,7 @@ class supp_trans
         if ($tax_group_id == null)
                $tax_group_id = $this->tax_group_id;
         $taxes = get_tax_for_items($items, $prices, $shipping_cost, $tax_group_id, 
-               $this->tax_included, null, $this->tax_algorithm);
+               $this->tax_included);
 
                if (isset($this->tax_overrides))
                        foreach($this->tax_overrides as $id => $value) // add values entered manually
index b172ed90627fcf5d7d5ff529ef35010b2e20ed82..1da839bbc1bab8fe48de5c3d881f7319c81ec802 100644 (file)
@@ -19,7 +19,6 @@ function copy_from_trans(&$supp_trans)
        $_POST['supp_reference'] = $supp_trans->supp_reference;
        $_POST['reference'] = $supp_trans->reference;
        $_POST['supplier_id'] = $supp_trans->supplier_id;
-       $_POST['tax_algorithm'] = $supp_trans->tax_algorithm;
     $_POST['dimension'] = $supp_trans->dimension;
     $_POST['dimension2'] = $supp_trans->dimension2;
 
@@ -38,8 +37,6 @@ function copy_to_trans(&$supp_trans)
        $supp_trans->due_date = $_POST['due_date'];
        $supp_trans->supp_reference = $_POST['supp_reference'];
        $supp_trans->reference = $_POST['reference'];
-       if (isset($_POST['tax_algorithm']))
-           $supp_trans->tax_algorithm = $_POST['tax_algorithm'];
        $supp_trans->dimension = @$_POST['dimension'];
        $supp_trans->dimension2 =  @$_POST['dimension2'];
 
@@ -197,11 +194,6 @@ function invoice_totals(&$supp_trans)
 
     end_table(1);
     start_table(TABLESTYLE2);
-    tax_algorithm_list_row(_("Tax algorithm:"), 'tax_algorithm', null, true);
-       if (list_updated('tax_algorithm')) {
-               $supp_trans->tax_algorithm = $_POST['tax_algorithm'];
-           $Ajax->activate('tax_table');
-       }
     textarea_row(_("Memo:"), "Comments", null, 50, 3);
     end_table(1);
        div_end();
index eedbf6bf8eaf48a8e6fd4d498b5fb111c187f5ed..67ce8676ab75f3d8600fd641a2d1b29bcc0a94a0 100644 (file)
@@ -26,7 +26,6 @@ function copy_from_cart()
        $_POST['Comments'] = $cart->Comments;
     $_POST['StkLocation'] = $cart->Location;
     $_POST['delivery_address'] = $cart->delivery_address;
-    $_POST['tax_algorithm'] = $cart->tax_algorithm;
        $_POST['prep_amount'] = price_format($cart->prep_amount);
        $_POST['_ex_rate'] = $cart->ex_rate;
        $_POST['cash_account'] = $cart->cash_account;
@@ -54,8 +53,6 @@ function copy_to_cart()
        $cart->delivery_address = $_POST['delivery_address'];
        $cart->dimension = @$_POST['dimension'];
        $cart->dimension2 =  @$_POST['dimension2'];
-       if (isset($_POST['tax_algorithm']))
-           $cart->tax_algorithm = $_POST['tax_algorithm'];
        $cart->prep_amount = input_num('prep_amount', 0);
        $cart->ex_rate = input_num('_ex_rate', null);
 
@@ -120,7 +117,6 @@ function display_po_header(&$order)
                get_supplier_details_to_order($order, $_POST['supplier_id']); 
            get_duedate_from_terms($order);
                $_POST['due_date'] = $order->due_date;
-               $_POST['tax_algorithm'] = $order->tax_algorithm;
 
                // supplier default price update
                foreach ($order->line_items as $line_no=>$item) {
@@ -132,7 +128,6 @@ function display_po_header(&$order)
                }
            $Ajax->activate('items_table');
            $Ajax->activate('due_date');
-           $Ajax->activate('tax_algorithm');
        }
        set_global_supplier($_POST['supplier_id']);
 
@@ -453,13 +448,7 @@ function display_po_footer(&$trans)
 
 start_table(TABLESTYLE2);
 
-if (list_updated('tax_algorithm')) {
-       $trans->tax_algorithm = $_POST['tax_algorithm'];
-    $Ajax->activate('items_table');
-}
-
 if ($trans->trans_type == ST_SUPPINVOICE) {
-       tax_algorithm_list_row(_("Tax algorithm:"), 'tax_algorithm', null, true);
        cash_accounts_list_row(_("Payment:"), 'cash_account', null, false, _('Delayed'));
 } elseif ($trans->trans_type == ST_PURCHORDER)
        amount_row(_("Pre-Payment Required:"), 'prep_amount');
index f36213117801af990b984282fbabb50b85275821..49261dcbd770c3ef6f3d4c0ca2eca63fe155ca78 100644 (file)
@@ -61,7 +61,6 @@ function supplier_settings(&$supplier_id)
                $_POST['credit_limit']  = price_format($myrow["credit_limit"]);
                $_POST['tax_group_id'] = $myrow["tax_group_id"];
                $_POST['tax_included'] = $myrow["tax_included"];
-               $_POST['tax_algorithm'] = $myrow["tax_algorithm"];
                $_POST['payable_account']  = $myrow["payable_account"];
                $_POST['purchase_account']  = $myrow["purchase_account"];
                $_POST['payment_discount_account'] = $myrow["payment_discount_account"];
@@ -75,7 +74,6 @@ function supplier_settings(&$supplier_id)
                $_POST['dimension_id'] = 0;
                $_POST['dimension2_id'] = 0;
                $_POST['tax_included'] = 0;
-               $_POST['tax_algorithm'] = 1;
                $_POST['sales_type'] = -1;
                $_POST['gst_no'] = $_POST['bank_account'] = '';
                $_POST['payment_terms']  = '';
@@ -122,7 +120,6 @@ function supplier_settings(&$supplier_id)
                hidden('tax_included');
                label_row(_("Prices contain tax included:"), $_POST['tax_included'] ? _('Yes') : _('No'));
        }
-       tax_algorithm_list_row(_("Tax Calculation Algorithm:"), 'tax_algorithm', null);
 
        if (!$supplier_id) table_section(2);
 
@@ -220,7 +217,7 @@ if (isset($_POST['submit']))
                                $_POST['website'], $_POST['supp_account_no'], $_POST['bank_account'], 
                                input_num('credit_limit', 0), $_POST['dimension_id'], $_POST['dimension2_id'], $_POST['curr_code'],
                                $_POST['payment_terms'], $_POST['payable_account'], $_POST['purchase_account'], $_POST['payment_discount_account'],
-                               $_POST['notes'], $_POST['tax_group_id'], get_post('tax_included', 0), get_post('tax_algorithm'));
+                               $_POST['notes'], $_POST['tax_group_id'], get_post('tax_included', 0));
                        update_record_status($_POST['supplier_id'], $_POST['inactive'],
                                'suppliers', 'supplier_id');
 
@@ -233,7 +230,7 @@ if (isset($_POST['submit']))
                                $_POST['gst_no'], $_POST['website'], $_POST['supp_account_no'], $_POST['bank_account'], 
                                input_num('credit_limit',0), $_POST['dimension_id'], $_POST['dimension2_id'],
                                $_POST['curr_code'], $_POST['payment_terms'], $_POST['payable_account'], $_POST['purchase_account'],
-                               $_POST['payment_discount_account'], $_POST['notes'], $_POST['tax_group_id'], check_value('tax_included'), get_post('tax_algorithm'));
+                               $_POST['payment_discount_account'], $_POST['notes'], $_POST['tax_group_id'], check_value('tax_included'));
 
                        $supplier_id = $_POST['supplier_id'] = db_insert_id();
 
index 086303bd06931596a9d2bc78690a3e97190b8ee2..17e123f9c6f891a54bd3c4e85e134d686de29792 100644 (file)
@@ -472,13 +472,8 @@ display_po_items($_SESSION['PO']);
 
 start_table(TABLESTYLE2);
 
-if (list_updated('tax_algorithm')) {
-       $_SESSION['PO']->tax_algorithm = $_POST['tax_algorithm'];
-    $Ajax->activate('items_table');
-}
 
 if ($_SESSION['PO']->trans_type == ST_SUPPINVOICE) {
-       tax_algorithm_list_row(_("Tax algorithm:"), 'tax_algorithm', null, true);
        cash_accounts_list_row(_("Payment:"), 'cash_account', null, false, _('Delayed'));
 }
 
index 7bc308afc5e8de698ea153f69e0a5a001e1a088f..696cd6d67c1387d85a944456055a58c3cfa1969c 100644 (file)
@@ -238,10 +238,6 @@ function handle_commit_invoice()
        $inv = $_SESSION['supp_trans'];
        $invoice_no = add_supp_invoice($inv);
 
-       // presume supplier data need correction
-       if ($inv->stored_algorithm != $inv->tax_algorithm)
-               update_supp_tax_algorithm($inv->supplier_id, $inv->tax_algorithm);
-
     $_SESSION['supp_trans']->clear_items();
     unset($_SESSION['supp_trans']);
 
index 38cbd47c45bf655eea68e39f3723a42f0c80b5a9..c3246a626cc78ef179886d670771bfebba0fb760 100644 (file)
@@ -34,7 +34,7 @@ print_po();
 function get_po($order_no)
 {
        $sql = "SELECT ".TB_PREF."purch_orders.*, ".TB_PREF."suppliers.supp_name,  "
-               .TB_PREF."suppliers.supp_account_no,".TB_PREF."suppliers.tax_included,".TB_PREF."suppliers.tax_algorithm,".TB_PREF."suppliers.gst_no AS tax_id,
+               .TB_PREF."suppliers.supp_account_no,".TB_PREF."suppliers.tax_included,".TB_PREF."suppliers.gst_no AS tax_id,
                ".TB_PREF."suppliers.curr_code, ".TB_PREF."suppliers.payment_terms, ".TB_PREF."locations.location_name,
                ".TB_PREF."suppliers.address, ".TB_PREF."suppliers.contact, ".TB_PREF."suppliers.tax_group_id
                FROM ".TB_PREF."purch_orders, ".TB_PREF."suppliers, ".TB_PREF."locations
@@ -167,7 +167,7 @@ function print_po()
                $rep->NewLine();
 
                $tax_items = get_tax_for_items($items, $prices, 0,
-                 $myrow['tax_group_id'], $myrow['tax_included'],  null, $myrow['tax_algorithm']);
+                 $myrow['tax_group_id'], $myrow['tax_included'],  null, TCA_LINES);
                $first = true;
                foreach($tax_items as $tax_item)
                {
index 3ae9e0ec53311aff3f57f89d45a257cc6ff29710..cebe4e203f59925fd8897c64699794d2b65e72b1 100644 (file)
@@ -1,5 +1,3 @@
-ALTER TABLE `0_suppliers` ADD COLUMN  `tax_algorithm` tinyint(1) NOT NULL default '1' AFTER `tax_included`;
-ALTER TABLE `0_supp_trans` ADD COLUMN `tax_algorithm` tinyint(1) NULL default '1' AFTER `tax_included`;
 INSERT INTO `0_sys_prefs` VALUES('tax_algorithm','glsetup.customer', 'tinyint', 1, '1');
 INSERT INTO `0_sys_prefs` VALUES('gl_closing_date','setup.closing_date', 'date', 8, '');
 ALTER TABLE `0_audit_trail` CHANGE `fiscal_year` `fiscal_year` int(11) NOT NULL default 0;
index 781d50379db3e00c5c8f0c01f1e742bd1a281e19..3effa593b6bb302af828d229c82e15e2b7cd89d3 100644 (file)
@@ -1907,7 +1907,6 @@ CREATE TABLE IF NOT EXISTS `0_suppliers` (
   `curr_code` char(3) default NULL,
   `payment_terms` int(11) default NULL,
   `tax_included` tinyint(1) NOT NULL default '0',
-  `tax_algorithm` tinyint(1) NOT NULL default '1',
   `dimension_id` int(11) default '0',
   `dimension2_id` int(11) default '0',
   `tax_group_id` int(11) default NULL,
@@ -1925,9 +1924,9 @@ CREATE TABLE IF NOT EXISTS `0_suppliers` (
 -- Dumping data for table `0_suppliers`
 --
 
-INSERT INTO `0_suppliers` VALUES(1, 'Junk Beer ApS', 'Junk Beer', 'Mailing 1\nMailing 2\nMailing 3', 'Address 1\nAddress 2\nAddress 3', '123456', 'Contact', '111', '', '', 'DKK', 3, 0, 1, 1, 0, 2, 1000, '', '2100', '5060', 'A supplier with junk beers.', 0);
-INSERT INTO `0_suppliers` VALUES(2, 'Lucky Luke Inc.', 'Lucky Luke', 'Mailing 1\nMailing 2\nMailing 3', 'Address 1\nAddress 2\nAddress 3', '654321', 'Luke', '333', '', '', 'USD', 3, 0, 1, 0, 0, 1, 500, '', '2100', '5060', '', 0);
-INSERT INTO `0_suppliers` VALUES(3, 'Money Makers Ltd.', 'Money Makers', 'Mailing 1\nMailing 2\nMailing 3', 'Address 1\nAddress 2\nAddress 3', '987654', 'Makers', '222', '', '', 'GBP', 3, 0, 1, 0, 0, 2, 300, '', '2100', '5060', '', 0);
+INSERT INTO `0_suppliers` VALUES(1, 'Junk Beer ApS', 'Junk Beer', 'Mailing 1\nMailing 2\nMailing 3', 'Address 1\nAddress 2\nAddress 3', '123456', 'Contact', '111', '', '', 'DKK', 3, 0, 1, 0, 2, 1000, '', '2100', '5060', 'A supplier with junk beers.', 0);
+INSERT INTO `0_suppliers` VALUES(2, 'Lucky Luke Inc.', 'Lucky Luke', 'Mailing 1\nMailing 2\nMailing 3', 'Address 1\nAddress 2\nAddress 3', '654321', 'Luke', '333', '', '', 'USD', 3, 0, 0, 0, 1, 500, '', '2100', '5060', '', 0);
+INSERT INTO `0_suppliers` VALUES(3, 'Money Makers Ltd.', 'Money Makers', 'Mailing 1\nMailing 2\nMailing 3', 'Address 1\nAddress 2\nAddress 3', '987654', 'Makers', '222', '', '', 'GBP', 3, 0, 0, 0, 2, 300, '', '2100', '5060', '', 0);
 
 -- --------------------------------------------------------
 
@@ -2014,7 +2013,6 @@ CREATE TABLE IF NOT EXISTS `0_supp_trans` (
   `rate` double NOT NULL default '1',
   `alloc` double NOT NULL default '0',
   `tax_included` tinyint(1) NOT NULL default '0',
-  `tax_algorithm` tinyint(1) NOT NULL default '1',
   PRIMARY KEY  (`type`,`trans_no`),
   KEY `supplier_id` (`supplier_id`),
   KEY `SupplierID_2` (`supplier_id`,`supp_reference`),
@@ -2026,9 +2024,9 @@ CREATE TABLE IF NOT EXISTS `0_supp_trans` (
 -- Dumping data for table `0_supp_trans`
 --
 
-INSERT INTO `0_supp_trans` VALUES(7, 20, 2, '1', '5t', '2014-06-21', '2014-07-01', 3300, 0, 165, 1, 3465, 0, 1);
-INSERT INTO `0_supp_trans` VALUES(8, 20, 2, '2', 'cc', '2014-06-21', '2014-07-01', 20, 0, 0, 1, 0, 0, 1);
-INSERT INTO `0_supp_trans` VALUES(4, 22, 2, '1', '', '2014-06-21', '2014-06-21', -3465, 0, 0, 1, 3465, 0, 1);
+INSERT INTO `0_supp_trans` VALUES(7, 20, 2, '1', '5t', '2014-06-21', '2014-07-01', 3300, 0, 165, 1, 3465, 0);
+INSERT INTO `0_supp_trans` VALUES(8, 20, 2, '2', 'cc', '2014-06-21', '2014-07-01', 20, 0, 0, 1, 0, 0);
+INSERT INTO `0_supp_trans` VALUES(4, 22, 2, '1', '', '2014-06-21', '2014-06-21', -3465, 0, 0, 1, 3465, 0);
 
 -- --------------------------------------------------------
 
index 69cb4c3d28af5bdf57553b2933b74645362e6171..868941e0bf94f42a85581695e6864f77c2248277 100644 (file)
@@ -1680,7 +1680,6 @@ CREATE TABLE IF NOT EXISTS `0_suppliers` (
   `curr_code` char(3) default NULL,
   `payment_terms` int(11) default NULL,
   `tax_included` tinyint(1) NOT NULL default '0',
-  `tax_algorithm` tinyint(1) NOT NULL default '1',
   `dimension_id` int(11) default '0',
   `dimension2_id` int(11) default '0',
   `tax_group_id` int(11) default NULL,
@@ -1778,7 +1777,6 @@ CREATE TABLE IF NOT EXISTS `0_supp_trans` (
   `rate` double NOT NULL default '1',
   `alloc` double NOT NULL default '0',
   `tax_included` tinyint(1) NOT NULL default '0',
-  `tax_algorithm` tinyint(1) NOT NULL default '1',
   PRIMARY KEY  (`type`,`trans_no`),
   KEY `supplier_id` (`supplier_id`),
   KEY `SupplierID_2` (`supplier_id`,`supp_reference`),