Thursday, 22 May 2014

Query to find Payroll details posted to GL in R12

select
 PAPF.EMPLOYEE_NUMBER,
 PAPF.FIRST_NAME ||' '||PAPF.LAST_NAME EMPLOYEENAME,
 XAL.DESCRIPTION,
 NVL(NVL(-xal.accounted_cr,xal.accounted_dr),0) amount
FROM xla.xla_ae_headers xah,
 xla.xla_ae_lines xal,
 xla_distribution_links xdl,
 gl_code_combinations gcc,
 xla.xla_transaction_entities xte,
 gl_import_references gir,
 gl_je_headers gjh,
 gl_je_lines gjl,
 pay_assignment_actions paa,
 per_all_assignments_f paaf,
 PER_ALL_PEOPLE_F PAPF
WHERE XAH.AE_HEADER_ID = XAL.AE_HEADER_ID
AND gcc.code_combination_id = xal.code_combination_id
AND xdl.ae_header_id = xah.ae_header_id
AND xdl.ae_line_num = xal.ae_line_num
AND xte.entity_id = xah.entity_id
AND xal.gl_sl_link_id = gir.gl_sl_link_id
AND gir.je_header_id = gjl.je_header_id
AND gir.je_line_num = gjl.je_line_num
AND gir.je_header_id = gjh.je_header_id
AND gjl.je_header_id = gjh.je_header_id
AND paa.assignment_action_id = xdl.source_distribution_id_num_1
AND paa.assignment_id = paaf.assignment_id
AND PAAF.PERSON_ID = PAPF.PERSON_ID
AND TRUNC(sysdate) BETWEEN TRUNC(paaf.EFFECTIVE_START_DATE) AND
TRUNC(paaf.EFFECTIVE_END_DATE)
and TRUNC(sysdate) between TRUNC(PAPF.EFFECTIVE_START_DATE) and
TRUNC(PAPF.EFFECTIVE_END_DATE)
and GJH.PERIOD_NAME='DEC-10'
and JE_CATEGORY_NAME='Payroll'

3 comments:

  1. Great post.......In accounting, payroll refers to the amount paid to employees for services they provided during a certain period of time. Payroll plays a major role in a company for several reasons.Learn More

    ReplyDelete
  2. Bayzat is the one of the best work life HR software that unifies HR, Payroll, and employee management in Dubai, UAE. payroll system

    ReplyDelete
  3. I’m going to read this. I’ll be sure to come back. thanks for sharing. and also This article gives the light in which we can observe the reality. this is very nice one and gives indepth information. thanks for this nice article... Payroll Software in India

    ReplyDelete