1 PACKAGE AP_EXTENDED_WITHHOLDING_PKG AUTHID CURRENT_USER AS
2 /* $Header: apexawts.pls 120.6 2005/10/25 22:07:30 dbetanco noship $ */
3
4
5 /**************************************************************************
6 * Constants *
7 **************************************************************************/
8
9 TRUE_VALUE CONSTANT NUMBER := 1;
10 FALSE_VALUE CONSTANT NUMBER := 0;
11
12
13
14 /**************************************************************************
15 * *
16 * Name : Ap_Do_Extended_Withholding *
17 * Purpose : This is a dummy procedure which will verify whether the *
18 * Regional Extended Package is installed (JG_EXTENDED_ *
19 * WITHHOLDING_PKG). If installed, then the Extended *
20 * Withholding Routine will be executed dynamically. *
21 * *
22 **************************************************************************/
23 PROCEDURE Ap_Do_Extended_Withholding
24 (P_Invoice_Id IN Number,
25 P_Awt_Date IN Date,
26 P_Calling_Module IN Varchar2,
27 P_Amount IN Number,
28 P_Payment_Num IN Number Default null,
29 P_Checkrun_Name IN Varchar2 Default null,
30 P_Last_Updated_By IN Number,
31 P_Last_Update_Login IN Number,
32 P_Program_Application_Id IN Number Default null,
33 P_Program_Id IN Number Default null,
34 P_Request_Id IN Number Default null,
35 P_Awt_Success OUT NOCOPY Varchar2,
36 P_Invoice_Payment_Id IN Number Default null,
37 P_Check_Id IN Number Default null,
38 p_checkrun_id in number default null);
39
40
41
42
43 /**************************************************************************
44 * *
45 * Name : Ap_Undo_Extended_Withholding *
46 * Purpose : This is a dummy procedure which will verify whether the *
47 * Regional Extended Package is installed (JG_EXTENDED_ *
48 * WITHHOLDING_PKG). If installed, then the Extended *
49 * Withholding Routine (for reversion) will be executed *
50 * dynamically. *
51 * *
52 **************************************************************************/
53 PROCEDURE Ap_Undo_Extended_Withholding
54 (P_Parent_Id IN Number,
55 P_Calling_Module IN Varchar2,
56 P_Awt_Date IN Date,
57 P_New_Invoice_Payment_Id IN Number Default null,
58 P_Last_Updated_By IN Number,
59 P_Last_Update_Login IN Number,
60 P_Program_Application_Id IN Number Default null,
61 P_Program_Id IN Number Default null,
62 P_Request_Id IN Number Default null,
63 P_Awt_Success OUT NOCOPY Varchar2 ,
64 P_Dist_Line_No IN Number Default null,
65 P_New_Invoice_Id IN Number Default null,
66 P_New_Dist_Line_No IN Number Default null);
67
68
69
70
71 /**************************************************************************
72 * *
73 * Name : Ap_Undo_Temp_Ext_Withholding *
74 * Purpose : This is a dummy procedure which will verify whether the *
75 * Regional Extended Package is installed (JG_EXTENDED_ *
76 * WITHHOLDING_PKG). If installed, then the Extended *
77 * Withholding Routine to reverse the temporary withholding *
78 * distribution lines will be executed dynamically. *
79 * *
80 **************************************************************************/
81 PROCEDURE Ap_Undo_Temp_Ext_Withholding
82 (P_Invoice_Id IN Number,
83 P_Vendor_Id IN Number Default null,
84 P_Payment_Num IN Number,
85 P_Checkrun_Name IN Varchar2,
86 P_Undo_Awt_Date IN Date,
87 P_Calling_Module IN Varchar2,
88 P_Last_Updated_By IN Number,
89 P_Last_Update_Login IN Number,
90 P_Program_Application_Id IN Number Default null,
91 P_Program_Id IN Number Default null,
92 P_Request_Id IN Number Default null,
93 P_Awt_Success OUT NOCOPY Varchar2,
94 p_checkrun_id in number default null);
95
96
97
98
99 /**************************************************************************
100 * *
101 * Name : Ap_Ext_Withholding_Default *
102 * Purpose : This is a dummy procedure which will verify whether the *
103 * Regional Extended Package is installed (JG_EXTENDED_ *
104 * WITHHOLDING_PKG). If installed, then the routine to *
105 * default withholding information will be executed *
106 * dynamically. *
107 * *
108 **************************************************************************/
109 PROCEDURE Ap_Ext_Withholding_Default
110 (P_Invoice_Id IN Number,
111 P_Inv_Line_Num IN Number, --Bug 4554163
112 P_Inv_Dist_Id IN ap_invoice_distributions_all.invoice_distribution_id%TYPE,
113 P_Calling_Module IN Varchar2, --Bug 4554163
114 P_Parent_Dist_ID IN Number,
115 P_Awt_Success OUT NOCOPY Varchar2);
116
117 /**************************************************************************
118 * *
119 * Name : Ap_Extended_Match *
120 * Purpose : This is a dummy procedure which will verify whether the *
121 * Regional Extended Package is installed (JG_EXTENDED_ *
122 * WITHHOLDING_PKG). If installed, then the Extended *
123 * Matching Routine will be executed dynamically. *
124 * *
125 **************************************************************************/
126 PROCEDURE Ap_Extended_Match
127 (P_Credit_Id IN Number,
128 P_Invoice_Id IN Number Default null,
129 P_Inv_Line_Num IN Number Default null, --Bug 4554163
130 P_Distribution_id IN Number Default null,
131 P_Parent_Dist_ID IN Number Default null);
132
133
134
135 /**************************************************************************
136 * *
137 * Name : Ap_Extended_Insert_Dist *
138 * Purpose : This is a dummy procedure which will verify whether the *
139 * Regional Extended Package is installed (JG_EXTENDED_ *
140 * WITHHOLDING_PKG). If installed, then the routine to *
141 * insert distribution lines will be executed dynamically. *
142 * *
143 **************************************************************************/
144 PROCEDURE Ap_Extended_Insert_Dist
145 (P_Invoice_Id IN Number,
146 P_Invoice_Distribution_id IN Number, -- Add new Column
147 P_Distribution_Line_Number IN Number,
148 P_Line_Type IN Varchar2,
149 P_GL_Date IN Date,
150 P_Period_Name IN Varchar2,
151 P_Type_1099 IN Varchar2,
152 P_Income_Tax_Region IN Varchar2,
153 P_Amount IN Number,
154 P_Tax_Code_ID IN Number, -- Add new Column
155 P_Code_Combination_Id IN Number,
156 P_PA_Quantity IN Number,
157 P_Description IN Varchar2,
158 P_tax_recoverable_flag IN Varchar2, -- Add new Column
159 P_tax_recovery_rate IN Number, -- Add new Column
160 P_tax_code_override_flag IN Varchar2, -- Add new Column
161 P_tax_recovery_override_flag IN Varchar2, -- Add new Column
162 P_po_distribution_id IN Number, -- Add new Column
163 P_Attribute_Category IN Varchar2,
164 P_Attribute1 IN Varchar2,
165 P_Attribute2 IN Varchar2,
166 P_Attribute3 IN Varchar2,
167 P_Attribute4 IN Varchar2,
168 P_Attribute5 IN Varchar2,
169 P_Attribute6 IN Varchar2,
170 P_Attribute7 IN Varchar2,
171 P_Attribute8 IN Varchar2,
172 P_Attribute9 IN Varchar2,
173 P_Attribute10 IN Varchar2,
174 P_Attribute11 IN Varchar2,
175 P_Attribute12 IN Varchar2,
176 P_Attribute13 IN Varchar2,
177 P_Attribute14 IN Varchar2,
178 P_Attribute15 IN Varchar2,
179 P_Calling_Sequence IN Varchar2);
180
181
182
183
184 /**************************************************************************
185 * *
186 * Name : Ap_Extended_Withholding_Active *
187 * Purpose : This function checks whether the extended withholding *
188 * calculation routine will be called, depending on the *
189 * value of the "JG: Extended AWT Calculation" profile *
190 * option. The values returned by this function can be: *
191 * - TRUE: If the "JG: Extended AWT Calculation" profile *
192 * option exists and is set to 'Yes'. *
193 * - FALSE: If the "JG: Extended AWT Calculation" profile *
194 * option does not exist, or is set to 'No', or *
195 * is null. *
196 * *
197 **************************************************************************/
198 FUNCTION Ap_Extended_Withholding_Active RETURN Boolean;
199 PRAGMA Restrict_References(Ap_Extended_Withholding_Active, WNDS);
200
201
202
203
204 /**************************************************************************
205 * *
206 * Name : Ap_Extended_Withholding_Option *
207 * Purpose : This function returns the value of the "JG: Extended AWT *
208 * Calculation" profile option. They can be: *
209 * - 'Y': If the "JG: Extended AWT Calculation" profile *
210 * option exists and is set to 'Yes'. *
211 * - 'N': If the "JG: Extended AWT Calculation" profile *
212 * option does not exist, or is set to 'No', or *
213 * is null. *
214 * *
215 **************************************************************************/
216 FUNCTION Ap_Extended_Withholding_Option RETURN Varchar2;
217 PRAGMA Restrict_References(Ap_Extended_Withholding_Option, WNDS);
218
219
220 /**************************************************************************
221 * *
222 * Name : Ap_Ext_Withholding_Prepay *
223 * Purpose : Extended Routine for carry over the withholdings from *
224 * Prepayment invoice Item line to Invoice Prepay Line. *
225 * *
226 **************************************************************************/
227 PROCEDURE Ap_Ext_Withholding_Prepay
228 (P_prepay_dist_id IN Number,
229 P_invoice_id IN Number,
230 P_inv_dist_id IN Number, --Bug 4554163
231 P_user_id IN Number,
232 P_last_update_login IN Number,
233 P_calling_sequence IN Varchar2);
234
235 /**************************************************************************
236 * *
237 * Name : Check_With_Dis *
238 * Purpose : Extended Routine to validate whether a Withholding Tax *
239 * Code has been calculated or not for a given invoice *
240 * distribution line. *
241 * *
242 **************************************************************************/
243 FUNCTION Check_With_Dis
244 (P_Invoice_Distribution_Id ap_invoice_distributions.invoice_distribution_id%TYPE
245 ,P_Tax_Name ap_tax_codes.name%TYPE
246 ,P_Global_Attribute2 ap_invoice_distributions.global_attribute2%TYPE
247 ,P_Global_Attribute3 ap_invoice_distributions.global_attribute3%TYPE
248 ) return Varchar2;
249
250 END AP_EXTENDED_WITHHOLDING_PKG;