1 PACKAGE BODY pay_ca_balance_pkg AS
2 /* $Header: pycabals.pkb 120.0.12020000.4 2012/12/21 13:42:01 rgottipa ship $ */
3 /*
4 +======================================================================+
5 | Copyright (c) 1997 Oracle Corporation |
6 | Redwood Shores, California, USA |
7 | All rights reserved. |
8 +======================================================================+
9 Package Body Name : pay_ca_balance_pkg
10 Package File Name : pycabals.pkb
11 Description : This package declares functions which are ....
12 call_ca_balance_get_value
13 get_current_balance
14
15 Change List:
16 ------------
17
18 Name Date Version Bug Text
19 -------------- ---------- ------- ------- ------------------------------
20 RThirlby 23-Oct-98 110.0 Initial Version
21 RThirlby 17-Nov-98 110.1 Added p_jurisdiction_code
22 and removed p_tax_unit.
23 RThirlby 11-Apr-99 110.2 Set default to p_business_group
24 to 0, so that will run if one
25 is not set. Also set p_report_
26 level to ASG for same reason.
27 NB Need Header file aswell,
28 pycabals.pkh v.110.2.
29 MMUKHERJ 12-MAY-99 110.3 1) Called get_defined_balance from
30 Canadian package which takes
31 business_group_id as an additional
32 parameter. 2)Changed the default
33 value of the business_group_id
34 parameter from 0 to NULL. To
35 ensure that set_context does not
36 fail, a local parameter of
37 l_business_group_id has been used.
38 JARTHURT 07-OCT-99 110.4 Remove 'upper' from balance_name
39 due to changes in
40 get_defined_balance function.
41 Set SOURCE_ID context.
42 JARTHURT 11-NOV-99 110.5 Return NULL if the
43 get_defined_balance routine
44 returns NULL
45 JARTHURT 24-NOV-99 110.6 Calculate CURRENT balance
46 jgoswami 06-DEC-1999 110.7 Overloading call_ca_balance_get_value,
47 added parameter p_source_id.
48 added l_report_unit in
49 l_dimension_suffix
50 JARTHURT 26-JAN-2000 110.8 Change hard-coding of balance
51 dimension in get_current_balance.
52 JARTHURT 28-JAN-2000 110.9 Correct building of dimension
53 suffix string.
54 RThirlby 11-FEB-2000 115.10 Changed all references to
55 pay_us_balance_view_pkg to
56 pay_ca_balance_view_pkg, except
57 for calls to debug procedures.
58 Added new procedure payments_bal-
59 ance_required. (This is a copy
60 from pay_us_taxbal_view_pkg).
61 RThirlby 05-JUN-2000 115.11 Added turn_off_dimension function
62 and turn_off_report_dimension
63 procedure. To help SOE view
64 performance.
65 MMUKHERJ 25-JAN-01 115.12 dbdrv command added
66 vpandya 03-May-02 115.15 Modified get_current_balance function
67 Added cursor csr_check_sep_chk, check
68 whether p_run_action_id is of sep
69 check or not, if yes then pass it
70 directly for calling get_value.
71 Modified cursor csr_get_aa_ids,
72 get all run aa id except sep chk.
73 TCLEWIS 09-SEP-02 115.16 Re-wrote payments_balance_required
74 to work with the umbrella process,
75 though I'm not sure it will be used
76 anymore.
77 Added code in call_ca_balance_get_value
78 to check for the ASG_PAYMENTS dimension
79 suffix. IF the Dimension Suffix is
80 ASG_PAYMENTS call the core balance
81 user_exit (Get_VALUE) function.
82 Modified the code in
83 call_ca_balance_get_value, it a view
84 still attempts to fetch the current
85 value, change the defined balance to
86 <Element_name>_ASG_PAYMENTS and call
87 the core balance user exit (get_value)
88 instead of the get_current_value
89 function. (Which I don't believe works).
90 TCLEWIS 29-OCT-02 115.17 modified the get_value function to check
91 the get current code if l_jd_context =
92 'NOT SET' he defined balance
93 to <element_name>_ASG_PAYMENTS if
94 l_jd_context <> 'NOT SET' then
95 the defined balance to
96 <element_name>_ASG_PAYMENTS_JD.
97
98 TCLEWIS 11-NOV-02 115.18 modified get value function to
99 check for null value of l_jd_context.
100 tclewis 12-NOV-02 115.19 added calls to the pay_balance_pkg.
101 set_context.
102 tclewis 14-nov-2002 115.21 modified payments balance required
103 to return true if pre-payments has
104 been run. It will no longer count
105 runs.
106 tclewis 03-mar-2003 115.22 modified the get value function to
107 determine it the assignment_action_id
108 passed to the procedure is a sep check
109 or regular run. IF sep check use
110 the assignment action, if not then use
111 master AA.
112 vpandya 23-May-2003 115.24 Changed for Multi GRE functionality:
113 Passing sub master asg act id to
114 Assignment Payments for Standard Run
115 and Tax Separate run and sepcheck asg
116 act id for separate payment run. if
117 TAX_GROUP is set then passing master
118 asg act id to it. Setting context for
119 Tax Group if TAX_GROUP is set.
120 rgottipa 19-Dec-2012 115.26 Bug 12534619, Added C_PMED_FLAG to
121 check PMED account is enabled or
122 disabled. If it is disabled then we
123 will skip the processing for the PMED
124 balance in CURRENT period.
125 ========================================================================
126
127 */
128 -- 'Current' balance dimension info for
129 -- prepayments related to many payroll runs
130 l_run_action_id NUMBER;
131 l_prepay_action_id NUMBER;
132
133 -- 'Current' balance dimension info for
134 -- prepayments related to many payroll runs
135 g_run_action_id NUMBER;
136 g_prepay_action_id NUMBER;
137 ------------------------------------------------------------------------
138 -- GET_CURRENT_BALANCE calculates the CURRENT balance given a run
139 -- assignment action id. From this it calculates the pre-payment and
140 -- then it finds all the runs included in this pre-payment.
141 -------------------------------------------------------------------------
142 FUNCTION get_current_balance (p_defined_balance_id NUMBER
143 ,p_run_action_id NUMBER)
144 RETURN NUMBER IS
145 --
146 CURSOR csr_get_aa_ids (p_prepay_aa_id NUMBER) IS
147 SELECT pai.locked_action_id
148 FROM pay_payroll_actions ppa,
149 pay_assignment_actions paa,
150 pay_action_interlocks pai
151 WHERE pai.locking_action_id = p_prepay_aa_id
152 AND paa.assignment_action_id = pai.locked_action_id
153 AND ppa.payroll_action_id = paa.payroll_action_id
154 AND ppa.action_type IN ('R', 'Q')
155 and not exists ( select 1 from pay_run_types_f prt
156 where prt.legislation_code = 'CA'
157 and prt.run_method = 'S'
158 and prt.run_type_id = paa.run_type_id );
159
160 CURSOR csr_get_prepay_id (p_run_id NUMBER) IS
161 SELECT pai.locking_action_id
162 FROM pay_payroll_actions ppa,
163 pay_assignment_actions paa,
164 pay_action_interlocks pai
165 WHERE pai.locked_action_id = p_run_id
166 AND paa.assignment_action_id = pai.locking_action_id
167 AND ppa.payroll_action_id = paa.payroll_action_id
168 AND ppa.action_type IN ('P', 'U');
169
170 CURSOR csr_check_sep_chk (p_run_aa_id NUMBER) IS
171 SELECT 1
172 FROM pay_assignment_actions paa
173 , pay_run_types_f prt
174 WHERE paa.assignment_action_id = p_run_aa_id
175 and prt.legislation_code = 'CA'
176 and prt.run_method = 'S'
177 and prt.run_type_id = paa.run_type_id;
178
179 l_defined_balance_id NUMBER;
180 l_bal_value NUMBER := 0;
181 l_prepay_action_id NUMBER;
182 l_check_sep_chk_aa NUMBER := 0;
183
184 BEGIN
185
186 OPEN csr_check_sep_chk (p_run_action_id);
187 FETCH csr_check_sep_chk INTO l_check_sep_chk_aa;
188 CLOSE csr_check_sep_chk;
189
190 IF l_check_sep_chk_aa = 1 THEN
191
192 l_bal_value := l_bal_value + pay_ca_balance_view_pkg.get_value
193 (p_run_action_id
194 ,p_defined_balance_id);
195
196 ELSE
197 pay_us_balance_view_pkg.debug_msg(' p_def_bal: '||l_defined_balance_id);
198 OPEN csr_get_prepay_id (p_run_action_id);
199 FETCH csr_get_prepay_id INTO l_prepay_action_id;
200 CLOSE csr_get_prepay_id;
201
202 FOR v_runs IN csr_get_aa_ids(l_prepay_action_id) LOOP
203
204 l_bal_value := l_bal_value + pay_ca_balance_view_pkg.get_value
205 (v_runs.locked_action_id,
206 p_defined_balance_id);
207
208 END LOOP;
209 END IF;
210
211 RETURN l_bal_value;
212
213 END get_current_balance;
214
215 ------------------------------------------------------------------------
216 -- CALL_CA_BALANCE_GET_VALUE is the wrapper function for calls to
217 -- get_value. It is used for ASG and PER level balances. Group Level balance
218 -- wrapper in pycatxbv.pkb.
219 -------------------------------------------------------------------------
220 FUNCTION call_ca_balance_get_value (p_balance_name VARCHAR2
221 ,p_time_period VARCHAR2
222 ,p_assignment_action_id NUMBER
223 ,p_assignment_id NUMBER
224 ,p_virtual_date DATE
225 ,p_report_level VARCHAR2
226 ,p_gre_id NUMBER
227 ,p_business_group_id NUMBER
228 ,p_jurisdiction_code VARCHAR2 )
229 RETURN number IS
230 --
231 BEGIN
232 --
233
234 return call_ca_balance_get_value( p_balance_name
235 ,p_time_period
236 ,p_assignment_action_id
237 ,p_assignment_id
238 ,p_virtual_date
239 ,p_report_level
240 ,p_gre_id
241 ,p_business_group_id
242 ,p_jurisdiction_code
243 ,NULL);
244 --
245 END call_ca_balance_get_value;
246 --------------------------------------------------------------------
250 -- get_value. It is used for ASG and PER level balances. Group Level balances
247 -- Overloaded Version of call_ca_balance_get_value
248 -- for parameter p_source_id
249 -- CALL_CA_BALANCE_GET_VALUE is the wrapper function for calls to
251 -- are in package pycatxbv.pkb.
252 -------------------------------------------------------------------------
253 FUNCTION call_ca_balance_get_value (p_balance_name VARCHAR2
254 ,p_time_period VARCHAR2
255 ,p_assignment_action_id NUMBER
256 ,p_assignment_id NUMBER
257 ,p_virtual_date DATE
258 ,p_report_level VARCHAR2
259 ,p_gre_id NUMBER
260 ,p_business_group_id NUMBER
261 ,p_jurisdiction_code VARCHAR2
262 ,p_source_id NUMBER )
263 RETURN number IS
264 --
265
266 CURSOR C_GET_MASTER_AAID (cp_prepay_action_id in number,
267 cp_assignment_id in number) is
268 select max(paa.assignment_action_id)
269 from pay_assignment_actions paa, -- assignment_action for master payroll run
270 pay_action_interlocks pai
271 where pai.locking_action_id = cp_prepay_action_id
272 and pai.locked_action_id = paa.assignment_action_id
273 and paa.assignment_id = cp_assignment_id
274 and paa.source_action_id is null -- master assignment_action
275 group by assignment_id;
276
277 /* added for bug 12534619 */
278 CURSOR C_PMED_FLAG IS
279 select ENABLED FROM pay_ca_pmed_accounts where SOURCE_ID = p_source_id;
280
281 g_prepay_action_id NUMBER;
282 l_defined_balance_id NUMBER;
283 l_business_group_id NUMBER;
284 l_report_level VARCHAR2(4);
285 l_tax_group VARCHAR2(30);
286 l_gre VARCHAR2(30);
287 l_dimension_suffix VARCHAR2(30);
288 l_jd_code VARCHAR2(10);
289 l_balance_value NUMBER;
290 l_jd_context VARCHAR2(10);
291 l_report_unit VARCHAR2(30);
292 l_time_period VARCHAR2(80);
293 l_gre_tg_or_rpt_unit VARCHAR2(80);
294 l_current_bal_flag BOOLEAN := FALSE;
295 l_sep_check VARCHAR2(1) := 'N';
296 l_assignment_action_id NUMBER;
297 l_pre_pay_aaid NUMBER;
298 l_assignment_id number;
299 l_tax_group_id number;
300 l_pmed_enable varchar2(1) := 'Y'; -- bug 12534619
301
302 --
303 BEGIN
304 pay_us_balance_view_pkg.debug_msg( '=======================================');
305 pay_us_balance_view_pkg.debug_msg('call_ca_balance_get_value entry:');
306 pay_us_balance_view_pkg.debug_msg(' p_balance_name: ' || p_balance_name);
307 pay_us_balance_view_pkg.debug_msg(' p_time_period: ' || p_time_period);
308 pay_us_balance_view_pkg.debug_msg(' p_assignment_action_id: ' ||
309 TO_CHAR(p_assignment_action_id));
310 pay_us_balance_view_pkg.debug_msg(' p_assignment_id: ' ||
311 TO_CHAR(p_assignment_id));
312 pay_us_balance_view_pkg.debug_msg(' p_virtual_date: ' ||
313 TO_CHAR(p_virtual_date));
314 pay_us_balance_view_pkg.debug_msg(' p_report_level: ' || p_report_level);
315 pay_us_balance_view_pkg.debug_msg(' p_gre_id: ' ||
316 TO_CHAR(p_gre_id));
317 pay_us_balance_view_pkg.debug_msg(' p_business_group_id: ' ||
318 TO_CHAR(p_business_group_id));
319 pay_us_balance_view_pkg.debug_msg(' p_jurisdiction_code: ' ||
320 p_jurisdiction_code);
321 pay_us_balance_view_pkg.debug_msg(' p_source_id: ' ||
322 TO_CHAR(p_source_id));
323
324 --
325 --Set contexts
326 --
327 pay_ca_balance_view_pkg.set_context('TAX_UNIT_ID',
328 p_gre_id);
329 pay_balance_pkg.set_context('TAX_UNIT_ID', p_gre_id);
330
331 IF p_jurisdiction_code IS NULL THEN
332 l_jd_context := nvl(pay_ca_balance_view_pkg.get_session_var
333 ('JURISDICTION_CODE'), 'Not_Set');
334 ELSE
335 l_jd_context := p_jurisdiction_code;
336 END IF;
337
338 IF p_business_group_id is NULL then
339 l_business_group_id := 0;
340 ELSE
341 l_business_group_id := p_business_group_id;
342 END IF;
343
344 IF l_jd_context = 'Not_Set' THEN
345 l_jd_code := '';
346 l_jd_context := NULL;
347 ELSE
348 IF p_source_id IS NULL THEN
349 l_jd_code := 'JD_';
350 ELSE
351 --
352 -- Balances with a Reporting Unit level dimension can not be at the
353 -- jurisdiction level aswell.
354 --
355 l_jd_code := '';
356 END IF;
357 END IF;
358 --
359 -- derive the dimension_suffix
360 -- set session var REPORT_LEVEL to default of ASG if not already set.
361 --
362 IF p_report_level IS NULL THEN
363 pay_ca_balance_view_pkg.set_session_var('REPORT_LEVEL','ASG');
364
365 l_report_level :=
366 pay_ca_balance_view_pkg.get_session_var('REPORT_LEVEL')||'_';
367 ELSE
368 l_report_level := p_report_level||'_';
369 END IF;
370
371 IF p_source_id IS NULL THEN
372 IF pay_ca_balance_view_pkg.get_session_var('TAX_GROUP') = 'Y' then
373 l_gre_tg_or_rpt_unit := 'TG_';
374
375 begin
376 select pac.context_value
377 into l_tax_group
378 from pay_action_contexts pac
379 ,ff_contexts fc
380 where pac.assignment_action_id = p_assignment_action_id
381 and fc.context_name = 'TAX_GROUP'
382 and pac.context_id = fc.context_id;
383
384 if l_tax_group <> 'No Tax Group' then
385 l_tax_group_id := l_tax_group;
386 pay_ca_balance_view_pkg.set_context('TAX_GROUP',l_tax_group_id);
387 pay_balance_pkg.set_context('TAX_GROUP',l_tax_group_id);
388 end if;
389
390 exception
391 when others then
392 null;
393 end;
394
395 ELSE
396 l_gre_tg_or_rpt_unit := 'GRE_';
397 END IF;
398 ELSE
399 l_gre_tg_or_rpt_unit := 'RPT_UNIT_';
400 END IF;
401
402 pay_ca_balance_view_pkg.set_context('JURISDICTION_CODE',l_jd_context);
403 pay_ca_balance_view_pkg.set_context('ASSIGNMENT_ACTION_ID'
404 ,p_assignment_action_id);
405 pay_ca_balance_view_pkg.set_context('BUSINESS_GROUP_ID',l_business_group_id);
406 pay_ca_balance_view_pkg.set_context('DATE_EARNED',p_virtual_date);
407 pay_ca_balance_view_pkg.set_context('SOURCE_ID',p_source_id);
408
409 pay_balance_pkg.set_context('JURISDICTION_CODE',l_jd_context);
410 pay_balance_pkg.set_context('ASSIGNMENT_ACTION_ID'
411 ,p_assignment_action_id);
412 pay_balance_pkg.set_context('BUSINESS_GROUP_ID',l_business_group_id);
413 pay_balance_pkg.set_context('DATE_EARNED',p_virtual_date);
414 pay_balance_pkg.set_context('SOURCE_ID',p_source_id);
415
416 l_time_period := p_time_period;
417 pay_us_balance_view_pkg.debug_msg(' l_time_period: ' || l_time_period);
418
419 IF p_time_period = 'CURRENT' THEN
420 /* bug 12534619 */
421 if p_balance_name = 'PMED Reduced Subject' then --rgottipa
422 OPEN C_PMED_FLAG;
423 FETCH C_PMED_FLAG into l_pmed_enable;
424 CLOSE C_PMED_FLAG;
425 if nvl(l_pmed_enable,'Y') = 'N' then
426 hr_utility.trace('l_pmed_enable '||l_pmed_enable);
427 RETURN NULL;
428 end if;
429 end if;
430 /* end bug 12534619 */
431 l_gre_tg_or_rpt_unit := 'GRE_';
432 l_time_period := 'RUN';
433 l_current_bal_flag := TRUE;
434 END IF;
435
436 --
437 -- Build the dimension suffix string
438 --
439 l_dimension_suffix := l_report_level||l_jd_code||l_gre_tg_or_rpt_unit||l_time_period;
440 --
441 -- Determine which dimensions should be returned.
442 -- turn_off_dimension is TRUE then don't get the balance.
443 --
444 IF turn_off_dimension(p_time_period)
445 --
446 THEN RETURN NULL;
447 --
448 ELSE -- turn_off_dimension is FALSE so get the balance.
449 --
450 -- Get the defined balance
451 --
452 pay_us_balance_view_pkg.debug_msg(' p_balance_name: ' || p_balance_name);
453 pay_us_balance_view_pkg.debug_msg
454 (' p_dimension_suffix: ' || l_dimension_suffix);
455 l_defined_balance_id := pay_ca_group_level_bal_pkg.get_defined_balance
456 (p_balance_name => p_balance_name
457 ,p_dimension => l_dimension_suffix
458 ,p_business_group_id => p_business_group_id);
459
460 --
461 -- The 'CURRENT' Dimension is for the current payment method amount.
462 -- This is needed for checks, deposit advice, and the payroll register.
463 --
464 IF l_current_bal_flag = TRUE AND
465 payments_balance_required(p_assignment_action_id)
466 THEN
467
468 l_assignment_action_id := p_assignment_action_id;
469
470 BEGIN
471
472 SELECT DECODE(prt.shortname,'SEP_PAY','Y','N'),
473 paa.assignment_id
474 INTO l_sep_check,
475 l_assignment_id
476 FROM pay_assignment_actions paa
477 ,pay_run_types_f prt
478 WHERE paa.assignment_action_id = p_assignment_action_id
479 AND prt.run_type_id = paa.run_type_id
480 AND prt.legislation_code = 'CA';
481
482 EXCEPTION
483
484 WHEN NO_DATA_FOUND THEN
485 l_sep_check := 'N';
486 END;
487
488 IF l_sep_check <> 'Y' THEN
489
490 IF pay_ca_balance_view_pkg.get_session_var('TAX_GROUP') = 'Y' then
491 select paa_master.source_action_id
492 into l_assignment_action_id
493 from pay_assignment_actions paa_master
494 ,pay_assignment_actions paa_sm
495 where paa_sm.assignment_action_id = p_assignment_action_id
496 and paa_master.assignment_action_id = paa_sm.source_action_id;
497 ELSE
498 select paa.source_action_id
499 into l_assignment_action_id
500 from pay_assignment_actions paa
501 where paa.assignment_action_id = p_assignment_action_id;
502 END IF;
503
504 IF nvl(l_jd_context,'Not_Set') = 'Not_Set' THEN
505 l_defined_balance_id :=
506 pay_ca_group_level_bal_pkg.get_defined_balance
507 (p_balance_name => p_balance_name
508 ,p_dimension => 'ASG_PAYMENTS'
509 ,p_business_group_id => p_business_group_id);
510 ELSE
511 l_defined_balance_id :=
512 pay_ca_group_level_bal_pkg.get_defined_balance
513 (p_balance_name => p_balance_name
514 ,p_dimension => 'ASG_PAYMENTS_JD'
515 ,p_business_group_id => p_business_group_id);
516 END IF;
517
518 END IF;
519
520 RETURN pay_balance_pkg.get_value
521 (l_defined_balance_id
522 ,l_assignment_action_id);
523
524 END IF;
525
526 IF p_time_period = 'ASG_PAYMENTS' THEN
527
528 l_defined_balance_id := pay_ca_group_level_bal_pkg.get_defined_balance
529 (p_balance_name => p_balance_name
530 ,p_dimension => 'ASG_PAYMENTS'
531 ,p_business_group_id => p_business_group_id);
532
533 RETURN pay_balance_pkg.get_value
534 (l_defined_balance_id
535 ,p_assignment_action_id);
536
537 END IF;
538
539 IF p_time_period = 'ASG_PAYMENTS_JD' THEN
540
541 l_defined_balance_id := pay_ca_group_level_bal_pkg.get_defined_balance
542 (p_balance_name => p_balance_name
543 ,p_dimension => 'ASG_PAYMENTS_JD'
544 ,p_business_group_id => p_business_group_id);
545
546 RETURN pay_balance_pkg.get_value
547 (l_defined_balance_id
548 ,p_assignment_action_id);
549
550 END IF;
551
552 IF l_defined_balance_id IS NULL THEN
553 pay_us_balance_view_pkg.debug_msg('The Defined Balance does not exist');
554 RETURN NULL;
555 ELSE
556
557 RETURN pay_ca_balance_view_pkg.get_value
558 (p_assignment_action_id
559 ,l_defined_balance_id);
560
561 END IF;
562 --
563 END IF; -- Determine which dimensions to return using turn_off_dimension
564 --
565 END call_ca_balance_get_value;
566 -----------------------------------------------------------------------------
567 -- FUNCTION Payments_Balance_Required
568 -- This function caches information related to an assignment action
569 -- for a payroll run related to a pre-payment composed of multiple
570 -- runs. This is to support the 'CURRENT' balance value displayed
571 -- on checkwriter and related reports(PAYRPCHK, PAYRPPST, PAYRPREG)
572 --
573 -- Returns:
574 -- TRUE if multiple runs exists and sets global prepayment id
575 -- FALSE if a single run exists and clears global prepayment id
576 --------------------------------------------------------------------------
577 FUNCTION payments_balance_required(p_assignment_action_id NUMBER)
578 RETURN boolean IS
579 --
580 CURSOR c_count_runs(p_asgact_id NUMBER) IS
581 SELECT pai.locking_action_id, count(pai2.locked_action_id)
582 FROM pay_action_interlocks pai,
583 pay_action_interlocks pai2,
584 pay_assignment_actions paa,
585 pay_payroll_actions ppa
586 WHERE pai.locked_action_id = p_asgact_id
587 AND pai.locking_action_id = pai2.locking_action_id
588 AND pai.locking_action_id = paa.assignment_action_id
589 AND paa.payroll_action_id = ppa.payroll_action_id
590 AND ppa.action_type in ('P', 'U')
591 GROUP BY pai.locking_action_id;
592
593 l_count_runs NUMBER;
594
595 BEGIN
596
597 IF l_run_action_id = p_assignment_action_id
598 AND l_prepay_action_id IS NOT NULL THEN
599 -- Have processed this assignment
600 -- and it does have multiple RUNS
601 RETURN TRUE;
602 ELSIF l_run_action_id = p_assignment_action_id
603 AND l_prepay_action_id IS NULL THEN
604 -- Have processed this assignment
605 -- and it does not have multiple RUNS
606 RETURN FALSE;
607 ELSE
608 l_run_action_id := p_assignment_action_id; -- set Run action id
609 OPEN c_count_runs(p_assignment_action_id);
610 FETCH c_count_runs INTO l_prepay_action_id, l_count_runs;
611 CLOSE c_count_runs;
612 IF l_count_runs > 1 THEN
613 -- Set asg_act_ids if multple runs
614 l_run_action_id := p_assignment_action_id;
615 RETURN TRUE;
616 ELSE
617 -- Clear asg_act_ids if they do not
618 l_prepay_action_id := NULL;
619 RETURN FALSE;
620 END IF;
621 END IF;
622
623
624
625
626
627 END payments_balance_required;
628 -----------------------------------------------------------------------------
629 -- FUNCTION turn_off_dimension
630 -----------------------------------------------------------------------------
631 FUNCTION turn_off_dimension (p_dimension varchar2)
632 RETURN BOOLEAN IS
633 --
634 BEGIN
635 --
636 IF nvl(pay_ca_balance_view_pkg.get_session_var(p_dimension),'ON') = 'OFF' THEN
637 --
638 RETURN TRUE;
639 --
640 ELSE
641 RETURN FALSE;
642 --
643 END IF;
644 --
645 END turn_off_dimension;
646 -----------------------------------------------------------------------------
647 -- PROCEDURE turn_off_report_dimension
648 -----------------------------------------------------------------------------
649 PROCEDURE turn_off_report_dimension (p_report_name varchar2)
650 is
651 --
652 BEGIN
653 --
654 /*
655 IF p_report_name = 'SOE'
656 --
657 THEN pay_ca_balance_view_pkg.set_session_var(PTD','OFF');
658 pay_ca_balance_view_pkg.set_session_var('MONTH','OFF');
659 pay_ca_balance_view_pkg.set_session_var('QTD','OFF');
660 pay_ca_balance_view_pkg.set_session_var('YTD','ON');
661 -- Need to check if need both CURRENT and RUN
662 pay_ca_balance_view_pkg.set_session_var('CURRENT','ON');
663 pay_ca_balance_view_pkg.set_session_var('RUN','ON');
664 --
665 END IF;
666 */
667 null;
668 END turn_off_report_dimension;
669 -----------------------------------------------------------------------------
670 END pay_ca_balance_pkg;