1 PACKAGE jai_boe_general_pkg AUTHID CURRENT_USER AS
2 /* $Header: jai_boe_general.pls 120.6 2011/06/09 11:36:06 qioliu noship $ */
3
4 /* ===============================================
5 -- PROGRAM NAME:
6 -- JAI_BOE_GENERAL_PKG
7 -- DESCRIPTION:
8 -- General package for BOE common used functions or procedures
9 -- HISTORY:
10 -- 1.00 21-DEC-2010 Wenqiong Zhou Creation
11 --
12 -- ==============================================*/
13
14 /* ===============================================
15 -- FUNCTION NAME:
16 -- get_boe_accounting
17 -- DESCRIPTION:
18
19 -- Get the ccid, firstly get ccid by organization + location + taxtype/taxcode+regime ,
20 -- secondly get ccid by regime.
21 -- HISTORY:
22 -- 1.00 21-Dec-2010 Wenqiong Zhou Creation
23 * ================================================*/
24 FUNCTION get_boe_accounting(pv_tax_type_code IN VARCHAR2
25 ,pv_account_type IN VARCHAR2
26 ,pn_organization_id IN NUMBER
27 ,pn_location_id IN NUMBER) RETURN NUMBER;
28
29 /* ===============================================
30 -- FUNCTION NAME:
31 -- get_depb_account
32 -- DESCRIPTION:
33
34 -- Get the DEPB account id
35 -- HISTORY:
36 -- 1.00 21-Dec-2010 Wenqiong Zhou Creation
37 * ================================================*/
38 FUNCTION get_depb_account
39 RETURN NUMBER;
40
41
42 --==========================================================================
43 -- PROCEDURE NAME:
44 --
45 -- ap_void_check Public
46 --
47 -- DESCRIPTION:
48 --
49 -- This procedure is written that would check Bill of Entry invoice is applied or not.
50 -- If the BOE invoice is applied, the payment for the invoice will not be voided
51 -- PARAMETERS:
52 -- In: pn_check_id Pass the check id for the payment
53 -- Out: xv_return_code Indicates the return code,
54 -- 'Y': the BOE inovice has been applied
55 -- 'N': the BOE inovice has not been applied
56 -- 'E' : for errors
57 -- xv_return_msg Indicates the return message
58 --
59 --
60 -- DESIGN REFERENCES:
61 --
62 -- CHANGE HISTORY:
63 --
64 --=========================================================================
65
66 PROCEDURE ap_void_check( pn_check_id IN NUMBER
67 , xv_return_code OUT NOCOPY VARCHAR2
68 , xv_return_mesg OUT NOCOPY VARCHAR2
69 );
70
71 --==========================================================================
72 -- PROCEDURE NAME:
73 --
74 -- get_boe_applied_status Public
75 --
76 -- DESCRIPTION:
77 --
78 -- This procedure is written that will get the status of the BOE so that
79 -- judge the BOE invoice if voided or not
80 --
81 -- PARAMETERS:
82 -- In: pn_application_id Identfier of JA product
83 -- In: pv_product_table The product table name for the reference table
84 -- In: pv_reference_key1 reference columns
85 -- In: pv_reference_key2 reference columns
86 -- In: pv_reference_key3 reference columns
87 -- In: pv_reference_key4 reference columns
88 -- In: pv_reference_key5 reference columns
89 -- Out: xv_return_code Indicates the return code,
90 -- 'Y': the BOE inovice has been applied
91 -- 'N': the BOE inovice has not been applied
92 -- 'E' : for errors
93 -- xv_return_msg Indicates the return message
94 --
95 --
96 -- DESIGN REFERENCES:
97 --
98 -- CHANGE HISTORY:
99 --
100 --=========================================================================
101 PROCEDURE get_boe_applied_status( pn_application_id IN NUMBER
102 , pv_product_table IN VARCHAR2
103 , pv_reference_key1 IN VARCHAR2
104 , pv_reference_key2 IN VARCHAR2 DEFAULT NULL
105 , pv_reference_key3 IN VARCHAR2 DEFAULT NULL
106 , pv_reference_key4 IN VARCHAR2 DEFAULT NULL
107 , pv_reference_key5 IN VARCHAR2 DEFAULT NULL
108 , xv_return_code OUT NOCOPY VARCHAR2
109 , xv_return_mesg OUT NOCOPY VARCHAR2
110 );
111
112 --==========================================================================
113 -- FUNCTION NAME:
114 --
115 -- check_boe_payment Public
116 --
117 -- DESCRIPTION:
118 --
119 -- This procedure is written that check the AP invoice is generated by the
120 -- BOE invoice or not
121 --
122 -- PARAMETERS:
123 -- In: pn_check_id Identfier AP payment
124 --
125 -- RETURN VALUE
126 -- 'Y' The payment is generated by BOE invoice payment
127 -- 'N' The payment is NOT generated by BOE invoice payment
128 --
129 -- DESIGN REFERENCES:
130 --
131 -- CHANGE HISTORY:
132 --
133 --=========================================================================
134 FUNCTION check_boe_payment(pn_check_id IN NUMBER)
135 RETURN VARCHAR2;
136
137 --==========================================================================
138 -- FUNCTION NAME:
139 --
140 -- chk_boe_tax Public
141 --
142 -- DESCRIPTION:
143 --
144 -- This function is written that check the tax type of tax belongs to
145 -- BOE or not
146 --
147 -- PARAMETERS:
148 -- In: pv_tax_type tax type
149 --
150 -- RETURN VALUE
151 -- 1 The tax type belongs to BOE Tax type
152 -- 0 The tax type don't belongs to BOE Tax type
153 --
154 -- DESIGN REFERENCES:
155 --
156 -- CHANGE HISTORY:
157 --
158 --=========================================================================
159 FUNCTION chk_boe_tax
160 (
161 pv_tax_type IN VARCHAR2
162 )return number ;
163 --==========================================================================
164 -- PROCEDURE NAME:
165 --
166 -- cancelled_boe Public
167 --
168 -- DESCRIPTION:
169 --
170 -- This procedure update boe table and set related amount to 0 when boe be cancelled
171 -- Should be called by JAINBOEI.fmb,JAI_AP_IA_TRIGGER_PKG
172 --
173 -- PARAMETERS:
174 -- In: pn_boe_id Identifier BOE
175
176 -- OUt:
177 --
178 --
179 -- DESIGN REFERENCES:
180 --
181 --
182 -- CHANGE HISTORY:
183 --
184 -- 09-JUN-2011 Qiong Liu created
185 --==========================================================================
186 PROCEDURE cancelled_boe
187 ( pn_boe_id IN NUMBER
188 );
189 END jai_boe_general_pkg;