From de9a4dac08d7c2316f48be813772c68ff2a2fc80 Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Tue, 21 Jun 2016 20:32:55 +0100 Subject: [PATCH] Fixed failures in updated rows in Suppliers and Report Detailed Receivings (#683) --- application/controllers/Suppliers.php | 10 ++++++++++ application/models/reports/Detailed_receivings.php | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/application/controllers/Suppliers.php b/application/controllers/Suppliers.php index 1acd5c0a7..8bc80d880 100644 --- a/application/controllers/Suppliers.php +++ b/application/controllers/Suppliers.php @@ -16,6 +16,16 @@ class Suppliers extends Persons $this->load->view('people/manage', $data); } + /* + Gets one row for a supplier manage table. This is called using AJAX to update one row. + */ + public function get_row($row_id) + { + $data_row = $this->xss_clean(get_supplier_data_row($this->Supplier->get_info($row_id), $this)); + + echo json_encode($data_row); + } + /* Returns Supplier table data rows. This will be called with AJAX. */ diff --git a/application/models/reports/Detailed_receivings.php b/application/models/reports/Detailed_receivings.php index 66004d0d3..3535ff3e2 100644 --- a/application/models/reports/Detailed_receivings.php +++ b/application/models/reports/Detailed_receivings.php @@ -35,7 +35,7 @@ class Detailed_receivings extends Report public function getDataByReceivingId($receiving_id) { - $this->db->select('receiving_id, DATE_FORMAT(receiving_date, "%d-%m-%Y") AS receiving_date, SUM(quantity_purchased) AS items_purchased, CONCAT(employee.first_name, " ", employee.last_name) AS employee_name, suppliers.company_name AS supplier_name, SUM(subtotal) AS subtotal, SUM(total) AS total, SUM(profit) AS profit, payment_type, comment, reference'); + $this->db->select('receiving_id, DATE_FORMAT(receiving_date, "%d-%m-%Y") AS receiving_date, SUM(quantity_purchased) AS items_purchased, CONCAT(employee.first_name, " ", employee.last_name) AS employee_name, supplier.company_name AS supplier_name, SUM(subtotal) AS subtotal, SUM(total) AS total, SUM(profit) AS profit, payment_type, comment, reference'); $this->db->from('receivings_items_temp'); $this->db->join('people AS employee', 'receivings_items_temp.employee_id = employee.person_id'); $this->db->join('suppliers AS supplier', 'receivings_items_temp.supplier_id = supplier.person_id', 'left');