Monday, 31 October 2011

po_loc_tax_details_v1.1

/* Formatted on 11-08-2011 01:20:16 (QP5 v5.115.810.9015) */
  SELECT   hou.name Operating_unit,
           po.po_header_id,
           po.PO_LINE_ID,
           (SELECT   vendor_name
              FROM   po_vendors
             WHERE   vendor_id = poh.vendor_id)
              PO_Vendor_Name,
           TO_NUMBER (poh.segment1) "PO NO",
           pol.LINE_NUm "Line No",
           tax.tax_id,
           tax.TAX_NAME,
           po.TAX_TYPE,
           tax.TAX_RATE,
           po.TAX_LINE_NO,
           po.PRECEDENCE_1,
           po.PRECEDENCE_2,
           po.PRECEDENCE_3,
           po.PRECEDENCE_4,
           po.PRECEDENCE_5,
           po.MODVAT_FLAG,
           po.TAX_AMOUNT,
           pov.vendor_name
    FROM   JA_IN_PO_LINE_LOCATION_TAXES po,
           JA_IN_TAX_CODES tax,
           po_vendors pov,
           po_headers_all poh,
           hr_operating_units hou,
           po_lines_all pol
   WHERE       po.TAX_ID = tax.TAX_ID
           AND pov.vendor_id = po.vendor_id
           AND po.po_header_id = poh.po_header_id
           AND poh.po_header_id = pol.po_header_id
           AND pol.po_line_id = po.po_line_id
           AND TRUNC (poh.creation_date) BETWEEN '01-JUL-2011'
                                             AND  '31-JUL-2011'
           AND hou.ORGANIZATION_ID = poh.org_id
           AND hou.set_of_books_id = 5
ORDER BY   po.po_header_id,
           po.PO_LINE_ID,
           TO_NUMBER (poh.segment1),
           pol.LINE_NUm,
           po.TAX_LINE_NO

No comments:

Post a Comment