How to submit return order with a different flow_status_code
Below mentioned is the Java code that was used to submit a return order in SUBMITTED status (flow_status_code at the order header level).
iBizSoft did this in order to have the return order go into Order Management as non-booked.
The natural choice of the status for a non-booked order would have been the ENTERED. It is found that iStore treats return orders in ENTERED status as part of the user’s pending returns queue even if that return had been “submitted” from the user’s perspective. Hence it was decided to use the as SUBMITTED .
This API can be modified to use any eligible flow status when submitting a return order.
Please note that the ASO: Default Order State profile option is applicable only to sales orders (order_category_code = ORDER) that are created as a shopping cart in iStore and submitted to OM.
RMA/Returns uses it’s own API (oracle.apps.ibe.postsales.*) to submit and access return orders.
package com.icu.oracle.apps.ibe.rma;
import oracle.apps.ibe.postsales.Order;
import oracle.apps.ibe.postsales.OrderItem;
import oracle.apps.ibe.postsales.OrderLineRecordColumnFlags;
import oracle.apps.ibe.postsales.SubmitControlRecord;
import oracle.apps.ibe.util.IBEUtil;
import oracle.apps.ibe.util.RequestCtx;
import oracle.apps.ibe.postsales.OrderDBException;
import oracle.apps.jtf.base.resources.FrameworkException;
import java.sql.SQLException;
public class RMAOrder extends Order{
public RMAOrder(){
super();
}
public String saveInSubmittedStatus(OrderItem aorderitem[]) throws OrderDBException, FrameworkException, SQLException{
if(logEnabled)
{
IBEUtil.log(“xxicu_RMAOrder”, “saveinSubmittedStatus”, ” SubmitOrder – Start”);
}
boolean flag = false;
if(logEnabled)
{
IBEUtil.log(“xxicu_RMAOrder”, “saveinSubmittedStatus”, ” ordItem:” + aorderitem.length);
}
if(aorderitem.length > 0 && aorderitem[0] != null)
{
flag = true;
}
super.submitControlRec = new SubmitControlRecord();
super.submitControlRec.submit_flag = “N”;
super.ordHeaderRec.BOOKED_FLAG = “N”;
super.ordHeaderRec.flow_status_code = “SUBMITTED”;
super.ordHeaderRec.force_apply_flag = “Y”;
if(flag)
{
minAttribValidate(aorderitem, 1);
setupOrderLineRecord(aorderitem);
save(true, RequestCtx.getPartyId(), 1, null);
}else
{
if(logEnabled)
{
IBEUtil.log(“xxicu_RMAOrder”, “saveinSubmittedStatus”, ” Before Calling Save”);
}
save(false, RequestCtx.getPartyId(), 1, null);
if(logEnabled)
{
IBEUtil.log(“xxicu_RMAOrder”, “saveinSubmittedStatus”, ” SubmitOrder – End: ” + super.ordHeaderRec.HEADER_ID.toString());
}
}
return super.ordHeaderRec.ORDER_NUMBER.toString();
}
}
There are no comments yet.