Quick Entries uses Tax Groups instead of Item Tax Types for calculating taxes (Please...
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 18 Aug 2009 00:13:02 +0000 (00:13 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 18 Aug 2009 00:13:02 +0000 (00:13 +0000)
CHANGELOG.txt
gl/includes/db/gl_db_bank_accounts.inc
gl/manage/gl_quick_entries.php
includes/ui/ui_view.inc
taxes/tax_calc.inc

index d3312c15c83d77d9047ad620f3337988075d42ca..e512760d572cd362f2edf5524e9d56f003c52846 100644 (file)
@@ -19,6 +19,13 @@ Legend:
 ! -> Note
 $ -> Affected files
 
+18-Aug-2009 Joe Hunt
+! Quick Entries uses Tax Groups instead of Item Tax Types for calculating taxes (Please change the item lines for tax).
+$ /gl/includes/db/gl_db_bank_accounts.inc
+  /gl/manage/gl_quick_entries.php
+  /includes/ui/ui_view.inc
+  /taxes/tax_calc.inc
+  
 17-Aug-2009 Janusz Dobrowolski
 # [0000158] Added missing check for POS usage before deletion.
 $ /sales/manage/sales_points.php
index 2a28580595616123957ab5b8fc6f9b0e30358c58..c6b71cf368eca2625c12da49ef49c9ee9d9b91ef 100644 (file)
@@ -166,12 +166,12 @@ function get_quick_entry($selected_id)
 function get_quick_entry_lines($qid)
 {
        $sql = "SELECT ".TB_PREF."quick_entry_lines.*, ".TB_PREF."chart_master.account_name,
-                       ".TB_PREF."item_tax_types.name as tax_name
+                       ".TB_PREF."tax_groups.name as tax_name
                FROM ".TB_PREF."quick_entry_lines
                LEFT JOIN ".TB_PREF."chart_master ON
                        ".TB_PREF."quick_entry_lines.dest_id = ".TB_PREF."chart_master.account_code
-               LEFT JOIN ".TB_PREF."item_tax_types ON
-                       ".TB_PREF."quick_entry_lines.dest_id = ".TB_PREF."item_tax_types.id
+               LEFT JOIN ".TB_PREF."tax_groups ON
+                       ".TB_PREF."quick_entry_lines.dest_id = ".TB_PREF."tax_groups.id
                WHERE 
                        qid=$qid
                ORDER by id";
index 137cfaa4bd47752ea9b40d90fad1112e1f2aa9ff..de19943f83d70a38551e27efed7954d71642a13a 100644 (file)
@@ -229,11 +229,11 @@ if ($selected_id != -1)
        start_table($table_style2);
        $dim = get_company_pref('use_dimension');
        if ($dim == 2)
-               $th = array(_("Post"), _("Account/Tax Type"), _("Amount"), _("Dimension"), _("Dimension")." 2", "", "");
+               $th = array(_("Post"), _("Account") . "/" . _("Tax Group"), _("Amount"), _("Dimension"), _("Dimension")." 2", "", "");
        else if ($dim == 1)     
-               $th = array(_("Post"), _("Account/Tax Type"), _("Amount"), _("Dimension"), "", "");
+               $th = array(_("Post"), _("Account") . "/" . _("Tax Group"), _("Amount"), _("Dimension"), "", "");
        else    
-               $th = array(_("Post"), _("Account/Tax Type"), _("Amount"), "", "");
+               $th = array(_("Post"), _("Account") . "/" . _("Tax Group"), _("Amount"), "", "");
 
        table_header($th);
        $k = 0;
@@ -302,7 +302,8 @@ if ($selected_id != -1)
 
        if ($actn == 't') 
        {
-               item_tax_types_list_row(_("Item Tax Type").":",'dest_id', null);
+               //item_tax_types_list_row(_("Item Tax Type").":",'dest_id', null);
+               tax_groups_list_row(_("Tax Group").":", 'dest_id', null);
        } 
        else 
        {
index 86062acba8b083cd9d476692443bc57a6fe38620..d9a33af98cedd1cc61b6107f5116aab659e4a763 100644 (file)
@@ -596,7 +596,11 @@ function display_quick_entries(&$cart, $id, $base, $type, $descr='')
                                case "t": // post taxes calculated on base amount
                                case "t+": // ditto & increase base amount
                                case "t-": // ditto & reduce base amount
-                                       $taxes = get_taxes_for_item_tax($qe_line['dest_id']);
+                                       //$taxes = get_taxes_for_item_tax($qe_line['dest_id']);
+                                       $taxes = array();
+                                       $res = get_tax_group_items($qe_line['dest_id']);
+                                       while ($row = db_fetch($res))
+                                               $taxes[] = $row;
                                        $tax_total = 0;
                                        $totrate = 0;
                                        // find total tax 
index 397c5f501f3d7eae3c0eef49de6fd847d9240663..088be56d6644a22a1a37e78990001547e356a5d0 100644 (file)
@@ -237,6 +237,8 @@ function get_tax_for_items($items, $prices, $shipping_cost, $tax_group, $tax_inc
 //     no tax group exemptions are active (local sales).
 //     To be used in quick entries.
 //
+// Redundant 18.08.2009 Joe Hunt (Tax Groups instead).
+/*
 function get_taxes_for_item_tax($tax_type_id)
 {
        $item_tax_type = get_item_tax_type($tax_type_id);
@@ -283,7 +285,7 @@ function get_taxes_for_item_tax($tax_type_id)
        
        return $ret_tax_array;
 }
-
+*/
 function is_tax_account($account_code)
 {
        $sql= "SELECT id FROM ".TB_PREF."tax_types WHERE