|
@@ -75,6 +75,26 @@
|
|
|
p.mildew_grain as contractExpenditure,
|
|
|
p.water_content as expenses,
|
|
|
p.goods_name as invoiced,
|
|
|
+ (SELECT IFNULL(sum(col.amount_ing_payable),0)
|
|
|
+ FROM collection_warehousing_record col
|
|
|
+ WHERE col.delete_flag = '0'
|
|
|
+ AND col.contract_no=m.contract_no
|
|
|
+ AND col.comp_id = m.comp_id) as amountIngPayable,
|
|
|
+ (SELECT IFNULL(sum(col.amount_ed_payable),0)
|
|
|
+ FROM collection_warehousing_record col
|
|
|
+ WHERE col.delete_flag = '0'
|
|
|
+ AND col.contract_no=m.contract_no
|
|
|
+ AND col.comp_id = m.comp_id) as amountEdPayableNew,
|
|
|
+ (SELECT IFNULL(sum(col.amount_not_collectable),0)
|
|
|
+ FROM collection_warehousing_record col
|
|
|
+ WHERE col.delete_flag = '0'
|
|
|
+ AND col.contract_no=m.contract_no
|
|
|
+ AND col.comp_id = m.comp_id) as amountNotCollectable,
|
|
|
+ (SELECT IFNULL(sum(col.amount_ed_collectionable),0)
|
|
|
+ FROM collection_warehousing_record col
|
|
|
+ WHERE col.delete_flag = '0'
|
|
|
+ AND col.contract_no=m.contract_no
|
|
|
+ AND col.comp_id = m.comp_id) as amountEdCollectionable,
|
|
|
case when m.deliver_type = '1' then (SELECT IFNULL(sum(t.amount_ed_payable),0)
|
|
|
FROM tran_settlement_report t
|
|
|
WHERE t.delete_flag = '0'
|