1 PACKAGE ARP_BALANCE_CHECK AUTHID CURRENT_USER AS
2 /* $Header: ARBALCHS.pls 120.4.12020000.2 2012/08/08 09:24:23 ankuagar ship $ */
3
4 out_of_balance EXCEPTION;
5 amount_mismatch EXCEPTION;
6 P_ps_rec ar_payment_schedules%ROWTYPE;
7 P_ps_rec_pmt ar_payment_schedules%ROWTYPE;
8 P_reg_cm VARCHAR(2) default 'N';
9
10 TYPE unbalanced_receipt IS RECORD (
11 cash_receipt_id NUMBER,
12 message_code VARCHAR2(100)
13 );
14
15 TYPE unbalanced_receipts IS TABLE OF unbalanced_receipt
16 INDEX BY BINARY_INTEGER;
17
18 /* =======================================================================
19 | PROCEDURE Check_Transaction_Balance
20 |
21 | DESCRIPTION
22 | This procedure takes sum of debits and credits for transactions
23 | and tallies that debits equal credits, if not then it sets a
24 | message on the message stack indicating that items are out of
25 | balance.
26 |
27 | PARAMETERS
28 | p_customer_trx_id IN Cash receipt id
29 | p_called_from_api IN Y-api call out
30 * ======================================================================*/
31 PROCEDURE CHECK_TRANSACTION_BALANCE(p_customer_trx_id IN VARCHAR2,
32 p_called_from_api IN VARCHAR2 default 'N');
33
34 /* =======================================================================
35 | PROCEDURE Check_Recp_Balance
36 |
37 | DESCRIPTION
38 | This procedure takes sum of debits and credits for receipts and
39 | adjustments including discounts and tallies that debits equal
40 | credits, if not then it sets a message on the message stack
41 | indicating that items are out of balance.
42 |
43 | PARAMETERS
44 | p_cr_id IN Cash receipt id
45 | p_request_id IN Request id
46 | p_called_from_api IN Y-api call out
47 * ======================================================================*/
48 PROCEDURE CHECK_RECP_BALANCE(
49 p_cr_id IN NUMBER,
50 p_request_id IN NUMBER,
51 p_called_from_api IN VARCHAR2 default 'N');
52
53 /* =======================================================================
54 | PROCEDURE Check_Recp_Balance_Bulk
55 |
56 | DESCRIPTION
57 | This procedure takes sum of debits and credits for receipts
58 | including discounts and tallies that debits equal credits, if
59 | not then it sets a message on the message stack indicating that
60 | items are out of balance.
61 |
62 | PARAMETERS
63 | p_cr_id_low IN Cash Receipt Id Low.
64 | p_cr_id_high IN Cash Receipt Id High.
65 | p_unbalanced_cr_tbl OUT NOCOPY Unbalanced CR Id's.
66 * ======================================================================*/
67 PROCEDURE CHECK_RECP_BALANCE_BULK(
68 p_cr_id_low IN NUMBER,
69 p_cr_id_high IN NUMBER,
70 p_unbalanced_cr_tbl OUT NOCOPY unbalanced_receipts);
71
72 /* =======================================================================
73 | PROCEDURE Check_Adj_Balance
74 |
75 | DESCRIPTION
76 | This procedure takes sum of debits and credits for adjustments
77 | tallies that debits equal credits, if not then it sets a message
78 | on the message stack indicating that items are out of balance.
79 |
80 | PARAMETERS
81 | p_adj_id IN Adjustment id
82 | p_request_id IN Request id
83 | p_called_from_api IN Y-api call out
84 * ======================================================================*/
85 PROCEDURE CHECK_ADJ_BALANCE(
86 p_adj_id IN NUMBER,
87 p_request_id IN NUMBER,
88 p_called_from_api IN VARCHAR2 default 'N');
89
90 /* =======================================================================
91 | PROCEDURE Check_Appln_Balance
92 |
93 | DESCRIPTION
94 | This procedure takes sum of debits and credits for CM Applications
95 | tallies that debits equal credits, if not then it sets a message
96 | on the message stack indicating that items are out of balance.
97 |
98 | PARAMETERS
99 | p_receivable_application_id IN Receivable Application ID
100 | p_request_id IN Request id
101 | p_called_from_api IN Y-api call out
102 * ======================================================================*/
103 PROCEDURE CHECK_APPLN_BALANCE(
104 p_receivable_application_id IN NUMBER,
105 p_request_id IN NUMBER,
106 p_called_from_api IN VARCHAR2 default 'N');
107
108 /* =======================================================================
109 | PROCEDURE Check_Appln_Balance
110 |
111 | DESCRIPTION
112 | This procedure takes sum of debits and credits for Receipt Applications
113 | tallies that debits equal credits, if not then it sets a message
114 | on the message stack indicating that items are out of balance.
115 |
116 | PARAMETERS
117 | p_receivable_application_id1 IN Receivable Application ID
118 | p_receivable_application_id2 IN Receivable Application ID of the pair
119 | p_request_id IN Request id
120 | p_called_from_api IN Y-api call out
121 * ======================================================================*/
122 PROCEDURE CHECK_APPLN_BALANCE(
123 p_receivable_application_id1 IN NUMBER,
124 p_receivable_application_id2 IN NUMBER,
125 p_request_id IN NUMBER,
126 p_called_from_api IN VARCHAR2 default 'N');
127 /* =======================================================================
128 | PROCEDURE Check_Ps_Date
129 |
130 | DESCRIPTION
131 | This Procedure checks if the gl_date_closed and actual_date_closed
132 | are stamped correctly in ar_payment_schedules when the payment schedule
133 | is closed. It returns the correct values which can can then be sent to the
134 | Fix_Ps_Date procedure to correct the data corruption
135 | PARAMETERS
136 | p_ps_id IN Payment Schedule id
137 | p_corrupt_type OUT Corruption Type
138 | p_gl_date_closed OUT New Value for GL Closed Date
139 | p_actual_date_closed OUT New Value for Actual Closed Date
140 * ======================================================================*/
141 PROCEDURE CHECK_PS_DATE(
142 p_ps_rec IN ar_payment_schedules%ROWTYPE,
143 p_corrupt_type OUT NOCOPY VARCHAR2,
144 p_gl_date_closed OUT NOCOPY DATE,
145 p_actual_date_closed OUT NOCOPY DATE);
146
147 /* =======================================================================
148 | PROCEDURE Fix_Ps_Date
149 |
150 | DESCRIPTION
151 | This procedure corrects the data for the fields gl_date_closed and actual_date_closed
152 | in ar_payment_schedules. The correct values need to be fetched from the procedure
153 | CHECK_PS_DATE
154 |
155 | PARAMETERS
156 | p_ps_id IN Payment Schedule id
157 | p_corrupt_type IN Corruption Type
158 | p_gl_date_closed IN New Value for GL Closed Date
159 | p_actual_date_closed IN New Value for Actual Closed Date
160 * ======================================================================*/
161 PROCEDURE FIX_PS_DATE( p_ps_id IN NUMBER,
162 p_corrupt_type IN VARCHAR2,
163 p_gl_date_closed IN DATE,
164 p_actual_date_closed IN DATE);
165
166 /* =======================================================================
167 | PROCEDURE Check_Precision
168 |
169 | DESCRIPTION
170 | Check the precision of the amount passed with its functional currency
171 | precision. If precision do not match then return TRUE else FALSE.
172 | PARAMETERS
173 | p_amount IN NUMBER
174 * ======================================================================*/
175 FUNCTION Check_Precision( p_amount IN NUMBER )
176 RETURN BOOLEAN;
177
178 /* =======================================================================
179 | PROCEDURE Check_Line_Level_Transaction_Balance
180 |
181 | DESCRIPTION
182 |
183 | PARAMETERS
184 | p_customer_trx_id IN Customer Trx id
185 | p_called_from_api IN Y-api call out
186 * ======================================================================*/
187 PROCEDURE CHECK_LL_TRANSACTION_BALANCE(p_customer_trx_id IN VARCHAR2,
188 p_called_from_api IN VARCHAR2 default 'N');
189
190 END ARP_BALANCE_CHECK;
191