AP()

--更新供应商地点
  PROCEDURE update_vendor_site(p_init_msg_list  IN VARCHAR2 DEFAULT fnd_api.g_false,
                               x_return_status  OUT NOCOPY VARCHAR2,
                               x_msg_count      OUT NOCOPY NUMBER,
                               x_msg_data       OUT NOCOPY VARCHAR2,
                               p_cust_vendor_id IN NUMBER) IS
    l_api_name       CONSTANT VARCHAR2(30) := ‘UPDATE_VENDOR_SITE‘;
    l_savepoint_name CONSTANT VARCHAR2(30) := ‘UPDATE_VENDOR_SITE‘;
    l_return_status VARCHAR2(1);
    l_msg_count     NUMBER;
    l_msg_data      VARCHAR2(4000);
    v_return_mes    VARCHAR2(4000);
    l_message       VARCHAR2(4000);

    lv_vendor_site_id NUMBER := 0;

    lv_vendor_site_rec_c ap_vendor_pub_pkg.r_vendor_site_rec_type;
    lv_vendor_site_rec   ap_vendor_pub_pkg.r_vendor_site_rec_type;

    l_vendor_site_id NUMBER;
    l_party_site_id  NUMBER;
    l_location_id    NUMBER;

    l_success_count NUMBER := 0;
    l_error_count   NUMBER := 0;

    l_party_id NUMBER;

  BEGIN
    x_return_status := hss_api.start_activity(p_pkg_name      => g_pkg_name,
                                              p_api_name      => l_api_name,
                                              p_init_msg_list => p_init_msg_list);
    IF (x_return_status = fnd_api.g_ret_sts_unexp_error) THEN
      RAISE fnd_api.g_exc_unexpected_error;
    ELSIF (x_return_status = fnd_api.g_ret_sts_error) THEN
      RAISE fnd_api.g_exc_error;
    END IF;

    FOR rec_pt IN (SELECT cva.party_id,
                          cva.party_name,
                          cva.attribute15,
                          cia.org_id
                     FROM cux_dis_cust_vendor_all cva,
                          cux_dis_org_info_all    cia
                    WHERE cva.cust_vendor_id = p_cust_vendor_id
                      AND cva.party_id = cia.party_id
                      AND cva.attribute15 = cia.attribute15
                      AND cia.new_discription_flag = ‘Y‘)
    LOOP

      FOR i IN (SELECT *
                  FROM (SELECT pvs.*
                          FROM po_vendors          pv,
                               po_vendor_sites_all pvs
                         WHERE pvs.vendor_id = pv.vendor_id
                           AND pv.vendor_name = rec_pt.party_name
                         ORDER BY pvs.last_update_date DESC)
                 WHERE rownum = 1)
      LOOP

        --log(‘org_id‘ || l_line.org_id);
        --log(‘vendor_site_code‘ || l_line.vendor_site_code);
        --log(‘vendor_id‘ || l_line.vendor_id);

        lv_vendor_site_rec := lv_vendor_site_rec_c;

        fnd_global.apps_initialize(user_id      => fnd_global.user_id,
                                   resp_id      => fnd_global.resp_id,
                                   resp_appl_id => fnd_global.resp_appl_id);

        mo_global.set_policy_context(‘S‘,
                                     rec_pt.org_id);

        --========================================================================
        lv_vendor_site_id                                := i.vendor_site_id; -- 供应商地点ID
        lv_vendor_site_rec.vendor_site_id                := i.vendor_site_id;
        lv_vendor_site_rec.vendor_id                     := i.vendor_id; -- 供应商ID
        lv_vendor_site_rec.vendor_site_code              := i.vendor_site_code;
        lv_vendor_site_rec.vendor_site_code_alt          := i.vendor_site_code_alt;
        lv_vendor_site_rec.inactive_date                 := trunc(SYSDATE); -- 失效日期
        lv_vendor_site_rec.org_id                        := rec_pt.org_id;
        lv_vendor_site_rec.location_id                   := i.location_id;
        lv_vendor_site_rec.party_site_id                 := i.party_site_id;
        lv_vendor_site_rec.address_style                 := i.address_style;
        lv_vendor_site_rec.address_line1                 := i.address_line1;
        lv_vendor_site_rec.address_line2                 := i.address_line2;
        lv_vendor_site_rec.address_line3                 := i.address_line3;
        lv_vendor_site_rec.address_line4                 := i.address_line4;
        lv_vendor_site_rec.address_lines_alt             := i.address_lines_alt;
        lv_vendor_site_rec.province                      := i.province;
        lv_vendor_site_rec.country                       := i.country;
        lv_vendor_site_rec.county                        := i.county;
        lv_vendor_site_rec.city                          := i.city;
        lv_vendor_site_rec.state                         := i.state;
        lv_vendor_site_rec.area_code                     := i.area_code;
        lv_vendor_site_rec.ship_to_location_id           := i.ship_to_location_id;
        lv_vendor_site_rec.bill_to_location_id           := i.bill_to_location_id;
        lv_vendor_site_rec.terms_date_basis              := i.terms_date_basis;
        lv_vendor_site_rec.accts_pay_code_combination_id := i.accts_pay_code_combination_id;
        lv_vendor_site_rec.prepay_code_combination_id    := i.prepay_code_combination_id;
        lv_vendor_site_rec.payment_priority              := i.payment_priority;
        lv_vendor_site_rec.terms_id                      := i.terms_id;
        lv_vendor_site_rec.pay_date_basis_lookup_code    := i.pay_date_basis_lookup_code;
        lv_vendor_site_rec.fax                           := i.fax;
        lv_vendor_site_rec.phone                         := i.phone;
        lv_vendor_site_rec.pcard_site_flag               := i.pcard_site_flag;
        lv_vendor_site_rec.match_option                  := i.match_option;
        lv_vendor_site_rec.country_of_origin_code        := i.country_of_origin_code;
        lv_vendor_site_rec.future_dated_payment_ccid     := i.future_dated_payment_ccid;
        lv_vendor_site_rec.email_address                 := i.email_address;
        lv_vendor_site_rec.primary_pay_site_flag         := i.primary_pay_site_flag;
        lv_vendor_site_rec.ship_via_lookup_code          := i.ship_via_lookup_code;
        lv_vendor_site_rec.freight_terms_lookup_code     := i.freight_terms_lookup_code;
        lv_vendor_site_rec.fob_lookup_code               := i.fob_lookup_code;
        lv_vendor_site_rec.pay_group_lookup_code         := i.pay_group_lookup_code;
        lv_vendor_site_rec.invoice_currency_code         := i.invoice_currency_code;
        lv_vendor_site_rec.payment_currency_code         := i.payment_currency_code;
        lv_vendor_site_rec.vat_code                      := i.vat_code;
        lv_vendor_site_rec.auto_tax_calc_flag            := i.auto_tax_calc_flag;
        lv_vendor_site_rec.pay_site_flag                 := ‘Y‘; --i.pay_site_flag;
        lv_vendor_site_rec.purchasing_site_flag          := ‘Y‘; --i.purchasing_site_flag;

        pos_vendor_pub_pkg.create_vendor_site(x_return_status   => l_return_status,
                                              x_msg_count       => l_msg_count,
                                              x_msg_data        => l_msg_data,
                                              p_vendor_site_rec => lv_vendor_site_rec,
                                              x_vendor_site_id  => l_vendor_site_id,
                                              x_party_site_id   => l_party_site_id,
                                              x_location_id     => l_location_id);

        IF (x_return_status <> fnd_api.g_ret_sts_success) THEN

          l_msg_data   := fnd_message.get || l_msg_data;
          v_return_mes := cux_dis_cust_vdr_ipt_pkg.get_return_message(l_msg_count,
                                                                      l_msg_data);
          l_message    := l_message || ‘.‘ || ‘新增地点:‘ || v_return_mes;
          l_msg_data   := l_message || ‘创建供应商地点失败!‘;

          -- cux_conc_utl.log_msg(‘创建供应商地点失败!‘ || ‘-‘ || l_vendor_site_id || ‘-‘ || l_party_site_id || ‘-‘ || l_location_id || ‘-‘ || l_msg_data);

          log(‘创建供应商地点失败!‘ || ‘-‘ || l_vendor_site_id || ‘-‘ || l_party_site_id || ‘-‘ || l_location_id || ‘-‘ || l_msg_data);
          RAISE fnd_api.g_exc_error;
        ELSE
          --导入后将party_id回写到客制化表中,并将状态更新为‘已导入‘
          UPDATE cux_dis_cust_vendor_all cva
             SET cva.status_code = ‘ENABLED‘,
                 cva.attribute15 = ‘Y‘
           WHERE cva.cust_vendor_id = p_cust_vendor_id;

          log(‘party_id:=‘ || ‘-‘ || rec_pt.party_id || ‘-‘ || ‘org_id:=-‘ || ‘-‘ || rec_pt.org_id);

          UPDATE cux_dis_org_info_all cia
             SET cia.discription_flag     = ‘Y‘,
                 cia.new_discription_flag = NULL,
                 cia.attribute15          = ‘Y‘
           WHERE cia.party_id = rec_pt.party_id
             AND cia.org_id = rec_pt.org_id
             AND cia.new_discription_flag = ‘Y‘;
        END IF;

      END LOOP;
    END LOOP;
    --============================================================================

    l_return_status := hss_api.end_activity(p_pkg_name  => g_pkg_name,
                                            p_api_name  => l_api_name,
                                            x_msg_count => x_msg_count,
                                            x_msg_data  => x_msg_data);
  EXCEPTION
    WHEN fnd_api.g_exc_error THEN
      ROLLBACK;
      UPDATE cux_dis_cust_vendor_all cva
         SET cva.status_code = ‘IMPORT_FAILED‘
       WHERE cva.cust_vendor_id = p_cust_vendor_id;
      x_return_status := hss_api.handle_exceptions(p_pkg_name       => g_pkg_name,
                                                   p_api_name       => l_api_name,
                                                   p_savepoint_name => l_savepoint_name,
                                                   p_exc_name       => hss_api.g_exc_name_error,
                                                   x_msg_count      => x_msg_count,
                                                   x_msg_data       => x_msg_data);
      x_msg_data      := x_msg_data || l_msg_data;

    WHEN fnd_api.g_exc_unexpected_error THEN
      ROLLBACK;
      UPDATE cux_dis_cust_vendor_all cva
         SET cva.status_code = ‘IMPORT_FAILED‘
       WHERE cva.cust_vendor_id = p_cust_vendor_id;
      x_return_status := hss_api.handle_exceptions(p_pkg_name       => g_pkg_name,
                                                   p_api_name       => l_api_name,
                                                   p_savepoint_name => l_savepoint_name,
                                                   p_exc_name       => hss_api.g_exc_name_unexp,
                                                   x_msg_count      => x_msg_count,
                                                   x_msg_data       => x_msg_data);
      x_msg_data      := x_msg_data || l_msg_data;
    WHEN OTHERS THEN
      ROLLBACK;
      UPDATE cux_dis_cust_vendor_all cva
         SET cva.status_code = ‘IMPORT_FAILED‘
       WHERE cva.cust_vendor_id = p_cust_vendor_id;
      x_return_status := hss_api.handle_exceptions(p_pkg_name       => g_pkg_name,
                                                   p_api_name       => l_api_name,
                                                   p_savepoint_name => l_savepoint_name,
                                                   p_exc_name       => hss_api.g_exc_name_others,
                                                   x_msg_count      => x_msg_count,
                                                   x_msg_data       => x_msg_data);
      x_msg_data      := x_msg_data || l_msg_data;
  END update_vendor_site;
时间: 2024-10-14 08:19:06

AP()的相关文章

在Ubuntu14.04下使用ap-hotspot建立无线热点(AP mode)

从https://launchpad.net/~nilarimogard/+archive/ubuntu/webupd8/+packages 下载最新版ap-hotspot并安装,我使用的是ap-hotspot - 0.3.1-1~webupd8~0.终端下执行sudo ap-hotspot configure 这一步会检查ubuntu的网络和WIFI接口,确定后会提示你配置热点,输入ssid和密码之类的就行了 接着执行sudo ap-hotspot start即可. ×××××××××××××

[ Perl 6 ] 被取代的钻石操作符(&lt;&gt;)

[ Perl 6 ] 被取代的钻石操作符(<>) There is more than one way to do it. Perl 5中,如果要逐行读取一个文件的内容,你可能会写出下面的代码 while (<>) { chomp; print "It was $_ that I saw.\n"; } $ perl myscript.pl in 但是在Perl 6中,钻石操作符<>已经不再被支持,现在可以用下面的代码来完成上面的功能 for line

微信小程序 this.setData() 详解

1.定义 setData()函数用于将逻辑层数据发送到视图层,同时对应的改变this.data的值. 2.setData()参数格式 接受一个对象,以键(key)值(value)的方式改变值. 其中,key十分灵活,以数据路径的方式给出 -- array[2].message,a.b.c.d,并且不需要在 this.data 中预先定义. 3.实例 Page({ data: { text: 'init data', array: [{text: 'init data'}], object: {

linux中fork()函数详解

 一.fork入门知识 一个进程,包括代码.数据和分配给进程的资源.fork()函数通过系统调用创建一个与原来进程几乎完全相同的进程,也就是两个进程可以做完全相同的事,但如果初始参数或者传入的变量不同,两个进程也可以做不同的事.    一个进程调用fork()函数后,系统先给新的进程分配资源,例如存储数据和代码的空间.然后把原来的进程的所有值都复制到新的新进程中,只有少数值与原来的进程的值不同.相当于克隆了一个自己. 我们来看一个例子: [cpp] view plain copy /* *  f

LeetCode 50 Pow(x, n)(Math、Binary Search)(*)

翻译 实现pow(x, n). 原文 Implement pow(x, n). 分析 首先给大家推荐维基百科: zh.wikipedia.org/wiki/二元搜尋樹 en.wikipedia.org/wiki/Binary_search_tree 其次,大家也可以看看类似的一道题: LeetCode 69 Sqrt(x)(Math.Binary Search)(*) 然而这题我还是没有解出来,看看别人的解法-- class Solution { private: double myPowHel

&lt;转载&gt;Div+Css布局教程(-)CSS必备知识

目录: 1.Div+Css布局教程(-)CSS必备知识 注:本教程要求对html和css有基础了解. 一.CSS布局属性 Width:设置对象的宽度(width:45px). Height:设置对象的高度(Height:45px;). Background:设置对象的背景颜色.背景图像. 1.背景颜色 background:#09F; 2.背景图像 background:url(file:///C|/Users/Administrator/Desktop/huipu.jpg) repeat-x;

转载——c++中冒号(:)和双冒号(::)的用法

1.冒号(:)用法 (1)表示机构内位域的定义(即该变量占几个bit空间) typedef struct _XXX{ unsigned char a:4; unsigned char c; } ; XXX (2)构造函数后面的冒号起分割作用,是类给成员变量赋值的方法,初始化列表,更适用于成员变量的常量const型. struct _XXX{ _XXX() : y(0xc0) {} }; (3) public:和private:后面的冒号,表示后面定义的所有成员都是公有或私有的,直到下一个"pub

android socket readline()方法读不到值的问题

在一次socket编码中,我从客户端发送一条数据到服务器, 可是在服务器我用readline()方法没取到值,也没报错. 于是我把可能发生错误的代码用输出语句包裹,到readline这一行的时候停止的编译, 我意识到是读取的时候出了问题 BufferedReader的readLine方法是一次读一行的,这个方法是阻塞的, 直到它读到了一行数据为止程序才会继续往下执行 直到程序遇到了换行符或者是对应流的结束符readLine方法才会认为读到了一行, 才会结束其阻塞,让程序继续往下执行 所以在写入的

操作符(++,+,+=,小于号,(),--等)重载

 1. 操作符(++,+,+=,小于号等)重载 新建QT项目,编写头文件 #ifndef DIALOG_H #define DIALOG_H #include <QDialog> #include<QLabel> namespace Ui { class Dialog; } //编写自己的Label class myLabel { public: //一定要是共有的,才可以被调用 QLabel *ql; int cx; int cy; myLabel() { ql=new QL