DBA Data[Home] [Help]

APPS.AP_AUTOSELECT_PKG dependencies on AP_INVOICES

Line 70: TYPE invoice_id_t IS TABLE OF AP_INVOICES.INVOICE_ID%TYPE INDEX BY BINARY_INTEGER;

66: PROCEDURE check_ccr_status( p_checkrun_id varchar2 ,
67: p_calling_sequence VARCHAR2) IS
68:
69:
70: TYPE invoice_id_t IS TABLE OF AP_INVOICES.INVOICE_ID%TYPE INDEX BY BINARY_INTEGER;
71: TYPE vendor_id_t IS TABLE OF AP_INVOICES.VENDOR_ID%TYPE INDEX BY BINARY_INTEGER;
72: TYPE vendor_site_id_t IS TABLE OF AP_INVOICES.VENDOR_SITE_ID%TYPE INDEX BY BINARY_INTEGER;
73: TYPE remit_to_supplier_site_id_t IS TABLE OF AP_INVOICES.REMIT_TO_SUPPLIER_SITE_ID%TYPE INDEX BY BINARY_INTEGER;
74:

Line 71: TYPE vendor_id_t IS TABLE OF AP_INVOICES.VENDOR_ID%TYPE INDEX BY BINARY_INTEGER;

67: p_calling_sequence VARCHAR2) IS
68:
69:
70: TYPE invoice_id_t IS TABLE OF AP_INVOICES.INVOICE_ID%TYPE INDEX BY BINARY_INTEGER;
71: TYPE vendor_id_t IS TABLE OF AP_INVOICES.VENDOR_ID%TYPE INDEX BY BINARY_INTEGER;
72: TYPE vendor_site_id_t IS TABLE OF AP_INVOICES.VENDOR_SITE_ID%TYPE INDEX BY BINARY_INTEGER;
73: TYPE remit_to_supplier_site_id_t IS TABLE OF AP_INVOICES.REMIT_TO_SUPPLIER_SITE_ID%TYPE INDEX BY BINARY_INTEGER;
74:
75: TYPE ccr_rec_type IS RECORD (

Line 72: TYPE vendor_site_id_t IS TABLE OF AP_INVOICES.VENDOR_SITE_ID%TYPE INDEX BY BINARY_INTEGER;

68:
69:
70: TYPE invoice_id_t IS TABLE OF AP_INVOICES.INVOICE_ID%TYPE INDEX BY BINARY_INTEGER;
71: TYPE vendor_id_t IS TABLE OF AP_INVOICES.VENDOR_ID%TYPE INDEX BY BINARY_INTEGER;
72: TYPE vendor_site_id_t IS TABLE OF AP_INVOICES.VENDOR_SITE_ID%TYPE INDEX BY BINARY_INTEGER;
73: TYPE remit_to_supplier_site_id_t IS TABLE OF AP_INVOICES.REMIT_TO_SUPPLIER_SITE_ID%TYPE INDEX BY BINARY_INTEGER;
74:
75: TYPE ccr_rec_type IS RECORD (
76: invoice_id_tab invoice_id_t

Line 73: TYPE remit_to_supplier_site_id_t IS TABLE OF AP_INVOICES.REMIT_TO_SUPPLIER_SITE_ID%TYPE INDEX BY BINARY_INTEGER;

69:
70: TYPE invoice_id_t IS TABLE OF AP_INVOICES.INVOICE_ID%TYPE INDEX BY BINARY_INTEGER;
71: TYPE vendor_id_t IS TABLE OF AP_INVOICES.VENDOR_ID%TYPE INDEX BY BINARY_INTEGER;
72: TYPE vendor_site_id_t IS TABLE OF AP_INVOICES.VENDOR_SITE_ID%TYPE INDEX BY BINARY_INTEGER;
73: TYPE remit_to_supplier_site_id_t IS TABLE OF AP_INVOICES.REMIT_TO_SUPPLIER_SITE_ID%TYPE INDEX BY BINARY_INTEGER;
74:
75: TYPE ccr_rec_type IS RECORD (
76: invoice_id_tab invoice_id_t
77: ,vendor_id_tab vendor_id_t

Line 99: FROM ap_selected_invoices_all asi,ap_invoices_all ai

95: SELECT asi.invoice_id
96: ,asi.vendor_id
97: ,asi.vendor_site_id
98: ,asi.remit_to_supplier_site_id
99: FROM ap_selected_invoices_all asi,ap_invoices_all ai
100: WHERE ai.invoice_id=asi.invoice_id
101: AND ai.invoice_type_lookup_code in ('STANDARD','PREPAYMENT')
102: AND AP_UTILITIES_PKG.GET_CCR_STATUS(asi.vendor_id,'S') <> 'F'
103: AND asi.checkrun_id=p_checkrun_id;

Line 280: ap_invoices AI, --Bug6040657. Changed from ap_invoices_all to ap_invoices

276: 'Y', AI.exclusive_payment_flag, 'N'),
277: asp.interest_accts_pay_ccid,
278: ai.org_id
279: FROM /* ap_interest_periods, Bug#12835170 */
280: ap_invoices AI, --Bug6040657. Changed from ap_invoices_all to ap_invoices
281: ap_selected_invoices_all ASI,
282: po_vendors pov,
283: ap_system_parameters_all asp
284: WHERE ASI.checkrun_id = P_checkrun_id

Line 543: ap_invoices_s.NEXTVAL,

539: payment_currency_code,
540: affects_rejection_level)
541: SELECT
542: P_checkrun_name,
543: ap_invoices_s.NEXTVAL,
544: l_vendor_id,
545: l_site_id,
546: l_int_vendor_num,
547: l_int_vendor_name,

Line 850: l_hint := ' / *+ index(ai AP_INVOICES_N3) * / ';

846:
847: -- Setting the hint string, bug8637005
848: /* Commented for bug#12773508 Start
849: IF p_pay_group_option <> 'ALL' THEN
850: l_hint := ' / *+ index(ai AP_INVOICES_N3) * / ';
851: ELSE
852: l_hint := ' ';
853: END IF;
854: Commented for bug#12773508 End */

Line 893: ' ap_invoices ai, '|| /* inv, '|| Commented for bug#9182499 GSCC Error File.Sql.6 Bug6040657. Changed from ap_invoices_all to ap_invoices */

889: ' ps.due_date, '||
890: ' ps.discount_amount_available, '||
891: ' ps.discount_date '||
892: ' FROM ap_supplier_sites_all sites, '||
893: ' ap_invoices ai, '|| /* inv, '|| Commented for bug#9182499 GSCC Error File.Sql.6 Bug6040657. Changed from ap_invoices_all to ap_invoices */
894: ' ap_payment_schedules ps, '||
895: ' ap_suppliers suppliers, '||
896: ' hz_parties hz '||
897: ' where ai.invoice_id = ps.invoice_id '||

Line 1359: ap_invoices ai, --Bug6040657. Changed from ap_invoices_all to ap_invoices

1355: ipm.support_bills_payable_flag, -- Bug 5357689, 5479979
1356: (trunc(aps.due_date) + nvl(ipm.maturity_date_offset_days,0)) due_date -- Bug 5357689
1357: --Bug 543942 added NVL in the above scenario
1358: from ap_selected_invoices_all asi,
1359: ap_invoices ai, --Bug6040657. Changed from ap_invoices_all to ap_invoices
1360: ap_inv_selection_criteria_all aisc,
1361: ap_payment_schedules_all aps,
1362: fv_tpp_assignments_v fv, --5017076
1363: iby_payment_methods_vl ipm -- Bug 5357689

Line 2722: l_hint := ' / *+ index(ai AP_INVOICES_N3) * / ';

2718:
2719: -- Setting the hint string(bug8637005)
2720: /* Commented for bug#12773508 Start
2721: IF l_pay_group_option <> 'ALL' THEN
2722: l_hint := ' / *+ index(ai AP_INVOICES_N3) * / ';
2723: ELSE
2724: l_hint := ' ';
2725: END IF;
2726: Commented for bug#12773508 End */

Line 2909: /* Bug 5192018 we will insert global attribute values from ap_invoices table */

2905: ' ,ai.org_id org_id '||
2906: ' ,ai.payment_currency_code payment_currency_code '||
2907: ' ,ps.external_bank_account_id external_bank_account_id '||
2908: ' ,ai.legal_entity_id legal_entity_id '||
2909: /* Bug 5192018 we will insert global attribute values from ap_invoices table */
2910: ' ,ai.global_attribute1 global_attribute1 '||
2911: ' ,ai.global_attribute2 global_attribute2 '||
2912: ' ,ai.global_attribute3 global_attribute3 '||
2913: ' ,ai.global_attribute4 global_attribute4 '||

Line 2965: ' ap_invoices ai, '|| /* inv, '||Commented for bug#9182499 --Bug6040657. Changed from ap_invoices_all to ap_invoices */

2961: ' ,ps.remit_to_supplier_site_id remit_to_supplier_site_id '||
2962: --End 8217641
2963: ' FROM ap_supplier_sites_all sites, '||
2964: ' ap_suppliers suppliers, '||
2965: ' ap_invoices ai, '|| /* inv, '||Commented for bug#9182499 --Bug6040657. Changed from ap_invoices_all to ap_invoices */
2966: ' ap_payment_schedules_all ps, '||
2967: ' ap_system_parameters_all asp, '||
2968: ' hz_parties hzp, '||
2969: ' hz_party_sites hzps, '||-- Bug 5620285

Line 3033: -- AND AP_INVOICES_PKG.get_wfapproval_status(inv.invoice_id, inv.org_id) in

3029: ' AND fv_econ_benf_disc.ebd_check(:p_checkrun_name, ai.invoice_id, '||
3030: ' to_date(:p_check_date, ''DD-MM-YYYY''), due_date, ps.discount_amount_available, ps.discount_date) = ''Y'' ';
3031:
3032: -- Bug 7265013 starts
3033: -- AND AP_INVOICES_PKG.get_wfapproval_status(inv.invoice_id, inv.org_id) in
3034: -- (''NOT REQUIRED'',''WFAPPROVED'',''MANUALLY APPROVED'')*/
3035: -- Bug 7265013 ends
3036:
3037: IF l_invoice_batch_id IS NOT NULL THEN

Line 3165: ' WHERE AP_INVOICES_PKG.get_wfapproval_status(ai.invoice_id, ai.org_id) in '||

3161: /* Bug 13901772
3162: ' AND EXISTS ( '||
3163: ' SELECT 1 '||
3164: ' FROM sys.dual '||
3165: ' WHERE AP_INVOICES_PKG.get_wfapproval_status(ai.invoice_id, ai.org_id) in '||
3166: ' (''NOT REQUIRED'',''WFAPPROVED'',''MANUALLY APPROVED'') '||
3167: ' ) '||
3168: */
3169: ' AND ai.wfapproval_status in (''NOT REQUIRED'',''WFAPPROVED'',''MANUALLY APPROVED'') '||

Line 3197: /*' FROM ap_invoices_derived_v AIDV '||

3193: ' ) '||
3194: ' ) '||
3195: /* Commented for bug 13901772 */
3196: /*' AND NOT EXISTS (SELECT /*+ no_unnest */ /*''Invoice is not fully approved'' '|| /* Added hint for bug#12773508 */
3197: /*' FROM ap_invoices_derived_v AIDV '||
3198: ' WHERE AIDV.invoice_id = ai.invoice_id '||
3199: ' AND AIDV.approval_status_lookup_code IN '||
3200: ' (''NEVER APPROVED'', ''NEEDS REAPPROVAL'', ''UNAPPROVED'')) '||
3201: */

Line 3732: -- Bug 5192018 we will insert global attribute values from ap_invoices table */

3728: ' ,ai.org_id org_id '||
3729: ' ,ai.payment_currency_code payment_currency_code '||
3730: ' ,ps.external_bank_account_id external_bank_account_id '||
3731: ' ,ai.legal_entity_id legal_entity_id '||
3732: -- Bug 5192018 we will insert global attribute values from ap_invoices table */
3733: ' ,ai.global_attribute1 global_attribute1 '||
3734: ' ,ai.global_attribute2 global_attribute2 '||
3735: ' ,ai.global_attribute3 global_attribute3 '||
3736: ' ,ai.global_attribute4 global_attribute4 '||

Line 3788: ' ap_invoices ai, '|| /* inv, '|| Commented for bug#9182499 GSCC Error File.Sql.6 --Bug6040657. Changed from ap_invoices_all to ap_invoices */

3784: ' ,ps.remit_to_supplier_site_id remit_to_supplier_site_id '||
3785: --End 8217641
3786: ' FROM ap_supplier_sites_all sites, '||
3787: ' ap_suppliers suppliers, '||
3788: ' ap_invoices ai, '|| /* inv, '|| Commented for bug#9182499 GSCC Error File.Sql.6 --Bug6040657. Changed from ap_invoices_all to ap_invoices */
3789: ' ap_payment_schedules_all ps, '||
3790: ' ap_system_parameters_all asp, '||
3791: ' hz_parties hzp, '||
3792: ' hz_party_sites hzps, '|| -- Bug 5620285

Line 3855: -- AND AP_INVOICES_PKG.get_wfapproval_status(inv.invoice_id, inv.org_id) in

3851: --End Bug 5929034
3852: ' AND fv_econ_benf_disc.ebd_check(:p_checkrun_name, ai.invoice_id, '||
3853: ' to_date(:p_check_date, ''DD-MM-YYYY''), due_date, ps.discount_amount_available, ps.discount_date) = ''Y'' ';
3854: -- Bug 7265013 starts
3855: -- AND AP_INVOICES_PKG.get_wfapproval_status(inv.invoice_id, inv.org_id) in
3856: -- ('NOT REQUIRED','WFAPPROVED','MANUALLY APPROVED')
3857: -- Bug 7265013 ends
3858:
3859:

Line 3982: ' WHERE AP_INVOICES_PKG.get_wfapproval_status(ai.invoice_id, ai.org_id) in '||

3978: -- Bug 7265013 starts
3979: /*' AND EXISTS ( '||
3980: ' SELECT 1 '||
3981: ' FROM sys.dual '||
3982: ' WHERE AP_INVOICES_PKG.get_wfapproval_status(ai.invoice_id, ai.org_id) in '||
3983: ' (''NOT REQUIRED'',''WFAPPROVED'',''MANUALLY APPROVED'') '||
3984: ' ) '|| */
3985: /* Bug 13901772 */
3986: ' AND ai.wfapproval_status in (''NOT REQUIRED'',''WFAPPROVED'',''MANUALLY APPROVED'') '||

Line 4015: -- ' FROM ap_invoices_derived_v AIDV '||

4011: /* Bug 12799362. End. */
4012: /*
4013: -- Commented for Bug 12727539.
4014: -- ' AND NOT EXISTS (SELECT ''Invoice is not fully approved'' '||
4015: -- ' FROM ap_invoices_derived_v AIDV '||
4016: -- ' WHERE AIDV.invoice_id = ai.invoice_id '||
4017: -- ' AND AIDV.approval_status_lookup_code IN '||
4018: -- ' (''NEVER APPROVED'', ''NEEDS REAPPROVAL'', ''UNAPPROVED'')) '||
4019: */

Line 4524: FROM AP_INVOICES_ALL AI

4520: AND ASI2.CHECKRUN_ID = l_checkrun_id
4521: --introduced for 8403042/8404650
4522: AND EXISTS
4523: (SELECT 1
4524: FROM AP_INVOICES_ALL AI
4525: WHERE AI.INVOICE_ID = ASI2.INVOICE_ID
4526: AND NVL(AI.RELATIONSHIP_ID,-1) <> -1)
4527: --end of 8403042/8404650
4528: AND NOT EXISTS

Line 4725: ap_invoices ai --Bug6040657. Changed from ap_invoices_all to ap_invoices

4721: * (PS.AMOUNT_REMAINING / DECODE(PS.GROSS_AMOUNT,
4722: 0, 1,
4723: prorated_awt_gross_amt(ps.invoice_id, ps.payment_num) )))))
4724: FROM ap_payment_schedules_all PS,
4725: ap_invoices ai --Bug6040657. Changed from ap_invoices_all to ap_invoices
4726: WHERE PS.invoice_id = asi.invoice_id
4727: AND PS.payment_num = asi.payment_num
4728: and ai.invoice_id = ps.invoice_id)
4729: WHERE checkrun_id = l_checkrun_id;

Line 5412: from ap_invoices_all

5408: END IF;
5409:
5410: update ap_selected_invoices_all asi
5411: set exclusive_payment_flag = (select nvl(exclusive_payment_flag, 'N')
5412: from ap_invoices_all
5413: where invoice_id = asi.invoice_id)
5414: where checkrun_id = p_checkrun_id
5415: and exists
5416: ( select 1

Line 6395: FROM ap_invoice_lines_all ail,ap_invoices_all ai

6391: l_prepay_with_tax NUMBER;
6392: BEGIN
6393: SELECT ((0 - SUM(NVL(ail.amount,0)))*ai.payment_cross_rate)
6394: INTO l_prepay_with_tax
6395: FROM ap_invoice_lines_all ail,ap_invoices_all ai
6396: WHERE ail.invoice_id = p_invoice_id
6397: AND ail.invoice_id=ai.invoice_id
6398: AND ail.prepay_invoice_id is not null
6399: AND ail.line_type_lookup_code in ('TAX', 'PREPAY')

Line 6453: (select /*+ use_nl_index(I AP_INVOICES_U1) */ si2.invoice_id

6449: set ok_to_pay_flag = 'N',
6450: dont_pay_reason_code = 'OVERPAYMENT'
6451: WHERE si.checkrun_id = p_checkrun_id
6452: AND si.invoice_id in
6453: (select /*+ use_nl_index(I AP_INVOICES_U1) */ si2.invoice_id
6454: from ap_selected_invoices_all si2
6455: , ap_invoices_all i
6456: where si2.checkrun_id = p_checkrun_id
6457: and si2.invoice_id = i.invoice_id

Line 6455: , ap_invoices_all i

6451: WHERE si.checkrun_id = p_checkrun_id
6452: AND si.invoice_id in
6453: (select /*+ use_nl_index(I AP_INVOICES_U1) */ si2.invoice_id
6454: from ap_selected_invoices_all si2
6455: , ap_invoices_all i
6456: where si2.checkrun_id = p_checkrun_id
6457: and si2.invoice_id = i.invoice_id
6458: and si2.original_invoice_id is null
6459: group by si2.invoice_id,i.invoice_amount, decode(i.net_of_retainage_flag, 'Y', 0,

Line 6460: nvl(AP_INVOICES_UTILITY_PKG.GET_RETAINED_TOTAL(si2.invoice_id, si2.org_id),0)),i.payment_cross_rate

6456: where si2.checkrun_id = p_checkrun_id
6457: and si2.invoice_id = i.invoice_id
6458: and si2.original_invoice_id is null
6459: group by si2.invoice_id,i.invoice_amount, decode(i.net_of_retainage_flag, 'Y', 0,
6460: nvl(AP_INVOICES_UTILITY_PKG.GET_RETAINED_TOTAL(si2.invoice_id, si2.org_id),0)),i.payment_cross_rate
6461: having abs((nvl(i.invoice_amount,0) - nvl(sum(si2.withholding_amount),0)
6462: - nvl(AP_INVOICES_UTILITY_PKG.get_amount_withheld(si2.invoice_id),0)
6463: + decode(i.net_of_retainage_flag, 'Y', 0,
6464: nvl(AP_INVOICES_UTILITY_PKG.GET_RETAINED_TOTAL(si2.invoice_id, si2.org_id),0)))*i.payment_cross_rate

Line 6462: - nvl(AP_INVOICES_UTILITY_PKG.get_amount_withheld(si2.invoice_id),0)

6458: and si2.original_invoice_id is null
6459: group by si2.invoice_id,i.invoice_amount, decode(i.net_of_retainage_flag, 'Y', 0,
6460: nvl(AP_INVOICES_UTILITY_PKG.GET_RETAINED_TOTAL(si2.invoice_id, si2.org_id),0)),i.payment_cross_rate
6461: having abs((nvl(i.invoice_amount,0) - nvl(sum(si2.withholding_amount),0)
6462: - nvl(AP_INVOICES_UTILITY_PKG.get_amount_withheld(si2.invoice_id),0)
6463: + decode(i.net_of_retainage_flag, 'Y', 0,
6464: nvl(AP_INVOICES_UTILITY_PKG.GET_RETAINED_TOTAL(si2.invoice_id, si2.org_id),0)))*i.payment_cross_rate
6465: /* retainage is returned as a negative */
6466: )

Line 6464: nvl(AP_INVOICES_UTILITY_PKG.GET_RETAINED_TOTAL(si2.invoice_id, si2.org_id),0)))*i.payment_cross_rate

6460: nvl(AP_INVOICES_UTILITY_PKG.GET_RETAINED_TOTAL(si2.invoice_id, si2.org_id),0)),i.payment_cross_rate
6461: having abs((nvl(i.invoice_amount,0) - nvl(sum(si2.withholding_amount),0)
6462: - nvl(AP_INVOICES_UTILITY_PKG.get_amount_withheld(si2.invoice_id),0)
6463: + decode(i.net_of_retainage_flag, 'Y', 0,
6464: nvl(AP_INVOICES_UTILITY_PKG.GET_RETAINED_TOTAL(si2.invoice_id, si2.org_id),0)))*i.payment_cross_rate
6465: /* retainage is returned as a negative */
6466: )
6467: < abs( nvl(sum(si2.discount_amount),0) + nvl(sum(si2.payment_amount),0)
6468: + nvl(get_prepay_with_tax(si2.invoice_id),0)