|
|
@@ -606,8 +606,8 @@
|
|
|
tpii.into_status AS list_into_status,
|
|
|
- sys.f_remove_zero(tpii.into_qty - tpii.return_qty) as list_can_return_qty,
|
|
|
- sys.f_remove_zero(tpii.into_qty - tpii.return_qty) as list_intoing_qty,
|
|
|
- - t.price_pur * (tpii.into_qty - tpii.return_qty) as list_intoing_amt,
|
|
|
- t.price_pur as list_price_into,
|
|
|
+ - tpii.price_into * (tpii.into_qty - tpii.return_qty) as list_intoing_amt,
|
|
|
+ tpii.price_into as list_price_into,
|
|
|
sys.f_remove_zero(tpii.into_qty) AS list_into_qty,
|
|
|
tpii.into_amt AS list_into_amt,
|
|
|
sys.f_remove_zero(tpii.return_qty) AS list_return_qty,
|
|
|
@@ -638,12 +638,57 @@
|
|
|
<!-- 查询表t_psi_inbound,(条件查询+分页)列表 -->
|
|
|
<select id="selectInboundAndItem" resultMap="BaseResultMapItemResponse">
|
|
|
SELECT
|
|
|
- <include refid="Base_Column_List_Item_Response"/>,
|
|
|
- <include refid="Base_Column_List_Item_Response_Join"/>
|
|
|
+ tpi.into_id
|
|
|
+ , tpi.into_no, tpi.into_type, tpi.from_id, tpi.from_no, tpi.org_id, tpi.staff_id, tpi.cus_id, tpi.sup_id,
|
|
|
+ tpi.into_status, sys.f_remove_zero(tpi.intoing_qty) as intoing_qty, tpi.intoing_amt,
|
|
|
+ sys.f_remove_zero(tpi.into_qty) as into_qty, tpi.into_amt, sys.f_remove_zero(tpi.return_qty) as return_qty, tpi.return_amt, tpi.into_date,
|
|
|
+ tpi.remarks, tpi.annex_paths, tpi.make_staff, tpi.make_time,
|
|
|
+ tpi.receivable_id, tpi.flg_valid, tpi.cp_id,
|
|
|
+ tpii
|
|
|
+ .
|
|
|
+ item_id
|
|
|
+ AS list_item_id,
|
|
|
+ tpii.item_id AS list_into_item_Id,
|
|
|
+ tpii.into_id AS list_into_id,
|
|
|
+ tpi.into_no AS list_into_no,
|
|
|
+ tpii.into_type AS list_into_type,
|
|
|
+ tpii.from_id AS list_from_id,
|
|
|
+ tpii.from_item_id AS list_from_item_id,
|
|
|
+ tpii.item_index AS list_item_index,
|
|
|
+ tpii.sku_id AS list_sku_id,
|
|
|
+ -- tpii.price_into AS list_price_into,
|
|
|
+ tpii.non_std_code AS list_non_std_code,
|
|
|
+ tpii.into_status AS list_into_status,
|
|
|
+ - sys.f_remove_zero(tpii.into_qty - tpii.return_qty) as list_can_return_qty,
|
|
|
+ - sys.f_remove_zero(tpii.into_qty - tpii.return_qty) as list_intoing_qty,
|
|
|
+ - tpii.price_into * (tpii.into_qty - tpii.return_qty) as list_intoing_amt,
|
|
|
+ tpii.price_into as list_price_into,
|
|
|
+ sys.f_remove_zero(tpii.into_qty) AS list_into_qty,
|
|
|
+ tpii.into_amt AS list_into_amt,
|
|
|
+ sys.f_remove_zero(tpii.return_qty) AS list_return_qty,
|
|
|
+ tpii.return_amt AS list_return_amt,
|
|
|
+ tpii.remarks AS list_remarks,
|
|
|
+ tpii.inv_id AS list_inv_id,
|
|
|
+ tpii.cost_price AS list_cost_price,
|
|
|
+ tpii.cost_amt AS list_cost_amt,
|
|
|
+ sys.f_remove_zero(tpii.out_qty) AS list_out_qty,
|
|
|
+ sys.f_remove_zero(tpii.inv_qty) AS list_inv_qty,
|
|
|
+ tpii.flg_valid AS list_flg_valids,
|
|
|
+ tpii.cp_id AS list_cp_id,
|
|
|
+ tmgs.sku_code AS list_sku_code,
|
|
|
+ tmgs.sku_name AS list_sku_name,
|
|
|
+ tmgs.sku_model AS list_sku_model,
|
|
|
+ tmgb.short_name AS list_short_name,
|
|
|
+ tmgs.sku_images AS list_sku_images,
|
|
|
+ tmgs.price_standard AS list_price_std,
|
|
|
+
|
|
|
+ i.inv_id as list_inv_id,
|
|
|
+ i.wh_id as list_wh_id,
|
|
|
+ i.inv_qty as list_inv_qty,
|
|
|
+ i.usable_qty as list_usable_qty,
|
|
|
+ i.wh_name as list_wh_name
|
|
|
FROM dkic_b.t_psi_inbound tpi
|
|
|
left join dkic_b.t_psi_inbound_item tpii on tpi.into_id = tpii.into_id and ( tpii.into_qty - tpii.return_qty) > 0
|
|
|
-
|
|
|
- inner join dkic_b.t_psi_purchase_item as t on t.item_id = tpii.from_item_id
|
|
|
left join dkic_b.t_mst_warehouse tmw on tmw.wh_id = tpii.wh_id
|
|
|
inner join dkic_b.t_mst_goods_sku tmgs on tmgs.sku_id = tpii.sku_id
|
|
|
left join dkic_b.t_mst_goods_brand tmgb on tmgb.brand_id = tmgs.brand_id
|
|
|
@@ -682,6 +727,8 @@
|
|
|
</select>
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
<update id="updateAmount" parameterType="com.dk.mdm.model.pojo.ivt.InboundItem">
|
|
|
update dkic_b.t_psi_inbound
|
|
|
<set>
|