|
|
@ -172,10 +172,21 @@ |
|
|
|
furd.reveivableMoney, |
|
|
|
furd.sid as receivablesSid, |
|
|
|
( |
|
|
|
SELECT sum(subscriptionMoney) |
|
|
|
FROM fin_selected_receivables_detailed |
|
|
|
WHERE receivablesSid = furd.sid |
|
|
|
AND auditState = 3) as subscriptionMoneyAll, |
|
|
|
select ifnull(sum(dbalance), 0) as subscriptionMoney |
|
|
|
from (SELECT d.receivablesSid, |
|
|
|
cast(( |
|
|
|
d.`subscriptionMoney` - COALESCE(SUM(f.`thisUseMoney`), 0)) AS DECIMAL(10, 2)) AS dbalance |
|
|
|
FROM fin_selected_receivables_detailed d |
|
|
|
LEFT JOIN ( |
|
|
|
SELECT f.busSid, |
|
|
|
f.thisUseMoney |
|
|
|
FROM fin_funds_carried_forward_veh f |
|
|
|
JOIN `fin_funds_carried_forward_apply` fa ON f.mainSid = fa.sid |
|
|
|
WHERE fa.`nodeState` != '终止' |
|
|
|
) f ON f.`busSid` = d.`sid` |
|
|
|
WHERE d.auditState = 3 |
|
|
|
GROUP BY d.`sid`) d |
|
|
|
WHERE d.receivablesSid = furd.sid) as subscriptionMoneyAll, |
|
|
|
( |
|
|
|
SELECT group_concat(length(remarks) > 0, ',') |
|
|
|
FROM fin_selected_receivables_detailed |
|
|
|