|
|
@@ -877,6 +877,7 @@
|
|
|
LEFT JOIN sys.t_data_kind tdktype ON tdktype.kind_code = tpi.into_type
|
|
|
Left join dkic_b.t_mst_warehouse tmw on tmw.wh_id = tpi.wh_id
|
|
|
left join dkic_b.t_mst_dictionary_data tmd on tmd.data_id = tpi.into_reason
|
|
|
+ left join t_mac_account_item tmai on tmai.item_id = tpi.receivable_id
|
|
|
</sql>
|
|
|
<!-- 采购退货用-->
|
|
|
<select id="selectByInboundReturnCond" resultMap="BaseResultMapInboundReturnResponse">
|
|
|
@@ -893,6 +894,9 @@
|
|
|
,tmp.return_address
|
|
|
,tmp.contact_name
|
|
|
,tmp.contact_phone
|
|
|
+ ,case when tpi.receivable_id is null then false
|
|
|
+ when tmai.amt_should = tmai.amt_residue then false
|
|
|
+ else true end as "paymentFlag"
|
|
|
FROM dkic_b.t_psi_inbound tpi
|
|
|
<include refid="Join_Table_Return"/>
|
|
|
<include refid="Condition"/>
|
|
|
@@ -922,6 +926,9 @@
|
|
|
,tmp.return_address
|
|
|
,tmp.contact_name
|
|
|
,tmp.contact_phone
|
|
|
+ ,case when tpi.receivable_id is null then false
|
|
|
+ when tmai.amt_should = tmai.amt_residue then false
|
|
|
+ else true end as "paymentFlag"
|
|
|
FROM dkic_b.t_psi_inbound tpi
|
|
|
Left join dkic_b.t_mst_org tmo on tmo.org_id = tpi.org_id
|
|
|
Left join dkic_b.t_mst_supplier tmp on tmp.sup_id = tpi.sup_id
|
|
|
@@ -929,6 +936,7 @@
|
|
|
Left join dkic_b.t_mst_staff tms1 on tms1.staff_id = tpi.make_staff
|
|
|
Left join dkic_b.t_mst_warehouse tmw on tmw.wh_id = tpi.wh_id
|
|
|
left join dkic_b.t_mst_dictionary_data tmd on tmd.data_id = tpi.into_reason
|
|
|
+ left join t_mac_account_item tmai on tmai.item_id = tpi.receivable_id
|
|
|
WHERE tpi.into_id = #{intoId}::uuid
|
|
|
</select>
|
|
|
</mapper>
|