|
|
@@ -414,11 +414,20 @@
|
|
|
tpobi.remarks,
|
|
|
t.wh_id,
|
|
|
tmw.wh_name
|
|
|
- ,(select ul.decimal_places from dkic_b.t_mst_unit ul where dkic_b.t_psi_order_item.unit_id = ul.unit_id) as "decimalPlaces"
|
|
|
+ ,(select ul.decimal_places from dkic_b.t_mst_unit ul where tpobi.unit_id = ul.unit_id) as "decimalPlaces"
|
|
|
+ ,tpobi.pack_box
|
|
|
+ ,tpobi.unit_id
|
|
|
+ ,tpobi.sub_unit_id
|
|
|
+ ,ul.unit_name as "unitName"
|
|
|
+ ,u2.unit_name as "subUnitName"
|
|
|
+ ,dkic_b.f_box_piece(u2.unit_name,ul.unit_name,tpobi.outing_box,tpobi.outing_piece) AS "outingBoxPiece"
|
|
|
+ ,dkic_b.f_box_piece(u2.unit_name,ul.unit_name,tpobi.out_box,tpobi.out_piece) AS "outBoxPiece"
|
|
|
FROM dkic_b.t_psi_outbound_item as tpobi
|
|
|
inner join dkic_b.t_psi_order_item as t on t.item_id = tpobi.from_item_id
|
|
|
inner join dkic_b.t_mst_goods_sku tmgs on t.sku_id = tmgs.sku_id
|
|
|
left join dkic_b.t_mst_warehouse as tmw on tmw.wh_id = t.wh_id
|
|
|
+ LEFT JOIN dkic_b.t_mst_unit AS ul ON tpobi.unit_id = ul.unit_id
|
|
|
+ LEFT JOIN dkic_b.t_mst_unit AS u2 ON tpobi.sub_unit_id = u2.unit_id
|
|
|
where tpobi.flg_valid
|
|
|
and tpobi.out_type = '出库类型-销售出库'
|
|
|
and tpobi.out_qty > tpobi.return_qty
|