DBA Data[Home] [Help]

APPS.PAY_BALANCE_PKG dependencies on PAY_RUN_BALANCES

Line 192: run_balance_id pay_run_balances.run_balance_id%type,

188: -- Internal Run Balance link list used in rollback
189: --
190: type t_int_rb_rec is record
191: (
192: run_balance_id pay_run_balances.run_balance_id%type,
193: defined_balance_id pay_defined_balances.defined_balance_id%type,
194: payroll_action_id pay_payroll_actions.payroll_action_id%type,
195: tax_unit_id pay_assignment_actions.tax_unit_id%type,
196: jurisdiction_code pay_run_results.jurisdiction_code%type,

Line 6248: from pay_run_balances rb

6244: and exists (select /*+ no_unnest */ 'x' from pay_balance_validation pbv
6245: where pbv.defined_balance_id = pdb.defined_balance_id
6246: and pbv.run_balance_status in ('P', 'V') )
6247: and exists ( select /*+ no_unnest */ 'x'
6248: from pay_run_balances rb
6249: where rb.defined_balance_id = pdb.defined_balance_id
6250: and rb.effective_date >= p_inv_date
6251: and exists ( select /*+ no_unnest */ 1 from pay_run_results rr,
6252: pay_run_result_values rrv

Line 6277: from pay_run_balances rb,

6273: and exists (select /*+ no_unnest */ 'x' from pay_balance_validation pbv
6274: where pbv.defined_balance_id = pdb.defined_balance_id
6275: and pbv.run_balance_status in ('P', 'V') )
6276: and exists ( select /*+ no_unnest */ 'x'
6277: from pay_run_balances rb,
6278: pay_assignment_actions assact
6279: where rb.defined_balance_id = pdb.defined_balance_id
6280: and rb.effective_date >= p_inv_date
6281: and assact.payroll_action_id = rb.payroll_action_id

Line 6312: from pay_run_balances rb

6308: and exists (select 'x' from pay_balance_validation pbv
6309: where pbv.defined_balance_id = pdb.defined_balance_id
6310: and pbv.run_balance_status in ('P', 'V') )
6311: and exists ( select 'x'
6312: from pay_run_balances rb
6313: where rb.defined_balance_id = pdb.defined_balance_id
6314: and rb.effective_date >= p_inv_date
6315: and exists ( select 1 from pay_run_results rr,
6316: pay_run_result_values rrv

Line 6341: from pay_run_balances rb,

6337: and exists (select 'x' from pay_balance_validation pbv
6338: where pbv.defined_balance_id = pdb.defined_balance_id
6339: and pbv.run_balance_status in ('P', 'V') )
6340: and exists ( select 'x'
6341: from pay_run_balances rb,
6342: pay_assignment_actions assact
6343: where rb.defined_balance_id = pdb.defined_balance_id
6344: and rb.effective_date >= p_inv_date
6345: and assact.payroll_action_id = rb.payroll_action_id

Line 6814: from pay_run_balances

6810: ,p_organization_id number)
6811: is
6812: select run_balance_id
6813: , balance_value
6814: from pay_run_balances
6815: where defined_balance_id = p_defined_balance_id
6816: and payroll_action_id = p_pact_id
6817: and nvl(tax_unit_id, -1) = nvl(p_gre, -1)
6818: and nvl(jurisdiction_code, 'null') = nvl(p_jd, 'null')

Line 6831: l_grp_run_bal_id pay_run_balances.run_balance_id%type;

6827: and nvl(balance_date, to_date('0001/01/01', 'YYYY/MM/DD'))
6828: = nvl(p_balance_date, to_date('0001/01/01', 'YYYY/MM/DD'))
6829: and rownum = 1;
6830: --
6831: l_grp_run_bal_id pay_run_balances.run_balance_id%type;
6832: l_grp_run_bal_val pay_run_balances.balance_value%type;
6833: l_cache_ct number;
6834: l_found boolean;
6835: l_jur1 pay_run_balances.jurisdiction_comp1%type;

Line 6832: l_grp_run_bal_val pay_run_balances.balance_value%type;

6828: = nvl(p_balance_date, to_date('0001/01/01', 'YYYY/MM/DD'))
6829: and rownum = 1;
6830: --
6831: l_grp_run_bal_id pay_run_balances.run_balance_id%type;
6832: l_grp_run_bal_val pay_run_balances.balance_value%type;
6833: l_cache_ct number;
6834: l_found boolean;
6835: l_jur1 pay_run_balances.jurisdiction_comp1%type;
6836: l_jur2 pay_run_balances.jurisdiction_comp2%type;

Line 6835: l_jur1 pay_run_balances.jurisdiction_comp1%type;

6831: l_grp_run_bal_id pay_run_balances.run_balance_id%type;
6832: l_grp_run_bal_val pay_run_balances.balance_value%type;
6833: l_cache_ct number;
6834: l_found boolean;
6835: l_jur1 pay_run_balances.jurisdiction_comp1%type;
6836: l_jur2 pay_run_balances.jurisdiction_comp2%type;
6837: l_jur3 pay_run_balances.jurisdiction_comp3%type;
6838: l_current_ptr number;
6839: l_previous_ptr number;

Line 6836: l_jur2 pay_run_balances.jurisdiction_comp2%type;

6832: l_grp_run_bal_val pay_run_balances.balance_value%type;
6833: l_cache_ct number;
6834: l_found boolean;
6835: l_jur1 pay_run_balances.jurisdiction_comp1%type;
6836: l_jur2 pay_run_balances.jurisdiction_comp2%type;
6837: l_jur3 pay_run_balances.jurisdiction_comp3%type;
6838: l_current_ptr number;
6839: l_previous_ptr number;
6840: --

Line 6837: l_jur3 pay_run_balances.jurisdiction_comp3%type;

6833: l_cache_ct number;
6834: l_found boolean;
6835: l_jur1 pay_run_balances.jurisdiction_comp1%type;
6836: l_jur2 pay_run_balances.jurisdiction_comp2%type;
6837: l_jur3 pay_run_balances.jurisdiction_comp3%type;
6838: l_current_ptr number;
6839: l_previous_ptr number;
6840: --
6841: begin

Line 6889: update pay_run_balances

6885: hr_utility.trace('l_grp_run_bal_val: '||to_char(l_grp_run_bal_val));
6886: hr_utility.trace('contrib amt: '||to_char(p_amount));
6887: end if;
6888: --
6889: update pay_run_balances
6890: set balance_value = (balance_value - p_amount)
6891: where run_balance_id = l_grp_run_bal_id;
6892: --
6893: end if;

Line 6926: update pay_run_balances

6922: if g_debug then
6923: hr_utility.set_location('pay_balance_pkg.subtract_from_grp_bal', 50);
6924: hr_utility.trace('MULTI THREADED UPDATE');
6925: end if;
6926: update pay_run_balances
6927: set balance_value = balance_value - p_amount
6928: where run_balance_id = p_int_mlt_thrd_cache(l_current_ptr).run_balance_id;
6929: --
6930: else -- no row for this balance

Line 6937: select pay_run_balances_s.nextval

6933: hr_utility.set_location('pay_balance_pkg.subtract_from_grp_bal', 55);
6934: end if;
6935: --
6936: --
6937: select pay_run_balances_s.nextval
6938: into l_grp_run_bal_id
6939: from dual;
6940: --
6941: split_jurisdiction(p_jur_code,

Line 6946: insert into pay_run_balances

6942: l_jur1,
6943: l_jur2,
6944: l_jur3);
6945: --
6946: insert into pay_run_balances
6947: (run_balance_id
6948: ,defined_balance_id
6949: ,payroll_action_id
6950: ,effective_date

Line 7053: from pay_run_balances

7049: -- Get all the group defined_balances
7050: --
7051: cursor get_dbs(p_pact number) is
7052: select distinct defined_balance_id
7053: from pay_run_balances
7054: where payroll_action_id = p_pact;
7055: --
7056: cursor get_contexts(p_asg_action in number,
7057: p_si_needed in varchar2,

Line 7366: l_jur1 pay_run_balances.jurisdiction_comp1%type;

7362: p_organization_id in number default null,
7363: p_tax_group in varchar2 default null
7364: )
7365: is
7366: l_jur1 pay_run_balances.jurisdiction_comp1%type;
7367: l_jur2 pay_run_balances.jurisdiction_comp2%type;
7368: l_jur3 pay_run_balances.jurisdiction_comp3%type;
7369: begin
7370: --

Line 7367: l_jur2 pay_run_balances.jurisdiction_comp2%type;

7363: p_tax_group in varchar2 default null
7364: )
7365: is
7366: l_jur1 pay_run_balances.jurisdiction_comp1%type;
7367: l_jur2 pay_run_balances.jurisdiction_comp2%type;
7368: l_jur3 pay_run_balances.jurisdiction_comp3%type;
7369: begin
7370: --
7371: split_jurisdiction(p_jurisdiction,

Line 7368: l_jur3 pay_run_balances.jurisdiction_comp3%type;

7364: )
7365: is
7366: l_jur1 pay_run_balances.jurisdiction_comp1%type;
7367: l_jur2 pay_run_balances.jurisdiction_comp2%type;
7368: l_jur3 pay_run_balances.jurisdiction_comp3%type;
7369: begin
7370: --
7371: split_jurisdiction(p_jurisdiction,
7372: l_jur1,

Line 7376: insert into pay_run_balances

7372: l_jur1,
7373: l_jur2,
7374: l_jur3);
7375: --
7376: insert into pay_run_balances
7377: (
7378: run_balance_id,
7379: defined_balance_id,
7380: assignment_action_id,

Line 7403: pay_run_balances_s.nextval,

7399: organization_id,
7400: tax_group
7401: )
7402: values (
7403: pay_run_balances_s.nextval,
7404: p_defined_balance_id,
7405: p_asg_act_id,
7406: p_payroll_act_id,
7407: p_asg_id,

Line 7433: -- Inserts into pay_run_balances /* Added for bug 6676876 */

7429:
7430: --
7431: --------------------------------------------------------------------------
7432: -- procedure ins_run_balance_bulk
7433: -- Inserts into pay_run_balances /* Added for bug 6676876 */
7434: --------------------------------------------------------------------------
7435: procedure ins_run_balance_bulk (p_output_list in t_detailed_bal_out_tab,
7436: p_asgact_id in pay_assignment_actions.assignment_action_id%type,
7437: p_pact_id in pay_assignment_actions.payroll_action_id%type,

Line 7444: Type t_pay_run_bal is table of pay_run_balances%rowtype index by binary_integer;

7440: p_effective_date in pay_payroll_actions.effective_date%type
7441: )
7442: is
7443:
7444: Type t_pay_run_bal is table of pay_run_balances%rowtype index by binary_integer;
7445: l_pay_run_bal t_pay_run_bal;
7446:
7447: i number;
7448: lv_run_balance_id pay_run_balances.run_balance_id%type;

Line 7448: lv_run_balance_id pay_run_balances.run_balance_id%type;

7444: Type t_pay_run_bal is table of pay_run_balances%rowtype index by binary_integer;
7445: l_pay_run_bal t_pay_run_bal;
7446:
7447: i number;
7448: lv_run_balance_id pay_run_balances.run_balance_id%type;
7449: l_output_list t_detailed_bal_out_tab;
7450:
7451: l_jur1 pay_run_balances.jurisdiction_comp1%type;
7452: l_jur2 pay_run_balances.jurisdiction_comp2%type;

Line 7451: l_jur1 pay_run_balances.jurisdiction_comp1%type;

7447: i number;
7448: lv_run_balance_id pay_run_balances.run_balance_id%type;
7449: l_output_list t_detailed_bal_out_tab;
7450:
7451: l_jur1 pay_run_balances.jurisdiction_comp1%type;
7452: l_jur2 pay_run_balances.jurisdiction_comp2%type;
7453: l_jur3 pay_run_balances.jurisdiction_comp3%type;
7454: begin
7455: --

Line 7452: l_jur2 pay_run_balances.jurisdiction_comp2%type;

7448: lv_run_balance_id pay_run_balances.run_balance_id%type;
7449: l_output_list t_detailed_bal_out_tab;
7450:
7451: l_jur1 pay_run_balances.jurisdiction_comp1%type;
7452: l_jur2 pay_run_balances.jurisdiction_comp2%type;
7453: l_jur3 pay_run_balances.jurisdiction_comp3%type;
7454: begin
7455: --
7456: hr_utility.trace('Enter ins_run_balance_bulk ');

Line 7453: l_jur3 pay_run_balances.jurisdiction_comp3%type;

7449: l_output_list t_detailed_bal_out_tab;
7450:
7451: l_jur1 pay_run_balances.jurisdiction_comp1%type;
7452: l_jur2 pay_run_balances.jurisdiction_comp2%type;
7453: l_jur3 pay_run_balances.jurisdiction_comp3%type;
7454: begin
7455: --
7456: hr_utility.trace('Enter ins_run_balance_bulk ');
7457: i := 0;

Line 7464: select pay_run_balances_s.nextval

7460: for cnt in 1..p_output_list.count loop
7461: if (p_output_list(cnt).balance_value <> 0) then
7462: i:=i+1;
7463:
7464: select pay_run_balances_s.nextval
7465: into lv_run_balance_id
7466: from dual;
7467:
7468: split_jurisdiction(p_output_list(cnt).jurisdiction_code,

Line 7501: insert into pay_run_balances values l_pay_run_bal(a) ;

7497: end loop;
7498: --
7499: hr_utility.trace('In ins_run_balance_bulk 3');
7500: forall a in 1..l_pay_run_bal.count
7501: insert into pay_run_balances values l_pay_run_bal(a) ;
7502:
7503: hr_utility.trace('Deleting the values from the l_pay_run_bal table ');
7504: l_pay_run_bal.delete;
7505: hr_utility.trace('Leaving ins_run_balance_bulk ');

Line 7990: delete from /* bue_delrb5 */ pay_run_balances

7986: end if;
7987: --
7988: -- Delete run balance records that may conflict with new one.
7989: --
7990: delete from /* bue_delrb5 */ pay_run_balances
7991: where
7992: defined_balance_id = l_rec.defined_balance_id
7993: and assignment_action_id = l_rr_info.assignment_action_id
7994: and payroll_action_id is null

Line 8194: -- Validate/Delete the pay_run_balances for this mode.

8190: end if;
8191: --
8192: end loop;
8193: --
8194: -- Validate/Delete the pay_run_balances for this mode.
8195: --
8196: for cnt in 1..p_defined_balance_lst.count loop
8197: --
8198: if (p_load_type = 'FORCE') then

Line 8202: delete /* bue_delrb1 */ from pay_run_balances

8198: if (p_load_type = 'FORCE') then
8199: if g_debug then
8200: hr_utility.set_location('pay_balance_pkg.create_set_asg_balance', 20);
8201: end if;
8202: delete /* bue_delrb1 */ from pay_run_balances
8203: where defined_balance_id = p_defined_balance_lst(cnt).defined_balance_id
8204: and assignment_action_id = p_asgact_id;
8205: elsif (p_load_type = 'TRUSTED') then
8206: null;

Line 8219: from pay_run_balances

8215: select 1
8216: into l_dummy
8217: from dual
8218: where exists (select ''
8219: from pay_run_balances
8220: where defined_balance_id = p_defined_balance_lst(cnt).defined_balance_id
8221: and assignment_action_id = p_asgact_id
8222: and balance_value <> 0);
8223: --

Line 8296: /* Commented for bug 6676876, used bulk insert into pay_run_balances for performance improvement

8292:
8293: if g_debug then
8294: hr_utility.set_location('pay_balance_pkg.create_set_asg_balance', 40);
8295: end if;
8296: /* Commented for bug 6676876, used bulk insert into pay_run_balances for performance improvement
8297: for cnt in 1..l_output_list.count loop
8298: if (l_output_list(cnt).balance_value <> 0) then
8299: --
8300: if g_debug then

Line 8485: delete /* bue_delrb2 */ from pay_run_balances

8481: if (p_load_type = 'FORCE') then
8482: if g_debug then
8483: hr_utility.set_location('pay_balance_pkg.add_grpbal_to_list', 20);
8484: end if;
8485: delete /* bue_delrb2 */ from pay_run_balances
8486: where defined_balance_id = p_def_bal_id
8487: and payroll_action_id = p_pactid;
8488: elsif (p_load_type = 'TRUSTED') then
8489: null;

Line 8501: from pay_run_balances

8497: select 1
8498: into l_dummy
8499: from dual
8500: where exists (select ''
8501: from pay_run_balances
8502: where defined_balance_id = p_def_bal_id
8503: and payroll_action_id = p_pactid
8504: and balance_value <> 0);
8505: --

Line 9165: /* Commented for bug 6676876, used bulk insert into pay_run_balances for performance improvement

9161: if g_debug then
9162: hr_utility.set_location(
9163: 'pay_balance_pkg.create_all_grp_balances_full', 90);
9164: end if;
9165: /* Commented for bug 6676876, used bulk insert into pay_run_balances for performance improvement
9166: for cnt in 1..l_output_list.count loop
9167: if (l_output_list(cnt).balance_value <> 0) then
9168: --
9169: if g_debug then

Line 9355: delete /* bue_delrb3 */ from pay_run_balances

9351: if (p_load_type = 'FORCE') then
9352: if g_debug then
9353: hr_utility.set_location('pay_balance_pkg.add_asgbal_to_list', 20);
9354: end if;
9355: delete /* bue_delrb3 */ from pay_run_balances
9356: where defined_balance_id = p_def_bal_id
9357: and assignment_action_id = p_asgact_id;
9358: elsif (p_load_type = 'TRUSTED') then
9359: null;

Line 9371: from pay_run_balances

9367: select 1
9368: into l_dummy
9369: from dual
9370: where exists (select ''
9371: from pay_run_balances
9372: where defined_balance_id = p_def_bal_id
9373: and assignment_action_id = p_asgact_id
9374: and balance_value <> 0);
9375: --

Line 10055: /* Commented for bug 6676876, used bulk insert into pay_run_balances for performance improvement

10051: if g_debug then
10052: hr_utility.set_location(
10053: 'pay_balance_pkg.create_all_asg_balances_full', 90);
10054: end if;
10055: /* Commented for bug 6676876, used bulk insert into pay_run_balances for performance improvement
10056: for cnt in 1..l_output_list.count loop
10057: if (l_output_list(cnt).balance_value <> 0) then
10058: --
10059: if g_debug then

Line 10428: -- Validate/Delete the pay_run_balances for this mode.

10424: end if;
10425: --
10426: end loop;
10427: --
10428: -- Validate/Delete the pay_run_balances for this mode.
10429: --
10430: for cnt in 1..p_defined_balance_lst.count loop
10431: --
10432: if (p_load_type = 'FORCE') then

Line 10436: delete /* bue_delrb4 */ from pay_run_balances

10432: if (p_load_type = 'FORCE') then
10433: if g_debug then
10434: hr_utility.set_location('pay_balance_pkg.create_set_group_balance', 20);
10435: end if;
10436: delete /* bue_delrb4 */ from pay_run_balances
10437: where defined_balance_id = p_defined_balance_lst(cnt).defined_balance_id
10438: and payroll_action_id = p_pact_id;
10439: elsif (p_load_type = 'TRUSTED') then
10440: null;

Line 10452: from pay_run_balances

10448: select 1
10449: into l_dummy
10450: from dual
10451: where exists (select 1
10452: from pay_run_balances
10453: where defined_balance_id = p_defined_balance_lst(cnt).defined_balance_id
10454: and payroll_action_id = p_pact_id
10455: and balance_value <> 0);
10456: --

Line 10529: /* Commented for bug 6676876, used bulk insert into pay_run_balances for performance improvement

10525: --
10526: if g_debug then
10527: hr_utility.set_location('pay_balance_pkg.create_set_group_balance', 40);
10528: end if;
10529: /* Commented for bug 6676876, used bulk insert into pay_run_balances for performance improvement
10530: for cnt in 1..l_output_list.count loop
10531: if g_debug then
10532: hr_utility.trace('Bal Value = '||l_output_list(cnt).balance_value);
10533: end if;

Line 11389: -- check that a row in pay_run_balances is correct

11385:
11386: end maintain_balances_for_action;
11387: --------------------------------------------------------------------------
11388: -- function run_balance_row_status
11389: -- check that a row in pay_run_balances is correct
11390: -- returns V for valid, I for invalid, U for undetermined, N no row
11391: -- M missing row, O for old (before from date)
11392: -- used to avoid expensive delete/insert for rb that are already correct.
11393: -- U return is where multiple rows could exist for a given assact/defbal

Line 11404: select * from pay_run_balances

11400: return varchar2 is
11401:
11402: cursor csr_run_bal(p_defined_balance_id number, p_assignment_action_id number ) is
11403:
11404: select * from pay_run_balances
11405: where defined_balance_id = p_defined_balance_id
11406: and assignment_action_id = p_assignment_action_id;
11407:
11408: cursor csr_feed(p_balance_type_id number , p_business_group_id number, p_from_date date ) is

Line 11460: l_value pay_run_balances.balance_value%type;

11456:
11457: rb_row csr_run_bal%ROWTYPE;
11458: rb_row2 csr_run_bal%ROWTYPE;
11459: l_rb_status varchar2(1);
11460: l_value pay_run_balances.balance_value%type;
11461: l_rrv_count number;
11462: l_start_time number;
11463: begin
11464: if g_debug then

Line 11684: -- check that a row in pay_run_balances is correct

11680:
11681: end run_balance_row_status;
11682: --------------------------------------------------------------------------
11683: -- function run_balance_row_status chunk fetch
11684: -- check that a row in pay_run_balances is correct
11685: -- returns V for valid, I for invalid, U for undetermined, N no row
11686: -- M missing row, O for old (before from date)
11687: -- used to avoid expensive delete/insert for rb that are already correct.
11688: -- U return is where multiple rows could exist for a given assact/defbal

Line 11701: select * from pay_run_balances

11697: return varchar2 is
11698:
11699: cursor csr_run_bal(p_defined_balance_id number, p_assignment_action_id number ) is
11700:
11701: select * from pay_run_balances
11702: where defined_balance_id = p_defined_balance_id
11703: and assignment_action_id = p_assignment_action_id;
11704:
11705: cursor csr_feed(p_balance_type_id number , p_business_group_id number, p_from_date date ) is

Line 11760: l_value pay_run_balances.balance_value%type;

11756:
11757: rb_row csr_run_bal%ROWTYPE;
11758: rb_row2 csr_run_bal%ROWTYPE;
11759: l_rb_status varchar2(1);
11760: l_value pay_run_balances.balance_value%type;
11761: l_rrv_count number;
11762: l_start_time number;
11763: begin
11764: if g_debug then