diff --git a/application/controllers/Reports.php b/application/controllers/Reports.php index 0758a00e6..2d9c335df 100644 --- a/application/controllers/Reports.php +++ b/application/controllers/Reports.php @@ -753,7 +753,7 @@ class Reports extends Secure_Controller if(isset($report_data['rewards'][$key])){ foreach($report_data['rewards'][$key] as $drow) { - $details_data_rewards[$row['sale_id']][] = $this->xss_clean(array($drow['earned'], $drow['used'])); + $details_data_rewards[$row['sale_id']][] = $this->xss_clean(array($drow['used'], $drow['earned'])); } } } @@ -984,7 +984,7 @@ class Reports extends Secure_Controller if(isset($report_data['rewards'][$key])){ foreach($report_data['rewards'][$key] as $drow) { - $details_data_rewards[$row['sale_id']][] = $this->xss_clean(array($drow['earned'], $drow['used'])); + $details_data_rewards[$row['sale_id']][] = $this->xss_clean(array($drow['used'], $drow['earned'])); } } } diff --git a/application/models/reports/Detailed_sales.php b/application/models/reports/Detailed_sales.php index 7fd900189..3ccd7fedd 100644 --- a/application/models/reports/Detailed_sales.php +++ b/application/models/reports/Detailed_sales.php @@ -102,7 +102,7 @@ class Detailed_sales extends Report $this->db->from('sales_items_temp'); $this->db->where('sale_id', $value['sale_id']); $data['details'][$key] = $this->db->get()->result_array(); - $this->db->select('earned, used'); + $this->db->select('used, earned'); $this->db->from('sales_reward_points'); $this->db->where('sale_id', $value['sale_id']); $data['rewards'][$key] = $this->db->get()->result_array(); diff --git a/application/models/reports/Specific_customer.php b/application/models/reports/Specific_customer.php index 3c53b800f..f94a4e400 100644 --- a/application/models/reports/Specific_customer.php +++ b/application/models/reports/Specific_customer.php @@ -76,7 +76,7 @@ class Specific_customer extends Report $this->db->from('sales_items_temp'); $this->db->where('sale_id', $value['sale_id']); $data['details'][$key] = $this->db->get()->result_array(); - $this->db->select('earned, used'); + $this->db->select('used, earned'); $this->db->from('sales_reward_points'); $this->db->where('sale_id', $value['sale_id']); $data['rewards'][$key] = $this->db->get()->result_array();