! -> 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
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";
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;
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
{
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
// 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);
return $ret_tax_array;
}
-
+*/
function is_tax_account($account_code)
{
$sql= "SELECT id FROM ".TB_PREF."tax_types WHERE