DBA Data[Home] [Help]

PACKAGE BODY: APPS.INL_CUSTOM_PUB

Source


1 PACKAGE BODY INL_CUSTOM_PUB AS
2 /* $Header: INLPCUSB.pls 120.6.12020000.3 2012/10/02 19:16:31 acferrei ship $ */
3 
4 -- Utility name : Get_Charges
5 -- Type       : Public
6 -- Function   :
7 -- Pre-reqs   : None
8 -- Parameters :
9 -- IN         :   p_ship_header_rec              IN inl_charge_pvt.ship_header_rec_tp,
10 --                p_ship_ln_group_rec            IN inl_charge_pvt.ship_ln_group_tbl_tp,
11 --                p_ship_ln_tbl                  IN inl_charge_pvt.ship_ln_tbl_tp,
12 --
13 -- OUT            x_charge_ln_tbl                OUT NOCOPY inl_charge_pvt.charge_ln_tbl
14 --                x_override_default_processing  OUT BOOLEAN (If TRUE, it enables the hook execution
15 --                                                            to override the default processing from
16 --                                                            the caller routine)
17 --                x_return_status                OUT NOCOPY VARCHAR2
18 --
19 -- Version    : Current version 1.0
20 --
21 -- Notes      :
22 
23 PROCEDURE Get_Charges(
24     p_ship_header_rec              IN inl_ship_headers%ROWTYPE,
25     p_ship_ln_group_tbl            IN inl_charge_pvt.ship_ln_group_tbl_tp,
26     p_ship_ln_tbl_tp               IN inl_charge_pvt.ship_ln_tbl_tp,
27     x_charge_ln_tbl                OUT NOCOPY inl_charge_pvt.charge_ln_tbl,
28     x_override_default_processing  OUT NOCOPY BOOLEAN,
29     x_return_status                OUT NOCOPY VARCHAR2
30 ) IS
31 BEGIN
32     x_override_default_processing := FALSE;
33     RETURN;
34 END Get_Charges;
35 
36 -- Utility name : Get_Taxes
37 -- Type       : Public
38 -- Function   :
39 -- Pre-reqs   : None
40 -- Parameters :
41 -- IN         : p_ship_header_rec              IN INL_TAX_PVT.Shipment_Header%ROWTYPE,
42 --              p_ship_ln_groups_tbl           IN INL_TAX_PVT.sh_group_ln_tbl_tp,
43 --              p_ship_lines_tbl               IN INL_TAX_PVT.ship_ln_tbl_tp,
44 --              p_charge_lines_tbl             IN inl_tax_pvt.charge_ln_tbl_tp,
45 --
46 -- OUT        : x_tax_ln_tbl                   OUT inl_tax_pvt.tax_ln_tbl
47 --              x_override_default_processing  OUT BOOLEAN
48 --              x_return_status                OUT NOCOPY VARCHAR2
49 --
50 -- Version    : Current version 1.0
51 --
52 -- Notes      :
53 PROCEDURE Get_Taxes(
54     p_ship_header_rec              IN INL_TAX_PVT.Shipment_Header%ROWTYPE,
55     p_ship_ln_groups_tbl           IN INL_TAX_PVT.sh_group_ln_tbl_tp,
56     p_ship_lines_tbl               IN INL_TAX_PVT.ship_ln_tbl_tp,
57     p_charge_lines_tbl             IN inl_tax_pvt.charge_ln_tbl_tp,
58     x_tax_ln_tbl                   OUT NOCOPY inl_tax_pvt.tax_ln_tbl,
59     x_override_default_processing  OUT NOCOPY  BOOLEAN,
60     x_return_status                OUT NOCOPY VARCHAR2
61 ) IS
62 BEGIN
63     x_override_default_processing := FALSE;
64     RETURN;
65 END Get_Taxes;
66 
67 -- Bug #9279355
68 -- Utility name : Get_LastTaskCodeForSimul
69 -- Type       : Public
70 -- Function   : Get Last Task Code for Simulated Shipment
71 --
72 -- Pre-reqs   : None
73 --
74 -- Version    : Current version 1.0
75 --
76 -- Notes      :
77 FUNCTION Get_LastTaskCodeForSimul RETURN VARCHAR2
78 IS
79     l_last_task_code VARCHAR2(25);
80 BEGIN
81     l_last_task_code := 50;
82 /*---Possiblevalues
83 10 - Import     Process until "Import"     task
84 20 - GetCharges Process until "GetCharges" task
85 30 - GetTaxes   Process until "GetTaxes"   task
86 40 - Validate   Process until "Validation" task
87 50 - LandedCost Process until "LandedCost" task
88 60 - Submit     Process until "Submit"     task
89 */
90     RETURN l_last_task_code;
91 
92 END Get_LastTaskCodeForSimul;
93 
94 -- Bug #9279355
95 -- Utility name : Get_SimulFlexFields
96 -- Type       : Public
97 -- Function   : Get Flexfield values for INL_SIMULATION table
98 -- Pre-reqs   : None
99 -- Parameters :
100 -- IN         :   p_parent_table_name IN VARCHAR2
101 --                p_parent_table_id IN NUMBER
102 --                p_parent_table_revision_num IN NUMBER
103 --
104 -- OUT            x_flexfield_ln_rec OUT NOCOPY INL_CUSTOM_PUB.flexfield_ln_rec
105 --                x_return_status OUT NOCOPY VARCHAR2
106 --
107 -- Version    : Current version 1.0
108 --
109 -- Notes      :
110 PROCEDURE Get_SimulFlexFields(p_parent_table_name IN VARCHAR2,
111                               p_parent_table_id IN NUMBER,
112                               p_parent_table_revision_num IN NUMBER,
113                               x_flexfield_ln_rec OUT NOCOPY INL_CUSTOM_PUB.flexfield_ln_rec,
114                               x_return_status OUT NOCOPY VARCHAR2) IS
115 BEGIN
116     -- Clean output table of records
117     x_flexfield_ln_rec.attribute_category := NULL;
118     x_flexfield_ln_rec.attribute1 := NULL;
119     x_flexfield_ln_rec.attribute2 := NULL;
120     x_flexfield_ln_rec.attribute3 := NULL;
121     x_flexfield_ln_rec.attribute4 := NULL;
122     x_flexfield_ln_rec.attribute5 := NULL;
123     x_flexfield_ln_rec.attribute6 := NULL;
124     x_flexfield_ln_rec.attribute7 := NULL;
125     x_flexfield_ln_rec.attribute8 := NULL;
126     x_flexfield_ln_rec.attribute9 := NULL;
127     x_flexfield_ln_rec.attribute10 := NULL;
128     x_flexfield_ln_rec.attribute11 := NULL;
129     x_flexfield_ln_rec.attribute12 := NULL;
130     x_flexfield_ln_rec.attribute13 := NULL;
131     x_flexfield_ln_rec.attribute14 := NULL;
132     x_flexfield_ln_rec.attribute15 := NULL;
133 
134 END Get_SimulFlexFields;
135 
136 -- Bug #9279355
137 -- Utility name : Get_SimulShipNum
138 -- Type       : Public
139 -- Function   : Get Shipment Number for the Simulated Shipment
140 -- Pre-reqs   : None
141 -- Parameters :
142 -- IN         :   p_simulation_rec IN INL_SIMULATION_PVT.simulation_rec,
143 --                p_document_number IN VARCHAR2,
144 --                p_organization_id IN NUMBER
145 --                p_sequence IN NUMBER
146 --
147 -- OUT            x_ship_num OUT VARCHAR2
148 --                x_return_status OUT NOCOPY VARCHAR2
149 --
150 -- Version    : Current version 1.0
151 --
152 -- Notes      :
153 PROCEDURE Get_SimulShipNum(p_simulation_rec IN INL_SIMULATION_PVT.simulation_rec,
154                            p_document_number IN VARCHAR2,
155                            p_organization_id IN NUMBER,
156                            p_sequence IN NUMBER,
157                            x_ship_num OUT NOCOPY VARCHAR2,
158                            x_return_status OUT NOCOPY VARCHAR2) IS
159 
160   l_po_lookup_code VARCHAR2(25);
161   l_ship_num_prefix VARCHAR2(3); -- Bug 14280113
162   l_release_num NUMBER;          -- Bug 14280113
163 
164 BEGIN
165     IF p_simulation_rec.parent_table_name = 'PO_HEADERS' THEN
166 
167         x_ship_num := 'P'||'O'||'.' || p_document_number || '.' || p_simulation_rec.parent_table_revision_num ||
168                       '.' || p_simulation_rec.version_num || '.' || p_sequence;
169 
170     ELSIF p_simulation_rec.parent_table_name = 'PO_RELEASES' THEN -- Bug 14280113
171 
172        SELECT ph.type_lookup_code, pr.release_num
173        INTO l_po_lookup_code, l_release_num
174        FROM po_headers_all ph,
175             po_releases_all pr
176        WHERE ph.po_header_id = pr.po_header_id
177        AND pr.po_release_id = p_simulation_rec.parent_table_id;
178 
179        IF l_po_lookup_code = 'PLANNED' THEN
180          l_ship_num_prefix := 'PPO';
181        ELSIF l_po_lookup_code = 'BLANKET' THEN
182           l_ship_num_prefix := 'BPA';
183        END IF;
184 
185        x_ship_num := l_ship_num_prefix ||'.' || p_document_number || '.' || l_release_num || '.' ||
186                      p_simulation_rec.parent_table_revision_num || '.' || p_simulation_rec.version_num || '.' || p_sequence;
187 
188     ELSE
189         x_ship_num := TO_NUMBER(TO_CHAR(SYSDATE,'YYMMDDHHMISS'));
190     END IF;
191 
192 --- Customize here, if needed:
193 --- x_ship_num := shipment number according to custom logic. Should not exceed 25 characters.
194 
195 END Get_SimulShipNum;
196 
197 END INL_CUSTOM_PUB;