Monday, 31 October 2011

Cost Centre querie

/* Formatted on 31-08-2011 18:17:05 (QP5 v5.115.810.9015) */
SELECT   DISTINCT hou.name Operating_unit,
                  glcc.segment6 job_code,
                  aia.invoice_num,
                  aia.INVOICE_DATE,
                  aia.INVOICE_TYPE_LOOKUP_CODE,
                  aia.GL_DATE,
                  aia.invoice_amount,
                  aia.DOC_SEQUENCE_VALUE DOCUMENT_NO,
                  ACA.CHECK_ID,
                  ACA.CHECK_NUMBER,
                  ACA.CHECK_DATE,
                  glcc.CONCATENATED_SEGMENTS Acct_Code
  FROM   gl_code_combinations_kfv glcc,
         ap_invoices_all aia,
         ap_invoice_distributions_All aid,
         hr_operating_units hou,
         ap_invoice_payments_all aip,
         ap_checks_all aca
 WHERE       aia.set_of_books_id = 5
         AND aid.DIST_CODE_COMBINATION_ID = glcc.CODE_COMBINATION_ID
         AND aia.invoice_id = aid.invoice_id
         AND aia.org_id = aid.org_id
         AND hou.organization_id = aia.org_id
         AND aip.INVOICE_ID = aia.INVOICE_ID
         AND aca.check_id = aip.check_id
         AND glcc.segment6 IN
                  ('103P',
                   '111P ',
                   '114P ',
                   '112P ',
                   '101P',
                   '102P',
                   '104P',
                   '105P',
                   '106P',
                   '106P',
                   '110P',
                   '104P',
                   '105P',
                   '109P',
                   '55CC',
                   '54CC',
                   '63CC',
                   '57CC',
                   '58CC',
                   '61CC',
                   '62CC',
                   '59CC',
                   '103P',
                   '50CC')

No comments:

Post a Comment