Friday, 24 January 2014

AP TABLES AND LINKS

20 MAR 2013:
=================================

PAYMENT AND TERMS:


SELECT *FROM AP_TERMS WHERE NAME='ARA_20_DAYNET'

BANK ACCOPUNTS TABALES:

SELECT * FROM HZ_PARTIES
WHERE PARTY_NAME ='HALFDINNERBANK'

SELECT * FROM HZ_PARTIES WHERE PARTY_NAME='HALFDINNER BEGUMPET'

SELECT * FROM CE_BANK_ACCOUNTS WHERE BANK_ID='436619' AND BANK_BRANCH_ID='436621'-- BANK_ID=PARTY_ID AND PARTY_ID=BANK_BRANCH_NAME


SELECT * FROM  AP_SUPPLIERS WHERE VENDOR_NAME LIKE 'ARA%'


SUPPLIERS TABLES:


SELECT * FROM  AP_SUPPLIERS WHERE VENDOR_NAME ='ARAVIND Technologies'

SELECT * FROM AP_SUPPLIER_SITES_ALL WHERE VENDOR_ID=55264

SELECT * FROM AP_SUPPLIER_CONTACTS WHERE VENDOR_SITE_ID=7334

SELECT * FROM IBY_EXT_BANK_ACCOUNTS WHERE BANK_ID= 436619

7978--DOCUMENT NUMBER

AR1001--INVOICE NUMBER

INVOICE TABLES:

SELECT * FROM AP_INVOICES_ALL WHERE  INVOICE_NUM='AR1001'

SELECT * FROM AP_INVOICE_LINES_ALL WHERE INVOICE_ID=212547

SELECT * FROM AP_INVOICE_DISTRIBUTIONS_ALL WHERE INVOICE_ID=212547

SELECT * FROM AP_PAYMENT_SCHEDULES_ALL WHERE  INVOICE_ID=212547

PAYMENT TABLES:

SELECT * FROM AP_CHECKS_ALL WHERE CHECK_NUMBER=7978---    PICK CHEK NUMBER 
                                                    SELECT ACA.CHECK_NUMBER
                                                           FROM AP_CHECKS_ALL ACA,
                                                                AP_INVOICES_ALL AIA,
                                                                AP_INVOICE_PAYMENTS_ALL AIPA
                                                           WHERE AIA.INVOICE_NUM='AR1001'  
                                                           AND  AIA.INVOICE_ID=AIPA.INVOICE_ID
                                                           AND  AIPA.CHECK_ID=ACA.CHECK_ID
      --------------------------------

SELECT * FROM AP_INVOICE_PAYMENTS_ALL WHERE CHECK_ID=78177

21-03-2013:
=======================

select PHA.SEGMENT1 PO_NUMBER
     from po_headers_all pha,
          PO_LINES_ALL PLA,
          PO_LINE_LOCATIONS_ALL PLLA,
          PO_DISTRIBUTIONS_ALL PDA,
          ap_invoices_all aia,
          AP_INVOICE_LINES_ALL AILA
     where aia.INVOICE_NUM='MT1004'
     AND AIA.INVOICE_ID=AILA.INVOICE_ID
     AND PDA.PO_DISTRIBUTION_ID=AILA.PO_DISTRIBUTION_ID
     AND PHA.PO_HEADER_ID=PLA.PO_HEADER_ID
     AND PLA.PO_LINE_ID=PLLA.PO_LINE_ID
     AND PLLA.LINE_LOCATION_ID=PDA.LINE_LOCATION_ID
    
SELECT ACA.CHECK_NUMBER
      FROM AP_CHECKS_ALL ACA,
           AP_INVOICES_ALL AIA,
           AP_INVOICE_PAYMENTS_ALL AIPA
      WHERE AIA.INVOICE_NUM='MT1004'  
      AND  AIA.INVOICE_ID=AIPA.INVOICE_ID
      AND  AIPA.CHECK_ID=ACA.CHECK_ID
     
SELECT     ASA.VENDOR_NAME   
       FROM AP_SUPPLIERS ASA,
            AP_INVOICES_ALL AIA
       WHERE AIA.VENDOR_ID = ASA.VENDOR_ID
       AND AIA.INVOICE_NUM='MT1004'    
      
SELECT AT.NAME TERM_NAME
     FROM AP_INVOICES_ALL AIA,
          AP_TERMS AT
     WHERE AIA.INVOICE_NUM='MT1004'
     AND  AIA.TERMS_ID=AT.TERM_ID   

1 comment: