1 PACKAGE JL_AR_AP_WITHHOLDING_PKG AUTHID CURRENT_USER AS
2 /* $Header: jlarpwhs.pls 120.6 2005/08/25 23:57:01 rguerrer ship $ */
3
4
5
6 /**************************************************************************
7 * Constants Definition *
8 **************************************************************************/
9
10 AWT_SUCCESS CONSTANT Varchar2(10) := Jl_Zz_Ap_Withholding_Pkg.AWT_SUCCESS;
11 AWT_ERROR CONSTANT Varchar2(10) := Jl_Zz_Ap_Withholding_Pkg.AWT_ERROR;
12 DUMMY_INVOICE_ID CONSTANT Number := -1;
13
14
15
16 /**************************************************************************
17 * Records and Tables Definition *
18 **************************************************************************/
19
20
21 TYPE Rec_Payment_Withholding IS RECORD
22 (
23 awt_type_code Varchar2(30),
24 tax_id Number,
25 invoice_id Number,
26 vendor_id Number,
27 invoice_distribution_id Number, -- Lines
28 invoice_amount Number,
29 line_amount Number,
30 payment_amount Number,
31 invoice_payment_id Number,
32 payment_num Number,
33 tax_base_amount_basis Varchar2(30)
34 );
35
36 TYPE Rec_Invoice_Amount IS RECORD
37 (
38 invoice_id Number,
39 invoice_distribution_id Number, -- Lines
40 invoice_amount Number,
41 amount Number,
42 tax_inclusive_amount Number,
43 payment_amount Number,
44 taxable_base_amount Number,
45 prorated_tax_incl_amt Number,
46 invoice_payment_id Number,
47 invoice_payment_num Number);
48
49 TYPE Tab_Amounts IS TABLE OF Rec_Invoice_Amount
50 INDEX BY BINARY_INTEGER;
51
52
53
54
55 /**************************************************************************
56 * Public Procedures Definition *
57 **************************************************************************/
58
59
60 /**************************************************************************
61 * *
62 * Name : Jl_Ar_Ap_Do_Withholding *
63 * Purpose : This is the main Argentine withholding tax calculation *
64 * routine. This procedure can be divided into three *
65 * processing units (just like the core calculation routine) *
66 * 1. Create Temporary Distribution Lines *
67 * 2. Create AWT Distribution Lines *
68 * 3. Create AWT Invoices *
69 * *
70 **************************************************************************/
71 PROCEDURE Jl_Ar_Ap_Do_Withholding
72 (P_Invoice_Id IN Number,
73 P_Awt_Date IN Date,
74 P_Calling_Module IN Varchar2,
75 P_Amount IN Number,
76 P_Payment_Num IN Number Default null,
77 P_Checkrun_Name IN Varchar2 Default null,
78 p_Checkrun_id IN Number Default null,
79 P_Last_Updated_By IN Number,
80 P_Last_Update_Login IN Number,
81 P_Program_Application_Id IN Number Default null,
82 P_Program_Id IN Number Default null,
83 P_Request_Id IN Number Default null,
84 P_Awt_Success OUT NOCOPY Varchar2,
85 P_Invoice_Payment_Id IN Number Default null,
86 P_Check_Id IN Number Default null);
87
88
89
90
91 /**************************************************************************
92 * *
93 * Name : Jl_Ar_Ap_Undo_Withholding *
94 * Purpose : Routine to reverse withholding taxes which were *
95 * calculated by the Argentine withholding tax calculation *
96 * routine (Jl_Ar_Ap_Do_Withholding). *
97 * Most of the withholding tax figures will be reversed by *
98 * the core procedures. This routine will only reverse *
99 * credit letter amounts and withholding certificates. *
100 * *
101 **************************************************************************/
102 PROCEDURE Jl_Ar_Ap_Undo_Withholding
103 (P_Parent_Id IN Number,
104 P_Calling_Module IN Varchar2,
105 P_Undo_Awt_Date IN Date,
106 P_Last_Updated_By IN Number,
107 P_Last_Update_Login IN Number,
108 P_Program_Application_Id IN Number Default null,
109 P_Program_Id IN Number Default null,
110 P_Request_Id IN Number Default null);
111
112
113 /**************************************************************************
114 * *
115 * Name : Jl_Ar_Ap_Void_Selec_Cetif *
116 * Purpose : Routine to Void the Certificates corresponding to cancel *
117 * payments *
118 * Created for bug 2145634 *
119 * *
120 **************************************************************************/
121
122 /* Removed to Cancel of payments in new process has not generated
123 certificates.
124
125 PROCEDURE JL_AR_AP_VOID_SELEC_CERTIF(
126 p_checkrun_Name IN Varchar2,
127 p_selected_check_id IN Number,
128 P_Calling_Sequence IN Varchar2);
129 */
130
131 /**************************************************************************
132 * *
133 * Name : Jl_Ar_Ap_Undo_Temp_Withholding *
134 * Purpose : Routine to reverse temporary withholding taxes which were *
135 * calculated by the Argentine withholding tax calculation *
136 * routine (Jl_Ar_Ap_Do_Withholding). *
137 * Most of the withholding tax figures will be reversed by *
138 * the core procedures. This routine will only reverse *
139 * credit letter amounts. *
140 * *
141 **************************************************************************/
142 PROCEDURE Jl_Ar_Ap_Undo_Temp_Withholding
143 (P_Invoice_Id IN Number,
144 P_Payment_Num IN Number,
145 P_Checkrun_Name IN Varchar2,
146 P_Checkrun_Id IN Number,
147 P_Undo_Awt_Date IN Date,
148 P_Calling_Module IN Varchar2,
149 P_Last_Updated_By IN Number,
150 P_Last_Update_Login IN Number,
151 P_Program_Application_Id IN Number Default null,
152 P_Program_Id IN Number Default null,
153 P_Request_Id IN Number Default null);
154
155
156
157
158 /**************************************************************************
159 * New release 12.0 procedure *
160 * Name : Jl_Ar_Ap_Certificates *
161 * Purpose : Handles creation and void of withholding certificates *
162 * for a particular payment. *
163 * *
164 **************************************************************************/
165 PROCEDURE Jl_Ar_Ap_Certificates
166 ( p_payment_instruction_ID IN NUMBER,
167 p_calling_module IN VARCHAR2,
168 p_api_version IN NUMBER,
169 p_init_msg_list IN VARCHAR2 ,
170 p_commit IN VARCHAR2,
171 x_return_status OUT NOCOPY VARCHAR2,
172 x_msg_count OUT NOCOPY NUMBER,
173 x_msg_data OUT NOCOPY VARCHAR2);
174
175 /**************************************************************************
176 * *
177 * Name : JL_CALL_DO_AWT *
178 * Purpose : Bug# 1428033 The reason of this procedure is: *
179 * One store procedure cannot be call from a form and *
180 * at the same time from the library in a single apps *
181 * session. *
182 * *
183 **************************************************************************/
184 PROCEDURE JL_CALL_DO_AWT
185 (P_Invoice_Id IN number
186 ,P_Awt_Date IN date
187 ,P_Calling_Module IN varchar2
188 ,P_Amount IN number
189 ,P_Payment_Num IN number
190 default null
191 ,P_Checkrun_Name IN varchar2
192 default null
193 ,P_Last_Updated_By IN number
194 ,P_Last_Update_Login IN number
195 ,P_Program_Application_Id IN number
196 default null
197 ,P_Program_Id IN number
198 default null
199 ,P_Request_Id IN number
200 default null
201 ,P_Awt_Success OUT NOCOPY varchar2
202 ,P_Invoice_Payment_Id IN number
203 default null
204 ,P_Check_Id IN number
205 );
206
207
208 -- Bug 2722425
209 /**************************************************************************
210 * *
211 * Name : Undo_Quick_Payment *
212 * Purpose : Updates the payment amount by adding the withheld *
213 * amount. *
214 * *
215 **************************************************************************/
216 PROCEDURE Undo_Quick_Payment
217 (P_Check_Id IN Number,
218 P_Old_Check_Id IN Number,
219 P_Calling_Sequence IN Varchar2);
220
221 END JL_AR_AP_WITHHOLDING_PKG;