|
|
@@ -379,6 +379,9 @@
|
|
|
|
|
|
t.price_sale as "priceOut",
|
|
|
t.price_sale * (t.item_qty - t.outing_qty - t.out_qty) as outing_amt,
|
|
|
+ t.fact_price,
|
|
|
+ t.fact_amt,
|
|
|
+ t.discount,
|
|
|
t.non_std_code,
|
|
|
t.remarks,
|
|
|
t.wh_id,
|
|
|
@@ -391,6 +394,8 @@
|
|
|
,(select ul.decimal_places from dkic_b.t_mst_unit ul where t.unit_id = ul.unit_id) as "decimalPlaces"
|
|
|
,ul.unit_name as "unitName"
|
|
|
,u2.unit_name as "subUnitName"
|
|
|
+ ,tmgb.brand_name
|
|
|
+ ,tmgb.short_name
|
|
|
,dkic_b.f_box_piece(u2.unit_name,ul.unit_name,t.box,t.piece) as "boxPiece"
|
|
|
FROM dkic_b.t_psi_order_item as t
|
|
|
inner join dkic_b.t_mst_goods_sku tmgs on t.sku_id = tmgs.sku_id
|
|
|
@@ -400,6 +405,7 @@
|
|
|
and tpi.wh_id = t.wh_id and tpi.cp_id = t.cp_id
|
|
|
LEFT JOIN dkic_b.t_mst_unit AS ul ON t.unit_id = ul.unit_id
|
|
|
LEFT JOIN dkic_b.t_mst_unit AS u2 ON t.sub_unit_id = u2.unit_id
|
|
|
+ LEFT join dkic_b.t_mst_goods_brand tmgb on tmgb.brand_id = tmgs.brand_id
|
|
|
where t.flg_valid
|
|
|
and t.item_qty > t.outing_qty
|
|
|
and t.order_id = #{orderId}::uuid
|