DBA Data[Home] [Help]

PACKAGE BODY: APPS.OZF_PRICE_LIST_REPORT_PVT_W

Source


1 package body ozf_price_list_report_pvt_w as
2   /* $Header: ozfwprlb.pls 120.0 2005/06/01 00:24:05 appldev 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   function rosetta_g_miss_num_map(n number) return number as
7     a number := fnd_api.g_miss_num;
8     b number := 0-1962.0724;
9   begin
10     if n=a then return b; end if;
11     if n=b then return a; end if;
12     return n;
13   end;
14 
15   -- this is to workaround the JDBC bug regarding IN DATE of value GMiss
16   function rosetta_g_miss_date_in_map(d date) return date as
17   begin
18     if d = rosetta_g_mistake_date then return fnd_api.g_miss_date; end if;
19     return d;
20   end;
21 
22   procedure rosetta_table_copy_in_p1(t OUT NOCOPY ozf_price_list_report_pvt.section_tbl_type, a0 JTF_NUMBER_TABLE
23     , a1 JTF_NUMBER_TABLE
24     , a2 JTF_NUMBER_TABLE
25     , a3 JTF_VARCHAR2_TABLE_100
26     ) as
27     ddindx binary_integer; indx binary_integer;
28   begin
29   if a0 is not null and a0.count > 0 then
30       if a0.count > 0 then
31         indx := a0.first;
32         ddindx := 1;
33         while true loop
34           t(ddindx).parent_section_id := rosetta_g_miss_num_map(a0(indx));
35           t(ddindx).child_section_id := rosetta_g_miss_num_map(a1(indx));
36           t(ddindx).sort_order := rosetta_g_miss_num_map(a2(indx));
37           t(ddindx).leaf := a3(indx);
38           ddindx := ddindx+1;
39           if a0.last =indx
40             then exit;
41           end if;
42           indx := a0.next(indx);
43         end loop;
44       end if;
45    end if;
46   end rosetta_table_copy_in_p1;
47   procedure rosetta_table_copy_out_p1(t ozf_price_list_report_pvt.section_tbl_type, a0 OUT NOCOPY JTF_NUMBER_TABLE
48     , a1 OUT NOCOPY JTF_NUMBER_TABLE
49     , a2 OUT NOCOPY JTF_NUMBER_TABLE
50     , a3 OUT NOCOPY JTF_VARCHAR2_TABLE_100
51     ) as
52     ddindx binary_integer; indx binary_integer;
53   begin
54   if t is null or t.count = 0 then
55     a0 := JTF_NUMBER_TABLE();
56     a1 := JTF_NUMBER_TABLE();
57     a2 := JTF_NUMBER_TABLE();
58     a3 := JTF_VARCHAR2_TABLE_100();
59   else
60       a0 := JTF_NUMBER_TABLE();
61       a1 := JTF_NUMBER_TABLE();
62       a2 := JTF_NUMBER_TABLE();
63       a3 := JTF_VARCHAR2_TABLE_100();
64       if t.count > 0 then
65         a0.extend(t.count);
66         a1.extend(t.count);
67         a2.extend(t.count);
68         a3.extend(t.count);
69         ddindx := t.first;
70         indx := 1;
71         while true loop
72           a0(indx) := rosetta_g_miss_num_map(t(ddindx).parent_section_id);
73           a1(indx) := rosetta_g_miss_num_map(t(ddindx).child_section_id);
74           a2(indx) := rosetta_g_miss_num_map(t(ddindx).sort_order);
75           a3(indx) := t(ddindx).leaf;
76           indx := indx+1;
77           if t.last =ddindx
78             then exit;
79           end if;
80           ddindx := t.next(ddindx);
81         end loop;
82       end if;
83    end if;
84   end rosetta_table_copy_out_p1;
85 
86   procedure get_section_heirarchy(p_section_id  NUMBER
87     , p1_a0 OUT NOCOPY JTF_NUMBER_TABLE
88     , p1_a1 OUT NOCOPY JTF_NUMBER_TABLE
89     , p1_a2 OUT NOCOPY JTF_NUMBER_TABLE
90     , p1_a3 OUT NOCOPY JTF_VARCHAR2_TABLE_100
91   )
92   as
93     ddpx_section_tbl ozf_price_list_report_pvt.section_tbl_type;
94     ddindx binary_integer; indx binary_integer;
95   begin
96 
97     -- copy data to the local IN or IN-OUT args, if any
98 
99 
100     -- here's the delegated call to the old PL/SQL routine
101     ozf_price_list_report_pvt.get_section_heirarchy(p_section_id,
102       ddpx_section_tbl);
103 
104     -- copy data back from the local OUT or IN-OUT args, if any
105 
106     ozf_price_list_report_pvt_w.rosetta_table_copy_out_p1(ddpx_section_tbl, p1_a0
107       , p1_a1
108       , p1_a2
109       , p1_a3
110       );
111   end;
112 
113 end ozf_price_list_report_pvt_w;