select
z.ledger,
z.business_group,
z.payroll,
z.consolidation_set,
z.payroll_period,
z.payroll_run_type,
z.payroll_run_date,
z.costing_date,
z.transfer_date,
z.gl_account,
z.costing_account,
z.element,
z.employee_number,
z.employee_name,
z.assignment_number,
z.currency,
z.status,
z.suspense_account,
z.uncosted_assignments,
z.costed_debit,
z.costed_credit,
z.costed_net,
z.costed_no_gl_transfer,
z.transferred_debit,
z.transferred_credit,
z.transferred_net,
z.journal_debit,
z.journal_credit,
z.journal_net,
z.posted_debit,
z.posted_credit,
z.gl_interface_debit,
z.gl_interface_credit,
z.not_transferred,
z.not_in_journals,
z.unposted,
z.gl_period,
z.journal_name
from
(
select
y.*,
case
when y.uncosted_assignments is not null then 'Not costed'
when (y.due_debit_p<>y.transferred_debit_p or y.due_credit_p<>y.transferred_credit_p) and y.transfer_date is null then 'Not transferred'
when y.due_debit_p<>y.transferred_debit_p or y.due_credit_p<>y.transferred_credit_p then 'Transfer difference'
when (y.transferred_debit_p<>y.journal_debit_p or y.transferred_credit_p<>y.journal_credit_p) and y.transferred_debit_p=y.journal_debit_p+y.interface_debit_p and y.transferred_credit_p=y.journal_credit_p+y.interface_credit_p then 'Not imported'
when y.transferred_debit_p<>y.journal_debit_p or y.transferred_credit_p<>y.journal_credit_p then 'Journal difference'
when y.journal_debit_p<>y.posted_debit_p or y.journal_credit_p<>y.posted_credit_p then 'Unposted'
when y.due_debit_p=0 and y.due_credit_p=0 then 'Nothing to transfer'
else 'Reconciled'
end status,
decode(y.row_in_account,1,nullif(y.due_debit_p-y.due_credit_p-y.transferred_debit_p+y.transferred_credit_p,0)) not_transferred,
decode(y.row_in_account,1,nullif(y.transferred_debit_p-y.transferred_credit_p-y.journal_debit_p+y.journal_credit_p,0)) not_in_journals,
decode(y.row_in_account,1,nullif(y.journal_debit_p-y.journal_credit_p-y.posted_debit_p+y.posted_credit_p,0)) unposted
from
(
select
x.ledger,
x.business_group,
x.payroll,
x.consolidation_set,
x.payroll_period,
x.payroll_run_type,
x.payroll_run_date,
x.costing_date,
x.transfer_date,
x.gl_account,
x.costing_account,
x.element,
x.employee_number,
x.employee_name,
x.assignment_number,
x.currency,
x.suspense_account,
sum(x.uncosted_assignments) uncosted_assignments,
nullif(sum(x.costed_debit),0) costed_debit,
nullif(sum(x.costed_credit),0) costed_credit,
nullif(sum(x.costed_net),0) costed_net,
nullif(sum(x.no_gl_net),0) costed_no_gl_transfer,
nullif(sum(x.transferred_debit),0) transferred_debit,
nullif(sum(x.transferred_credit),0) transferred_credit,
nullif(sum(x.transferred_net),0) transferred_net,
nullif(sum(x.journal_debit),0) journal_debit,
nullif(sum(x.journal_credit),0) journal_credit,
nullif(sum(x.journal_net),0) journal_net,
nullif(sum(x.posted_debit),0) posted_debit,
nullif(sum(x.posted_credit),0) posted_credit,
nullif(sum(x.interface_debit),0) gl_interface_debit,
nullif(sum(x.interface_credit),0) gl_interface_credit,
min(x.gl_period) gl_period,
min(x.journal_name) journal_name,
row_number() over (partition by x.ledger,x.business_group,x.payroll,x.consolidation_set,x.payroll_period,x.payroll_run_type,x.payroll_run_date,x.costing_date,x.transfer_date,x.gl_account,x.costing_account,x.currency,x.suspense_account order by x.element,x.employee_name,x.assignment_number) row_in_account,
nvl(sum(sum(x.due_debit)) over (partition by x.ledger,x.business_group,x.payroll,x.consolidation_set,x.payroll_period,x.payroll_run_type,x.payroll_run_date,x.costing_date,x.transfer_date,x.gl_account,x.costing_account,x.currency,x.suspense_account),0) due_debit_p,
nvl(sum(sum(x.due_credit)) over (partition by x.ledger,x.business_group,x.payroll,x.consolidation_set,x.payroll_period,x.payroll_run_type,x.payroll_run_date,x.costing_date,x.transfer_date,x.gl_account,x.costing_account,x.currency,x.suspense_account),0) due_credit_p,
nvl(sum(sum(x.transferred_debit)) over (partition by x.ledger,x.business_group,x.payroll,x.consolidation_set,x.payroll_period,x.payroll_run_type,x.payroll_run_date,x.costing_date,x.transfer_date,x.gl_account,x.costing_account,x.currency,x.suspense_account),0) transferred_debit_p,
nvl(sum(sum(x.transferred_credit)) over (partition by x.ledger,x.business_group,x.payroll,x.consolidation_set,x.payroll_period,x.payroll_run_type,x.payroll_run_date,x.costing_date,x.transfer_date,x.gl_account,x.costing_account,x.currency,x.suspense_account),0) transferred_credit_p,
nvl(sum(sum(x.journal_debit)) over (partition by x.ledger,x.business_group,x.payroll,x.consolidation_set,x.payroll_period,x.payroll_run_type,x.payroll_run_date,x.costing_date,x.transfer_date,x.gl_account,x.costing_account,x.currency,x.suspense_account),0) journal_debit_p,
nvl(sum(sum(x.journal_credit)) over (partition by x.ledger,x.business_group,x.payroll,x.consolidation_set,x.payroll_period,x.payroll_run_type,x.payroll_run_date,x.costing_date,x.transfer_date,x.gl_account,x.costing_account,x.currency,x.suspense_account),0) journal_credit_p,
nvl(sum(sum(x.posted_debit)) over (partition by x.ledger,x.business_group,x.payroll,x.consolidation_set,x.payroll_period,x.payroll_run_type,x.payroll_run_date,x.costing_date,x.transfer_date,x.gl_account,x.costing_account,x.currency,x.suspense_account),0) posted_debit_p,
nvl(sum(sum(x.posted_credit)) over (partition by x.ledger,x.business_group,x.payroll,x.consolidation_set,x.payroll_period,x.payroll_run_type,x.payroll_run_date,x.costing_date,x.transfer_date,x.gl_account,x.costing_account,x.currency,x.suspense_account),0) posted_credit_p,
nvl(sum(sum(x.interface_debit)) over (partition by x.ledger,x.business_group,x.payroll,x.consolidation_set,x.payroll_period,x.payroll_run_type,x.payroll_run_date,x.costing_date,x.transfer_date,x.gl_account,x.costing_account,x.currency,x.suspense_account),0) interface_debit_p,
nvl(sum(sum(x.interface_credit)) over (partition by x.ledger,x.business_group,x.payroll,x.consolidation_set,x.payroll_period,x.payroll_run_type,x.payroll_run_date,x.costing_date,x.transfer_date,x.gl_account,x.costing_account,x.currency,x.suspense_account),0) interface_credit_p
from
(
select
gl.name ledger,
haouv.name business_group,
pap.payroll_name payroll,
pcs.consolidation_set_name consolidation_set,
ptp.period_name payroll_period,
xxen_util.meaning(w.action_type,'ACTION_TYPE',3) payroll_run_type,
w.payroll_run_date,
ppa_c.effective_date costing_date,
ppa_t.effective_date transfer_date,
(
select
replace(rtrim(listagg(decode(ppgfm.payroll_cost_segment,
'SEGMENT1',pcak.segment1,'SEGMENT2',pcak.segment2,'SEGMENT3',pcak.segment3,'SEGMENT4',pcak.segment4,'SEGMENT5',pcak.segment5,'SEGMENT6',pcak.segment6,'SEGMENT7',pcak.segment7,'SEGMENT8',pcak.segment8,'SEGMENT9',pcak.segment9,'SEGMENT10',pcak.segment10,
'SEGMENT11',pcak.segment11,'SEGMENT12',pcak.segment12,'SEGMENT13',pcak.segment13,'SEGMENT14',pcak.segment14,'SEGMENT15',pcak.segment15,'SEGMENT16',pcak.segment16,'SEGMENT17',pcak.segment17,'SEGMENT18',pcak.segment18,'SEGMENT19',pcak.segment19,'SEGMENT20',pcak.segment20,
'SEGMENT21',pcak.segment21,'SEGMENT22',pcak.segment22,'SEGMENT23',pcak.segment23,'SEGMENT24',pcak.segment24,'SEGMENT25',pcak.segment25,'SEGMENT26',pcak.segment26,'SEGMENT27',pcak.segment27,'SEGMENT28',pcak.segment28,'SEGMENT29',pcak.segment29,'SEGMENT30',pcak.segment30
)||chr(1)) within group (order by fis.segment_num),chr(1)),chr(1),max(fifs.concatenated_segment_delimiter))
from
fnd_id_flex_structures fifs,
fnd_id_flex_segments fis,
pay_payroll_gl_flex_maps ppgfm
where
gl.chart_of_accounts_id=fifs.id_flex_num and
fifs.application_id=101 and
fifs.id_flex_code='GL#' and
fifs.application_id=fis.application_id and
fifs.id_flex_code=fis.id_flex_code and
fifs.id_flex_num=fis.id_flex_num and
fis.enabled_flag='Y' and
fis.application_column_name=ppgfm.gl_account_segment(+) and
ppgfm.payroll_id(+)=pap.payroll_id and
ppgfm.gl_set_of_books_id(+)=pap.gl_set_of_books_id
) gl_account,
decode(:detail_level,null,null,
(
select
replace(rtrim(listagg(decode(fis.application_column_name,
'SEGMENT1',pcak.segment1,'SEGMENT2',pcak.segment2,'SEGMENT3',pcak.segment3,'SEGMENT4',pcak.segment4,'SEGMENT5',pcak.segment5,'SEGMENT6',pcak.segment6,'SEGMENT7',pcak.segment7,'SEGMENT8',pcak.segment8,'SEGMENT9',pcak.segment9,'SEGMENT10',pcak.segment10,
'SEGMENT11',pcak.segment11,'SEGMENT12',pcak.segment12,'SEGMENT13',pcak.segment13,'SEGMENT14',pcak.segment14,'SEGMENT15',pcak.segment15,'SEGMENT16',pcak.segment16,'SEGMENT17',pcak.segment17,'SEGMENT18',pcak.segment18,'SEGMENT19',pcak.segment19,'SEGMENT20',pcak.segment20,
'SEGMENT21',pcak.segment21,'SEGMENT22',pcak.segment22,'SEGMENT23',pcak.segment23,'SEGMENT24',pcak.segment24,'SEGMENT25',pcak.segment25,'SEGMENT26',pcak.segment26,'SEGMENT27',pcak.segment27,'SEGMENT28',pcak.segment28,'SEGMENT29',pcak.segment29,'SEGMENT30',pcak.segment30
)||chr(1)) within group (order by fis.segment_num),chr(1)),chr(1),max(fifs.concatenated_segment_delimiter))
from
fnd_id_flex_structures fifs,
fnd_id_flex_segments fis
where
pcak.id_flex_num=fifs.id_flex_num and
fifs.application_id=801 and
fifs.id_flex_code='COST' and
fifs.application_id=fis.application_id and
fifs.id_flex_code=fis.id_flex_code and
fifs.id_flex_num=fis.id_flex_num and
fis.enabled_flag='Y'
)
) costing_account,
decode(:detail_level,'Element',petfv.element_name,'Employee',petfv.element_name) element,
papf.employee_number,
papf.full_name employee_name,
paaf.assignment_number,
nvl(w.currency_code,decode(pivf.uom,'M',petfv.output_currency_code,null,null,'STAT')) currency,
xxen_util.yes(case when w.cost_allocation_keyflex_id=pap.suspense_account_keyflex_id then 'Y' end) suspense_account,
w.uncosted_assignments,
decode(w.record_type,'DUE',w.debit,'NO_GL',w.debit) costed_debit,
decode(w.record_type,'DUE',w.credit,'NO_GL',w.credit) costed_credit,
decode(w.record_type,'DUE',w.net,'NO_GL',w.net) costed_net,
decode(w.record_type,'NO_GL',w.net) no_gl_net,
decode(w.record_type,'DUE',w.debit) due_debit,
decode(w.record_type,'DUE',w.credit) due_credit,
decode(w.record_type,'TRANSFERRED',w.debit) transferred_debit,
decode(w.record_type,'TRANSFERRED',w.credit) transferred_credit,
decode(w.record_type,'TRANSFERRED',w.net) transferred_net,
decode(w.record_type,'POSTED',w.debit,'UNPOSTED',w.debit) journal_debit,
decode(w.record_type,'POSTED',w.credit,'UNPOSTED',w.credit) journal_credit,
decode(w.record_type,'POSTED',w.net,'UNPOSTED',w.net) journal_net,
decode(w.record_type,'POSTED',w.debit) posted_debit,
decode(w.record_type,'POSTED',w.credit) posted_credit,
decode(w.record_type,'INTERFACE',w.debit) interface_debit,
decode(w.record_type,'INTERFACE',w.credit) interface_credit,
w.gl_period,
w.journal_name
from
(
select
v.record_type,
case when v.record_type in ('POSTED','UNPOSTED','INTERFACE') then min(v.cost_payroll_action_id) over (partition by v.transfer_payroll_action_id,v.run_payroll_action_id) else v.cost_payroll_action_id end cost_payroll_action_id,
v.run_payroll_action_id,
v.transfer_payroll_action_id,
v.cost_allocation_keyflex_id,
v.element_type_id,
v.input_value_id,
v.assignment_id,
v.currency_code,
v.ledger_id,
v.debit,
v.credit,
nvl(v.debit,0)-nvl(v.credit,0) net,
v.uncosted_assignments,
v.gl_period,
v.journal_name,
ppa_r.action_type,
ppa_r.effective_date payroll_run_date,
ppa_r.date_earned,
ppa_r.business_group_id,
ppa_r.payroll_id,
ppa_r.consolidation_set_id,
ppa_r.time_period_id
from
(
select
decode(s.transfer_to_gl_flag,'N','NO_GL','DUE') record_type,
s.cost_payroll_action_id,
s.run_payroll_action_id,
t.transfer_payroll_action_id,
s.cost_allocation_keyflex_id,
s.element_type_id,
s.input_value_id,
s.assignment_id,
null currency_code,
to_number(null) ledger_id,
sum(decode(s.debit_or_credit,'D',s.costed_value)) debit,
sum(decode(s.debit_or_credit,'C',s.costed_value)) credit,
to_number(null) uncosted_assignments,
null gl_period,
null journal_name
from
(
select
ppa.payroll_action_id cost_payroll_action_id,
paa.assignment_action_id,
paa_r.payroll_action_id run_payroll_action_id,
pc.cost_allocation_keyflex_id,
prr.element_type_id,
pc.input_value_id,
decode(:detail_level,'Employee',paa.assignment_id) assignment_id,
pc.transfer_to_gl_flag,
pc.debit_or_credit,
pc.costed_value
from
pay_payroll_actions ppa,
pay_assignment_actions paa,
pay_costs pc,
pay_run_results prr,
pay_assignment_actions paa_r
where
ppa.action_type in ('C','S') and
ppa.effective_date>=:date_from and
ppa.effective_date<:date_to+1 and
2=2 and
ppa.payroll_action_id=paa.payroll_action_id and
paa.assignment_action_id=pc.assignment_action_id and
pc.run_result_id=prr.run_result_id and
prr.assignment_action_id=paa_r.assignment_action_id
) s,
(
select
paa.assignment_action_id,
paa_m.payroll_action_id run_payroll_action_id,
max(paa_t.payroll_action_id) transfer_payroll_action_id
from
pay_payroll_actions ppa,
pay_assignment_actions paa,
pay_action_interlocks pai_c,
pay_assignment_actions paa_t,
pay_payroll_actions ppa_t,
pay_action_interlocks pai_r,
pay_assignment_actions paa_m
where
ppa.action_type in ('C','S') and
ppa.effective_date>=:date_from and
ppa.effective_date<:date_to+1 and
2=2 and
ppa.payroll_action_id=paa.payroll_action_id and
paa.assignment_action_id=pai_c.locked_action_id and
pai_c.locking_action_id=paa_t.assignment_action_id and
paa_t.payroll_action_id=ppa_t.payroll_action_id and
ppa_t.action_type='T' and
paa_t.assignment_action_id=pai_r.locking_action_id and
pai_r.locked_action_id=paa_m.assignment_action_id
group by
paa.assignment_action_id,
paa_m.payroll_action_id
) t
where
s.assignment_action_id=t.assignment_action_id(+) and
s.run_payroll_action_id=t.run_payroll_action_id(+)
group by
decode(s.transfer_to_gl_flag,'N','NO_GL','DUE'),
s.cost_payroll_action_id,
s.run_payroll_action_id,
t.transfer_payroll_action_id,
s.cost_allocation_keyflex_id,
s.element_type_id,
s.input_value_id,
s.assignment_id
union all
select
'TRANSFERRED' record_type,
u.cost_payroll_action_id,
u.run_payroll_action_id,
u.transfer_payroll_action_id,
u.cost_allocation_keyflex_id,
null element_type_id,
null input_value_id,
u.assignment_id,
u.currency_code,
null ledger_id,
sum(u.entered_dr) debit,
sum(u.entered_cr) credit,
null uncosted_assignments,
null gl_period,
null journal_name
from
(
select
ppa.payroll_action_id cost_payroll_action_id,
pgi.run_payroll_action_id,
paa_t.payroll_action_id transfer_payroll_action_id,
pgi.cost_allocation_keyflex_id,
decode(:detail_level,'Employee',paa.assignment_id) assignment_id,
pgi.currency_code,
pgi.entered_dr,
pgi.entered_cr
from
pay_payroll_actions ppa,
pay_assignment_actions paa,
pay_action_interlocks pai,
pay_assignment_actions paa_t,
pay_payroll_actions ppa_t,
pay_gl_interface pgi
where
ppa.action_type in ('C','S') and
ppa.effective_date>=:date_from and
ppa.effective_date<:date_to+1 and
2=2 and
ppa.payroll_action_id=paa.payroll_action_id and
paa.assignment_action_id=pai.locked_action_id and
pai.locking_action_id=paa_t.assignment_action_id and
paa_t.payroll_action_id=ppa_t.payroll_action_id and
ppa_t.action_type='T' and
paa_t.assignment_action_id=pgi.assignment_action_id
) u
group by
u.cost_payroll_action_id,
u.run_payroll_action_id,
u.transfer_payroll_action_id,
u.cost_allocation_keyflex_id,
u.assignment_id,
u.currency_code
union all
select
decode(gjh.status,'P','POSTED','UNPOSTED') record_type,
null cost_payroll_action_id,
to_number(gjl.reference_5) run_payroll_action_id,
to_number(gjl.reference_1) transfer_payroll_action_id,
to_number(gjl.reference_2) cost_allocation_keyflex_id,
null element_type_id,
null input_value_id,
null assignment_id,
gjh.currency_code,
gjh.ledger_id,
sum(gjl.entered_dr) debit,
sum(gjl.entered_cr) credit,
null uncosted_assignments,
min(gjh.period_name) gl_period,
min(gjh.name) journal_name
from
gl_je_headers gjh,
gl_je_lines gjl
where
gjh.period_name in (
select
gp.period_name
from
gl_periods gp
where
gp.end_date>=(
select
min(least(ppa_r.effective_date,ppa_r.date_earned))
from
pay_payroll_actions ppa_r
where
ppa_r.action_type in (select pac.action_type from pay_action_classifications pac where pac.classification_name='COSTED') and
ppa_r.effective_date>=(select min(ppa_c.start_date) from pay_payroll_actions ppa_c where ppa_c.action_type in ('C','S') and ppa_c.effective_date>=:date_from and ppa_c.effective_date<:date_to+1) and
ppa_r.effective_date<:date_to+1
)
) and
gjh.je_category='Payroll' and
gjh.je_source='Payroll' and
gjh.actual_flag='A' and
gjh.je_header_id=gjl.je_header_id and
gjl.reference_1 in (select to_char(ppa_t.payroll_action_id) from pay_payroll_actions ppa_t where ppa_t.action_type='T' and ppa_t.effective_date>=:date_from and ppa_t.start_date<:date_to+1)
group by
decode(gjh.status,'P','POSTED','UNPOSTED'),
gjl.reference_5,
gjl.reference_1,
gjl.reference_2,
gjh.currency_code,
gjh.ledger_id
union all
select
'INTERFACE' record_type,
null cost_payroll_action_id,
to_number(gi.reference25) run_payroll_action_id,
to_number(gi.reference21) transfer_payroll_action_id,
to_number(gi.reference22) cost_allocation_keyflex_id,
null element_type_id,
null input_value_id,
null assignment_id,
gi.currency_code,
null ledger_id,
sum(gi.entered_dr) debit,
sum(gi.entered_cr) credit,
null uncosted_assignments,
null gl_period,
null journal_name
from
gl_interface gi
where
gi.user_je_source_name in (select gjs.user_je_source_name from gl_je_sources gjs where gjs.je_source_name='Payroll') and
gi.reference21 in (select to_char(ppa_t.payroll_action_id) from pay_payroll_actions ppa_t where ppa_t.action_type='T' and ppa_t.effective_date>=:date_from and ppa_t.start_date<:date_to+1)
group by
gi.reference25,
gi.reference21,
gi.reference22,
gi.currency_code
union all
select
'UNCOSTED' record_type,
null cost_payroll_action_id,
ppa.payroll_action_id run_payroll_action_id,
null transfer_payroll_action_id,
null cost_allocation_keyflex_id,
null element_type_id,
null input_value_id,
null assignment_id,
null currency_code,
null ledger_id,
null debit,
null credit,
count(*) uncosted_assignments,
null gl_period,
null journal_name
from
pay_payroll_actions ppa,
pay_assignment_actions paa
where
ppa.action_type in (select pac.action_type from pay_action_classifications pac where pac.classification_name='COSTED') and
ppa.effective_date>=:date_from and
ppa.effective_date<:date_to+1 and
2=2 and
ppa.payroll_action_id=paa.payroll_action_id and
paa.action_status='C' and
paa.source_action_id is null and
decode(ppa.action_type,'B',(select max(peef.balance_adj_cost_flag) from pay_element_entries_f peef where paa.assignment_action_id=peef.creator_id and peef.creator_type='B'),'Y')='Y' and
not exists (select null from pay_action_interlocks pai, pay_assignment_actions paa_c, pay_payroll_actions ppa_c where paa.assignment_action_id=pai.locked_action_id and pai.locking_action_id=paa_c.assignment_action_id and paa_c.payroll_action_id=ppa_c.payroll_action_id and ppa_c.action_type in ('C','S'))
group by
ppa.payroll_action_id
) v,
pay_payroll_actions ppa_r
where
v.run_payroll_action_id=ppa_r.payroll_action_id
) w,
pay_payroll_actions ppa_c,
pay_payroll_actions ppa_t,
hr_all_organization_units_vl haouv,
pay_all_payrolls_f pap,
gl_ledgers gl,
pay_consolidation_sets pcs,
per_time_periods ptp,
pay_cost_allocation_keyflex pcak,
pay_input_values_f pivf,
pay_element_types_f_vl petfv,
per_all_assignments_f paaf,
per_all_people_f papf
where
(w.cost_payroll_action_id is not null or w.record_type='UNCOSTED') and
w.cost_payroll_action_id=ppa_c.payroll_action_id(+) and
w.transfer_payroll_action_id=ppa_t.payroll_action_id(+) and
w.business_group_id=haouv.organization_id and
w.payroll_id=pap.payroll_id and
w.payroll_run_date between pap.effective_start_date and pap.effective_end_date and
pap.gl_set_of_books_id=gl.ledger_id(+) and
(w.ledger_id is null or w.ledger_id=pap.gl_set_of_books_id) and
w.consolidation_set_id=pcs.consolidation_set_id and
w.time_period_id=ptp.time_period_id and
w.cost_allocation_keyflex_id=pcak.cost_allocation_keyflex_id(+) and
w.input_value_id=pivf.input_value_id(+) and
w.date_earned between pivf.effective_start_date(+) and pivf.effective_end_date(+) and
w.element_type_id=petfv.element_type_id(+) and
w.date_earned between petfv.effective_start_date(+) and petfv.effective_end_date(+) and
w.assignment_id=paaf.assignment_id(+) and
w.date_earned between paaf.effective_start_date(+) and paaf.effective_end_date(+) and
paaf.person_id=papf.person_id(+) and
trunc(sysdate) between papf.effective_start_date(+) and papf.effective_end_date(+)
) x
group by
x.ledger,
x.business_group,
x.payroll,
x.consolidation_set,
x.payroll_period,
x.payroll_run_type,
x.payroll_run_date,
x.costing_date,
x.transfer_date,
x.gl_account,
x.costing_account,
x.element,
x.employee_number,
x.employee_name,
x.assignment_number,
x.currency,
x.suspense_account
) y
) z
where
1=1
order by
z.ledger,
z.payroll,
z.payroll_run_date,
z.costing_date,
z.gl_account,
z.costing_account,
z.currency,
z.element,
z.employee_name |