Commit 91a4c6c8 by jianan

新单跟进v2

parent 12cf4403
...@@ -68,8 +68,8 @@ ...@@ -68,8 +68,8 @@
else 0 else 0
end as paidRatio, end as paidRatio,
case when ifnull(sum(ef.hkd_amount), 0) > 0 case when ifnull(sum(ef.hkd_amount), 0) > 0
then round(ifnull(sum(ef.unpaid_amount), 0) / ifnull(sum(ef.hkd_amount), 0) * 100, 2) then round(100 - (ifnull(sum(ef.paid_amount), 0) / ifnull(sum(ef.hkd_amount), 0) * 100), 2)
else 0 else 100
end as unpaidRatio, end as unpaidRatio,
MAX(first_broker.broker_name) as broker, MAX(first_broker.broker_name) as broker,
DATE_ADD(DATE_ADD(MAX(p.effective_date), INTERVAL 2 MONTH), INTERVAL (ef.fortune_period - 1) YEAR) as payoutDate DATE_ADD(DATE_ADD(MAX(p.effective_date), INTERVAL 2 MONTH), INTERVAL (ef.fortune_period - 1) YEAR) as payoutDate
...@@ -120,8 +120,8 @@ ...@@ -120,8 +120,8 @@
else 0 else 0
end as paidRatio, end as paidRatio,
case when ifnull(ef.hkd_amount, 0) > 0 case when ifnull(ef.hkd_amount, 0) > 0
then round(ifnull(ef.unpaid_amount, 0) / ifnull(ef.hkd_amount, 0) * 100, 2) then round(100 - (ifnull(ef.paid_amount, 0) / ifnull(ef.hkd_amount, 0) * 100), 2)
else 0 else 100
end as unpaidRatio, end as unpaidRatio,
ef.broker as broker, ef.broker as broker,
ef.payout_date as payoutDate ef.payout_date as payoutDate
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment