This commit is contained in:
Zoey
2019-06-26 11:42:51 +06:30
parent 56b8115ac9
commit 79d8eb94ef
17 changed files with 306 additions and 78 deletions

View File

@@ -921,6 +921,7 @@ def self.daily_sales_list(from,to)
AND DATE_FORMAT(CONVERT_TZ(s.receipt_date,'+00:00','+06:30'),'%Y-%m-%d') = DATE_FORMAT(CONVERT_TZ(sales.receipt_date,'+00:00','+06:30'),'%Y-%m-%d')"
payments_total = Sale.select("CAST((CONVERT_TZ(sales.receipt_date,'+00:00','+06:30')) AS DATE) as sale_date,
SUM(case when (sale_payments.payment_method='KBZPay') then sale_payments.payment_amount else 0 end) as kbzpay_amount,
SUM(case when (sale_payments.payment_method='mpu') then sale_payments.payment_amount else 0 end) as mpu_amount,
SUM(case when (sale_payments.payment_method='master') then sale_payments.payment_amount else 0 end) as master_amount,
SUM(case when (sale_payments.payment_method='visa') then sale_payments.payment_amount else 0 end) as visa_amount,
@@ -970,6 +971,7 @@ def self.daily_sales_list(from,to)
:paypar_amount => pay.paypar_amount,
:unionpay_amount => pay.unionpay_amount,
:alipay_amount => pay.alipay_amount,
:kbzpay_amount => pay.kbzpay_amount,
:paymal_amount => pay.paymal_amount,
:dinga_amount => pay.dinga_amount,
:junctionpay_amount => pay.junctionpay_amount,
@@ -1453,6 +1455,7 @@ def self.get_payment_method_by_shift(shift_sale_range,shift,from,to,payment_type
SUM(case when (sale_payments.payment_method='paypar') then sale_payments.payment_amount else 0 end) as paypar_amount,
SUM(case when (sale_payments.payment_method='unionpay') then sale_payments.payment_amount else 0 end) as unionpay_amount,
SUM(case when (sale_payments.payment_method='alipay') then sale_payments.payment_amount else 0 end) as alipay_amount,
SUM(case when (sale_payments.payment_method='KBZPay') then sale_payments.payment_amount else 0 end) as kbzpay_amount,
SUM(case when (sale_payments.payment_method='paymal') then sale_payments.payment_amount else 0 end) as paymal_amount,
SUM(case when (sale_payments.payment_method='dinga') then sale_payments.payment_amount else 0 end) as dinga_amount,
SUM(case when (sale_payments.payment_method='JunctionPay') then sale_payments.payment_amount else 0 end) as junctionpay_amount,