登记销售订单api

业务人员或商务人员在下销售订单,登记之后方可出货,现在财务要求商务人员不能登记订单,填写价格后申请由财务登记,

因为财务会看销售价格与成本,再考虑是否同意按此销售单价出售。

解决办法:

1、销售人员做订单时个性化设置登记按钮灰色,并做一个活动菜单提交订单到财务

2、销售人员提交之后,财务会收到一个workflow,点开网页显示销售订单相关信息,点审批

3、审批的时候就是登记此销售订单

故需要登记销售订单api,code如下:

DECLARE
  l_header_rec               OE_ORDER_PUB.Header_Rec_Type;
  l_line_tbl                 OE_ORDER_PUB.Line_Tbl_Type;
  l_action_request_tbl       OE_ORDER_PUB.Request_Tbl_Type;
  l_header_adj_tbl           OE_ORDER_PUB.Header_Adj_Tbl_Type;
  l_line_adj_tbl             OE_ORDER_PUB.line_adj_tbl_Type;
  l_header_scr_tbl           OE_ORDER_PUB.Header_Scredit_Tbl_Type;
  l_line_scredit_tbl         OE_ORDER_PUB.Line_Scredit_Tbl_Type;
  l_return_status            VARCHAR2(1000);
  l_msg_count                NUMBER;
  l_msg_data                 VARCHAR2(1000);
  p_api_version_number       NUMBER := 1.0;
  p_init_msg_list            VARCHAR2(10) := FND_API.G_FALSE;
  p_return_values            VARCHAR2(10) := FND_API.G_FALSE;
  p_action_commit            VARCHAR2(10) := FND_API.G_FALSE;
  x_return_status            VARCHAR2(1);
  x_msg_count                NUMBER;
  x_msg_data                 VARCHAR2(100);
  p_action_request_tbl       OE_ORDER_PUB.Request_Tbl_Type := oe_order_pub.G_MISS_REQUEST_TBL;
  x_header_val_rec           OE_ORDER_PUB.Header_Val_Rec_Type;
  x_Header_Adj_tbl           OE_ORDER_PUB.Header_Adj_Tbl_Type;
  x_Header_Adj_val_tbl       OE_ORDER_PUB.Header_Adj_Val_Tbl_Type;
  x_Header_price_Att_tbl     OE_ORDER_PUB.Header_Price_Att_Tbl_Type;
  x_Header_Adj_Att_tbl       OE_ORDER_PUB.Header_Adj_Att_Tbl_Type;
  x_Header_Adj_Assoc_tbl     OE_ORDER_PUB.Header_Adj_Assoc_Tbl_Type;
  x_Header_Scredit_tbl       OE_ORDER_PUB.Header_Scredit_Tbl_Type;
  x_Header_Scredit_val_tbl   OE_ORDER_PUB.Header_Scredit_Val_Tbl_Type;
  x_line_val_tbl             OE_ORDER_PUB.Line_Val_Tbl_Type;
  x_Line_Adj_tbl             OE_ORDER_PUB.Line_Adj_Tbl_Type;
  x_Line_Adj_val_tbl         OE_ORDER_PUB.Line_Adj_Val_Tbl_Type;
  x_Line_price_Att_tbl       OE_ORDER_PUB.Line_Price_Att_Tbl_Type;
  x_Line_Adj_Att_tbl         OE_ORDER_PUB.Line_Adj_Att_Tbl_Type;
  x_Line_Adj_Assoc_tbl       OE_ORDER_PUB.Line_Adj_Assoc_Tbl_Type;
  x_Line_Scredit_tbl         OE_ORDER_PUB.Line_Scredit_Tbl_Type;
  x_Line_Scredit_val_tbl     OE_ORDER_PUB.Line_Scredit_Val_Tbl_Type;
  x_Lot_Serial_tbl           OE_ORDER_PUB.Lot_Serial_Tbl_Type;
  x_Lot_Serial_val_tbl       OE_ORDER_PUB.Lot_Serial_Val_Tbl_Type;
  x_action_request_tbl       OE_ORDER_PUB.Request_Tbl_Type;
  X_DEBUG_FILE               VARCHAR2(100);
  l_action_request_tbl_index NUMBER;
  l_msg_index_out            NUMBER(10);
BEGIN
  dbms_output.enable(1000000);
  fnd_global.apps_initialize(user_id      => /*l_user_id*/ 1553,
                             resp_id      => /*l_resp_id*/ 50718,
                             resp_appl_id => /*l_RESP_APPL_ID*/ 660); -- pass in user_id,responsibility_id, and  202000949
  --application_id
  mo_global.init('ONT');
 -- mo_global.set_policy_context('S', 86);
  oe_msg_pub.initialize;
  oe_debug_pub.initialize;
  X_DEBUG_FILE := OE_DEBUG_PUB.Set_Debug_Mode('FILE');
  oe_debug_pub.SetDebugLevel(5); -- Use 5 for the most debuging output, I warn you its a lot
  --of data
  --DBMS_APPLICATION_INFO.set_client_info(82); 
  dbms_output.put_line('START OF NEW DEBUG');
  l_action_request_tbl_index := 1;
  -- action request
  p_action_request_tbl(l_action_request_tbl_index) := oe_order_pub.g_miss_request_rec;
  p_action_request_tbl(l_action_request_tbl_index).request_type := oe_globals.g_book_order;
  p_action_request_tbl(l_action_request_tbl_index).entity_code := oe_globals.g_entity_header;
  p_action_request_tbl(l_action_request_tbl_index).entity_id := 66884;
  OE_ORDER_PUB.process_order(p_api_version_number => 1.0,
                             p_init_msg_list      => fnd_api.g_false,
                             p_return_values      => fnd_api.g_false,
                             p_action_commit      => fnd_api.g_false,
                             x_return_status      => l_return_status,
                             x_msg_count          => l_msg_count,
                             x_msg_data           => l_msg_data,
                             p_action_request_tbl => p_action_request_tbl
                             -- OUT PARAMETERS
                            ,
                             x_header_rec             => l_header_rec,
                             x_header_val_rec         => x_header_val_rec,
                             x_Header_Adj_tbl         => x_Header_Adj_tbl,
                             x_Header_Adj_val_tbl     => x_Header_Adj_val_tbl,
                             x_Header_price_Att_tbl   => x_Header_price_Att_tbl,
                             x_Header_Adj_Att_tbl     => x_Header_Adj_Att_tbl,
                             x_Header_Adj_Assoc_tbl   => x_Header_Adj_Assoc_tbl,
                             x_Header_Scredit_tbl     => x_Header_Scredit_tbl,
                             x_Header_Scredit_val_tbl => x_Header_Scredit_val_tbl,
                             x_line_tbl               => l_line_tbl,
                             x_line_val_tbl           => x_line_val_tbl,
                             x_Line_Adj_tbl           => x_Line_Adj_tbl,
                             x_Line_Adj_val_tbl       => x_Line_Adj_val_tbl,
                             x_Line_price_Att_tbl     => x_Line_price_Att_tbl,
                             x_Line_Adj_Att_tbl       => x_Line_Adj_Att_tbl,
                             x_Line_Adj_Assoc_tbl     => x_Line_Adj_Assoc_tbl,
                             x_Line_Scredit_tbl       => x_Line_Scredit_tbl,
                             x_Line_Scredit_val_tbl   => x_Line_Scredit_val_tbl,
                             x_Lot_Serial_tbl         => x_Lot_Serial_tbl,
                             x_Lot_Serial_val_tbl     => x_Lot_Serial_val_tbl,
                             x_action_request_tbl     => l_action_request_tbl);
  dbms_output.put_line('OM Debug file: ' || oe_debug_pub.G_DIR || '/' ||
                       oe_debug_pub.G_FILE);
  FOR i IN 1 .. l_msg_count LOOP
    Oe_Msg_Pub.get(p_msg_index     => i,
                   p_encoded       => Fnd_Api.G_FALSE,
                   p_data          => l_msg_data,
                   p_msg_index_out => l_msg_index_out);
    DBMS_OUTPUT.PUT_LINE('message is: ' || l_msg_data);
    DBMS_OUTPUT.PUT_LINE('message index is: ' || l_msg_index_out);
    dbms_output.put_line(' www.dezai.cn');
  END LOOP;
  -- Check the return status
  IF l_return_status = FND_API.G_RET_STS_SUCCESS THEN
    dbms_output.put_line('Process order Success');
  ELSE
    dbms_output.put_line('Failed');
  END IF;
  -- debug output
  dbms_output.put_line('Debug Output');
  FOR i in 1 .. OE_DEBUG_PUB.g_debug_count LOOP
    dbms_output.put_line(OE_DEBUG_PUB.G_debug_tbl(i));
  END LOOP;
END;

ps:OE_ORDER_PUB.process_order此功能可以增删改、取消销售订单等操作

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值