diff --git a/application/controllers/Reports.php b/application/controllers/Reports.php index 1287f3d40..523de6836 100644 --- a/application/controllers/Reports.php +++ b/application/controllers/Reports.php @@ -304,6 +304,7 @@ class Reports extends Secure_Controller foreach($report_data as $row) { $tabular_data[] = $this->xss_clean(array( + 'tax_name' => $row['name'], 'tax_percent' => $row['percent'], 'report_count' => $row['count'], 'subtotal' => to_currency($row['subtotal']), diff --git a/application/language/en-US/reports_lang.php b/application/language/en-US/reports_lang.php index a14631001..0775e9923 100644 --- a/application/language/en-US/reports_lang.php +++ b/application/language/en-US/reports_lang.php @@ -116,6 +116,7 @@ $lang["reports_supplier"] = "Supplier"; $lang["reports_suppliers"] = "Suppliers"; $lang["reports_suppliers_summary_report"] = "Suppliers Summary Report"; $lang["reports_tax"] = "Tax"; +$lang["report_tax_name"] = "Tax Name"; $lang["reports_tax_category"] = "Tax Category"; $lang["reports_tax_percent"] = "Tax Percent"; $lang["reports_tax_rate"] = "Tax Rate"; diff --git a/application/models/reports/Summary_taxes.php b/application/models/reports/Summary_taxes.php index dfc5d2297..ec532dc39 100644 --- a/application/models/reports/Summary_taxes.php +++ b/application/models/reports/Summary_taxes.php @@ -7,6 +7,7 @@ class Summary_taxes extends Summary_report protected function _get_data_columns() { return array( + array('tax_name' => $this->lang->line('reports_tax_name'), 'sortable' => FALSE), array('tax_percent' => $this->lang->line('reports_tax_percent'), 'sorter' => 'number_sorter'), array('report_count' => $this->lang->line('reports_sales'), 'sorter' => 'number_sorter'), array('subtotal' => $this->lang->line('reports_subtotal'), 'sorter' => 'number_sorter'), @@ -63,9 +64,10 @@ class Summary_taxes extends Summary_report . ' ELSE sales_items.quantity_purchased * (sales_items.item_unit_price - sales_items.discount) END)'; } - $query = $this->db->query("SELECT percent, COUNT(DISTINCT sale_id) AS count, ROUND(SUM(subtotal), $decimals) AS subtotal, ROUND(SUM(tax), $decimals) AS tax, ROUND(SUM(total), $decimals) AS total + $query = $this->db->query("SELECT name as name, percent, COUNT(DISTINCT sale_id) AS count, ROUND(SUM(subtotal), $decimals) AS subtotal, ROUND(SUM(tax), $decimals) AS tax, ROUND(SUM(total), $decimals) AS total FROM ( SELECT + name AS name, CONCAT(IFNULL(ROUND(percent, $decimals), 0), '%') AS percent, sales.sale_id AS sale_id, $sale_subtotal AS subtotal,