From de06b64e4e39002389d44238ad35b16466f5b1b9 Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Sun, 12 Oct 2014 03:18:19 +0200 Subject: [PATCH] Fix warning in specific discount report (add category to query) Add grant for default stock location in sql --- application/controllers/reports.php | 2 +- application/models/reports/specific_discount.php | 2 +- database/database.sql | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/application/controllers/reports.php b/application/controllers/reports.php index d649f7dba..70507a0f6 100644 --- a/application/controllers/reports.php +++ b/application/controllers/reports.php @@ -790,7 +790,7 @@ class Reports extends Secure_area foreach($report_data['details'][$key] as $drow) { - $details_data[$key][] = array($drow['name'], $drow['category'], $drow['description'], $drow['quantity_purchased'], to_currency($drow['subtotal']), to_currency($drow['total']), to_currency($drow['tax']),/*to_currency($drow['profit']),*/ $drow['discount_percent'].'%'); + $details_data[$key][] = array($drow['name'], $drow['description'], $drow['quantity_purchased'], to_currency($drow['subtotal']), to_currency($drow['total']), to_currency($drow['tax']),/*to_currency($drow['profit']),*/ $drow['discount_percent'].'%'); } } diff --git a/application/models/reports/specific_discount.php b/application/models/reports/specific_discount.php index 679275756..31656eca4 100755 --- a/application/models/reports/specific_discount.php +++ b/application/models/reports/specific_discount.php @@ -39,7 +39,7 @@ class Specific_discount extends Report foreach($data['summary'] as $key=>$value) { - $this->db->select('name, serialnumber, sales_items_temp.description, quantity_purchased, subtotal,total, tax, profit, discount_percent'); + $this->db->select('name, serialnumber, category, sales_items_temp.description, quantity_purchased, subtotal,total, tax, profit, discount_percent'); $this->db->from('sales_items_temp'); $this->db->join('items', 'sales_items_temp.item_id = items.item_id'); $this->db->where('sale_id = '.$value['sale_id'] . " AND discount_percent >= " . $inputs['discount']); diff --git a/database/database.sql b/database/database.sql index 635a7b278..b81d55e8f 100644 --- a/database/database.sql +++ b/database/database.sql @@ -379,6 +379,7 @@ INSERT INTO `ospos_grants` (`permission_id`, `person_id`) VALUES ('reports', 1), ('sales', 1), ('config', 1), +('items_stock', 1), ('suppliers', 1); --