Fixed failures in updated rows in Suppliers and Report Detailed Receivings (#683)

This commit is contained in:
FrancescoUK
2016-06-21 20:32:55 +01:00
parent 9bada9e18e
commit de9a4dac08
2 changed files with 11 additions and 1 deletions

View File

@@ -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.
*/

View File

@@ -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');