[Home] [Help]
PACKAGE: APPS.JAI_GST_GENERAL_PKG
Source
1 PACKAGE JAI_GST_GENERAL_PKG AUTHID CURRENT_USER AS
2 /* $Header: jai_gst_general.pls 120.4 2010/11/02 09:32:16 zhhou noship $ */
3
4 /* ===============================================
5 * PROGRAM NAME:
6 * JAI_GST_GENERAL_PKG
7 * DESCRIPTION:
8 * General package for GST common used functions or procedures
9 * HISTORY:
10 * 1.00 06-AUG-2010 Peng.Zheng Creation
11 *
12 * ==============================================*/
13
14 YES CONSTANT VARCHAR2(1) := 'Y';
15 NO CONSTANT VARCHAR2(1) := 'N';
16
17 INDIAN_CURRENCY CONSTANT VARCHAR2(3) := 'INR';
18
19 --==========================================================================
20 -- FUNCTION NAME:
21 -- IS_GST_ENABLED Public
22 --
23 -- DESCRIPTION:
24 -- Check if gst tax enabled
25 -- Enabled: If there is SGST or CGST regime defined on Regime Registration form.
26 --
27 --
28 -- Return:
29 -- Y: enabled
30 -- N or others: Not enabled
31 --
32 -- ER NAME/BUG#
33 -- GST Enhancement/ bug 10043656
34 --
35 -- PARAMETERS:
36 -- In:
37 --
38 -- DESIGN REFERENCES:
39 -- <<TDD_12_2_FIN_JAI_Enhanced_GST.doc>>
40 --
41 -- CALL FROM
42 --
43 --
44 -- CHANGE HISTORY:
45 -- 1.00 20-Sep-2010 Created by peng.zheng
46 --==========================================================================
47 FUNCTION IS_GST_ENABLED RETURN VARCHAR2;
48
49
50 --==========================================================================
51 -- FUNCTION NAME:
52 -- GET_GST_ASSESSABLE_VALUE Public
53 --
54 -- DESCRIPTION:
55 -- Get gst assable value according customer+customer+site/vendor+vendor_site, item, uom, date
56 -- Base on the logic of function JAI_GENERAL_PKG.JA_IN_VAT_ASSESSABLE_VALUE
57 -- Replace vat_price_list_id with Gst_Assessable_Price in jai_cmn_vendor_sites/jai_cmn_cus_addresses
58 --
59 -- Return:
60 -- Number, the value of gst AV
61 --
62 -- ER NAME/BUG#
63 -- GST Enhancement/ bug 10043656
64 --
65 -- PARAMETERS:
66 -- In: p_party_id Customer_id/vendor_id
67 -- p_party_site_id ship_to_site_use_id when SO(NOT customer_site_id)/vendor_site_id when PO
68 -- p_inventory_item_id Inventory Item
69 -- p_uom_code Uom code of the item
70 -- p_default_price unit price, will be used as GST av if GST setup not found
71 -- p_ass_value_date Price date
72 -- p_party_type C:Customer/V:Vendor
73 --
74 -- DESIGN REFERENCES:
75 -- <<TDD_12_2_FIN_JAI_Enhanced_GST.doc>>
76 --
77 -- CALL FROM
78 --
79 --
80 -- CHANGE HISTORY:
81 -- 1.00 20-Sep-2010 Created by peng.zheng
82 --==========================================================================
83 FUNCTION GET_GST_ASSESSABLE_VALUE(p_party_id IN NUMBER,
84 p_party_site_id IN NUMBER,
85 p_inventory_item_id IN NUMBER,
86 p_uom_code IN VARCHAR2,
87 p_default_price IN NUMBER,
88 p_ass_value_date IN DATE,
89 p_party_type IN VARCHAR2)
90 RETURN NUMBER;
91
92 /* ===============================================
93 * FUNCTION NAME:
94 * GET_ACCOUNT
95 * DESCRIPTION:
96 * Get the ccid for the specific organzation and regime
97 * HISTORY:
98 * 1.00 06-AUG-2010 Bo Li Creation
99 * ================================================*/
100 FUNCTION get_account(
101 p_regime_id IN NUMBER,
102 p_organization_type IN VARCHAR2,
103 p_organization_id IN NUMBER,
104 p_location_id IN NUMBER,
105 p_tax_type IN VARCHAR2,
106 p_account_name IN VARCHAR2
107 ) RETURN NUMBER;
108
109 /* ===============================================
110 * FUNCTION NAME:
111 * GET_REGIME_CODE
112 * DESCRIPTION:
113 * Get the regime code for the specific regime id
114 * HISTORY:
115 * 1.00 06-AUG-2010 Bo Li Creation
116 * ================================================*/
117 FUNCTION get_regime_code(p_regime_id IN NUMBER) RETURN VARCHAR2;
118
119 /* ===============================================
120 * FUNCTION NAME:
121 * GET_REGIME_CODE
122 * DESCRIPTION:
123 * Get the regime id for the specific regime code
124 * HISTORY:
125 * 1.00 06-AUG-2010 Bo Li Creation
126 * ================================================*/
127 FUNCTION get_regime_id(p_regime_code IN VARCHAR2) RETURN NUMBER;
128 /* ===============================================
129 * FUNCTION NAME:
130 * get_tax_code
131 * DESCRIPTION:
132
133 * Get the tax code by tax id
134 * HISTORY:
135 * 1.00 29-Oct-2010 zhiwei Creation
136 * ================================================*/
137 FUNCTION get_tax_code (pn_tax_id IN NUMBER) RETURN VARCHAR2;
138 /* ===============================================
139 * FUNCTION NAME:
140 * get_tax_type_code
141 * DESCRIPTION:
142
143 * Get the tax type code by tax id
144 * HISTORY:
145 * 1.00 29-Oct-2010 zhiwei Creation
146 * ================================================*/
147 FUNCTION get_tax_type_code(pn_tax_id IN NUMBER) RETURN NUMBER;
148 /* ===============================================
149 * FUNCTION NAME:
150 * get_tax_regime_id_by_taxtype
151 * DESCRIPTION:
152
153 * Get the regime id by tax type code
154 * HISTORY:
155 * 1.00 29-Oct-2010 zhiwei Creation
156 * ================================================*/
157 FUNCTION get_tax_regime_id_by_taxtype(pn_tax_type_code IN VARCHAR2) RETURN NUMBER;
158 /* ===============================================
159 * FUNCTION NAME:
160 * get_regim_accounting_parameter
161 * DESCRIPTION:
162
163 * Get the regime setup type by regime id
164 * HISTORY:
165 * 1.00 29-Oct-2010 zhiwei Creation
166 * ================================================*/
167 FUNCTION get_regim_accounting_parameter(pn_regime_id IN NUMBER) RETURN VARCHAR2;
168 /* ===============================================
169 * FUNCTION NAME:
170 * get_gst_accounting
171 * DESCRIPTION:
172
173 * Get the ccid, firstly get ccid by organization + location + taxtype/taxcode+regime , secondly get ccid by regime
174 * HISTORY:
175 * 1.00 29-Oct-2010 zhiwei Creation
176 * ================================================*/
177 FUNCTION get_gst_accounting(
178 pv_account_source IN VARCHAR2,
179 pv_trx_type IN VARCHAR2,
180 pn_tax_regim_id IN NUMBER,
181 pv_tax_type_code IN VARCHAR2,
182 pn_tax_id IN NUMBER,
183 pn_organization_id IN NUMBER,
184 pn_location_id IN NUMBER
185 ) RETURN NUMBER;
186
187 END JAI_GST_GENERAL_PKG;