|
|
@@ -403,6 +403,8 @@ sys.f_remove_zero(out_qty) as out_qty, out_amt, sys.f_remove_zero(return_qty) as
|
|
|
tmgs.flg_sub_unit AS "flgSubUnit",
|
|
|
t.outing_box ,
|
|
|
t.outing_piece ,
|
|
|
+ t.out_box ,
|
|
|
+ t.out_piece ,
|
|
|
tmgs.price_standard AS "priceStandard",
|
|
|
t.pack_box ,
|
|
|
tmgus.unit_name as "subUnitName",
|
|
|
@@ -412,7 +414,7 @@ sys.f_remove_zero(out_qty) as out_qty, out_amt, sys.f_remove_zero(return_qty) as
|
|
|
tmgs.sku_code as "skuCode",
|
|
|
sys.f_remove_zero(tpoi.item_qty) as "orderQty",
|
|
|
sys.f_remove_zero(tpoi.item_qty - tpoi.outing_qty - tpoi.out_qty + t.outing_qty + t.out_qty) as "canOutingQty",
|
|
|
- tmgb.brand_name AS "brandName",
|
|
|
+ case when t.sku_id is null then tmp.sup_name || '(外协)' else tmgb.brand_name end AS brandName,
|
|
|
tmgb.short_name AS "shortName",
|
|
|
t.price_out,
|
|
|
sys.f_remove_zero(t.outing_qty + t.out_qty) as outing_qty,
|
|
|
@@ -432,6 +434,7 @@ sys.f_remove_zero(out_qty) as out_qty, out_amt, sys.f_remove_zero(return_qty) as
|
|
|
tms.sup_name
|
|
|
,t.out_status
|
|
|
FROM dkic_b.t_psi_outbound_item as t
|
|
|
+ Left join dkic_b.t_mst_supplier tmp on t.sup_id = tmp.sup_id
|
|
|
left join dkic_b.t_mst_warehouse as tmw on tmw.wh_id = t.wh_id
|
|
|
left join dkic_b.t_mst_supplier as tms on t.sup_id = tms.sup_id
|
|
|
left join dkic_b.t_psi_order_item as tpoi on tpoi.item_id = t.from_item_id
|
|
|
@@ -534,7 +537,7 @@ sys.f_remove_zero(out_qty) as out_qty, out_amt, sys.f_remove_zero(return_qty) as
|
|
|
t.item_index,
|
|
|
t.sku_id,
|
|
|
tmgs.sku_images,
|
|
|
- tmgb.brand_name,
|
|
|
+ case when t.sku_id is null then tmp.sup_name || '(外协)' else tmgb.brand_name end AS brand_name,
|
|
|
tmgb.short_name,
|
|
|
tmgs.sku_code as "skuCode",
|
|
|
case when t.sku_id is null then t.sku_model else tmgs.sku_model end as "skuModel",
|
|
|
@@ -569,6 +572,7 @@ sys.f_remove_zero(out_qty) as out_qty, out_amt, sys.f_remove_zero(return_qty) as
|
|
|
left join dkic_b.t_mst_goods_brand tmgb on tmgb.brand_id = tmgs.brand_id
|
|
|
left join dkic_b.t_psi_inventory tpi on tpi.inv_id = t.inv_id
|
|
|
left join dkic_b.t_psi_outbound_item as tpobi on tpobi.item_id = t.s_out_item_id
|
|
|
+ Left join dkic_b.t_mst_supplier tmp on t.sup_id = tmp.sup_id
|
|
|
where t.flg_valid
|
|
|
and t.out_id = #{id}::uuid
|
|
|
order by t.item_index
|