|
|
@@ -433,6 +433,29 @@ sys.f_remove_zero(out_qty) as out_qty, out_amt, sys.f_remove_zero(return_qty) as
|
|
|
t.sup_id,
|
|
|
tms.sup_name
|
|
|
,t.out_status
|
|
|
+ ,t.unit_id
|
|
|
+ ,t.sub_unit_id
|
|
|
+ ,tmgu.unit_name as "unitName"
|
|
|
+ ,tmgus.unit_name as "subUnitName"
|
|
|
+
|
|
|
+ ,case
|
|
|
+ when t.sub_unit_id ISNULL
|
|
|
+ then dkic_b.f_box_piece(tmgus.unit_name, tmgu.unit_name, 0,tpoi.item_qty)
|
|
|
+ else
|
|
|
+ dkic_b.f_box_piece(tmgus.unit_name, tmgu.unit_name,
|
|
|
+ floor((tpoi.item_qty) / T.pack_box)::INT,
|
|
|
+ floor((tpoi.item_qty) % T.pack_box)::INT)
|
|
|
+ end AS "boxPiece"
|
|
|
+
|
|
|
+ ,case
|
|
|
+ when t.sub_unit_id ISNULL
|
|
|
+ then dkic_b.f_box_piece(tmgus.unit_name, tmgu.unit_name, 0,t.outing_qty)
|
|
|
+ else
|
|
|
+ dkic_b.f_box_piece(tmgus.unit_name, tmgu.unit_name,
|
|
|
+ floor(t.outing_qty / T.pack_box)::INT,
|
|
|
+ floor(t.outing_qty % T.pack_box)::INT)
|
|
|
+ end AS "unitInfo"
|
|
|
+
|
|
|
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
|