Friday, 4 July 2014

0 TAX Query in Oracle Apps

/* Formatted on 7/4/2014 3:36:24 PM (QP5 v5.115.810.9015) */
SELECT a.invoice_id,
       DECODE (c.organization_type_lookup_code, 'Company', 2, 1) deducteecode,
       c.vendor_name,
       'N' bookentry,
       0 interest,
       0 other,
       c.segment1 vendor_code,
       c.vendor_id,
       b.vendor_site_id,
       b.vendor_site_code,
       b.address_line1,
       b.address_line2,
       b.address_line3,
       b.address_line4,
       b.city,
       b.state,
       a.invoice_num,
       a.invoice_date,
       a.org_id,
       d.period_name,
       e.tax_name,
       d.amount,
       d.accounting_date
FROM apps.ap_invoices_all a,
     apps.po_vendor_sites_all b,
     apps.po_vendors c,
     apps.ap_invoice_distributions_all d,
     apps.jai_cmn_taxes_all e
WHERE     a.vendor_id = b.vendor_id
      AND a.vendor_site_id = b.vendor_site_id
      AND b.vendor_id = c.vendor_id
      AND a.org_id = b.org_id
      AND a.invoice_id = d.invoice_id
      AND d.global_attribute1 = e.tax_id
--AND A.ORG_ID=D.ORG_ID
--AND A.ORG_ID=90
--AND E.TAX_NAME IN ('03 194C 0%N','03 194C 0%C')
--AND D.ACCOUNTING_DATE >= '01-JUL-2011'
--AND A.INVOICE_NUM='RECEIPT/36040127/2462460'
ORDER BY 1

No comments:

Post a Comment