销售发运相关API

创建批
  v_batch_rec.order_header_id := rec.header_id;
      -- v_batch_rec.order_type_id   := rec.order_type_id;
      --- v_batch_rec.ship_
      --  v_rule_id                   := rec.rule_id;
    
      --p_batch_rec.default_stage_subinventory := 'STAGING';
    
      wsh_picking_batches_pub.create_batch(p_api_version   => 1.0,
                                           p_init_msg_list => fnd_api.g_false,
                                           p_commit        => fnd_api.g_false, --p_commit,
                                           x_msg_count     => x_msg_count,
                                           x_return_status => x_return_status,
                                           x_msg_data      => x_msg_data,
                                           p_batch_rec     => v_batch_rec,
                                           p_rule_id       => v_rule_id,
                                           p_rule_name     => p_rule_name,
                                           --  p_batch_prefix  => p_batch_prefix,
                                           
                                           x_batch_id => x_batch_id);
释放批行
wsh_picking_batches_pub.release_batch(p_api_version   => 1.0,
                                              p_init_msg_list => fnd_api.g_false,
                                              p_commit        => fnd_api.g_false,
                                              x_msg_count     => x_msg_count,
                                              x_return_status => x_return_status,
                                              x_msg_data      => x_msg_data,
                                              p_batch_id      => v_batch_id,
                                              --    p_batch_name    => p_batch_name,
                                              p_log_level    => 0,
                                              p_release_mode => 'ONLINE', -- 'CONCURRENT', --'ONLINE',
                                              x_request_id   => x_request_id);
     
   分配搬运单
        inv_replenish_detail_pub.line_details_pub(p_line_id               => cur_line_res.line_id,
                                                  x_number_of_rows        => x_number_of_rows,
                                                  x_detailed_qty          => x_detailed_qty,
                                                  x_return_status         => x_return_status,
                                                  x_msg_count             => x_msg_count,
                                                  x_msg_data              => x_msg_data,
                                                  x_revision              => x_revision,
                                                  x_locator_id            => x_locator_id,
                                                  x_transfer_to_location  => x_transfer_to_location,
                                                  x_lot_number            => x_lot_number,
                                                  x_expiration_date       => x_expiration_date,
                                                  x_transaction_temp_id   => x_transaction_temp_id,
                                                  p_transaction_header_id => NULL,
                                                  p_transaction_mode      => NULL,
                                                  p_move_order_type       => 1,
                                                  p_serial_flag           => fnd_api.g_true,
                                                  p_plan_tasks            => NULL,
                                                  p_auto_pick_confirm     => NULL,
                                                  p_commit                => NULL);
      
        --  END LOOP;
        log_msg('分配行搬运行x_return_status = ' || x_return_status || x_revision);

更新发货仓库和批次 货位 序列号
 v_trolin_tbl_type(1) := inv_trolin_util.query_row(p_line_id => cur_line_res.line_id); --Move Order Line ID
        v_trolin_tbl_type(1).db_flag := fnd_api.g_true;
        v_trolin_tbl_type(1).from_subinventory_code := p_subinvetory_code;
        v_trolin_tbl_type(1).from_locator_id := p_locator_id;
        v_trolin_tbl_type(1).quantity := p_ship_qty; ---   v_trolin_tbl_type(1).s := p_locator_id;
        /* v_trolin_tbl_type(i).lot_number := l_lot_number;
        v_trolin_tbl_type(1).serial_number_start := l_serial_number;
        v_trolin_tbl_type(1).serial_number_end := l_serial_number;*/
        v_trolin_tbl_type(1).attribute1 := 'update move order test!';
        v_trolin_tbl_type(1).operation := inv_globals.g_opr_update;
        inv_move_order_pub.process_move_order_line(p_api_version_number => 1.0,
                                                   p_init_msg_list      => fnd_api.g_false,
                                                   p_return_values      => x_return_status,
                                                   p_commit             => fnd_api.g_false,
                                                   x_return_status      => x_return_status,
                                                   x_msg_count          => x_msg_count,
                                                   x_msg_data           => x_msg_data,
                                                   p_trolin_tbl         => v_trolin_tbl_type,
                                                   p_trolin_old_tbl     => l_trolin_tbl,
                                                   x_trolin_tbl         => x_trolin_tbl);
  插入多行SN
 l_success := inv_trx_util_pub.insert_ser_trx(p_trx_tmp_id       => rec_mmtt.transaction_temp_id,
                                                       p_user_id          => rec_mmtt.created_by,
                                                       p_fm_ser_num       => l_fm_serial,
                                                       p_to_ser_num       => l_fm_serial,
                                                       p_validation_level => NULL,
                                                       p_quantity         => 1,
                                                       x_proc_msg         => l_proc_msg);
  log_msg('--------自动挑库确认开始----------');
      inv_pick_wave_pick_confirm_pub.pick_confirm(p_api_version_number => 1.0,
                                                  p_init_msg_list      => fnd_api.g_false,
                                                  p_commit             => fnd_api.g_false,
                                                  x_return_status      => x_return_status,
                                                  x_msg_count          => x_msg_count,
                                                  x_msg_data           => x_msg_data,
                                                  p_move_order_type    => 1,
                                                  p_transaction_mode   => 1,
                                                  p_trolin_tbl         => v_trolin_tbl_type,
                                                  p_mold_tbl           => l_mold_tbl,
                                                  x_mmtt_tbl           => x_mmtt_tbl,
                                                  x_trolin_tbl         => x_trolin_tbl,
                                                  p_transaction_date   => p_transaction_date);
发运确认
  wsh_deliveries_pub.delivery_action(p_api_version_number      => 1.0,
                                         p_init_msg_list           => fnd_api.g_true,
                                         x_return_status           => x_return_status,
                                         x_msg_count               => x_msg_count,
                                         x_msg_data                => x_msg_data,
                                         p_action_code             => 'CONFIRM',
                                         p_delivery_id             => l_delivery_id,
                                         p_sc_rule_id              => 1, --发运规则 select * from wsh_ship_confirm_rules
                                         p_sc_action_flag          => 'S', --s/a/c/o: Ship entered quantity--option - 'S', 'B', 'T', 'A', 'C'
                                         p_sc_stage_del_flag       => 'Y', --ship confirm create delivery for staged quantity flag
                                         p_sc_actual_dep_date      => p_transaction_date, --ship confirm actual departure date
                                         p_sc_intransit_flag       => 'Y', --ship confirm set in-transit flag
                                         p_sc_close_trip_flag      => 'Y', --ship confirm close trip flag
                                         p_sc_create_bol_flag      => 'N', --ship confirm create BOL flag
                                         p_sc_defer_interface_flag => 'Y', --ship confirm defer interface flag  --为‘Y’,手动运行连接停靠站
                                         --p_sc_report_set_id        => 6, --Ship Confirm Documents:from wsh_report_sets where usage_code='SHIP_CONFIRM'
                                         x_trip_id   => l_trip_id,
                                         x_trip_name => l_trip_name);
                 或者 提交请求  发运确认
               /* l_request_id := fnd_request.submit_request('WSH',
    'WSHASCSRS',
    '',
    to_char(SYSDATE, 'YYYY/MM/DD HH24:MI:SS'),
    FALSE,
    1,
    to_char(p_transaction_date, 'YYYY/MM/DD HH24:MI:SS'),
    'WEBADI',
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL);*/
    log_msg('--------结束自动发运确认结束----------');
           

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24023385/viewspace-2147649/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/24023385/viewspace-2147649/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值