修改量消耗明细
--修改量消耗明细
SELECT t.name,
t.comments,
t.version_no,
cux_rebate_pub.get_hou_name(p_organization_id => t.orig_org_id) org_name,
ac.customer_name,
--ql.amount "限额",
-- qlb.limit_balance_id,
qlb.consumed_amount "总消耗",
qlb.available_amount "总可用",
--qlt.creation_date,
qlt.price_request_code,
substr(qlt.price_request_code, 5, 6) header_id,
substr(qlt.price_request_code, 12, 6) line_id,
qlt.amount "本次消耗",
hou.name org_name,
ooh.order_number,
type.name order_type,
type.description type_desc,
b.segment1 || '.' || b.segment2 item_code,
b.description item_desc,
decode(ool.line_category_code,
'ORDER',
ool.ordered_quantity,
'RETURN',
-1 * ool.ordered_quantity,
ool.ord