|
@@ -95,28 +95,29 @@
|
|
|
p.imperfect_grain as imperfectGrain,
|
|
|
m.status,
|
|
|
m.signing_date as signingDate,
|
|
|
- (
|
|
|
- SELECT
|
|
|
- IFNULL( sum( s.amount_ing_receivable ), 0 )
|
|
|
- FROM
|
|
|
- stock_sale_receipt_report s
|
|
|
- WHERE
|
|
|
- s.delete_flag = '0'
|
|
|
- AND s.contract_no = m.contract_no
|
|
|
- AND s.comp_id = m.comp_id
|
|
|
- )- (
|
|
|
- SELECT
|
|
|
- IFNULL( sum( ei.amount_money ), 0 )
|
|
|
- FROM
|
|
|
- expense_info ei
|
|
|
- WHERE
|
|
|
- ei.delete_flag = '0'
|
|
|
- AND ei.contract_no = m.contract_no
|
|
|
- AND ei.comp_id = m.comp_id
|
|
|
- AND ei.expenses_type = '1'
|
|
|
- AND ei.expenses_purpose = '1'
|
|
|
- AND ei.cost_type = '1'
|
|
|
- AND ( ei.STATUS = '已收款' OR ei.STATUS = '已完成' )) AS mildewGrain,
|
|
|
+-- (
|
|
|
+-- SELECT
|
|
|
+-- IFNULL( sum( s.amount_ing_receivable ), 0 )
|
|
|
+-- FROM
|
|
|
+-- stock_sale_receipt_report s
|
|
|
+-- WHERE
|
|
|
+-- s.delete_flag = '0'
|
|
|
+-- AND s.contract_no = m.contract_no
|
|
|
+-- AND s.comp_id = m.comp_id
|
|
|
+-- )- (
|
|
|
+-- SELECT
|
|
|
+-- IFNULL( sum( ei.amount_money ), 0 )
|
|
|
+-- FROM
|
|
|
+-- expense_info ei
|
|
|
+-- WHERE
|
|
|
+-- ei.delete_flag = '0'
|
|
|
+-- AND ei.contract_no = m.contract_no
|
|
|
+-- AND ei.comp_id = m.comp_id
|
|
|
+-- AND ei.expenses_type = '1'
|
|
|
+-- AND ei.expenses_purpose = '1'
|
|
|
+-- AND ei.cost_type = '1'
|
|
|
+-- AND ( ei.STATUS = '已收款' OR ei.STATUS = '已完成' )) AS mildewGrain,
|
|
|
+ p.mildew_grain as mildewGrain,
|
|
|
p.goods_name as goodsNames,
|
|
|
m.statement_url as statementUrl,
|
|
|
m.invoice_url as invoiceUrl,
|
|
@@ -138,19 +139,7 @@
|
|
|
AND ei.expenses_type = '1'
|
|
|
AND ei.expenses_purpose = '1'
|
|
|
AND ei.cost_type != '3'
|
|
|
- AND ( ei.STATUS = '已收款' OR ei.STATUS = '已完成' ))- (
|
|
|
- SELECT
|
|
|
- IFNULL( sum( ei.amount_money ), 0 )
|
|
|
- FROM
|
|
|
- expense_info ei
|
|
|
- WHERE
|
|
|
- ei.delete_flag = '0'
|
|
|
- AND ei.contract_no = m.contract_no
|
|
|
- AND ei.comp_id = m.comp_id
|
|
|
- AND ei.expenses_type = '2'
|
|
|
- AND ei.expenses_purpose = '1'
|
|
|
- AND ei.cost_type != '3'
|
|
|
- AND ( ei.STATUS = '已付款' OR ei.STATUS = '已完成' )) AS contractRevenue,
|
|
|
+ AND ( ei.STATUS = '已收款' OR ei.STATUS = '已完成' )) AS contractRevenue,
|
|
|
(
|
|
|
SELECT
|
|
|
IFNULL( sum( ei.amount_money ), 0 )
|
|
@@ -163,19 +152,7 @@
|
|
|
AND ei.expenses_type = '2'
|
|
|
AND ei.expenses_purpose = '1'
|
|
|
AND ei.cost_type != '3'
|
|
|
- AND ( ei.STATUS = '已付款' OR ei.STATUS = '已完成' ))- (
|
|
|
- SELECT
|
|
|
- IFNULL( sum( ei.amount_money ), 0 )
|
|
|
- FROM
|
|
|
- expense_info ei
|
|
|
- WHERE
|
|
|
- ei.delete_flag = '0'
|
|
|
- AND ei.contract_no = m.contract_no
|
|
|
- AND ei.comp_id = m.comp_id
|
|
|
- AND ei.expenses_type = '1'
|
|
|
- AND ei.expenses_purpose = '1'
|
|
|
- AND ei.cost_type != '3'
|
|
|
- AND ( ei.STATUS = '已收款' OR ei.STATUS = '已完成' )) AS contractExpenditure,
|
|
|
+ AND ( ei.STATUS = '已付款' OR ei.STATUS = '已完成' )) AS contractExpenditure,
|
|
|
(
|
|
|
SELECT
|
|
|
IFNULL( sum( ei.amount_money ), 0 )
|