[E-Bussiness Suite] Query Invoice Details AP


Deskripsi
     Untuk menampilkan nama vendor , deskripsi , no_pajak , invoice number , dpp , ppn 10% , tanggal invoice , tanggal faktur.

Howto
select pv.VENDOR_NAME as Nama_PT
      ,ai.DESCRIPTION as Deskripsi
      ,data_tax.ATTRIBUTE1 as No_Pajak
      ,ai.INVOICE_NUM as Invoice_Number
      ,data_item.amount as DPP
      ,data_tax.amount as PPN
      ,to_date(ai.INVOICE_DATE,'DD/MM/YYYY') as Tanggal_Invoice
      ,data_tax.ATTRIBUTE2 as Tanggal_Faktur
      --,aid.INVOICE_ID
from ap_invoices_all ai
    ,po_vendors pv
    ,(
        select aid.INVOICE_ID, aid.attribute1, aid.attribute2, aid.AMOUNT
        from ap_invoice_distributions aid
        where aid.LINE_TYPE_LOOKUP_CODE = 'TAX'
     ) data_tax
    ,(
        select aid.INVOICE_ID, aid.AMOUNT
        from ap_invoice_distributions aid
        where aid.LINE_TYPE_LOOKUP_CODE = 'ITEM'
     ) data_item

where ai.GL_DATE >= to_date('01/08/2013','DD/MM/YYYY')
and ai.GL_DATE <= to_date('31/08/2013','DD/MM/YYYY')
and ai.INVOICE_NUM = '1130144'
and ai.VENDOR_ID = pv.VENDOR_ID
and ai.INVOICE_ID = data_tax.INVOICE_ID
and ai.INVOICE_ID = data_item.INVOICE_ID
;

Post a Comment

Harap gunakan bahasa yang baik dan sopan, terima kasih