Fix Graphical Summary Payment report

This commit is contained in:
FrancescoUK
2020-01-12 20:28:29 +00:00
parent 60b9069a60
commit af2fd78348
2 changed files with 7 additions and 4 deletions

View File

@@ -866,8 +866,11 @@ class Reports extends Secure_Controller
{
$row = $this->xss_clean($row);
$labels[] = $row['payment_type'];
$series[] = array('meta' => $row['payment_type'] . ' ' . round($row['payment_amount'] / $summary['total'] * 100, 2) . '%', 'value' => $row['payment_amount']);
if($row['trans_group'] == $this->lang->line('reports_trans_payments'))
{
$labels[] = $row['trans_type'];
$series[] = array('meta' => $row['trans_type'] . ' ' . round($row['trans_amount'] / $summary['total'] * 100, 2) . '%', 'value' => $row['trans_amount']);
}
}
$data = array(

View File

@@ -61,7 +61,7 @@ class Summary_payments extends Summary_report
$this->db->where('sales.sale_status', COMPLETED);
$this->_where($inputs);
$this->db->group_by("trans_type");
$this->db->group_by('trans_type');
$sales = $this->db->get()->result_array();
@@ -89,7 +89,7 @@ class Summary_payments extends Summary_report
$this->db->where('sales.sale_status', COMPLETED);
$this->_where($inputs);
$this->db->group_by("sales_payments.payment_type");
$this->db->group_by('sales_payments.payment_type');
$payments = $this->db->get()->result_array();