Sie sind auf Seite 1von 27

be happy and make others to be happy WEDNESDAY, 6 JUNE 2012 ORACLE APPS ALL QUERIES ORACLE APPS ALL

QUERIES ALL QUERIES 1 REPAY INVOICE DETAILS SELECT aid1.ROWID row_id, aid1.invoice_id invoice_id, aid1.invoice_distribution_id invoice_distribution_id, aid1.prepay_distribution_id prepay_distribution_id, aid2.distribution_line_number prepay_dist_number, (-1) * aid1.amount prepay_amount_applied, aid1.dist_code_combination_id dist_code_combination_id, aid2.accounting_date accounting_date, aid1.period_name period_name, aid1.set_of_books_id set_of_books_id, aid1.description description, aid1.po_distribution_id po_distribution_id, aid1.rcv_transaction_id rcv_transaction_id, aid1.org_id org_id, ai.invoice_num invoice_num, ai.vendor_id vendor_id, ai.vendor_site_id vendor_site_id, aid2.invoice_id prepay_id, ai2.invoice_num prepayment_invoice_num FROM ap_invoices_all ai, ap_invoice_distributions_all aid1, ap_invoice_distributions_all aid2, ap_invoices_all ai2 WHERE aid1.prepay_distribution_id = aid2.invoice_distribution_id AND ai.invoice_id = aid1.invoice_id AND aid1.amount < 0 AND NVL (aid1.reversal_flag, 'N') != 'Y' AND aid1.line_type_lookup_code = 'PREPAY' AND ai.invoice_type_lookup_code NOT IN('PREPAYMENT', 'CREDIT', 'DEBIT') and ai2.invoice_id = aid2.invoice_id / PO ALL RECEIPTS SELECT RCV_SHIPMENT_LINES.SHIPMENT_LINE_ID, PO_VENDORS.VENDOR_NAME, DECODE(RCV_SHIPMENT_HEADERS.VENDOR_SITE_ID, NULL, NULL,PO_VENDOR_SITES_ALL.VENDO R_SITE_CODE) VENDOR_SITE, PO_VENDOR_SITES_ALL.ADDRESS_LINE1, PO_VENDOR_SITES_ALL.ADDRESS_LINE2, PO_VENDOR_SITES_ALL.ADDRESS_LINE3, PO_VENDOR_SITES_ALL.CITY, PO_VENDOR_SITES_ALL.STATE, PO_VENDOR_SITES_ALL.COUNTRY, DECODE(RCV_SHIPMENT_LINES.PO_HEADER_ID,NULL,'Unordered','Ordered') AS RECEIPT_TY PE, RCV_SHIPMENT_HEADERS.RECEIPT_NUM, RCV_SHIPMENT_HEADERS.CREATION_DATE AS RECEIPT_DATE, RCV_SHIPMENT_LINES.SHIP_TO_LOCATION_ID, HR_LOCATIONS.LOCATION_CODE||'-'||HR_LOCATIONS.DESCRIPTION AS SHIP_TO_LOCATION, RCV_SHIPMENT_HEADERS.SHIP_TO_ORG_ID, HR_ALL_ORGANIZATION_UNITS_TL.NAME AS ORGANIZATION, RCV_SHIPMENT_HEADERS.EMPLOYEE_ID, PER_ALL_PEOPLE_F.FULL_NAME, RCV_SHIPMENT_HEADERS.PACKING_SLIP, RCV_SHIPMENT_HEADERS.SHIPPED_DATE, RCV_SHIPMENT_HEADERS.FREIGHT_CARRIER_CODE,

RCV_SHIPMENT_HEADERS.FREIGHT_TERMS, RCV_SHIPMENT_LINES.CATEGORY_ID, MTL_CATEGORIES_V.SEGMENT1||'.'||MTL_CATEGORIES_V.SEGMENT2 AS CATEGORY_SUBCAT, RCV_SHIPMENT_LINES.QUANTITY_SHIPPED, RCV_SHIPMENT_LINES.QUANTITY_RECEIVED, RCV_SHIPMENT_LINES.UNIT_OF_MEASURE, RCV_SHIPMENT_LINES.ITEM_DESCRIPTION, PO_HEADERS.SEGMENT1 AS PO_NUM, PO_HEADERS.CREATION_DATE AS PO_DATE, RCV_SHIPMENT_LINES.PO_LINE_ID, RCV_SHIPMENT_LINES.PO_DISTRIBUTION_ID, RCV_SHIPMENT_LINES.REQUISITION_LINE_ID, RCV_SHIPMENT_LINES.DELIVER_TO_PERSON_ID, DISC_RCV_DELIVERY.DELIVERY_DATE, RCV_SHIPMENT_HEADERS.COMMENTS AS HEADER_NOTE, DISC_PO_DISTRIBUTION_DSC.GL_NAME_SEG1, DISC_PO_DISTRIBUTION_DSC.GL_NAME_SEG2, DISC_PO_DISTRIBUTION_DSC.GL_NAME_SEG3, DISC_PO_DISTRIBUTION_DSC.GL_NAME_SEG4, DISC_PO_DISTRIBUTION_DSC.GL_NAME_SEG5, DISC_PO_DISTRIBUTION_DSC.GL_NAME_SEG6, DISC_PO_DISTRIBUTION_DSC.QUANTITY_ORDERED, DISC_PO_DISTRIBUTION_DSC.QUANTITY_BILLED, DISC_PO_DISTRIBUTION_DSC.QUANTITY_DELIVERED , PO_LINES_ALL.UNIT_PRICE, PO_HEADERS.CURRENCY_CODE, PO_LINE_LOCATIONS_ALL.PROMISED_DATE, DECODE(RCV_SHIPMENT_LINES.ROUTING_HEADER_ID, 2, 'Yes','No') AS INSPECTION_REQUIR ED, DISC_RCV_ACCEPTANCE.INSPECTION_STATUS_CODE, DISC_RCV_RETURN.RETURN_DATE, DISC_RCV_RETURN.TRANSACTION_TYPE AS RETURN_TRANSACTION_CODE FROM RCV_SHIPMENT_HEADERS RCV_SHIPMENT_HEADERS, RCV_SHIPMENT_LINES RCV_SHIPMENT_LINES, DISC_RCV_DELIVERY DISC_RCV_DELIVERY, DISC_RCV_RETURN DISC_RCV_RETURN, PO_VENDORS PO_VENDORS, PO_VENDOR_SITES_ALL PO_VENDOR_SITES_ALL, HR_LOCATIONS HR_LOCATIONS, HR_ALL_ORGANIZATION_UNITS_TL HR_ALL_ORGANIZATION_UNITS_TL, PER_ALL_PEOPLE_F PER_ALL_PEOPLE_F, PO_HEADERS_ALL PO_HEADERS, MTL_CATEGORIES_V MTL_CATEGORIES_V, DISC_PO_DISTRIBUTION_DSC DISC_PO_DISTRIBUTION_DSC, PO_LINES_ALL PO_LINES_ALL, PO_LINE_LOCATIONS_ALL PO_LINE_LOCATIONS_ALL, DISC_RCV_ACCEPTANCE WHERE RCV_SHIPMENT_HEADERS.SHIPMENT_HEADER_ID = RCV_SHIPMENT_LINES.SHIPMENT_HEADER_ID AND RCV_SHIPMENT_HEADERS.VENDOR_ID = PO_VENDORS.VENDOR_ID AND PO_VENDORS.VENDOR_ID = PO_VENDOR_SITES_ALL.VENDOR_ID AND NVL(RCV_SHIPMENT_HEADERS.VENDOR_SITE_ID,(SELECT MAX(s.vendor_site_id) FROM p o_vendor_sites_all s WHERE s.vendor_id = PO_VENDORS.VENDOR_ID ) ) = PO_VENDOR_SI TES_ALL.VENDOR_SITE_ID AND RCV_SHIPMENT_LINES.SHIP_TO_LOCATION_ID = HR_LOCATIONS.LOCATION_ID AND RCV_SHIPMENT_HEADERS.SHIP_TO_ORG_ID = HR_ALL_ORGANIZATION_UNITS_TL.ORGANIZAT ION_ID AND RCV_SHIPMENT_HEADERS.EMPLOYEE_ID = PER_ALL_PEOPLE_F.PERSON_ID (+) AND RCV_SHIPMENT_LINES.PO_HEADER_ID = PO_HEADERS.PO_HEADER_ID (+)

AND RCV_SHIPMENT_LINES.PO_DISTRIBUTION_ID = DISC_PO_DISTRIBUTION_DSC.PO_DISTRIBU TION_ID (+) AND RCV_SHIPMENT_LINES.SHIPMENT_HEADER_ID = DISC_RCV_DELIVERY.SHIPMENT_HEADER_ID (+) AND RCV_SHIPMENT_LINES.SHIPMENT_LINE_ID = DISC_RCV_DELIVERY.SHIPMENT_LINE_ID (+) AND RCV_SHIPMENT_LINES.PO_LINE_ID = PO_LINES_ALL.PO_LINE_ID (+) AND RCV_SHIPMENT_LINES.PO_LINE_LOCATION_ID = PO_LINE_LOCATIONS_ALL.LINE_LOCATION _ID (+) AND MTL_CATEGORIES_V.CATEGORY_ID = RCV_SHIPMENT_LINES.CATEGORY_ID AND RCV_SHIPMENT_LINES.SHIPMENT_LINE_ID = DISC_RCV_ACCEPTANCE.SHIPMENT_LINE_ID ( +) AND RCV_SHIPMENT_LINES.SHIPMENT_LINE_ID = DISC_RCV_RETURN.SHIPMENT_LINE_ID (+) AND DECODE(RCV_SHIPMENT_HEADERS.EMPLOYEE_ID,NULL,SYSDATE,RCV_SHIPMENT_HEADERS.CR EATION_DATE) BETWEEN DECODE(RCV_SHIPMENT_HEADERS.EMPLOYEE_ID,NULL,SYSDATE,PER_AL L_PEOPLE_F.effective_start_date) AND DECODE(RCV_SHIPMENT_HEADERS.EMPLOYEE_ID,NUL L,SYSDATE,PER_ALL_PEOPLE_F.effective_end_date) / PO DETAILS QUERY SELECT disc_gl_set_of_books.set_of_books_id, disc_gl_set_of_books.description AS set_of_books, disc_gl_set_of_books.set_of_book_currency, po_headers_all.segment1 AS po_number, po_headers_all.creation_date AS po_date, po_headers_all.revision_num AS po_revision_num, po_headers_all.currency_code, po_headers_all.rate_type exchange_rate_type, po_headers_all.rate_date exchange_rate_date, po_headers_all.rate exchange_rate, po_headers_all.comments AS description, po_headers_all.type_lookup_code AS po_type, NVL (po_headers_all.approved_flag, 'N') AS approved_flag, po_headers_all.approved_date, po_headers_all.fob_lookup_code AS fob, po_headers_all.freight_terms_lookup_code AS freight_terms, po_headers_all.closed_code AS closure_status, po_headers_all.authorization_status AS approval_status, --PO_HEADERS_ALL.TERMS_ID, ap_terms.NAME AS payment_terms, po_lines_all.item_description, disc_item_master.segment1 AS item_code, po_lines_all.list_price_per_unit, po_lines_all.unit_price, po_lines_all.closed_code AS line_closed_code, po_distributions_all.quantity_billed, po_distributions_all.quantity_cancelled, po_distributions_all.quantity_delivered, po_line_locations_all.quantity_received, disc_po_accepted_qty.quantity quantity_accepted, po_distributions_all.quantity_ordered, po_lines_all.category_id, NVL (mtl_categories_v.description, 'Undefined' ) AS category_description, mtl_categories_v.segment1 AS CATEGORY, mtl_categories_v.segment2 AS sub_category, ( po_lines_all.unit_price * po_distributions_all.quantity_ordered * DECODE (po_distributions_all.rate, NULL, 1, po_distributions_all.rate ) ) AS po_value, ( po_lines_all.unit_price * po_distributions_all.quantity_delivered

* DECODE (po_distributions_all.rate, NULL, 1, po_distributions_all.rate ) ) AS po_received_value, ( po_lines_all.unit_price * po_distributions_all.quantity_billed * DECODE (po_distributions_all.rate, NULL, 1, po_distributions_all.rate ) ) AS po_billed_value, ( po_lines_all.unit_price * po_distributions_all.quantity_cancelled * DECODE (po_distributions_all.rate, NULL, 1, po_distributions_all.rate ) ) AS po_cancelled_value, --DISC_PO_TAX.TOTAL_AMOUNT AS TOTAL_TAX_AMOUNT, 0 AS total_tax_amount, po_headers_all.creation_date AS po_created_date, po_distributions_all.project_id, po_distributions_all.task_id, po_distributions_all.expenditure_type, po_distributions_all.expenditure_organization_id, po_distributions_all.expenditure_item_date, po_vendors.vendor_id, po_vendors.vendor_name, po_headers_all.vendor_site_id, po_headers_all.closed_code, --PO_DISTRIBUTIONS_ALL.CODE_COMBINATION_ID AS PO_CCID, po_ccid_dsc.gl_seg1 AS charge_gl_seg1, po_ccid_dsc.gl_seg2 AS charge_gl_seg2, po_ccid_dsc.gl_seg3 AS charge_gl_seg3, po_ccid_dsc.gl_seg4 AS charge_gl_seg4, po_ccid_dsc.gl_seg5 AS charge_gl_seg5, po_ccid_dsc.gl_seg6 AS charge_gl_seg6, po_ccid_dsc.gl_seg2 AS charge_gl_seg7, po_ccid_dsc.gl_seg3 AS charge_gl_seg8, po_ccid_dsc.gl_seg4 AS charge_gl_seg9, po_ccid_dsc.gl_seg5 AS charge_gl_seg10, po_ccid_dsc.gl_seg6 AS charge_gl_seg11, po_ccid_dsc.gl_name_seg1 AS charge_gl_name_seg1, po_ccid_dsc.gl_name_seg2 AS charge_gl_name_seg2, po_ccid_dsc.gl_name_seg3 AS charge_gl_name_seg3, po_ccid_dsc.gl_name_seg4 AS charge_gl_name_seg4, po_ccid_dsc.gl_name_seg5 AS charge_gl_name_seg5, po_ccid_dsc.gl_name_seg6 AS charge_gl_name_seg6, po_ccid_dsc.gl_name_seg2 AS charge_gl_name_seg7, po_ccid_dsc.gl_name_seg3 AS charge_gl_name_seg8, po_ccid_dsc.gl_name_seg4 AS charge_gl_name_seg9, po_ccid_dsc.gl_name_seg5 AS charge_gl_name_seg10, po_ccid_dsc.gl_name_seg6 AS charge_gl_name_seg11, po_ccid_accrual.gl_seg1 AS accrual_gl_seg1, po_ccid_accrual.gl_seg2 AS accrual_gl_seg2, po_ccid_accrual.gl_seg3 AS accrual_gl_seg3, po_ccid_accrual.gl_seg4 AS accrual_gl_seg4, po_ccid_accrual.gl_seg5 AS accrual_gl_seg5, po_ccid_accrual.gl_seg6 AS accrual_gl_seg6, po_ccid_accrual.gl_seg2 AS accrual_gl_seg7, po_ccid_accrual.gl_seg3 AS accrual_gl_seg8, po_ccid_accrual.gl_seg4 AS accrual_gl_seg9,

po_ccid_accrual.gl_seg5 AS accrual_gl_seg10, po_ccid_accrual.gl_seg6 AS accrual_gl_seg11, po_ccid_accrual.gl_name_seg1 AS accrual_gl_name_seg1, po_ccid_accrual.gl_name_seg2 AS accrual_gl_name_seg2, po_ccid_accrual.gl_name_seg3 AS accrual_gl_name_seg3, po_ccid_accrual.gl_name_seg4 AS accrual_gl_name_seg4, po_ccid_accrual.gl_name_seg5 AS accrual_gl_name_seg5, po_ccid_accrual.gl_name_seg6 AS accrual_gl_name_seg6, po_ccid_accrual.gl_name_seg2 AS accrual_gl_name_seg7, po_ccid_accrual.gl_name_seg3 AS accrual_gl_name_seg8, po_ccid_accrual.gl_name_seg4 AS accrual_gl_name_seg9, po_ccid_accrual.gl_name_seg5 AS accrual_gl_name_seg10, po_ccid_accrual.gl_name_seg6 AS accrual_gl_name_seg11, disc_po_status_reason.note AS status_reason, disc_pro_req_dist_map.req_num as req_number FROM po_headers_all po_headers_all, po_lines_all po_lines_all, po_distributions_all po_distributions_all, po_vendors po_vendors, disc_ccid_dsc_mv po_ccid_dsc, disc_ccid_dsc_mv po_ccid_accrual, po_line_locations_all po_line_locations_all, mtl_categories_v mtl_categories_v, ap_terms ap_terms, --DISC_PO_TAX DISC_PO_TAX , apps.disc_gl_set_of_books disc_gl_set_of_books, disc_po_status_reason disc_po_status_reason, disc_po_accepted_qty disc_po_accepted_qty, disc_item_master disc_item_master, disc_pro_req_dist_map disc_pro_req_dist_map WHERE po_distributions_all.po_header_id = po_headers_all.po_header_id AND po_distributions_all.po_line_id = po_lines_all.po_line_id AND po_distributions_all.line_location_id = po_line_locations_all.line_location_id AND po_headers_all.po_header_id = po_lines_all.po_header_id AND po_line_locations_all.po_header_id = po_lines_all.po_header_id AND po_line_locations_all.po_line_id = po_lines_all.po_line_id AND NVL (po_line_locations_all.cancel_flag, 'N') = 'N' AND po_vendors.vendor_id = po_headers_all.vendor_id AND po_ccid_dsc.code_combination_id = po_distributions_all.code_combination_id AND po_ccid_accrual.code_combination_id = po_distributions_all.accrual_account_id AND mtl_categories_v.category_id = po_lines_all.category_id AND po_headers_all.terms_id = ap_terms.term_id(+) AND disc_gl_set_of_books.set_of_books_id = po_distributions_all.set_of_books_id AND po_headers_all.po_header_id = disc_po_status_reason.object_id(+) AND po_distributions_all.po_header_id = disc_po_accepted_qty.po_header_id(+) AND po_distributions_all.po_line_id = disc_po_accepted_qty.po_line_id(+) AND po_distributions_all.line_location_id = disc_po_accepted_qty.po_line_locatio n_id(+) AND disc_item_master.inventory_item_id = po_lines_all.item_id -- AND po_distributions_all.req_header_reference_num = po_requisition_headers_al l.requisition_header_id(+) -- AND po_distributions_all.req_line_reference_num = po_requisition_lines_all.re quisition_line_id(+) AND po_distributions_all.REQ_DISTRIBUTION_ID = disc_pro_req_dist_map.DISTRIBUTIO N_ID (+) /

AP PAYMENT ANALYSYS SELECT ap_invoice_payments_all.accounting_date, ap_invoice_payments_all.amount, ap_invoice_payments_all.check_id, ap_invoice_payments_all.invoice_id, ap_invoice_payments_all.invoice_payment_id, ap_invoice_payments_all.payment_num, ap_invoice_payments_all.bank_account_num, ap_invoices_all.invoice_num, --ap_invoices_all.invoice_date, AP_INVOICES_ALL.DOC_SEQUENCE_VALUE , ap_invoices_all.invoice_currency_code, ap_invoices_all.payment_currency_code, ap_invoices_all.vendor_id, ap_invoices_all.vendor_site_id, po_vendors.vendor_name, ap_invoices_all.invoice_amount, ap_invoices_all.amount_paid, ap_invoices_all.invoice_date, ap_invoices_all.description, ap_invoices_all.tax_amount, po_vendor_sites_all.vendor_site_code, ap_checks_all.amount check_amount, ap_checks_all.bank_account_id, ap_checks_all.bank_account_name, ap_checks_all.address_line1, ap_checks_all.address_line2, ap_checks_all.address_line3, ap_checks_all.city, --ap_checks_all.vendor_name, --ap_checks_all.vendor_site_code, --ap_checks_all.bank_account_num, ap_checks_all.bank_num, ap_checks_all.check_voucher_num, --ap_invoices_all.attribute6 AS "LOA/WO/PO NUM", --ap_invoices_all.attribute7 AS "C-Form NUM" , disc_gl_month.period_name, --Added by CV AP_CHECKS_ALL.STATUS_LOOKUP_CODE, AP_CHECKS_ALL.CHECK_NUMBER, AP_CHECKS_ALL.PAYMENT_TYPE_FLAG, AP_CHECKS_ALL.DOC_SEQUENCE_ID, AP_CHECKS_ALL.DOC_SEQUENCE_VALUE FROM ap_invoice_payments_all, ap_invoices_all ap_invoices_all, po.po_vendors po_vendors, ap_checks_all ap_checks_all, po.po_vendor_sites_all po_vendor_sites_all, disc_gl_month disc_gl_month WHERE ap_invoice_payments_all.reversal_flag <> 'y' AND ap_invoices_all.invoice_id = ap_invoice_payments_all.invoice_id AND po_vendors.vendor_id = ap_invoices_all.vendor_id AND po_vendor_sites_all.vendor_site_id = ap_invoices_all.vendor_site_id AND ap_invoice_payments_all.check_id = ap_checks_all.check_id (+) and ap_invoice_payments_all.accounting_date between disc_gl_month.start_date and disc_gl_month.end_date / AP INVOICE QUERY SELECT aiv.vendor_name, vendor_number, aiv.vendor_site_code,

NVL (aiv.amount_paid, 0) amount_paid, aiv.approved_amount, aiv.description, aiv.doc_sequence_value, aiv.expenditure_item_date, aiv.expenditure_type, NVL (aiv.invoice_amount, 0) invoice_amount, aiv.invoice_currency_code, aiv.invoice_date, aiv.invoice_id, aiv.invoice_num, aiv.base_amount, aiv.invoice_type_lookup_code, aiv.terms_date, aiv.batch_name, aiv.invoice_type, aiv.payment_status, aiv.actual_invoice_amount, aiv.doc_sequence_name, aiv.set_of_books_id, aiv.org_id, aiv.set_of_books_name, aiv.expenditure_organization_name, aiv.distribution_total, aiv.approval_status_lookup_code, aiv.po_number, aiv.receipt_number, aiv.gl_date, aiv.period_name, aiv.prepayments_applied_flag, aiv.payments_exist_flag, aiv.prepay_amount_applied, aiv.project, aiv.task, aiv.pay_curr_invoice_amount, NVL (aiv.invoice_amount, 0) - NVL (aiv.amount_paid, 0) net_due, -DECODE (aiv.invoice_type, 'Prepayment', DECODE (aiv.approval_status_lookup_code, 'AVAILABLE', - (NVL (aiv.amount_paid, 0 ) ) ), 0 ) advance, ffvt.description liability_account, ( segment1 || '.' || segment2 || '.' || segment3 || '.' || segment4 || '.' || segment5 || '.' || segment6 || '.' || segment7 || '.' || segment8 || '.' || segment9 || '.' || segment10 || '.' || segment11 ) liability_code, aiv.POSTING_STATUS, decode(aiv.POSTING_FLAG,'Y','Accounted', 'P','Partial', 'N', 'Not Accounted','Ot her') as POSTING_FLAG, aiv.EXCHANGE_RATE --NVL(NET_DUE,0)+NVL(ADVANCE,0) NET_OUTSTANDING FROM DISC_AP_INVOICES_ALL_V aiv, gl_code_combinations gcc, fnd_flex_values_vl ffvt WHERE gcc.code_combination_id = aiv.accts_pay_code_combination_id AND gcc.segment2 = ffvt.flex_value AND ffvt.flex_value_set_id = 1008011 and aiv.invoice_id in (select distinct(invoice_id) from AP_INVOICE_DISTRIBUTIONS _ALL) /

AP INVOICE DETAIL SELECT disc_gl_set_of_books.set_of_books_id, disc_gl_set_of_books.description AS set_of_books, disc_gl_set_of_books.set_of_book_currency AS set_of_book_currency, disc_ccid_dsc_mv.gl_seg1, disc_ccid_dsc_mv.gl_seg2, disc_ccid_dsc_mv.gl_seg3, disc_ccid_dsc_mv.gl_seg4, disc_ccid_dsc_mv.gl_seg5, disc_ccid_dsc_mv.gl_seg6, disc_ccid_dsc_mv.gl_seg7, disc_ccid_dsc_mv.gl_seg8, disc_ccid_dsc_mv.gl_seg9, disc_ccid_dsc_mv.gl_seg10, disc_ccid_dsc_mv.gl_seg11, disc_ccid_dsc_mv.gl_name_seg1, disc_ccid_dsc_mv.gl_name_seg2, disc_ccid_dsc_mv.gl_name_seg3, disc_ccid_dsc_mv.gl_name_seg4, disc_ccid_dsc_mv.gl_name_seg5, disc_ccid_dsc_mv.gl_name_seg6, disc_ccid_dsc_mv.gl_name_seg7, disc_ccid_dsc_mv.gl_name_seg8, disc_ccid_dsc_mv.gl_name_seg9, disc_ccid_dsc_mv.gl_name_seg10, disc_ccid_dsc_mv.gl_name_seg11, disc_ccid_dsc_mv1.gl_seg2 as liab_gl_seg2, disc_ccid_dsc_mv1.gl_name_seg2 as liab_gl_name_seg2, ap_invoices_all.invoice_num, ap_invoices_all.invoice_date, INITCAP (ap_invoices_all.invoice_type_lookup_code ) invoice_type_lookup_code, --AP_INVOICES_ALL.INVOICE_AMOUNT, ap_invoices_all.invoice_currency_code, ap_invoices_all.payment_currency_code, --AP_INVOICES_ALL.DESCRIPTION, --AP_INVOICES_ALL.EXCHANGE_RATE, ap_invoices_all.vendor_id, ap_invoices_all.vendor_site_id, po_vendor_sites_all.vendor_site_code, ap_invoice_distributions_all.accounting_date, ap_invoice_distributions_all.description, ap_invoice_distributions_all.amount, ap_invoice_distributions_all.base_amount, ap_invoice_distributions_all.period_name, ap_invoice_distributions_all.exchange_rate, ap_invoice_distributions_all.attribute4, --AP_INVOICES_PKG.GET_POSTING_STATUS(AP_INVOICES_ALL.INVOICE_ID) POSTING_FLAG , ap_invoices_pkg.get_approval_status (ap_invoices_all.invoice_id, ap_invoices_all.invoice_amount, ap_invoices_all.payment_status_flag, ap_invoices_all.invoice_type_lookup_code ) approval_status_lookup_code, --AP_INVOICES_PKG.SELECTED_FOR_PAYMENT_FLAG(AP_INVOICES_ALL.INVOICE_ID) SELECTED _FOR_PAYMENT_FLAG , --AP_INVOICES_PKG.GET_UNPOSTED_VOID_PAYMENT (AP_INVOICES_ALL.INVOICE_ID) UNPOSTE D_VOID_PAYMENT_FLAG , --AP_INVOICES_PKG.GET_DISCOUNT_PAY_DISTS_FLAG (AP_INVOICES_ALL.INVOICE_ID) DISCO UNT_PAY_DISTS_FLAG , --AP_INVOICES_PKG.GET_PREPAYMENTS_APPLIED_FLAG (AP_INVOICES_ALL.INVOICE_ID) PREP AYMENTS_APPLIED_FLAG , --AP_INVOICES_PKG.GET_PAYMENTS_EXIST_FLAG (AP_INVOICES_ALL.INVOICE_ID) PAYMENTS_ EXIST_FLAG , --DECODE(AP_INVOICES_ALL.INVOICE_TYPE_LOOKUP_CODE, 'PREPAYMENT', AP_INVOICES_PKG .GET_PREPAY_AMOUNT_APPLIED (AP_INVOICES_ALL.INVOICE_ID), 0) PREPAY_AMOUNT_APPLIE D , --AP_INVOICES_ALL.APPROVAL_STATUS APPROVAL_STATUS , ap_invoices_all.posting_status posting_status, ap_invoices_pkg.get_po_number (ap_invoices_all.invoice_id) po_number,

ap_invoices_pkg.get_release_number (ap_invoices_all.invoice_id) release_number, ap_invoices_pkg.get_receipt_number (ap_invoices_all.invoice_id) receipt_number, ap_invoices_pkg.get_amount_withheld (ap_invoices_all.invoice_id) amount_withheld, ap_invoices_pkg.get_prepaid_amount (ap_invoices_all.invoice_id) prepaid_amount, alc4.displayed_field wfapproval_status_dsp, ap_invoices_all.approved_amount, ap_invoices_all.amount_paid, --ap_invoices_all.description, ap_invoices_all.tax_amount, po_vendors.vendor_name, INITCAP (NVL (po_vendors.vendor_type_lookup_code, 'VENDOR') ) vendor_type_lookup_code, ja_in_ap_tds_invoices.invoice_amount, ja_in_ap_tds_invoices.dm_invoice_num, ja_in_ap_tds_invoices.tds_invoice_num, ja_in_ap_tds_invoices.tds_tax_id, ja_in_ap_tds_invoices.tds_section, ja_in_ap_tds_invoices.tds_tax_rate, ja_in_ap_tds_invoices.tds_amount, ap_invoice_distributions_all.task_id, ap_invoice_distributions_all.expenditure_organization_id, ap_invoices_all.invoice_id, ap_invoices_all.doc_sequence_id doc_sequence_id, ap_invoices_all.doc_sequence_value doc_sequence_value, disc_prepay_invoice_details.prepay_amount_applied, disc_prepay_invoice_details.prepayment_invoice_num FROM ap.ap_invoices_all ap_invoices_all, ap.ap_invoice_distributions_all ap_invoice_distributions_all, apps.disc_gl_set_of_books disc_gl_set_of_books, apps.disc_ccid_dsc_mv disc_ccid_dsc_mv, po.po_vendors po_vendors, po.po_vendor_sites_all po_vendor_sites_all, ja.ja_in_ap_tds_invoices ja_in_ap_tds_invoices, disc_prepay_invoice_details disc_prepay_invoice_details, --AP_LOOKUP_CODES ALC1, --AP_LOOKUP_CODES ALC2, --AP_LOOKUP_CODES ALC3, ap_lookup_codes alc4, apps.disc_ccid_dsc_mv disc_ccid_dsc_mv1 WHERE ap_invoice_distributions_all.invoice_id = ap_invoices_all.invoice_id AND ap_invoice_distributions_all.set_of_books_id = disc_gl_set_of_books.set_of_books_id AND ap_invoice_distributions_all.dist_code_combination_id = disc_ccid_dsc_mv.code_combination_id AND ap_invoice_distributions_all.reversal_flag IS NULL AND po_vendors.vendor_id = ap_invoices_all.vendor_id AND ap_invoices_all.vendor_site_id = po_vendor_sites_all.vendor_site_id AND ap_invoice_distributions_all.invoice_id = ja_in_ap_tds_invoices.invoice_id(+ ) AND po_vendors.vendor_id = po_vendor_sites_all.vendor_id AND alc4.lookup_type(+) = 'AP_WFAPPROVAL_STATUS' AND alc4.lookup_code(+) = ap_invoices_all.wfapproval_status AND ap_invoice_distributions_all.invoice_distribution_id = disc_prepay_invoice_d etails.invoice_distribution_id(+)

and ap_invoices_all.ACCTS_PAY_CODE_COMBINATION_ID = disc_ccid_dsc_mv1.code_combi nation_id (+) / CUST LIABILITY BALANCE SELECT 'Reached GL From AP' SOURCE, GLB.NAME sob_name, alb.accounting_date, pov.vendor_id, pov.vendor_name, api.invoice_id, api.invoice_num, api.doc_sequence_value, lia.gl_seg2 ACCOUNT, lia.gl_name_seg2 account_desc, lia.gl_seg1 Entity, lia.GL_NAME_SEG1 Entity_desc, api.INVOICE_DATE, SUM (NVL (accounted_dr, 0)) - SUM (NVL (accounted_cr, 0)) balance FROM ap_liability_balance alb, po_vendors pov, ap_invoices_all api, disc_ccid_dsc_mv lia, gl_sets_of_books GLB WHERE alb.vendor_id = pov.vendor_id AND alb.invoice_id = api.invoice_id AND pov.vendor_id = api.vendor_id AND alb.code_combination_id = lia.code_combination_id AND alb.set_of_books_id = GLB.set_of_books_id AND lia.account_type = 'Liability' GROUP BY GLB.NAME, alb.accounting_date, pov.vendor_id, pov.vendor_name, api.doc_sequence_value, api.invoice_id, api.invoice_num, lia.gl_seg2, lia.gl_name_seg2, lia.gl_seg1, lia.gl_name_seg1, api.INVOICE_DATE UNION ALL SELECT /*+ ORDERED USE_NL(JEL JEH JEB CAT SRC) INDEX(JEL GL_JE_LINES_N1) INDEX(JEH GL_JE_HEADERS_U1) INDEX(JEB GL_JE_BATCHES_U1) INDEX(CAT GL_JE_CATEGORIES_U1) INDEX(SRC GL_JE_SOURCES_U1) */ DECODE (src.user_je_source_name, 'Payables', 'Debit on Liability', src.user_je_source_name ), gsb.NAME, jel.effective_date effective_date, 0, DECODE (src.user_je_source_name, 'Payables', jel.reference_1, NULL ), 0, DECODE (src.user_je_source_name, 'Payables', jel.reference_5, NULL ), DECODE (src.user_je_source_name, 'Payables', jel.subledger_doc_sequence_value, jeh.doc_sequence_value ),

cc.gl_seg2, cc.gl_name_seg2, cc.GL_SEG1, cc.GL_NAME_SEG1, jel.INVOICE_DATE, SUM (NVL (accounted_dr, 0)) - SUM (NVL (accounted_cr, 0)) balance FROM disc_ccid_dsc_mv cc, gl_sets_of_books gsb, gl_je_lines jel, gl_je_headers jeh, gl_je_batches jeb, gl_je_categories cat, gl_je_sources src, fnd_user fu WHERE jel.code_combination_id = cc.code_combination_id AND jel.status || '' = 'P' AND (accounted_dr != 0 OR accounted_cr != 0) AND jeh.je_header_id = jel.je_header_id AND jeh.actual_flag = 'A' AND jeb.je_batch_id = jeh.je_batch_id AND jeb.set_of_books_id = gsb.set_of_books_id AND jeb.average_journal_flag = 'N' AND src.je_source_name = jeh.je_source AND cat.je_category_name = jeh.je_category AND ( (jeh.je_source NOT IN ('Payables')) OR ( jeh.je_source IN ('Payables') AND jel.reference_10 != 'LIABILITY' ) ) AND jeh.last_updated_by = fu.user_id(+) AND cc.account_type = 'Liability' GROUP BY src.user_je_source_name, gsb.NAME, jel.effective_date, jeh.NAME, jel.reference_1, jel.reference_5, jel.subledger_doc_sequence_value, jeh.doc_sequence_value, cc.gl_seg2, cc.gl_name_seg2, cc.gl_seg1, cc.GL_NAME_SEG1, jel.INVOICE_DATE UNION ALL SELECT 'Not in GL Yet' SOURCE, GLB.NAME sob_name, aph.accounting_date, pov.vendor_id, pov.vendor_name, api.invoice_id, api.invoice_num, api.doc_sequence_value, lia.gl_seg2 ACCOUNT, lia.gl_name_seg2 account_desc, lia.gl_seg1 Entity, lia.GL_NAME_SEG1 Entity_desc, api.INVOICE_DATE, SUM (NVL (accounted_dr, 0)) - SUM (NVL (accounted_cr, 0)) balance FROM ap_ae_lines_all apl, ap_ae_headers_all aph, gl_sets_of_books GLB, po_vendors pov, ap_invoices_all api, disc_ccid_dsc_mv lia WHERE apl.ae_line_type_code = 'LIABILITY' AND apl.gl_sl_link_id IS NULL AND apl.ae_header_id = aph.ae_header_id AND apl.third_party_id = pov.vendor_id

AND apl.reference2 = api.invoice_id AND pov.vendor_id = api.vendor_id AND apl.code_combination_id = lia.code_combination_id AND aph.set_of_books_id = GLB.set_of_books_id AND lia.account_type = 'Liability' GROUP BY GLB.NAME, aph.accounting_date, pov.vendor_id, pov.vendor_name, api.doc_sequence_value, api.invoice_id, api.invoice_num, lia.gl_seg2, lia.gl_name_seg2, lia.gl_seg1, lia.gl_name_seg1, api.INVOICE_DATE / CUST LIABILITY ADVANCE BAL SELECT 'Reached GL From AP' SOURCE, GLB.NAME sob_name, alb.accounting_date, pov.vendor_id, pov.vendor_name, api.invoice_id, api.invoice_num, api.doc_sequence_value, lia.gl_seg2 ACCOUNT, lia.gl_name_seg2 account_desc, lia.gl_seg1 Entity, lia.GL_NAME_SEG1 Entity_desc, api.INVOICE_DATE, SUM (NVL (accounted_dr, 0)) - SUM (NVL (accounted_cr, 0)) balance FROM ap_liability_balance alb, po_vendors pov, ap_invoices_all api, disc_ccid_dsc_mv lia, gl_sets_of_books GLB WHERE alb.vendor_id = pov.vendor_id AND alb.invoice_id = api.invoice_id AND pov.vendor_id = api.vendor_id AND alb.code_combination_id = lia.code_combination_id AND alb.set_of_books_id = GLB.set_of_books_id AND lia.account_type IN ('Liability','Asset') GROUP BY GLB.NAME, alb.accounting_date, pov.vendor_id, pov.vendor_name, api.doc_sequence_value, api.invoice_id, api.invoice_num, lia.gl_seg2, lia.gl_name_seg2, lia.gl_seg1, lia.gl_name_seg1, api.INVOICE_DATE UNION ALL SELECT /*+ ORDERED USE_NL(JEL JEH JEB CAT SRC) INDEX(JEL GL_JE_LINES_N1) INDEX(JEH GL_JE_HEADERS_U1) INDEX(JEB GL_JE_BATCHES_U1) INDEX(CAT GL_JE_CATEGORIES_U1) INDEX(SRC GL_JE_SOURCES_U1) */ DECODE (src.user_je_source_name, 'Payables', 'Debit on Liability', src.user_je_source_name

), gsb.NAME, jel.effective_date effective_date, 0, DECODE (src.user_je_source_name, 'Payables', jel.reference_1, NULL ), 0, DECODE (src.user_je_source_name, 'Payables', jel.reference_5, NULL ), DECODE (src.user_je_source_name, 'Payables', jel.subledger_doc_sequence_value, jeh.doc_sequence_value ), cc.gl_seg2, cc.gl_name_seg2, cc.GL_SEG1, cc.GL_NAME_SEG1, jel.INVOICE_DATE, SUM (NVL (accounted_dr, 0)) - SUM (NVL (accounted_cr, 0)) balance FROM disc_ccid_dsc_mv cc, gl_sets_of_books gsb, gl_je_lines jel, gl_je_headers jeh, gl_je_batches jeb, gl_je_categories cat, gl_je_sources src, fnd_user fu WHERE jel.code_combination_id = cc.code_combination_id AND jel.status || '' = 'P' AND (accounted_dr != 0 OR accounted_cr != 0) AND jeh.je_header_id = jel.je_header_id AND jeh.actual_flag = 'A' AND jeb.je_batch_id = jeh.je_batch_id AND jeb.set_of_books_id = gsb.set_of_books_id AND jeb.average_journal_flag = 'N' AND src.je_source_name = jeh.je_source AND cat.je_category_name = jeh.je_category AND ( (jeh.je_source NOT IN ('Payables')) OR ( jeh.je_source IN ('Payables') AND jel.reference_10 not IN ('Liability') ) ) AND jeh.last_updated_by = fu.user_id(+) AND cc.account_type IN ('Liability','Asset') GROUP BY src.user_je_source_name, gsb.NAME, jel.effective_date, jeh.NAME, jel.reference_1, jel.reference_5, jel.subledger_doc_sequence_value, jeh.doc_sequence_value, cc.gl_seg2, cc.gl_name_seg2, cc.gl_seg1, cc.GL_NAME_SEG1, jel.INVOICE_DATE UNION ALL SELECT 'Not in GL Yet' SOURCE, GLB.NAME sob_name, aph.accounting_date, pov.vendor_id, pov.vendor_name, api.invoice_id, api.invoice_num,

api.doc_sequence_value, lia.gl_seg2 ACCOUNT, lia.gl_name_seg2 account_desc, lia.gl_seg1 Entity, lia.GL_NAME_SEG1 Entity_desc, api.INVOICE_DATE, SUM (NVL (accounted_dr, 0)) - SUM (NVL (accounted_cr, 0)) balance FROM ap_ae_lines_all apl, ap_ae_headers_all aph, gl_sets_of_books GLB, po_vendors pov, ap_invoices_all api, disc_ccid_dsc_mv lia WHERE apl.ae_line_type_code IN ('LIABILITY') AND apl.gl_sl_link_id IS NULL AND apl.ae_header_id = aph.ae_header_id AND apl.third_party_id = pov.vendor_id AND apl.reference2 = api.invoice_id AND pov.vendor_id = api.vendor_id AND apl.code_combination_id = lia.code_combination_id AND aph.set_of_books_id = GLB.set_of_books_id AND lia.account_type IN ('Liability','Asset') GROUP BY GLB.NAME, aph.accounting_date, pov.vendor_id, pov.vendor_name, api.doc_sequence_value, api.invoice_id, api.invoice_num, lia.gl_seg2, lia.gl_name_seg2, lia.gl_seg1, lia.gl_name_seg1, api.INVOICE_DATE / AP INVOICE DETAILS SELECT disc_gl_set_of_books.set_of_books_id, disc_gl_set_of_books.description AS set_of_books, disc_gl_set_of_books.set_of_book_currency AS set_of_book_currency, disc_ccid_dsc_mv.gl_seg1, disc_ccid_dsc_mv.gl_seg2, disc_ccid_dsc_mv.gl_seg3, disc_ccid_dsc_mv.gl_seg4, disc_ccid_dsc_mv.gl_seg5, disc_ccid_dsc_mv.gl_seg6, disc_ccid_dsc_mv.gl_seg7, disc_ccid_dsc_mv.gl_seg8, disc_ccid_dsc_mv.gl_seg9, disc_ccid_dsc_mv.gl_seg10, disc_ccid_dsc_mv.gl_seg11, disc_ccid_dsc_mv.gl_name_seg1, disc_ccid_dsc_mv.gl_name_seg2, disc_ccid_dsc_mv.gl_name_seg3, disc_ccid_dsc_mv.gl_name_seg4, disc_ccid_dsc_mv.gl_name_seg5, disc_ccid_dsc_mv.gl_name_seg6, disc_ccid_dsc_mv.gl_name_seg7, disc_ccid_dsc_mv.gl_name_seg8, disc_ccid_dsc_mv.gl_name_seg9, disc_ccid_dsc_mv.gl_name_seg10, disc_ccid_dsc_mv.gl_name_seg11, disc_ccid_dsc_mv1.gl_seg2 as liab_gl_seg2, disc_ccid_dsc_mv1.gl_name_seg2 as liab_gl_name_seg2, ap_invoices_all.invoice_num, ap_invoices_all.invoice_date, INITCAP (ap_invoices_all.invoice_type_lookup_code ) invoice_type_lookup_code, --AP_INVOICES_ALL.INVOICE_AMOUNT, ap_invoices_all.invoice_currency_code, ap_invoices_all.payment_currency_code, --AP_INVOICES_ALL.DESCRIPTION, --AP_INVOICES_ALL.EXCHANGE_RATE, ap_invoices_all.vendor_id,

ap_invoices_all.vendor_site_id, po_vendor_sites_all.vendor_site_code, ap_invoice_distributions_all.accounting_date, ap_invoice_distributions_all.description, ap_invoice_distributions_all.amount, ap_invoice_distributions_all.base_amount, ap_invoice_distributions_all.period_name, ap_invoice_distributions_all.exchange_rate, ap_invoice_distributions_all.attribute4, --AP_INVOICES_PKG.GET_POSTING_STATUS(AP_INVOICES_ALL.INVOICE_ID) POSTING_FLAG , ap_invoices_pkg.get_approval_status (ap_invoices_all.invoice_id, ap_invoices_all.invoice_amount, ap_invoices_all.payment_status_flag, ap_invoices_all.invoice_type_lookup_code ) approval_status_lookup_code, --AP_INVOICES_PKG.SELECTED_FOR_PAYMENT_FLAG(AP_INVOICES_ALL.INVOICE_ID) SELECTED _FOR_PAYMENT_FLAG , --AP_INVOICES_PKG.GET_UNPOSTED_VOID_PAYMENT (AP_INVOICES_ALL.INVOICE_ID) UNPOSTE D_VOID_PAYMENT_FLAG , --AP_INVOICES_PKG.GET_DISCOUNT_PAY_DISTS_FLAG (AP_INVOICES_ALL.INVOICE_ID) DISCO UNT_PAY_DISTS_FLAG , --AP_INVOICES_PKG.GET_PREPAYMENTS_APPLIED_FLAG (AP_INVOICES_ALL.INVOICE_ID) PREP AYMENTS_APPLIED_FLAG , --AP_INVOICES_PKG.GET_PAYMENTS_EXIST_FLAG (AP_INVOICES_ALL.INVOICE_ID) PAYMENTS_ EXIST_FLAG , --DECODE(AP_INVOICES_ALL.INVOICE_TYPE_LOOKUP_CODE, 'PREPAYMENT', AP_INVOICES_PKG .GET_PREPAY_AMOUNT_APPLIED (AP_INVOICES_ALL.INVOICE_ID), 0) PREPAY_AMOUNT_APPLIE D , --AP_INVOICES_ALL.APPROVAL_STATUS APPROVAL_STATUS , ap_invoices_all.posting_status posting_status, ap_invoices_pkg.get_po_number (ap_invoices_all.invoice_id) po_number, ap_invoices_pkg.get_release_number (ap_invoices_all.invoice_id) release_number, ap_invoices_pkg.get_receipt_number (ap_invoices_all.invoice_id) receipt_number, ap_invoices_pkg.get_amount_withheld (ap_invoices_all.invoice_id) amount_withheld, ap_invoices_pkg.get_prepaid_amount (ap_invoices_all.invoice_id) prepaid_amount, alc4.displayed_field wfapproval_status_dsp, ap_invoices_all.approved_amount, ap_invoices_all.amount_paid, --ap_invoices_all.description, ap_invoices_all.tax_amount, po_vendors.vendor_name, INITCAP (NVL (po_vendors.vendor_type_lookup_code, 'VENDOR') ) vendor_type_lookup_code, ja_in_ap_tds_invoices.invoice_amount, ja_in_ap_tds_invoices.dm_invoice_num, ja_in_ap_tds_invoices.tds_invoice_num, ja_in_ap_tds_invoices.tds_tax_id, ja_in_ap_tds_invoices.tds_section, ja_in_ap_tds_invoices.tds_tax_rate, ja_in_ap_tds_invoices.tds_amount, ap_invoice_distributions_all.task_id, ap_invoice_distributions_all.expenditure_organization_id,

ap_invoices_all.invoice_id, ap_invoices_all.doc_sequence_id doc_sequence_id, ap_invoices_all.doc_sequence_value doc_sequence_value, disc_prepay_invoice_details.prepay_amount_applied, disc_prepay_invoice_details.prepayment_invoice_num FROM ap.ap_invoices_all ap_invoices_all, ap.ap_invoice_distributions_all ap_invoice_distributions_all, apps.disc_gl_set_of_books disc_gl_set_of_books, apps.disc_ccid_dsc_mv disc_ccid_dsc_mv, po.po_vendors po_vendors, po.po_vendor_sites_all po_vendor_sites_all, ja.ja_in_ap_tds_invoices ja_in_ap_tds_invoices, disc_prepay_invoice_details disc_prepay_invoice_details, --AP_LOOKUP_CODES ALC1, --AP_LOOKUP_CODES ALC2, --AP_LOOKUP_CODES ALC3, ap_lookup_codes alc4, apps.disc_ccid_dsc_mv disc_ccid_dsc_mv1 WHERE ap_invoice_distributions_all.invoice_id = ap_invoices_all.invoice_id AND ap_invoice_distributions_all.set_of_books_id = disc_gl_set_of_books.set_of_books_id AND ap_invoice_distributions_all.dist_code_combination_id = disc_ccid_dsc_mv.code_combination_id AND ap_invoice_distributions_all.reversal_flag IS NULL AND po_vendors.vendor_id = ap_invoices_all.vendor_id AND ap_invoices_all.vendor_site_id = po_vendor_sites_all.vendor_site_id AND ap_invoice_distributions_all.invoice_id = ja_in_ap_tds_invoices.invoice_id(+ ) AND po_vendors.vendor_id = po_vendor_sites_all.vendor_id AND alc4.lookup_type(+) = 'AP_WFAPPROVAL_STATUS' AND alc4.lookup_code(+) = ap_invoices_all.wfapproval_status AND ap_invoice_distributions_all.invoice_distribution_id = disc_prepay_invoice_d etails.invoice_distribution_id(+) and ap_invoices_all.ACCTS_PAY_CODE_COMBINATION_ID = disc_ccid_dsc_mv1.code_combi nation_id (+) / PA PROJECT TASKS SELECT PPA.SEGMENT1, PPA.NAME, PT.TASK_NUMBER, PT.TASK_NAME, PT.ATTRIBUTE1 FROM PA_PROJECTS_ALL PPA, PA_TASKS PT WHERE PPA.PROJECT_ID = PT.PROJECT_ID AND PT.BILLABLE_FLAG='Y' AND PPA.TEMPLATE_FLAG='N' AND PT.TOP_TASK_ID <> PT.TASK_ID AND UPPER(PPA.PROJECT_TYPE)='PROGRAM-US' / PRE-PAY STATUS QUERY SELECT aid.accounting_date prepay_accounting_date, NVL (aid1.accounting_date, aid.accounting_date ) prepay_application_date, gsb.short_name sob_name, pv.vendor_name vendor_name, pvs.vendor_site_code vendor_site_code, aia.invoice_num invoice_num, aia.invoice_date invoice_date, aip.accounting_date payment_date, gcc.segment2 prepay_natural_account, aia.description prepay_description, aia.invoice_currency_code currency, aid.invoice_distribution_id prepay_distribution_id, aid.amount currency_amt, NVL (aid.base_amount, aid.amount) inr_amount,

NVL (SUM (-1 * aid1.amount), 0) currency_amt_applied, NVL (SUM (-1 * NVL (aid1.base_amount, aid1.amount)), 0 ) inr_amount_applied, aid.amount + NVL (SUM (aid1.amount), 0) available_currency_amount, NVL (aid.base_amount, aid.amount) + NVL (SUM (NVL (aid1.base_amount, aid1.amount)), 0) available_inr_amount FROM ap_invoices_all aia, ap_invoice_distributions_all aid, ap_invoice_distributions_all aid1, po_vendors pv, po_vendor_sites_all pvs, gl_code_combinations gcc, ap_invoice_payments_all aip, gl_sets_of_books gsb WHERE aia.invoice_id = aid.invoice_id AND aia.invoice_type_lookup_code = 'PREPAYMENT' AND aia.invoice_amount = aia.amount_paid AND aid.invoice_distribution_id = aid1.prepay_distribution_id(+) AND aia.vendor_id = pv.vendor_id AND aia.vendor_site_id = pvs.vendor_site_id AND pv.vendor_id = pvs.vendor_id AND aid.dist_code_combination_id = gcc.code_combination_id AND aip.invoice_id = aid.invoice_id AND gsb.set_of_books_id = aia.set_of_books_id and aip.REVERSAL_FLAG= 'N' --AND DECODE(APPS.FND_GLOBAL.RESP_ID,21612,1,APPS.FND_GLOBAL.RESP_ID) = DECODE(A PPS.FND_GLOBAL.RESP_ID,21612,1,DISC_SECURITY.RESP_ID) --AND DECODE(APPS.FND_GLOBAL.RESP_ID,21612,1,DISC_SECURITY.GL_SOB_ID) = DECODE(A PPS.FND_GLOBAL.RESP_ID,21612,1,GSB.SET_OF_BOOKS_ID) GROUP BY gsb.short_name, aia.invoice_num, aia.invoice_date, aip.accounting_date, gcc.segment2, aia.description, aia.invoice_currency_code, aid.invoice_distribution_id, aid.amount, aid.base_amount, pv.vendor_name, pvs.vendor_site_code, aid.accounting_date, aid1.accounting_date / PA PROJECT MASTER SELECT ppa.project_id, ppa.NAME "PROJECT NAME", ppa.long_name "PROJECT ALIAS", ppa.description "PROJECT DESCRIPTION", ppa.start_date "START DATE", ppa.completion_date "END DATE", prc.customer_name "PRIMARY CUSTOMER", prc1.customer_name "SECONDARY CUSTOMER", hou.NAME "BUSINESS UNIT", LOB.class_code "LINE OF BUSINESS", pra.class_code "PRACTICE", prloc.class_code "PROGRAM LOCATION", so.class_code "SERVICE OFFERING", bm.class_code "BUSINESS MODEL", sb.class_code "SETUP BILLING", 0 "PARENT PROJECT ID", ppa.segment1 "PROJECT NUMBER", '0' "TASK NUMBER", ppa.project_type "PROJECT TYPE", pm."PROJECT MANAGER", pgm."PROGRAM MANAGER", vp p."VICE PRESIDENT",

prc.project_relationship_code "PARENT RELATIONSHIP" FROM pa_projects_all ppa, hr_all_organization_units hou, pa_project_customers_v prc, disc_pa_sec_customers prc1, pa_project_classes_v LOB, pa_project_classes_v pra, pa_project_classes_v prloc, pa_project_classes_v so, pa_project_classes_v sb, disc_pa_biz_model bm, --PA_PROJECT_CLASSES_V BIL, disc_pa_pm pm, disc_pa_pgm pgm, disc_pa_vpp vpp WHERE ppa.carrying_out_organization_id = hou.organization_id AND ppa.template_flag != 'Y' AND ppa.project_id = prc.project_id(+) AND ppa.project_id = prc1.project_id(+) AND ppa.project_id = LOB.project_id(+) AND LOB.class_category = 'LINE OF BUSINESS' AND ppa.project_id = pra.project_id(+) AND pra.class_category = 'PRACTICE' AND ppa.project_id = prloc.project_id(+) AND prloc.class_category = 'PROGRAM LOCATION' AND ppa.project_id = so.project_id(+) AND so.class_category = 'SERVICE OFFERING' AND ppa.project_id = sb.project_id(+) AND sb.class_category = 'SETUP BILLING' AND ppa.project_id = bm.project_id(+) --AND BM.CLASS_CATEGORY = 'BUSINESS MODEL' --AND PPA.PROJECT_ID = BIL.PROJECT_ID (+) AND BIL.CLASS_CATEGORY (+) = --'FINAL PROJECTS FOR GO LIVE' AND BIL.CLASS_CODE = 'YES' AND ppa.project_id = pm.project_id(+) -- AND UPPER (prm.ROLE) = 'PROJECT MANAGER' --AND UPPER(PPA.PROJECT_TYPE) LIKE 'PROGRAM%' --AND PRC.PROJECT_RELATIONSHIP_CODE IN ('PARENT','INTERNAL'); AND ppa.project_id = pgm.project_id(+) -- AND UPPER (pm.ROLE) = 'PROGRAM MANAGER' AND ppa.project_id = vpp.project_id(+) -- AND UPPER (vpp.ROLE) = 'VICE PRESIDENT-PROGRAM' -- and ppa.segment1 = '10242' / PA PROJECT PROGRAM MAP SELECT PPA1.PROJECT_ID, PPA1.SEGMENT1 "ACCOUNT_VALUE", PPA2.SEGMENT1 "INDIAN PRO JECTS" FROM PA_TASKS PT, PA_PROJECTS_ALL PPA1,PA_PROJECTS_ALL PPA2, PA_PROJECT_CUSTOMER S PPC ,PA_PROJECT_TYPES_ALL PPT WHERE PT.TASK_ID = PPC.RECEIVER_TASK_ID AND PT.PROJECT_ID = PPA1.PROJECT_ID AND PPT.PROJECT_TYPE = PPA2.PROJECT_TYPE AND PPC.PROJECT_ID=PPA2.PROJECT_ID AND PPT.PROJECT_TYPE_CLASS_CODE = 'CONTRACT' AND PPA2.PROJECT_STATUS_CODE ='APPROVED' AND PPA1.TEMPLATE_FLAG='N' UNION SELECT PPA.PROJECT_ID, PPA.SEGMENT1, PPA.SEGMENT1 FROM PA_PROJECTS_ALL PPA, PA_PROJECT_TYPES_ALL PPT WHERE PPT.PROJECT_TYPE = PPA.PROJECT_TYPE

AND PPT.PROJECT_TYPE_CLASS_CODE <> 'CONTRACT' AND PPA.TEMPLATE_FLAG='N' UNION SELECT PPA1.PROJECT_ID, PPA1.SEGMENT1 "ACCOUNT_VALUE", PPA1.SEGMENT1 "INDIAN PRO JECTS" FROM PA_PROJECTS_ALL PPA1, PA_PROJECT_CUSTOMERS PPC ,PA_PROJECT_TYPES_ALL PPT WHERE PPT.PROJECT_TYPE = PPA1.PROJECT_TYPE AND PPC.PROJECT_ID=PPA1.PROJECT_ID AND PPT.PROJECT_TYPE_CLASS_CODE = 'CONTRACT' AND PPC.BILL_ANOTHER_PROJECT_FLAG='N' AND PPA1.PROJECT_STATUS_CODE ='APPROVED' AND PPA1.TEMPLATE_FLAG='N' / GL BILL COLLECTION & RECOVERY SELECT a_b_flag, set_of_books_id, set_of_books, set_of_book_currency, gl_seg1, gl_seg2, gl_seg3, gl_seg4, gl_seg5, gl_seg6, gl_seg7, gl_seg8, gl_seg9, gl_seg10, gl_seg11, item_date, gl_name_seg1, gl_name_seg2, gl_name_seg3, gl_name_seg4, gl_name_seg5, gl_name_seg6, gl_name_seg7, gl_name_seg8, gl_name_seg9, gl_name_seg10, gl_name_seg11, txn_no AS invoice_no, trx_date AS invoice_date, cm_no, NULL AS receipt_no, NULL AS receipt_date, period_name AS bill_period_name, NULL AS coll_period_name, NULL AS rev_period_name, customer_name, period_net AS billing, 0 AS collection, 0 AS revenues, 0 AS exchange FROM disc_gl_billing UNION ALL SELECT a_b_flag,

set_of_books_id, set_of_books, set_of_book_currency, gl_seg1, gl_seg2, gl_seg3, gl_seg4, gl_seg5, gl_seg6, gl_seg7, gl_seg8, gl_seg9, gl_seg10, gl_seg11, item_date, gl_name_seg1, gl_name_seg2, gl_name_seg3, gl_name_seg4, gl_name_seg5, gl_name_seg6, gl_name_seg7, gl_name_seg8, gl_name_seg9, gl_name_seg10, gl_name_seg11, txn_no AS invoice_no, trx_date AS invoice_date, cm_no, NULL AS receipt_date, receipt_date, NULL AS bill_period_name, period_name AS coll_period_name, NULL AS rev_period_name, customer_name, 0 AS billing, period_net AS collection, 0 AS revenues, 0 AS exchange FROM disc_gl_collection UNION ALL SELECT a_b_flag, set_of_books_id, set_of_books, set_of_book_currency, gl_seg1, gl_seg2, gl_seg3, gl_seg4, gl_seg5, gl_seg6, gl_seg7, gl_seg8, gl_seg9, gl_seg10, gl_seg11, item_date, gl_name_seg1, gl_name_seg2, gl_name_seg3,

gl_name_seg4, gl_name_seg5, gl_name_seg6, gl_name_seg7, gl_name_seg8, gl_name_seg9, gl_name_seg10, gl_name_seg11, txn_no AS invoice_no, trx_date AS invoice_date, cm_no, NULL AS receipt_date, receipt_date, NULL AS bill_period_name, period_name AS coll_period_name, NULL AS rev_period_name, customer_name, 0 AS billing, 0 AS collection, 0 AS revenues, period_net AS exchange FROM disc_gl_exchange / HR EMPLOYEES SELECT ppf.full_name "Employee_Name", ppf.employee_number "Employee_Num", ppf.date_of_birth "Date_Of_Birth", ppf.start_date "Date_Of_Joining", ppf.email_address "Email_Address", ppf.attribute1 "Employee_Type", psf.full_name "Supervisor", hou.NAME, paf.effective_start_date start_date, paf.effective_end_date end_date, (paf.effective_end_date - paf.effective_start_date) days_employed FROM per_all_people_f ppf, per_all_assignments_f paf, per_all_people_f psf, hr_all_organization_units hou WHERE ppf.person_id = paf.person_id(+) AND paf.supervisor_id = psf.person_id(+) --and ppf.person_type_id = 6 --and psf.person_type_id = 6 AND paf.primary_flag = 'Y' AND paf.organization_id = hou.organization_id / ACCOUNT PARENT & CHILD SELECT DISTINCT b.parent_flex_value, b.child_flex_value_low, b.child_flex_value_high, c.description, d.segment, d. description as account FROM fnd_flex_values_vl a, fnd_flex_value_norm_hierarchy b, disc_segment2 c, disc_segment2 D WHERE a.flex_value_set_id = '1008011' AND a.flex_value_set_id = b.flex_value_set_id AND c.SEGMENT = b.parent_flex_value and b.RANGE_ATTRIBUTE = 'C' and

D.segment between b.child_flex_value_low and b.child_flex_value_high / Posted by Krishnareddy at 21:16 Email This BlogThis! Share to Twitter Share to Facebook Labels: QUERIES No comments: Post a Comment Newer Post Older Post Home Subscribe to: Post Comments (Atom) ORACLE APPS BLOG ARCHIVE ? 2012 (1141) ? May (238) ? June (281) basic apps instructions GL FAQS OM FAQS AR FAQS REPORTS FAQS Migrating Reports to Release 12 - Co-Existing & Ob... Sending EMail from oracle application A comparative analysis between SQL*LOADER and UTL_... Create Trace File for Concurrent Program Oracle Implementation Methodalogy REPORT NAMES WITH DESCRIPTION Standard Request Submission AOL frequently asked questions How to delete a DFF Context Form Personalization - How to Change Field Name Fo... Purchasing Interface Errors Report(choose paramete... Release 12.0, the Import Standard Purchase Orders... MATCH_OPTION COLUMN / METHOD MISSING IN Purchasing... Introduction to LINUX 10 Tips for Project Success Interface Tables of GL, AP, AR,FA,INV,PO,BOMS,WIP,... Report Questions Oracle Apps Reports REPORTS FAQ'S Best Practices in Report Development AR CONTACT,PERSON,ETC CREATION SUBSTR And INSTR String Functions (SQL) GL Tables which stores parent and child segments i... HOW GL TABLES ARE EFFECTED AR INTERFACES PO INTERFACES GL Interface AP INTERFACE INVENTORY INTERFACES OM INTERFACES AP SETUPS AP SETUPS Account PayablesCreating ... Multiple Currencies (MRC) AR Reconciliation Report AR Aging Report (Query) ORACLE APPS ALL QUERIES AR R12 Tables

GL R12 CHANGES R12 AP CHANGES Oracle app s technical FAQ's OM Related Queries ALL MODULES STANDARD REQUEST GROUPS NAMES Unix Commands IMPORTANT APPS QUERIES APPS ALL QUERIES PREVIOUS ASKED FAQ'S Payables open interface import PROFILE OPTIONS IN ORACLE APPS R12 - OVERVIEW (FND... FND_REQUEST.SUBMIT_REQUEST in R12 Item attributes in oracle inventory R12 Aging Reports in Oracle Apps Receivables - Quick O... R12 Payables changes R12 Receivables changes R12 Purchasing changes R12 General Ledger changes Oracle Concepts and Architecture Database Structur... Triggers Types of Purchase Orders (PO types) What is Interface SALES ORDER CONVERSION Query fetching both Prepayment Data and Invoice Da... XML Running Total XMLSEQUENCE SQL Function Suppliers and their Bank Details in Oracle Apps R1... How Payable Invoices Data is stored in Sub-ledger ... REPORT CUSTOMIZATION EXAMPLES Various Queries on Customer Data (HZ Tables) SQL Queries for checking Profile Option Values Revenue Recognition DBA Views GL STANDARD REPORTS INTERNAL SALES ORDER UTL FILE PKG FNDLOAD AR Tables Info Inventory related Queries AR COMPLETE MANUAL XML Publisher SET Operators in Oracle SQL What is Normalization and De-Normalization Personalization Vs Extension Vs Customization Database Structures FAQ's Financials technical interview questions How To Register a Report in Oracle APPS Most Frequently Used Tables in Oracle APPS How To Delete a Concurrent Program and Executable Functional questions pertaining to Oracle AR modul... How To customize Oracle Reports? 5 Major Mistakes You Should Avoid During Attending... Tips For Preparing For Exams Do You Have a Carrier Plan 5 Things Technical Writers Need To Know Grammar Tips For Those Who Speak English As Second... 5 Awesome Carrier Paths in Information Technology 5 Reasons to Choose IT Path (Carrier) Key Oracle APPS Purchasing Tables Key Meta Data Tables (Views) in Oracle Apps

Oracle Work Flow Table Information Key Interface Tables for different modules in Orac... Differences Between Oracle Applications 11i And R... COMPARING PURCHASE ORDERS Key Unix/Linux Commands Unix Shell Scripting Basics Key FND Tables in Oracle Application Mandatory Columns in the Customer Interface Tables... How To Search For a Table Using Specific Column Na... SQL Query To Get Oracle HR Organization Hierarchy Sql Query To Update Multiple Rows Using Single Upd... PL/SQL Procedure to reverse a string PL/SQL funtion to compute the factorial of a numb... PL/SQL function To print the Fibonacci series Script To Create A User In Oracle Applications[EBS... How To Remove End Date From Responsibilities Assig... Delete Duplicate Rows/Records From A Table Sql Query to Analyze The Performance of The Concur... query can be used to display all the independent V... Sql Query To Display The List of Value sets based ... Commit After Performing Insert or Update or Delete... Sql Query To Display The Mandatory Parameters And ... PL/SQL function can be used to convert the entered... Script to Create an Organization in Oracle Apps Oracle DBA interview questions Oracle interview questions Linux interview questions SQL Server DBA interview questions Types of Invoices in Oracle Account Payables customer_details_credit_limits Purchase Order raised that have been received PURCHASE ORDER RECEIVING AND NOT PAID REPORT mtl_material_transactions CREDIT CHECK-1 Customers Payment Terms Standerd Reports Short Names ontseededprograms PO: P2P Query based on the Purchase Order Number Outstanding Holds Report Outstanding Holds Report with Parameters OE Report With Lexical Parameters(open,shipped,bac... Oracle Alerts is Discoverer Discoverer notes Discoverer Report With Example MD70 SAMPLE DISCOVERER REPORT MOT_J2J_INV_PARTS_USG_CONV_PKG_SPS MOT_J2J_INV_PARTS_USG_CONV_PKG_SPB Package is to Enable the Purchsaing Site for all t... Package specification to import Purchase Orders da... SALES ORDER INTERFACE Table/View Changes, Additions R12 XXFTC_OM_ORDER_HOLDS XXFTC_OM_ORDER_RELEASE XXFTC_OM_ORDER_RLS_HOLDS XXFTC_SHIPPING_ORDER_HOLDS XXFTC_OPEN_ORDER_LINES_FC_V1 =MD120 APPS.xxftc_open_orders_report_pkg_copy_PROD_010520... CREATE OR REPLACE VIEW XXFTC_OPEN_ORDER_LINES_FC_V... XXFTCOOT RTF (XXFTC_OPEN_ORDER_LINES_FC_V1)

APPS.XXFTC_REC_RES_BCKFILL_PKG_copy_PROD_01132012 OOR - BO vs Available 12-08-11 SCREEN SHOTS OF BACKORDER VS AVAILABLE APPS INTERVIEW QUESTIONS rejected and returned quantities and the days betw... Report on Inactive Items that exists on active POs... Report on inactive items that exists on active PO-... Report On Sales Order With Zero Onhand Quantity Cancelled Orders Functional Item Cost ComparisonTechnical Spec Obsolete and Excess Inventory Report Percentage Delivered on Time Sales Orders Report Finding Request Group Query hr_employee_api Meta_Link_Rcv_Transactions create-oracle-fnduser-with-system Item Import Program Using API in 11i ORACLE FAQS FAQS Receiving Journal Transfer to GL by Journal Import... INVENTORY OM ORDER MANEGMENT PO,GL,ALERT SYSTEM ADMINISTRATOR AR ACCOUNT RECEIVABLES QP QUALITY PRICING BULK COLLECT Collections O2C,P2P MULTI ORG How GL Tables are effected Descriptive Flexfields General Ledger ORACLE APPS INSTALL How to Remove Existing Oracle Applications Environ... oracle 10g RAC on Linux AS 3 APPS DBA FAQ's ORACLE SQL DEVELOPER Oracle 10g New Features SQL TUINING Apps Tuining EBS R12 New Changes Data Flow Among Applications TOAD FOR ORACLE MANUAL Enabling / Disabling buttons / functions in custom... Oracle Inventory R12 FA AND AR R12 PA Fixed Assets Oracle Forms FLEX FIELDS Setting Up Cash Management System Parameters R12 CASHMANAGEMENT CHANGES Oracle Purchasing Account Receivables GENERAL LEDGER Defining Request Groups Invoice to Payment Process Flow in Oracle Payables... PO to AP to Fixed Assets Suppliers and their Bank Details in Oracle Apps R1...

Install Oracle E-Business Suite Release 12 on MS W... Oracle EBS R12 Purchasing, Inventory, Order Manage... Issues When Upgrading Oracle Apps from 11i to R12 Oracle E-Business R12 - Configuring the Custom Top... Queries Related to Concurrent Requests in 11i Appl... How Payable Invoices Data is stored in Sub-ledger ... Apps 11i Technical Interview Question/Answers Interview Questions For Technical Consultant Oracle Apps-Changing LOV Query-Form Personalizatio... Creating Parameters for Report Steps to create a dependent value set in Oracle Ap... Value set basics in Oracle Apps SQL Loader with XML DATA Invoking SQL*Loader SQL*Loader Environment Defining and Viewing BLOB Data in Oracle Applicati... How to add Descriptive Flexfields (DFF) in an Orac... Oracle Applications : Descriptive Flexfields Overv... How to use FNDLOAD to extract ldt file for specifi... Getting Started with Oracle SQL Developer PROFILE OPTIONS IN ORACLE APPS R12 API is to collect complete details about a sales o... "ORA-01861: literal does not match format string d... API to create a Person Type Party and Customer Acc... How to Drilldown from General Ledger(GL) to Accoun... Oracle Apps Reports Faq's Oracle Apps Table Registration API Oracle Reports 6i Oracle Apps 11i : Creating Journals through Oracle... Oracle Apps 11i: Internationalization Support and ... Email From Oracle PL/SQL (UTL_SMTP) WHAT VERSION OF TOAD SHOULD WE USE? Purchase Order Detail Query Workflow Basics Sample Code and Output- Run Work Flow API OBIEE Interview Questions exe Oracle Datatypes Oracle Unicode Data Types Data Integrity - Constraints and Triggers Oracle Syntax - Tables Exceptions Performing SQL Operations from PL/SQL Collections PL/SQL Exceptions Views, Materialized Views and Synonyms Clusters and Hash Clusters Indexes and Sequences Oracle 11g Architecture diagram Instance startup and shutdown List of all Oracle Server Parameters Server Parameters PL/SQL Program Limits PL/SQL Reserved Words CHAR versus VARCHAR2 Semantics Overview of PL/SQL Fundamentals of PL/SQL Cursor Attributes Interaction Between PL/SQL and Oracle Sample PL/SQL Programs

? July (568) ? August (16) ? September (33) ? November (3) ? December (2) ? 2013 (43) LABELS 02C (5) AP (5) API (10) Apps-11i (17) AR (7) ARCHITECTURE OF ERP-EBS (2) Collections (2) Dataware House (10) DISCOVEER (1) EBS (20) ERP (22) ERP INFO (36) ETL Informatica Testing (5) FAQS (94) FND LOAD (2) FNDLOAD (4) GL (7) INFO (7) INFORMATICA (33) Interfaces (71) Interview Questions (18) KIRAN (24) KRISHNAVENI (15) NEW (30) OAF (2) Oracel Apps (38) ORACLE (22) Oracle PLSQL Exceptions (6) P2P (3) PL/SQL TUTORIAL (38) PLSQL (55) po (9) QUERIES (8) R12 CHANGES IN AP (11) REPORTS (83) SCRIPTS (119) SEEDED REPORTS (2) SITES (5) SPOA (50) SQL (65) sql*loader (1) TABLES (1) TCA (1) Technical world (2) Testing (7) TIPS (15) UNIX (16) XML (7) FISH Picture Window template. Template images by urbancow. Powered by Blogger.

Das könnte Ihnen auch gefallen