md
This commit is contained in:
parent
895509a9e2
commit
4b926d6183
@ -114,7 +114,7 @@
|
|||||||
ifnull(tbc.recdPayMoney,0) as recdPayMoney,
|
ifnull(tbc.recdPayMoney,0) as recdPayMoney,
|
||||||
(tba.recPayMoney-ifnull(tbc.recdPayMoney,0)) as noRecdPayMoney,
|
(tba.recPayMoney-ifnull(tbc.recdPayMoney,0)) as noRecdPayMoney,
|
||||||
ifnull(tbd.expiredRecdPayMoney,0) as expiredRecdPayMoney,
|
ifnull(tbd.expiredRecdPayMoney,0) as expiredRecdPayMoney,
|
||||||
(tba.recPayMoney-ifnull(tbd.expiredRecdPayMoney,0)) as expiredNoRecdPayMoney
|
ifnull(tbe.expiredNoRecdPayMoney,0) as expiredNoRecdPayMoney
|
||||||
from (
|
from (
|
||||||
select salesmen,bill_month as billMonth,
|
select salesmen,bill_month as billMonth,
|
||||||
ROUND(sum(rec_money),2) as recPayMoney,
|
ROUND(sum(rec_money),2) as recPayMoney,
|
||||||
@ -207,6 +207,28 @@
|
|||||||
</where>
|
</where>
|
||||||
group by salesmen,bill_month
|
group by salesmen,bill_month
|
||||||
) tbd on tba.salesmen=tbd.salesmen and tba.billMonth=tbd.billMonth
|
) tbd on tba.salesmen=tbd.salesmen and tba.billMonth=tbd.billMonth
|
||||||
|
left join (
|
||||||
|
select a.salesmen,a.bill_month as billMonth,
|
||||||
|
ROUND(sum(rec_money-reced_money),2) as expiredNoRecdPayMoney
|
||||||
|
from emis_settle_bill a
|
||||||
|
<where>
|
||||||
|
a.del_flag='0' and now() <![CDATA[ > ]]> a.payment_due_date
|
||||||
|
<if test="salesmen != null and salesmen!='' "> and a.salesmen = #{salesmen}</if>
|
||||||
|
<if test="billMonth != null and billMonth!='' "> and a.bill_month = #{billMonth}</if>
|
||||||
|
<if test="openBillStatus != null and openBillStatus != ''"> and a.open_bill_status = #{openBillStatus}</if>
|
||||||
|
<if test="paymentStatus != null and paymentStatus != ''"> and a.payment_status = #{paymentStatus}</if>
|
||||||
|
<if test="params.privSiteCode != null and params.privSiteCode != '88888'">
|
||||||
|
and (
|
||||||
|
a.salesmen=#{params.privEmpName}
|
||||||
|
or a.payee=#{params.privEmpName}
|
||||||
|
or a.salesmen in(
|
||||||
|
select salesmen from emis_salesmen_rel esr where esr.del_flag='0' and esr.bl_open='1' and now() <![CDATA[ >= ]]> esr.start_date and now() <![CDATA[ <= ]]> esr.end_date and esr.sales_ass=#{params.privEmpName}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
group by salesmen,bill_month
|
||||||
|
) tbe on tba.salesmen=tbe.salesmen and tba.billMonth=tbe.billMonth
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user