Fix values when using multiple attribute columns (#68)

This commit is contained in:
jekkos
2018-09-20 00:35:20 +02:00
committed by jekkos
parent e2147d8b00
commit 667c4e2afe
3 changed files with 5 additions and 2 deletions

View File

@@ -1262,8 +1262,8 @@ class Reports extends Secure_Controller
to_currency($drow['total']),
to_currency($drow['cost']),
to_currency($drow['profit']),
($drow['discount_type'] == PERCENT)? $drow['discount'].'%':to_currency($drow['discount']),
explode('|', (isset($drow['attribute_values'])) ? $drow['attribute_values'] : ""))));
($drow['discount_type'] == PERCENT)? $drow['discount'].'%':to_currency($drow['discount'])),
explode('|', (isset($drow['attribute_values'])) ? $drow['attribute_values'] : "")));
}
if(isset($report_data['rewards'][$key]))

View File

@@ -106,6 +106,7 @@ class Detailed_receivings extends Report
$this->db->join('attribute_links', 'attribute_links.item_id = items.item_id AND attribute_links.receiving_id = receivings_items_temp.receiving_id AND definition_id IN (' . implode(',', $inputs['definition_ids']) . ')', 'left');
$this->db->join('attribute_values', 'attribute_values.attribute_id = attribute_links.attribute_id', 'left');
$this->db->order_by('definition_id');
$this->db->group_by('receivings_items_temp.receiving_id');
}
$this->db->where('receivings_items_temp.receiving_id', $value['receiving_id']);
$data['details'][$key] = $this->db->get()->result_array();

View File

@@ -152,9 +152,11 @@ class Detailed_sales extends Report
$this->db->join('attribute_links', 'attribute_links.item_id = sales_items_temp.item_id AND attribute_links.sale_id = sales_items_temp.sale_id AND definition_id IN (' . implode(',', $inputs['definition_ids']) . ')', 'left');
$this->db->join('attribute_values', 'attribute_values.attribute_id = attribute_links.attribute_id', 'left');
$this->db->order_by('definition_id');
$this->db->group_by('sales_items_temp.sale_id');
}
$this->db->where('sales_items_temp.sale_id', $value['sale_id']);
$data['details'][$key] = $this->db->get()->result_array();
$this->db->select('used, earned');
$this->db->from('sales_reward_points');
$this->db->where('sale_id', $value['sale_id']);