DBA Data[Home] [Help]

PACKAGE BODY: APPS.AP_CUSTOM_WITHHOLDING_PKG

Source


1 package body AP_CUSTOM_WITHHOLDING_PKG as
2 /* $Header: apcmawtb.pls 120.8.12020000.4 2013/03/28 14:35:43 tjbhatt ship $ */
3                                                                           --
4 function Ap_Special_Rate (
5                           P_Tax_Name    IN varchar2
6                          ,P_Invoice_Id  IN number
7                          ,P_Payment_Num IN number
8                          ,P_Awt_Date    IN date
9                          ,P_Amount      IN number
10                          )
11                          return number
12 is
13 
14 l_special_rate number := null;		--bug16563023
15 
16 BEGIN
17 
18 -- IMPORTANT: This section is reserved for Globalization features.
19 --            Please do not modify code here.
20 
21 -- BUG 7232736 replaced sys_context with g_zz_shared_pkg.get_product
22 
23 -- IF sys_context('JG','JGZZ_PRODUCT_CODE') is not null THEN
24 IF jg_zz_shared_pkg.get_product(AP_CALC_WITHHOLDING_PKG.g_org_id, NULL) is not null THEN
25     l_special_rate := JG_WITHHOLDING_TAX_PKG.Get_Rate_Id(			--bug16563023
26                           		       P_Tax_Name
27                          		      ,P_Invoice_Id
28                          		      ,P_Payment_Num
29                          		      ,P_Awt_Date
30                         		      ,P_Amount
31 					     );
32   END IF;
33 
34 
35 
36 --bug13334982
37 --bug16563023
38 if l_special_rate is not null then
39 	return l_special_rate;
40 else
41 	return(AP_CUSTOM_WITHHOLDING_HOOK_PKG.Ap_Special_Rate(
42                                                P_Tax_Name
43                          		      ,P_Invoice_Id
44                          		      ,P_Payment_Num
45                          		      ,P_Awt_Date
46                         		      ,P_Amount
47 					     ));
48 end if;
49 
50 
51 
52 END Ap_Special_Rate;
53 
54 				   --
55 procedure Ap_Special_Rounding (P_Checkrun_Name IN varchar2)
56 is
57 --l_org_id           NUMBER(15); -- BUG 7232736
58 
59 BEGIN
60 -- BUG 7232736 : added select ot get the Org_id using checkrun_id (p_checkrun_name)
61 -- select org_id into l_org_id
62 -- from ap_checks_all
63 -- where checkrun_id = P_Checkrun_Name;
64 
65 
66 
67 -- IMPORTANT: This section is reserved for Globalization features.
68 --            Please do not modify code here.
69 
70 --  BUG 7232736 replaced sys_context with g_zz_shared_pkg.get_product/reverted to Orginal  code.
71    IF sys_context('JG','JGZZ_PRODUCT_CODE') is not null THEN
72 -- IF jg_zz_shared_pkg.get_product(l_org_id, NULL) is not null THEN
73     JG_WITHHOLDING_TAX_PKG.AWT_Rounding(
74                           		P_Checkrun_Name
75 				       );
76   END IF;
77 
78 
79 --bug13334982
80 AP_CUSTOM_WITHHOLDING_HOOK_PKG.Ap_Special_Rounding
81                                      (P_Checkrun_Name
82                                       );
83 
84 
85 END Ap_Special_Rounding;
86 
87 /*****************************************************************
88  Procedure: Ap_Special_Withheld_Amt
89  Objective: This procedure enable globalization to make some
90             adjusments in the withheld amount, for example
91             rounding.  This procedure is called from
92             AP_CALC_WITHHOLDING_PKG.Insert_Temp_Distribution
93  ******************************************************************/
94 
95 procedure Ap_Special_Withheld_Amt
96                 (
97                  P_Withheld_Amount        IN OUT NOCOPY Number
98                 ,P_Base_WT_amount         IN OUT NOCOPY Number
99                 ,P_CurrCode               IN Varchar2
100                 ,P_BaseCurrCode           IN Varchar2
101                 ,P_Invoice_exchange_rate  IN Number
102                 ,P_Tax_Name               IN Varchar2
103                 ,P_Calling_sequence       IN Varchar2
104                 ,P_Unrounded_WT_Amount    IN Number     DEFAULT NULL --bug 10262174
105                 ,P_Calling_parameter      IN Varchar2   DEFAULT NULL --bug 14271407
106                  )
107 is
108 
109 BEGIN
110 
111 -- IMPORTANT: This section is reserved for Globalization features.
112 --            Please do not modify code here.
113 -- BUG 7232736 replaced sys_context with g_zz_shared_pkg.get_product
114 -- Uncommented the call to JG_WITHHOLDING_TAX_PKG.JG_Special_Withheld_Amt
115 
116 -- IF sys_context('JG','JGZZ_PRODUCT_CODE') is not null THEN
117 IF jg_zz_shared_pkg.get_product(AP_CALC_WITHHOLDING_PKG.g_org_id, NULL) is not null THEN
118     JG_WITHHOLDING_TAX_PKG.JG_Special_Withheld_Amt
119                                      (P_Withheld_Amount
120                                      ,P_Base_WT_amount
121                                      ,P_CurrCode
122                                      ,P_BaseCurrCode
123                                      ,P_Invoice_exchange_rate
124                                      ,P_Tax_Name
125                                      ,P_Calling_sequence
126                                      );
127     NULL;
128 
129   END IF;
130 
131 
132 --bug13334982
133 AP_CUSTOM_WITHHOLDING_HOOK_PKG.Ap_Special_Withheld_Amt
134                                      (P_Withheld_Amount
135                 ,P_Base_WT_amount
136                 ,P_CurrCode
137                 ,P_BaseCurrCode
138                 ,P_Invoice_exchange_rate
139                 ,P_Tax_Name
140                 ,P_Calling_sequence
141                 ,P_Unrounded_WT_Amount
142                 ,P_Calling_parameter
143                                       );
144 
145 
146 
147 END Ap_Special_Withheld_Amt;
148 
149 end AP_CUSTOM_WITHHOLDING_PKG;