Fix detailed reports (#68)

This commit is contained in:
jekkos
2018-08-27 23:52:58 +02:00
committed by jekkos
parent b2da8f5e9d
commit 0fc702627e
2 changed files with 1 additions and 4 deletions

View File

@@ -1192,7 +1192,6 @@ class Sale extends CI_Model
MAX(' . $this->Item->get_item_name() . ') AS name,
MAX(items.item_number) AS item_number,
MAX(items.category) AS category,
MAX(definition_name) AS definition_name,
MAX(items.supplier_id) AS supplier_id,
MAX(sales_items.quantity_purchased) AS quantity_purchased,
MAX(sales_items.item_cost_price) AS item_cost_price,

View File

@@ -97,11 +97,9 @@ class Detailed_receivings extends Report
foreach($data['summary'] as $key=>$value)
{
$this->db->select('name, item_number, category, definition_name, quantity_purchased, serialnumber, total, discount_percent, item_location, receivings_items_temp.receiving_quantity');
$this->db->select('name, item_number, category, quantity_purchased, serialnumber, total, discount_percent, item_location, receivings_items_temp.receiving_quantity');
$this->db->from('receivings_items_temp');
$this->db->join('items', 'receivings_items_temp.item_id = items.item_id');
$this->db->join('attribute_links', 'attribute_links.item_id = items.item_id AND attribute_links.receiving_id = receivings_items_temp.receiving_id', 'left');
$this->db->join('attribute_definitions', 'attribute_definitions.definition_id = attribute_links.definition_id AND definition_type = \'GROUP\'', 'left');
$this->db->where('receivings_items_temp.receiving_id', $value['receiving_id']);
$data['details'][$key] = $this->db->get()->result_array();
}