mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-10-26 10:08:42 -04:00
Fix payment summary report missing return and location (#1133)
This commit is contained in:
1 parent
3f73e449f0
commit
c5697edf76
1 file changed
+4
-15
@@ -12,23 +12,12 @@ class Summary_payments extends Summary_report
|
||||
array('amount_tendered' => $this->lang->line('sales_amount_tendered'), 'sorter' => 'number_sorter'));
|
||||
}
|
||||
|
||||
protected function _where(array $inputs)
|
||||
{
|
||||
if(empty($this->config->item('date_or_time_format')))
|
||||
{
|
||||
$this->db->where('DATE(sales.sale_time) BETWEEN ' . $this->db->escape($inputs['start_date']) . ' AND ' . $this->db->escape($inputs['end_date']));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->db->where('sales.sale_time BETWEEN ' . $this->db->escape(rawurldecode($inputs['start_date'])) . ' AND ' . $this->db->escape(rawurldecode($inputs['end_date'])));
|
||||
}
|
||||
}
|
||||
|
||||
public function getData(array $inputs)
|
||||
{
|
||||
$this->db->select('sales_payments.payment_type, count(*) AS count, SUM(sales_payments.payment_amount) AS payment_amount');
|
||||
$this->db->select('sales_payments.payment_type, COUNT(*) AS count, SUM(sales_payments.payment_amount) AS payment_amount');
|
||||
$this->db->from('sales_payments AS sales_payments');
|
||||
$this->db->join('sales AS sales', 'sales.sale_id = sales_payments.sale_id');
|
||||
$this->db->join('sales_items AS sales_items', 'sales_items.sale_id = sales_payments.sale_id');
|
||||
|
||||
$this->_where($inputs);
|
||||
|
||||
@@ -39,9 +28,9 @@ class Summary_payments extends Summary_report
|
||||
// consider Gift Card as only one type of payment and do not show "Gift Card: 1, Gift Card: 2, etc." in the total
|
||||
$gift_card_count = 0;
|
||||
$gift_card_amount = 0;
|
||||
foreach($payments as $key=>$payment)
|
||||
foreach($payments as $key => $payment)
|
||||
{
|
||||
if(strstr($payment['payment_type'], $this->lang->line('sales_giftcard')) != FALSE)
|
||||
if(strstr($payment['payment_type'], $this->lang->line('sales_giftcard')) !== FALSE)
|
||||
{
|
||||
$gift_card_count += $payment['count'];
|
||||
$gift_card_amount += $payment['payment_amount'];
|
||||
|
||||
Reference in new issue
Block a user