DBA Data[Home] [Help]

APPS.AP_RCT_AMT_MATCH_PKG dependencies on PO_DISTRIBUTIONS

Line 240: l_po_distribution_id po_distributions.po_distribution_id%TYPE := NULL;

236: X_retained_amount IN NUMBER DEFAULT NULL,
237: X_calling_sequence IN VARCHAR2)
238: IS
239: l_single_dist_flag varchar2(1) := 'N';
240: l_po_distribution_id po_distributions.po_distribution_id%TYPE := NULL;
241: l_invoice_distribution_id ap_invoice_distributions.invoice_distribution_id%TYPE;
242: l_item_line_number ap_invoice_lines.line_number%TYPE;
243: l_amount_to_recoup ap_invoice_lines_all.amount%TYPE;
244: l_line_amt_net_retainage ap_invoice_lines_all.amount%TYPE;

Line 437: --po distributions of the shipment, for distribution level match we need to

433:
434: END IF;
435:
436: --If shipment level match then we need to prorate the match-amount among the
437: --po distributions of the shipment, for distribution level match we need to
438: --derive the invoice_distribution_id, base_amount, ccid.
439:
440: l_debug_info := 'Get Distribution information';
441:

Line 568: po_distributions pd,

564: --end Bug 7483260
565: l_retained_amount,
566: -1 * l_retained_amount
567: FROM ap_invoice_distributions aid,
568: po_distributions pd,
569: po_line_locations pll,
570: rcv_transactions rtxn -- bug 5443250
571: WHERE aid.invoice_distribution_id = l_invoice_distribution_id
572: AND pd.po_distribution_id = aid.po_distribution_id

Line 690: l_debug_info := 'Update Amount Billed on the PO Distributions';

686: P_Calling_Sequence => current_calling_sequence);
687:
688: END IF;
689:
690: l_debug_info := 'Update Amount Billed on the PO Distributions';
691:
692: Update_PO_Shipments_Dists(X_Dist_Tab => x_dist_tab,
693: X_Po_Line_Location_Id => x_po_line_location_id,
694: X_Match_Amount => x_amount,

Line 1008: CURSOR po_distributions_cursor IS

1004:
1005: --Modified below cursor for bug #7015553 to receive projec_id and task_id
1006: --values from receivables tables if these are different in PO and receipt.
1007:
1008: CURSOR po_distributions_cursor IS
1009: SELECT pd.po_distribution_id,
1010: X_Match_Quantity,
1011: pd.code_combination_id,
1012: accrue_on_receipt_flag ,

Line 1031: FROM po_distributions_ap_v PD,

1027: NULL), --expenditure_organization_id
1028: DECODE(PD.destination_type_code,
1029: 'EXPENSE', PD.award_id), --award_id
1030: ap_invoice_distributions_s.nextval
1031: FROM po_distributions_ap_v PD,
1032: rcv_transactions RT
1033: WHERE PD.line_location_id = x_po_line_location_id
1034: and Pd.line_location_id = RT.po_line_location_id
1035: and Pd.po_distribution_id = NVL(RT.po_distribution_id, Pd.po_distribution_id) --Added for bug 13845471

Line 1038: l_po_distribution_id PO_DISTRIBUTIONS_ALL.PO_DISTRIBUTION_ID%TYPE;

1034: and Pd.line_location_id = RT.po_line_location_id
1035: and Pd.po_distribution_id = NVL(RT.po_distribution_id, Pd.po_distribution_id) --Added for bug 13845471
1036: and RT.TRANSACTION_ID= X_Rcv_Transaction_Id ;
1037:
1038: l_po_distribution_id PO_DISTRIBUTIONS_ALL.PO_DISTRIBUTION_ID%TYPE;
1039: l_amount_ordered NUMBER;
1040: l_amount_cancelled NUMBER;
1041: l_amount_delivered NUMBER;
1042: l_amount_returned NUMBER;

Line 1053: l_po_dist_ccid po_distributions.code_combination_id%TYPE;

1049: l_amount_invoiced ap_invoice_distributions_all.amount%TYPE;
1050: l_matching_case VARCHAR2(2);
1051: l_amount NUMBER;
1052: l_quantity_invoiced NUMBER;
1053: l_po_dist_ccid po_distributions.code_combination_id%TYPE;
1054: l_accrue_on_receipt_flag po_distributions.accrue_on_receipt_flag%TYPE;
1055: l_project_id po_distributions.project_id%TYPE;
1056: l_task_id po_distributions.task_id%TYPE;
1057: l_award_set_id po_distributions_all.award_id%TYPE;

Line 1054: l_accrue_on_receipt_flag po_distributions.accrue_on_receipt_flag%TYPE;

1050: l_matching_case VARCHAR2(2);
1051: l_amount NUMBER;
1052: l_quantity_invoiced NUMBER;
1053: l_po_dist_ccid po_distributions.code_combination_id%TYPE;
1054: l_accrue_on_receipt_flag po_distributions.accrue_on_receipt_flag%TYPE;
1055: l_project_id po_distributions.project_id%TYPE;
1056: l_task_id po_distributions.task_id%TYPE;
1057: l_award_set_id po_distributions_all.award_id%TYPE;
1058: l_expenditure_type po_distributions.expenditure_type%TYPE;

Line 1055: l_project_id po_distributions.project_id%TYPE;

1051: l_amount NUMBER;
1052: l_quantity_invoiced NUMBER;
1053: l_po_dist_ccid po_distributions.code_combination_id%TYPE;
1054: l_accrue_on_receipt_flag po_distributions.accrue_on_receipt_flag%TYPE;
1055: l_project_id po_distributions.project_id%TYPE;
1056: l_task_id po_distributions.task_id%TYPE;
1057: l_award_set_id po_distributions_all.award_id%TYPE;
1058: l_expenditure_type po_distributions.expenditure_type%TYPE;
1059: l_po_expenditure_item_date po_distributions.expenditure_item_date%TYPE;

Line 1056: l_task_id po_distributions.task_id%TYPE;

1052: l_quantity_invoiced NUMBER;
1053: l_po_dist_ccid po_distributions.code_combination_id%TYPE;
1054: l_accrue_on_receipt_flag po_distributions.accrue_on_receipt_flag%TYPE;
1055: l_project_id po_distributions.project_id%TYPE;
1056: l_task_id po_distributions.task_id%TYPE;
1057: l_award_set_id po_distributions_all.award_id%TYPE;
1058: l_expenditure_type po_distributions.expenditure_type%TYPE;
1059: l_po_expenditure_item_date po_distributions.expenditure_item_date%TYPE;
1060: l_expenditure_organization_id po_distributions.expenditure_organization_id%TYPE;

Line 1057: l_award_set_id po_distributions_all.award_id%TYPE;

1053: l_po_dist_ccid po_distributions.code_combination_id%TYPE;
1054: l_accrue_on_receipt_flag po_distributions.accrue_on_receipt_flag%TYPE;
1055: l_project_id po_distributions.project_id%TYPE;
1056: l_task_id po_distributions.task_id%TYPE;
1057: l_award_set_id po_distributions_all.award_id%TYPE;
1058: l_expenditure_type po_distributions.expenditure_type%TYPE;
1059: l_po_expenditure_item_date po_distributions.expenditure_item_date%TYPE;
1060: l_expenditure_organization_id po_distributions.expenditure_organization_id%TYPE;
1061: i NUMBER;

Line 1058: l_expenditure_type po_distributions.expenditure_type%TYPE;

1054: l_accrue_on_receipt_flag po_distributions.accrue_on_receipt_flag%TYPE;
1055: l_project_id po_distributions.project_id%TYPE;
1056: l_task_id po_distributions.task_id%TYPE;
1057: l_award_set_id po_distributions_all.award_id%TYPE;
1058: l_expenditure_type po_distributions.expenditure_type%TYPE;
1059: l_po_expenditure_item_date po_distributions.expenditure_item_date%TYPE;
1060: l_expenditure_organization_id po_distributions.expenditure_organization_id%TYPE;
1061: i NUMBER;
1062: l_dist_ccid ap_invoice_distributions.dist_code_combination_id%TYPE;

Line 1059: l_po_expenditure_item_date po_distributions.expenditure_item_date%TYPE;

1055: l_project_id po_distributions.project_id%TYPE;
1056: l_task_id po_distributions.task_id%TYPE;
1057: l_award_set_id po_distributions_all.award_id%TYPE;
1058: l_expenditure_type po_distributions.expenditure_type%TYPE;
1059: l_po_expenditure_item_date po_distributions.expenditure_item_date%TYPE;
1060: l_expenditure_organization_id po_distributions.expenditure_organization_id%TYPE;
1061: i NUMBER;
1062: l_dist_ccid ap_invoice_distributions.dist_code_combination_id%TYPE;
1063: l_unbuilt_flex VARCHAR2(240):='';

Line 1060: l_expenditure_organization_id po_distributions.expenditure_organization_id%TYPE;

1056: l_task_id po_distributions.task_id%TYPE;
1057: l_award_set_id po_distributions_all.award_id%TYPE;
1058: l_expenditure_type po_distributions.expenditure_type%TYPE;
1059: l_po_expenditure_item_date po_distributions.expenditure_item_date%TYPE;
1060: l_expenditure_organization_id po_distributions.expenditure_organization_id%TYPE;
1061: i NUMBER;
1062: l_dist_ccid ap_invoice_distributions.dist_code_combination_id%TYPE;
1063: l_unbuilt_flex VARCHAR2(240):='';
1064: l_reason_unbuilt_flex VARCHAR2(2000):='';

Line 1069: l_rounding_index po_distributions.po_distribution_id%TYPE;

1065: l_invoice_distribution_id ap_invoice_distributions.invoice_distribution_id%TYPE;
1066: l_sum_prorated_amount ap_invoice_distributions.amount%TYPE := 0;
1067: l_sum_dist_base_amount ap_invoice_distributions.base_amount%TYPE := 0;
1068: l_max_dist_amount ap_invoice_distributions.amount%TYPE := 0;
1069: l_rounding_index po_distributions.po_distribution_id%TYPE;
1070: l_base_amount ap_invoice_distributions.base_amount%TYPE;
1071: FLEX_OVERLAY_FAILED EXCEPTION;
1072: current_calling_sequence VARCHAR2(2000);
1073: l_debug_info VARCHAR2(2000);

Line 1094: OPEN PO_Distributions_Cursor;

1090: X_Total_Amount => l_total_amount,
1091: X_Matching_Case => l_matching_case,
1092: X_Calling_Sequence => current_calling_sequence);
1093:
1094: OPEN PO_Distributions_Cursor;
1095:
1096: LOOP
1097:
1098: FETCH PO_Distributions_Cursor INTO l_po_distribution_id,

Line 1098: FETCH PO_Distributions_Cursor INTO l_po_distribution_id,

1094: OPEN PO_Distributions_Cursor;
1095:
1096: LOOP
1097:
1098: FETCH PO_Distributions_Cursor INTO l_po_distribution_id,
1099: l_quantity_invoiced,
1100: l_po_dist_ccid,
1101: l_accrue_on_receipt_flag,
1102: l_project_id,

Line 1110: EXIT WHEN PO_Distributions_Cursor%NOTFOUND;

1106: l_expenditure_organization_id,
1107: l_award_set_id,
1108: l_invoice_distribution_id;
1109:
1110: EXIT WHEN PO_Distributions_Cursor%NOTFOUND;
1111:
1112: x_dist_tab(l_po_distribution_id).po_distribution_id := l_po_distribution_id;
1113: x_dist_tab(l_po_distribution_id).invoice_distribution_id := l_invoice_distribution_id;
1114:

Line 1230: CLOSE PO_Distributions_Cursor;

1226: l_sum_prorated_amount := l_sum_prorated_amount + l_amount_invoiced;
1227:
1228: END LOOP;
1229:
1230: CLOSE PO_Distributions_Cursor;
1231:
1232: --Update the PL/SQL table's amount column with the rounding amount due
1233: --to proration, before the base_amounts are calculated.
1234:

Line 1268: FROM po_distributions_ap_v pod

1264: x_dist_tab(i).expenditure_type,
1265: x_dist_tab(i).expenditure_item_date,
1266: x_dist_tab(i).expenditure_organization_id,
1267: x_dist_tab(i).invoice_distribution_id
1268: FROM po_distributions_ap_v pod
1269: ,rcv_transactions RT --Added for bug 13845471
1270: WHERE pod.po_distribution_id = x_dist_tab(i).po_distribution_id
1271: AND pod.po_distribution_id = NVL(rt.po_distribution_id,pod.po_distribution_id) --Added for bug 13845471
1272: AND rt.TRANSACTION_ID= X_Rcv_Transaction_Id; --Added for bug 13845471

Line 1499: --po_distributions_ap_v.code_combination_id is accrual account

1495: --bugfix:4668058 added the following clause
1496: (x_dist_tab(i).project_id IS NOT NULL AND g_allow_pa_override = 'N')
1497: ) THEN
1498:
1499: --po_distributions_ap_v.code_combination_id is accrual account
1500: --if accruing on receipt or else charge account
1501:
1502: x_dist_tab(i).dist_ccid := x_dist_tab(i).po_ccid;
1503:

Line 1714: l_source_distribution_id po_distributions.source_distribution_id%TYPE;

1710: X_Match_Amount IN NUMBER,
1711: X_Uom_Lookup_Code IN VARCHAR2,
1712: X_Calling_Sequence IN VARCHAR2)
1713: IS
1714: l_source_distribution_id po_distributions.source_distribution_id%TYPE;
1715: current_calling_sequence VARCHAR2(2000);
1716: l_debug_info VARCHAR2(2000);
1717: i NUMBER;
1718: l_po_ap_dist_rec PO_AP_DIST_REC_TYPE;

Line 1818: l_debug_info := 'Call the PO_AP_INVOICE_MATCH_GRP to update the Po Distributions and Po Line Locations';

1814: END IF;
1815:
1816: END LOOP;
1817:
1818: l_debug_info := 'Call the PO_AP_INVOICE_MATCH_GRP to update the Po Distributions and Po Line Locations';
1819: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
1820: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||l_api_name,l_debug_info);
1821: END IF;
1822:

Line 2277: FROM PO_DISTRIBUTIONS_AP_V PD,

2273: --Modified for bug#13505998 -G_ASSESSABLE_VALUE,
2274: DECODE(X_Amount,l_full_mtch_amt,G_ASSESSABLE_VALUE, NULL),
2275: G_dflt_tax_class_code,
2276: G_PAY_AWT_GROUP_ID --bug 9689194
2277: FROM PO_DISTRIBUTIONS_AP_V PD,
2278: MTL_SYSTEM_ITEMS MSI,
2279: PO_AP_RECEIPT_MATCH_V RCV,
2280: RCV_SHIPMENT_LINES RSL,
2281: RCV_TRANSACTIONS RT --7015553

Line 2971: FROM po_distributions_ap_v pd,

2967: ,'N' --accrual_posted_flag
2968: ,'N' --cash_posted_flag
2969: ,'N' --rcv_charge_addition_flag
2970: ,x_dist_tab(i).pay_awt_group_id --pay_awt_group_id --bug 9689194
2971: FROM po_distributions_ap_v pd,
2972: ap_invoice_lines ail,
2973: po_ap_receipt_match_v rcv,
2974: gl_code_combinations gcc
2975: WHERE ail.invoice_id = x_invoice_id

Line 3151: l_po_distribution_id PO_DISTRIBUTIONS.PO_DISTRIBUTION_ID%TYPE := NULL;

3147: X_Uom_Lookup_Code IN VARCHAR2,
3148: X_Retained_Amount IN NUMBER DEFAULT NULL,
3149: X_Calling_Sequence IN VARCHAR2) IS
3150:
3151: l_po_distribution_id PO_DISTRIBUTIONS.PO_DISTRIBUTION_ID%TYPE := NULL;
3152: l_item_line_number AP_INVOICE_LINES_ALL.LINE_NUMBER%TYPE;
3153: l_amount_to_recoup AP_INVOICE_LINES_ALL.AMOUNT%TYPE;
3154: l_line_amt_net_retainage ap_invoice_lines_all.amount%TYPE;
3155: l_max_amount_to_recoup ap_invoice_lines_all.amount%TYPE;

Line 3564: FND_LOG.STRING(G_LEVEL_PROCEDURE,G_MODULE_NAME||l_api_name,'AP_PO_AMT_MATCH_PKG.Update_Corr_Po_Distributions(+)');

3560:
3561: l_api_name := 'Update_Corr_Po_Shipments_Dists';
3562:
3563: IF (G_LEVEL_PROCEDURE >= G_CURRENT_RUNTIME_LEVEL) THEN
3564: FND_LOG.STRING(G_LEVEL_PROCEDURE,G_MODULE_NAME||l_api_name,'AP_PO_AMT_MATCH_PKG.Update_Corr_Po_Distributions(+)');
3565: END IF;
3566:
3567: l_debug_info := 'Create l_po_ap_dist_rec object';
3568: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN

Line 3612: l_debug_info := 'Call the PO_AP_INVOICE_MATCH_GRP to update the Po Distributions and Po Line Locations';

3608: END IF;
3609:
3610: END LOOP;
3611:
3612: l_debug_info := 'Call the PO_AP_INVOICE_MATCH_GRP to update the Po Distributions and Po Line Locations';
3613: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
3614: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||l_api_name,l_debug_info);
3615: END IF;
3616:

Line 4359: po_distributions pd

4355: ail.pay_awt_group_id,NULL),
4356: NULL) --pay_awt_group_id bug 9689194
4357: FROM ap_invoice_lines ail,
4358: ap_invoice_distributions aid,
4359: po_distributions pd
4360: WHERE ail.invoice_id = x_invoice_id
4361: AND ail.line_number = x_invoice_line_number
4362: AND aid.invoice_id = ail.corrected_inv_id
4363: AND aid.invoice_line_number = ail.corrected_line_number