|
|
@@ -3003,7 +3003,7 @@
|
|
|
FROM
|
|
|
dkic_b.t_psi_order tpio
|
|
|
LEFT JOIN dkic_b.t_mac_account_item a ON a.object_id = tpio.cus_id
|
|
|
- LEFT JOIN dkic_b.t_psi_outbound tpo ON tpo.out_id = a.biznis_id
|
|
|
+ LEFT JOIN dkic_b.t_psi_outbound tpo ON tpo.out_id = a.biznis_id and tpo.out_type = '出库类型-销退回库'
|
|
|
LEFT JOIN dkic_b.t_mac_rec_pay tmrp ON tmrp.rp_id = a.biznis_id
|
|
|
LEFT JOIN dkic_b.t_mst_customer tmc ON tmc.cus_id = a.object_id
|
|
|
LEFT JOIN dkic_b.t_mac_rec_pay_item tmrpi ON tmrpi.rp_id = tmrp.rp_id
|
|
|
@@ -3168,8 +3168,10 @@
|
|
|
<!--获取销售额-->
|
|
|
<select id="getSales" resultType="java.util.Map">
|
|
|
SELECT
|
|
|
- COALESCE(SUM(tpo.fact_amt), 0) as "facAmt"
|
|
|
- FROM dkic_b.t_psi_order tpo
|
|
|
+ COALESCE(SUM(tpio.fact_amt), 0) + COALESCE(SUM(tpo.out_amt), 0) as "facAmt"
|
|
|
+ FROM dkic_b.t_psi_order tpio
|
|
|
+ LEFT JOIN dkic_b.t_mac_account_item a ON a.object_id = tpio.cus_id
|
|
|
+ LEFT JOIN dkic_b.t_psi_outbound tpo ON tpo.out_id = a.biznis_id and tpo.out_type = '出库类型-销退回库'
|
|
|
WHERE tpo.flg_valid
|
|
|
AND tpo.cp_id = #{cpId}
|
|
|
AND tpo.make_time::date <= CURRENT_DATE
|