1 package body okl_vendor_refund_pvt_w as
2 /* $Header: OKLIRFDB.pls 120.1 2005/09/30 21:26:44 cklee 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_vendor_refund_pvt.error_tbl_type, a0 JTF_VARCHAR2_TABLE_200
23 , a1 JTF_VARCHAR2_TABLE_100
24 , a2 JTF_NUMBER_TABLE
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).contract_number := a0(indx);
34 t(ddindx).cure_type := a1(indx);
35 t(ddindx).cure_amount := rosetta_g_miss_num_map(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_vendor_refund_pvt.error_tbl_type, a0 out nocopy JTF_VARCHAR2_TABLE_200
46 , a1 out nocopy JTF_VARCHAR2_TABLE_100
47 , a2 out nocopy JTF_NUMBER_TABLE
48 ) as
49 ddindx binary_integer; indx binary_integer;
50 begin
51 if t is null or t.count = 0 then
52 a0 := JTF_VARCHAR2_TABLE_200();
53 a1 := JTF_VARCHAR2_TABLE_100();
54 a2 := JTF_NUMBER_TABLE();
55 else
56 a0 := JTF_VARCHAR2_TABLE_200();
57 a1 := JTF_VARCHAR2_TABLE_100();
58 a2 := JTF_NUMBER_TABLE();
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) := t(ddindx).contract_number;
67 a1(indx) := t(ddindx).cure_type;
68 a2(indx) := rosetta_g_miss_num_map(t(ddindx).cure_amount);
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 rosetta_table_copy_in_p5(t out nocopy okl_vendor_refund_pvt.error_message_type, a0 JTF_VARCHAR2_TABLE_2000) as
80 ddindx binary_integer; indx binary_integer;
81 begin
82 if a0 is not null and a0.count > 0 then
83 if a0.count > 0 then
84 indx := a0.first;
85 ddindx := 1;
86 while true loop
87 t(ddindx) := a0(indx);
88 ddindx := ddindx+1;
89 if a0.last =indx
90 then exit;
91 end if;
92 indx := a0.next(indx);
93 end loop;
94 end if;
95 end if;
96 end rosetta_table_copy_in_p5;
97 procedure rosetta_table_copy_out_p5(t okl_vendor_refund_pvt.error_message_type, a0 out nocopy JTF_VARCHAR2_TABLE_2000) as
98 ddindx binary_integer; indx binary_integer;
99 begin
100 if t is null or t.count = 0 then
101 a0 := JTF_VARCHAR2_TABLE_2000();
102 else
103 a0 := JTF_VARCHAR2_TABLE_2000();
104 if t.count > 0 then
105 a0.extend(t.count);
106 ddindx := t.first;
107 indx := 1;
108 while true loop
109 a0(indx) := t(ddindx);
110 indx := indx+1;
111 if t.last =ddindx
112 then exit;
113 end if;
114 ddindx := t.next(ddindx);
115 end loop;
116 end if;
117 end if;
118 end rosetta_table_copy_out_p5;
119
120 end okl_vendor_refund_pvt_w;