Search 800 + Posts

Nov 1, 2009

Create Sales Order using OE_ORDER_PUB.PROCESS_ORDER with Pricing Modifier (Partial Pricing)

Recently there was requirement to create the Sales Order in Order Management from the Oracle Sales Quotations. Since iStore was involved in that we don’t have leverage to press the Place Order button in Sales Quotations to create Sales Order in Order Management.
  1. Apart from that we have requirement that.All the discounts that has applied in Oracle Sales Quotation should also applied once Order created to Order Management.
  2. User should have option to Update the Price Manually once it is in OM by means of applying Manual Modifier.
  3. But at the same time Price should not be update Automatically ( I mean If we says Action > price Line /price Order).

Solution – Since Order comes from Oracle Sales Quotation/iStore , we need process Order API  OE_ORDER_PUB.PROCESS_ORDER to create Sales Order.

To fulfill the requirement#1
When populating the sales Order line data in OE_ORDER_PUB.PROCESS_ORDER API , populate the adjustment records as shown blow.
l_line_tbl       oe_order_pub.line_tbl_type;--Price Adjustment record
Make sure you populate the
l_line_price_att_tbl_out(l_line_items) := OE_ORDER_PUB.G_MISS_LINE_PRICE_ATT_REC;
l_adj_tbl(l_line_items) := OE_ORDER_PUB.G_MISS_LINE_ADJ_REC;
l_adj_tbl(l_line_items).list_header_id := l_Modifier_id
l_adj_tbl(l_line_items).list_line_id := l_Modifier_line_id
l_adj_tbl(l_line_items).automatic_flag := 'Y';
l_adj_tbl(l_line_items).list_line_type_code := 'DIS';        
l_adj_tbl(l_line_items).arithmetic_operator := 'AMT';--          l_adj_tbl(l_line_items).operand := ll_line_list_price          l_adj_tbl(l_line_items).operation := oe_globals.g_opr_create;
l_adj_tbl(l_line_items).line_index := l_line_items;
l_adj_tbl(l_line_items).applied_flag := 'Y';          l_adj_tbl(l_line_items).updated_flag := 'Y';
l_adj_tbl(l_line_items).change_reason_code := 'MANUAL';
l_adj_tbl(l_line_items).change_reason_text := 'Manually applied adjustments';
Please make sure that while populating the following field
l_line_tbl(l_line_items).unit_list_price:= l_line_list_price;
l_line_tbl(l_line_items).unit_selling_price:= l_line_quote_price;

Requirement #2
Since requirement is to allow user to manually change price by applying Manual Modifier , add the below line of code in Process Order API.
l_line_tbl(l_line_items).calculate_price_flag         := 'P';
Above line indicate that calculate Price flag will be “Partial Price”. With calculate Price = “partial price”,user can change the price .

Requirement #3
Once the calculate price is “partial price” and unit selling rice is already populated, selecting ACTION >Process Order/Pricess line will not modify price or will not apply another Modifier.

No comments:

Post a Comment