DBA Data[Home] [Help]

APPS.CSTPPACQ dependencies on AP_INVOICE_DISTRIBUTIONS_ALL

Line 111: from ap_invoice_distributions_all aida

107: -- i_invoice_no is not null. It is the invoice id
108: -- -----------------------------------------------------------------------------
109: CURSOR c_receipts_src_flag_2_invid(i_invoice_no IN NUMBER) IS
110: Select distinct rcv_transaction_id
111: from ap_invoice_distributions_all aida
112: where aida.invoice_id = i_invoice_no
113: and aida.rcv_transaction_id IS NOT NULL
114: and aida.line_type_lookup_code = 'ITEM'
115: and NOT EXISTS (SELECT 1 FROM rcv_transactions rt,rcv_accounting_events rae --add for dropshipment

Line 157: from ap_invoice_distributions_all aida

153: l_end_date IN DATE
154: )IS
155: Select /*+ OPTIMIZER_FEATURES_ENABLE('9.0.1') */
156: distinct aida.rcv_transaction_id transaction_id
157: from ap_invoice_distributions_all aida
158: ,ap_invoice_distributions_all aida2
159: WHERE aida.invoice_distribution_id = aida2.charge_applicable_to_dist_id
160: AND aida2.accounting_date between l_start_date and l_end_date
161: AND aida2.posted_flag = 'Y'

Line 158: ,ap_invoice_distributions_all aida2

154: )IS
155: Select /*+ OPTIMIZER_FEATURES_ENABLE('9.0.1') */
156: distinct aida.rcv_transaction_id transaction_id
157: from ap_invoice_distributions_all aida
158: ,ap_invoice_distributions_all aida2
159: WHERE aida.invoice_distribution_id = aida2.charge_applicable_to_dist_id
160: AND aida2.accounting_date between l_start_date and l_end_date
161: AND aida2.posted_flag = 'Y'
162: AND aida2.org_id = aida.org_id /* rgangara perf bug 7475729 */

Line 208: select distinct rcv_transaction_id from ap_invoice_distributions_all aida

204: AND rae.rcv_transaction_id = rt.transaction_id
205: AND rae.event_type_id = 1 -- RECEIVE
206: AND rae.trx_flow_header_id is not NULL)
207: UNION
208: select distinct rcv_transaction_id from ap_invoice_distributions_all aida
209: where aida.accounting_date between l_start_date and l_end_date
210: and aida.posted_flag = 'Y'
211: /* Invoice Lines Project, TAX is now REC_TAX and NONREC_TAX */
212: and aida.line_type_lookup_code <> 'REC_TAX'

Line 893: -- 2.3 Get all posted Invoice lines from AP_INVOICE_DISTRIBUTIONS_ALL

889:
890:
891: if (l_accounting_event_id = 0) then --added for dropshipment project
892: -------------------------------------------------------------
893: -- 2.3 Get all posted Invoice lines from AP_INVOICE_DISTRIBUTIONS_ALL
894: -- which are matched to the receipt
895: --------------------------------------------------------------
896:
897: l_stmt_num := 85;

Line 908: FROM ap_invoice_distributions_all ad1

904: l_stmt_num := 90;
905:
906: SELECT count(rcv_transaction_id)
907: INTO l_inv_count
908: FROM ap_invoice_distributions_all ad1
909: WHERE ad1.rcv_transaction_id = c_rec.transaction_id AND
910: ( (l_res_flag =1 AND ad1.accounting_date between i_start_date
911: and i_end_date
912: )

Line 949: ap_invoice_distributions_all ad2,

945: 'QUANTITY', ad2.unit_price), 0 ) unit_price, -- Invoice Currency
946: --------------------------------------------------------------------------------
947: nvl(ad2.base_amount, nvl(ad2.amount, 0)) base_amount
948: FROM
949: ap_invoice_distributions_all ad2,
950: -- J Changes -----------------------------------------------------------
951: RCV_TRANSACTIONS RT,
952: PO_LINES_ALL POL,
953: PO_LINE_LOCATIONS_ALL POLL, -- Added for Complex work Procurement

Line 989: FROM AP_INVOICE_DISTRIBUTIONS_ALL AIDA,

985: SELECT AIDA.invoice_distribution_id,
986: AIDA.line_type_lookup_code,
987: NVL(AIDA.BASE_AMOUNT, NVL(AIDA.AMOUNT, 0)) correction_amount
988:
989: FROM AP_INVOICE_DISTRIBUTIONS_ALL AIDA,
990: AP_INVOICES_ALL AP_INV
991: /* Invoice Lines Project
992: No root_distribution_id or xinv_parent_reversal_id
993: now it'll just be represented by corrected_invoice_dist_id

Line 1093: from ap_invoice_distributions_all

1089: BEGIN
1090:
1091: /* Invoice Lines Project no more ap_chrg_allocations_all table */
1092: Select count(*) into l_chrg_present
1093: from ap_invoice_distributions_all
1094: where invoice_distribution_id = c_inv.invoice_distribution_id
1095: and charge_applicable_to_dist_id is not null;
1096:
1097: EXCEPTION

Line 2731: -- 2.3 Get all posted Invoice lines from AP_INVOICE_DISTRIBUTIONS_ALL

2727:
2728:
2729: if (l_accounting_event_id = 0) then --added for dropshipment project
2730: -------------------------------------------------------------
2731: -- 2.3 Get all posted Invoice lines from AP_INVOICE_DISTRIBUTIONS_ALL
2732: -- which are matched to the receipt
2733: --------------------------------------------------------------
2734:
2735: l_stmt_num := 86;

Line 2746: FROM ap_invoice_distributions_all ad1

2742: l_stmt_num := 91;
2743:
2744: SELECT count(rcv_transaction_id)
2745: INTO l_inv_count
2746: FROM ap_invoice_distributions_all ad1
2747: WHERE ad1.rcv_transaction_id = l_rec_transaction_id
2748: AND ad1.accounting_date <= l_end_date
2749: AND ad1.posted_flag = 'Y' AND
2750: /* Invoice Lines Project TAX is now REC_TAX and NONREC_TAX */

Line 2783: ap_invoice_distributions_all ad2,

2779: 'QUANTITY', ad2.unit_price), 0 ) unit_price, -- Invoice Currency
2780: --------------------------------------------------------------------------------
2781: nvl(ad2.base_amount, nvl(ad2.amount, 0)) base_amount
2782: FROM
2783: ap_invoice_distributions_all ad2,
2784: -- J Changes -----------------------------------------------------------
2785: RCV_TRANSACTIONS RT,
2786: PO_LINES_ALL POL,
2787: PO_LINE_LOCATIONS_ALL POLL, -- Added for Complex work Procurement

Line 2818: FROM AP_INVOICE_DISTRIBUTIONS_ALL AIDA,

2814: CURSOR c_price_correction(inv_dist_id NUMBER) is
2815: SELECT AIDA.invoice_distribution_id,
2816: AIDA.line_type_lookup_code,
2817: NVL(AIDA.BASE_AMOUNT, NVL(AIDA.AMOUNT, 0)) correction_amount
2818: FROM AP_INVOICE_DISTRIBUTIONS_ALL AIDA,
2819: AP_INVOICES_ALL AP_INV
2820: /* Invoice Lines Project
2821: No root_distribution_id or xinv_parent_reversal_id
2822: now it'll just be represented by corrected_invoice_dist_id

Line 2922: from ap_invoice_distributions_all

2918: BEGIN
2919:
2920: /* Invoice Lines Project no more ap_chrg_allocations_all table */
2921: Select count(*) into l_chrg_present
2922: from ap_invoice_distributions_all
2923: where invoice_distribution_id = c_inv.invoice_distribution_id
2924: and charge_applicable_to_dist_id is not null;
2925:
2926: EXCEPTION

Line 3379: through ap_invoice_distributions_all. To determine if a distribution is a

3375: -- Check if any allocations (both parent and child should be posted)
3376: -------------------------------------------------------
3377: /* Invoice Lines Project
3378: No more ap_chrg_allocations_all table. Now need to get all information
3379: through ap_invoice_distributions_all. To determine if a distribution is a
3380: charge, just examine whether the charge_applicable_to_dist_id is not null
3381: */
3382: SELECT count(1)
3383: INTO l_chg_count

Line 3384: FROM ap_invoice_distributions_all aida

3380: charge, just examine whether the charge_applicable_to_dist_id is not null
3381: */
3382: SELECT count(1)
3383: INTO l_chg_count
3384: FROM ap_invoice_distributions_all aida
3385: WHERE aida.posted_flag = 'Y'
3386: AND (((i_res_flag = 1)
3387: AND (aida.accounting_date BETWEEN i_start_date AND i_end_Date))
3388: OR (i_res_flag = 2))

Line 3392: FROM ap_invoice_distributions_all aida2

3388: OR (i_res_flag = 2))
3389: AND aida.line_type_lookup_code <> 'REC_TAX'
3390: AND EXISTS (
3391: SELECT 'X'
3392: FROM ap_invoice_distributions_all aida2
3393: WHERE aida2.invoice_distribution_id = aida.charge_applicable_to_dist_id
3394: AND aida2.posted_flag = 'Y'
3395: AND (((i_res_flag = 1)
3396: AND (aida2.accounting_date BETWEEN i_start_date AND i_end_Date))

Line 3418: through ap_invoice_distributions_all. To determine if a distribution is a

3414: -- Insert into CRACD all allocations level by level
3415: -------------------------------------------------------------
3416: /* Invoice Lines Project
3417: No more ap_chrg_allocations_all table. Now need to get all information
3418: through ap_invoice_distributions_all. To determine if a distribution is a
3419: charge, just examine whether the charge_applicable_to_dist_id is not null
3420: */
3421:
3422: INSERT INTO

Line 3475: ap_invoice_distributions_all aida

3471: i_prog_id,
3472: SYSDATE,
3473: i_login_id
3474: FROM
3475: ap_invoice_distributions_all aida
3476: WHERE aida.posted_flag = 'Y'
3477: AND (((i_res_flag = 1) AND (aida.accounting_date BETWEEN i_start_date AND i_end_Date))
3478: OR (i_res_flag = 2))
3479: AND aida.line_type_lookup_code <> 'REC_TAX'

Line 3482: FROM ap_invoice_distributions_all aida2

3478: OR (i_res_flag = 2))
3479: AND aida.line_type_lookup_code <> 'REC_TAX'
3480: AND EXISTS (
3481: SELECT 'X'
3482: FROM ap_invoice_distributions_all aida2
3483: WHERE aida2.invoice_distribution_id = aida.charge_applicable_to_dist_id
3484: AND aida2.posted_flag = 'Y'
3485: AND (((i_res_flag = 1) AND (aida2.accounting_date BETWEEN i_start_date AND i_end_Date))
3486: OR (i_res_flag = 2))

Line 3497: -- Get the parent amount from the AP_INVOICE_DISTRIBUTIONS_ALL table

3493:
3494: l_stmt_num := 30;
3495:
3496: ----------------------------------------------------------
3497: -- Get the parent amount from the AP_INVOICE_DISTRIBUTIONS_ALL table
3498: -- and also the LINE TYPE
3499: -- and update the CRACD rows just created
3500: ----------------------------------------------------------
3501:

Line 3509: ap_invoice_distributions_all ad7

3505: cracd3.parent_amount = (
3506: SELECT
3507: nvl(ad7.base_amount,nvl(ad7.amount,0))
3508: FROM
3509: ap_invoice_distributions_all ad7
3510: WHERE
3511: ad7.invoice_distribution_id = cracd3.parent_invoice_dist_id) ,
3512: cracd3.line_type = (
3513: SELECT

Line 3516: ap_invoice_distributions_all ad8

3512: cracd3.line_type = (
3513: SELECT
3514: ad8.line_type_lookup_code
3515: FROM
3516: ap_invoice_distributions_all ad8
3517: WHERE
3518: ad8.invoice_distribution_id = cracd3.invoice_distribution_id)
3519: WHERE
3520: cracd3.parent_invoice_dist_id IS NOT NULL AND

Line 3605: through ap_invoice_distributions_all. To determine if a distribution is a

3601: -- Check if any allocations (both parent and child should be posted)
3602: -------------------------------------------------------
3603: /* Invoice Lines Project
3604: No more ap_chrg_allocations_all table. Now need to get all information
3605: through ap_invoice_distributions_all. To determine if a distribution is a
3606: charge, just examine whether the charge_applicable_to_dist_id is not null
3607: */
3608:
3609: SELECT

Line 3614: ap_invoice_distributions_all aida

3610: count(1)
3611: INTO
3612: l_chg_count
3613: FROM
3614: ap_invoice_distributions_all aida
3615: WHERE aida.posted_flag = 'Y'
3616: AND aida.accounting_date <= l_end_date
3617: AND aida.line_type_lookup_code <> 'REC_TAX'
3618: AND EXISTS (

Line 3620: FROM ap_invoice_distributions_all aida2

3616: AND aida.accounting_date <= l_end_date
3617: AND aida.line_type_lookup_code <> 'REC_TAX'
3618: AND EXISTS (
3619: SELECT 'X'
3620: FROM ap_invoice_distributions_all aida2
3621: WHERE aida2.invoice_distribution_id = aida.charge_applicable_to_dist_id
3622: AND aida2.posted_flag = 'Y'
3623: AND aida2.accounting_date <= l_end_date
3624: AND aida2.line_type_lookup_code <> 'REC_TAX'

Line 3645: through ap_invoice_distributions_all. To determine if a distribution is a

3641: -- Insert into CRACD all allocations level by level
3642: -------------------------------------------------------------
3643: /* Invoice Lines Project
3644: No more ap_chrg_allocations_all table. Now need to get all information
3645: through ap_invoice_distributions_all. To determine if a distribution is a
3646: charge, just examine whether the charge_applicable_to_dist_id is not null
3647: */
3648:
3649: INSERT INTO

Line 3702: ap_invoice_distributions_all aida

3698: i_prog_id,
3699: SYSDATE,
3700: i_login_id
3701: FROM
3702: ap_invoice_distributions_all aida
3703: WHERE aida.posted_flag = 'Y'
3704: AND aida.accounting_date <= l_end_date
3705: AND aida.line_type_lookup_code <> 'REC_TAX'
3706: AND EXISTS (

Line 3708: FROM ap_invoice_distributions_all aida2

3704: AND aida.accounting_date <= l_end_date
3705: AND aida.line_type_lookup_code <> 'REC_TAX'
3706: AND EXISTS (
3707: SELECT 'X'
3708: FROM ap_invoice_distributions_all aida2
3709: WHERE aida2.invoice_distribution_id = aida.charge_applicable_to_dist_id
3710: AND aida2.posted_flag = 'Y'
3711: AND aida2.accounting_date <= l_end_date
3712: AND aida2.line_type_lookup_code <> 'REC_TAX'

Line 3722: -- Get the parent amount from the AP_INVOICE_DISTRIBUTIONS_ALL table

3718:
3719: l_stmt_num := 30;
3720:
3721: ----------------------------------------------------------
3722: -- Get the parent amount from the AP_INVOICE_DISTRIBUTIONS_ALL table
3723: -- and also the LINE TYPE
3724: -- and update the CRACD rows just created
3725: ----------------------------------------------------------
3726:

Line 3735: ap_invoice_distributions_all ad7

3731: cracd3.parent_amount = (
3732: SELECT
3733: nvl(ad7.base_amount,nvl(ad7.amount,0))
3734: FROM
3735: ap_invoice_distributions_all ad7
3736: WHERE
3737: ad7.invoice_distribution_id = cracd3.parent_invoice_dist_id) ,
3738: cracd3.line_type = (
3739: SELECT

Line 3742: ap_invoice_distributions_all ad8

3738: cracd3.line_type = (
3739: SELECT
3740: ad8.line_type_lookup_code
3741: FROM
3742: ap_invoice_distributions_all ad8
3743: WHERE
3744: ad8.invoice_distribution_id = cracd3.invoice_distribution_id)
3745: WHERE
3746: cracd3.parent_invoice_dist_id IS NOT NULL AND