DBA Data[Home] [Help]

PACKAGE BODY: APPS.OKL_CURE_RECON_PUB_W

Source


1 package body okl_cure_recon_pub_w as
2   /* $Header: OKLURCOB.pls 115.2 2003/10/07 18:02:35 pdevaraj noship $ */
3   rosetta_g_mistake_date date := to_date('01/01/+4713', 'MM/DD/SYYYY');
4   rosetta_g_miss_date date := to_date('01/01/-4712', 'MM/DD/SYYYY');
5 
6   -- this is to workaround the JDBC bug regarding IN DATE of value GMiss
7   function rosetta_g_miss_date_in_map(d date) return date as
8   begin
9     if d = rosetta_g_mistake_date then return fnd_api.g_miss_date; end if;
10     return d;
11   end;
12 
13   function rosetta_g_miss_num_map(n number) return number as
14     a number := fnd_api.g_miss_num;
15     b number := 0-1962.0724;
16   begin
17     if n=a then return b; end if;
18     if n=b then return a; end if;
19     return n;
20   end;
21 
22   procedure rosetta_table_copy_in_p4(t out nocopy okl_cure_recon_pub.cure_amount_tbl, a0 JTF_NUMBER_TABLE
23     , a1 JTF_NUMBER_TABLE
24     , a2 JTF_VARCHAR2_TABLE_100
25     ) as
26     ddindx binary_integer; indx binary_integer;
27   begin
28   if a0 is not null and a0.count > 0 then
29       if a0.count > 0 then
30         indx := a0.first;
31         ddindx := 1;
32         while true loop
33           t(ddindx).cam_id := rosetta_g_miss_num_map(a0(indx));
34           t(ddindx).negotiated_amount := rosetta_g_miss_num_map(a1(indx));
35           t(ddindx).process := a2(indx);
36           ddindx := ddindx+1;
37           if a0.last =indx
38             then exit;
39           end if;
40           indx := a0.next(indx);
41         end loop;
42       end if;
43    end if;
44   end rosetta_table_copy_in_p4;
45   procedure rosetta_table_copy_out_p4(t okl_cure_recon_pub.cure_amount_tbl, a0 out nocopy JTF_NUMBER_TABLE
46     , a1 out nocopy JTF_NUMBER_TABLE
47     , a2 out nocopy JTF_VARCHAR2_TABLE_100
48     ) as
49     ddindx binary_integer; indx binary_integer;
50   begin
51   if t is null or t.count = 0 then
52     a0 := JTF_NUMBER_TABLE();
53     a1 := JTF_NUMBER_TABLE();
54     a2 := JTF_VARCHAR2_TABLE_100();
55   else
56       a0 := JTF_NUMBER_TABLE();
57       a1 := JTF_NUMBER_TABLE();
58       a2 := JTF_VARCHAR2_TABLE_100();
59       if t.count > 0 then
60         a0.extend(t.count);
61         a1.extend(t.count);
62         a2.extend(t.count);
63         ddindx := t.first;
64         indx := 1;
65         while true loop
66           a0(indx) := rosetta_g_miss_num_map(t(ddindx).cam_id);
67           a1(indx) := rosetta_g_miss_num_map(t(ddindx).negotiated_amount);
68           a2(indx) := t(ddindx).process;
69           indx := indx+1;
70           if t.last =ddindx
71             then exit;
72           end if;
73           ddindx := t.next(ddindx);
74         end loop;
75       end if;
76    end if;
77   end rosetta_table_copy_out_p4;
78 
79   procedure update_cure_invoice(p_api_version  NUMBER
80     , p_init_msg_list  VARCHAR2
81     , p_commit  VARCHAR2
82     , p_report_id  NUMBER
83     , p_invoice_date  date
84     , p5_a0 JTF_NUMBER_TABLE
85     , p5_a1 JTF_NUMBER_TABLE
86     , p5_a2 JTF_VARCHAR2_TABLE_100
87     , p_operation  VARCHAR2
88     , x_return_status out nocopy  VARCHAR2
89     , x_msg_count out nocopy  NUMBER
90     , x_msg_data out nocopy  VARCHAR2
91   )
92 
93   as
94     ddp_invoice_date date;
95     ddp_cam_tbl okl_cure_recon_pub.cure_amount_tbl;
96     ddindx binary_integer; indx binary_integer;
97   begin
98 
99     -- copy data to the local IN or IN-OUT args, if any
100 
101 
102 
103 
104     ddp_invoice_date := rosetta_g_miss_date_in_map(p_invoice_date);
105 
106     okl_cure_recon_pub_w.rosetta_table_copy_in_p4(ddp_cam_tbl, p5_a0
107       , p5_a1
108       , p5_a2
109       );
110 
111 
112 
113 
114 
115     -- here's the delegated call to the old PL/SQL routine
116     okl_cure_recon_pub.update_cure_invoice(p_api_version,
117       p_init_msg_list,
118       p_commit,
119       p_report_id,
120       ddp_invoice_date,
121       ddp_cam_tbl,
122       p_operation,
123       x_return_status,
124       x_msg_count,
125       x_msg_data);
126 
127     -- copy data back from the local variables to OUT or IN-OUT args, if any
128 
129 
130 
131 
132 
133 
134 
135 
136 
137   end;
138 
139 end okl_cure_recon_pub_w;