DBA Data[Home] [Help]

APPS.AP_ACCTG_PREPAY_DIST_PKG dependencies on AP_PREPAY_HISTORY_ALL

Line 39: l_gain_loss_indicator ap_prepay_history_all.gain_loss_indicator%type;

35:
36: -- Logging Infra:
37: l_procedure_name CONSTANT VARCHAR2(30) := 'Update_Gain_Loss_Ind';
38: l_log_msg FND_LOG_MESSAGES.MESSAGE_TEXT%TYPE;
39: l_gain_loss_indicator ap_prepay_history_all.gain_loss_indicator%type;
40: l_gain_loss_indicator_parent ap_prepay_history_all.gain_loss_indicator%type; -- bug9175969
41: l_reversal_adj VARCHAR2(1);
42:
43:

Line 40: l_gain_loss_indicator_parent ap_prepay_history_all.gain_loss_indicator%type; -- bug9175969

36: -- Logging Infra:
37: l_procedure_name CONSTANT VARCHAR2(30) := 'Update_Gain_Loss_Ind';
38: l_log_msg FND_LOG_MESSAGES.MESSAGE_TEXT%TYPE;
39: l_gain_loss_indicator ap_prepay_history_all.gain_loss_indicator%type;
40: l_gain_loss_indicator_parent ap_prepay_history_all.gain_loss_indicator%type; -- bug9175969
41: l_reversal_adj VARCHAR2(1);
42:
43:
44: BEGIN

Line 74: FROM AP_Prepay_History_All aph1,

70: l_gain_loss_indicator_parent := NULL;
71:
72: SELECT aph1.Gain_Loss_Indicator
73: INTO l_gain_loss_indicator_parent
74: FROM AP_Prepay_History_All aph1,
75: AP_Prepay_History_All APH
76: WHERE aph1.invoice_id=aph.invoice_id
77: AND aph1.accounting_event_id = aph.related_prepay_app_event_id
78: AND aph.accounting_event_id = p_xla_event_rec.event_id

Line 75: AP_Prepay_History_All APH

71:
72: SELECT aph1.Gain_Loss_Indicator
73: INTO l_gain_loss_indicator_parent
74: FROM AP_Prepay_History_All aph1,
75: AP_Prepay_History_All APH
76: WHERE aph1.invoice_id=aph.invoice_id
77: AND aph1.accounting_event_id = aph.related_prepay_app_event_id
78: AND aph.accounting_event_id = p_xla_event_rec.event_id
79: AND rownum=1;

Line 101: FROM ap_prepay_history_all apph,

97: INTO l_reversal_adj
98: FROM dual
99: WHERE EXISTS
100: (SELECT 1
101: FROM ap_prepay_history_all apph,
102: ap_prepay_app_dists apad,
103: ap_prepay_app_dists apad_rel,
104: ap_prepay_history_all apph_rel
105: WHERE apph.accounting_event_id = P_XLA_Event_Rec.Event_ID

Line 104: ap_prepay_history_all apph_rel

100: (SELECT 1
101: FROM ap_prepay_history_all apph,
102: ap_prepay_app_dists apad,
103: ap_prepay_app_dists apad_rel,
104: ap_prepay_history_all apph_rel
105: WHERE apph.accounting_event_id = P_XLA_Event_Rec.Event_ID
106: AND apph.prepay_history_id = apad.prepay_history_id
107: AND apad.reversed_prepay_app_dist_id = apad_rel.prepay_app_dist_id
108: AND apad_rel.prepay_history_id = apph_rel.prepay_history_id

Line 136: UPDATE AP_Prepay_History_All APH

132: END IF;
133:
134: -- Added by abhsaxen for bug 9032498
135: --
136: UPDATE AP_Prepay_History_All APH
137: SET Gain_Loss_Indicator =
138: (SELECT DECODE(APH.Transaction_Type, 'PREPAYMENT APPLIED',
139: DECODE(SIGN(SUM(APAD.Base_Amount - APAD.Base_Amt_At_Prepay_XRate)),
140: -1, 'G', 1, 'L', NULL),

Line 168: FROM ap_prepay_history_all aph

164: BEGIN
165:
166: SELECT aph.gain_loss_indicator
167: INTO l_gain_loss_indicator
168: FROM ap_prepay_history_all aph
169: WHERE APH.Accounting_Event_ID = p_xla_event_rec.event_id;
170:
171: l_log_msg := 'APH.Gain_Loss_Indicator: '|| nvl(l_gain_loss_indicator,'NULL');
172: FND_LOG.STRING(G_LEVEL_STATEMENT, G_MODULE_NAME||l_procedure_name, l_log_msg);

Line 355: INSERT INTO AP_PREPAY_HISTORY_ALL

351: l_transaction_type := 'PREPAYMENT UNAPPLIED';
352: END IF;
353:
354:
355: INSERT INTO AP_PREPAY_HISTORY_ALL
356: (PREPAY_HISTORY_ID
357: ,PREPAY_INVOICE_ID
358: ,PREPAY_LINE_NUM
359: ,ACCOUNTING_EVENT_ID

Line 427: l_prepay_hist_id AP_PREPAY_HISTORY_ALL.Prepay_History_id%TYPE := -99;

423: PROCEDURE Prepay_Dist_Appl
424: (P_Invoice_ID IN NUMBER
425: ,P_Calling_Sequence IN VARCHAR2
426: ) IS
427: l_prepay_hist_id AP_PREPAY_HISTORY_ALL.Prepay_History_id%TYPE := -99;
428: l_accounting_event_id XLA_EVENTS.event_id%TYPE := -99;
429: l_historical_flag AP_PREPAY_HISTORY_ALL.Historical_flag%TYPE := 'N';
430: l_posted_flag AP_PREPAY_HISTORY_ALL.Posted_flag%TYPE := 'N';
431: l_upg_batch_id XLA_AE_HEADERS.Upg_Batch_Id%TYPE := -99;

Line 429: l_historical_flag AP_PREPAY_HISTORY_ALL.Historical_flag%TYPE := 'N';

425: ,P_Calling_Sequence IN VARCHAR2
426: ) IS
427: l_prepay_hist_id AP_PREPAY_HISTORY_ALL.Prepay_History_id%TYPE := -99;
428: l_accounting_event_id XLA_EVENTS.event_id%TYPE := -99;
429: l_historical_flag AP_PREPAY_HISTORY_ALL.Historical_flag%TYPE := 'N';
430: l_posted_flag AP_PREPAY_HISTORY_ALL.Posted_flag%TYPE := 'N';
431: l_upg_batch_id XLA_AE_HEADERS.Upg_Batch_Id%TYPE := -99;
432:
433: l_curr_calling_sequence VARCHAR2(2000);

Line 430: l_posted_flag AP_PREPAY_HISTORY_ALL.Posted_flag%TYPE := 'N';

426: ) IS
427: l_prepay_hist_id AP_PREPAY_HISTORY_ALL.Prepay_History_id%TYPE := -99;
428: l_accounting_event_id XLA_EVENTS.event_id%TYPE := -99;
429: l_historical_flag AP_PREPAY_HISTORY_ALL.Historical_flag%TYPE := 'N';
430: l_posted_flag AP_PREPAY_HISTORY_ALL.Posted_flag%TYPE := 'N';
431: l_upg_batch_id XLA_AE_HEADERS.Upg_Batch_Id%TYPE := -99;
432:
433: l_curr_calling_sequence VARCHAR2(2000);
434: l_total_paid_amt NUMBER;

Line 551: FROM ap_prepay_history_all APPH,

547: l_accounting_event_id,
548: l_posted_flag,
549: l_historical_flag,
550: l_upg_batch_id
551: FROM ap_prepay_history_all APPH,
552: xla_ae_headers XAH,
553: ap_system_parameters_all ASP
554: WHERE APPH.Invoice_ID = P_Invoice_ID
555: AND APPH.accounting_event_id = l_prepay_hist_rec.related_prepay_app_event_id

Line 1042: FROM AP_Prepay_History_All APH

1038: APH.Transaction_Type,
1039: APH.Accounting_Date,
1040: APH.Invoice_Adjustment_Event_ID,
1041: APH.Related_Prepay_App_Event_ID
1042: FROM AP_Prepay_History_All APH
1043: WHERE APH.Invoice_ID = P_Invoice_ID
1044: AND APH.Accounting_Event_ID = P_Event_ID;
1045:
1046: CURSOR Inv_Adj_Dists

Line 1095: FROM AP_Prepay_History_All APH,

1091: AID.Parent_Reversal_ID
1092: FROM AP_Invoice_Distributions_All AID
1093: WHERE Accounting_Event_ID = P_Event_ID
1094: AND EXISTS (SELECT 'Prepay History'
1095: FROM AP_Prepay_History_All APH,
1096: AP_Invoice_Distributions_All AID1
1097: WHERE APH.Prepay_History_ID = P_Prepay_History_ID
1098: AND AID1.Invoice_Distribution_ID = AID.Prepay_Distribution_ID
1099: AND AID1.Invoice_ID = APH.Prepay_Invoice_ID

Line 1120: FROM AP_Prepay_History_All APH,

1116: FROM AP_Invoice_Distributions_All AID1
1117: WHERE Line_Type_Lookup_Code = 'PREPAY'
1118: AND Accounting_Event_ID = P_Event_ID
1119: AND EXISTS (SELECT 'Prepay History'
1120: FROM AP_Prepay_History_All APH,
1121: AP_Invoice_Distributions_All AID2
1122: WHERE APH.Prepay_History_ID = P_Prepay_History_ID
1123: AND AID2.Invoice_Distribution_ID = AID1.Prepay_Distribution_ID
1124: AND AID2.Invoice_ID = APH.Prepay_Invoice_ID

Line 1418: FROM ap_prepay_history_all apph

1414: CLOSE Inv_Adj_Dists;
1415: END IF;
1416:
1417: SELECT MAX(accounting_event_id) into l_rounding_adjust_id --8201141
1418: FROM ap_prepay_history_all apph
1419: WHERE transaction_type = 'PREPAYMENT APPLICATION ADJ'
1420: AND posted_flag <> 'Y'
1421: AND prepay_invoice_id = l_prepay_hist_rec.prepay_invoice_id
1422: AND invoice_id = l_prepay_hist_rec.invoice_id

Line 1434: ap_prepay_history_all apph_rev

1430: 'PREPAY APPL NONREC TAX')
1431: AND APAD2.Reversed_Prepay_App_Dist_Id IS NULL
1432: AND NOT EXISTS (SELECT 1
1433: FROM ap_prepay_app_dists apad2_rev,
1434: ap_prepay_history_all apph_rev
1435: WHERE apad2_rev.reversed_prepay_app_dist_id = APAD2.prepay_app_dist_id
1436: AND apad2_rev.prepay_history_id = apph_rev.prepay_history_id
1437: AND apph_rev.invoice_id = apph.invoice_id)
1438: )

Line 1493: ap_prepay_history_all apph

1489: /* bug12858105 - start */
1490: AND APAD2.Reversed_Prepay_App_Dist_Id IS NULL
1491: AND NOT EXISTS (SELECT 1
1492: FROM ap_prepay_app_dists apad2_rev,
1493: ap_prepay_history_all apph
1494: WHERE apad2_rev.reversed_prepay_app_dist_id = APAD2.prepay_app_dist_id
1495: AND apad2_rev.prepay_history_id = apph.prepay_history_id
1496: AND apph.invoice_id = p_xla_event_rec.source_id_int_1)
1497: /* bug12858105 - end */

Line 1503: ap_prepay_history_all apph

1499: /* bug12858105 - start */
1500: AND APAD1.Reversed_Prepay_App_Dist_Id IS NULL
1501: AND NOT EXISTS (SELECT 1
1502: FROM ap_prepay_app_dists apad1_rev,
1503: ap_prepay_history_all apph
1504: WHERE apad1_rev.reversed_prepay_app_dist_id = APAD1.prepay_app_dist_id
1505: AND apad1_rev.prepay_history_id = apph.prepay_history_id
1506: AND apph.invoice_id = p_xla_event_rec.source_id_int_1)
1507: /* bug12858105 - end */

Line 1539: ap_prepay_history_all apph

1535: /* bug12858105 - start */
1536: AND APAD2.Reversed_Prepay_App_Dist_Id IS NULL
1537: AND NOT EXISTS (SELECT 1
1538: FROM ap_prepay_app_dists apad2_rev,
1539: ap_prepay_history_all apph
1540: WHERE apad2_rev.reversed_prepay_app_dist_id = APAD2.prepay_app_dist_id
1541: AND apad2_rev.prepay_history_id = apph.prepay_history_id
1542: AND apph.invoice_id = p_xla_event_rec.source_id_int_1)
1543: /* bug12858105 - end */

Line 1549: ap_prepay_history_all apph

1545: /* bug12858105 - start */
1546: AND APAD1.Reversed_Prepay_App_Dist_Id IS NULL
1547: AND NOT EXISTS (SELECT 1
1548: FROM ap_prepay_app_dists apad1_rev,
1549: ap_prepay_history_all apph
1550: WHERE apad1_rev.reversed_prepay_app_dist_id = APAD1.prepay_app_dist_id
1551: AND apad1_rev.prepay_history_id = apph.prepay_history_id
1552: AND apph.invoice_id = p_xla_event_rec.source_id_int_1)
1553: /* bug12858105 - end */

Line 1622: ap_prepay_history_all apph

1618: AND APAD2.Prepay_Dist_Lookup_Code IN ('TAX DIFF')
1619: AND APAD2.Reversed_Prepay_App_Dist_Id IS NULL
1620: AND NOT EXISTS (SELECT 1
1621: FROM ap_prepay_app_dists apad2_rev,
1622: ap_prepay_history_all apph
1623: WHERE apad2_rev.reversed_prepay_app_dist_id = APAD2.prepay_app_dist_id
1624: AND apad2_rev.prepay_history_id = apph.prepay_history_id
1625: AND apph.invoice_id = p_xla_event_rec.source_id_int_1)
1626: )

Line 1630: ap_prepay_history_all apph

1626: )
1627: AND APAD1.Reversed_Prepay_App_Dist_Id IS NULL
1628: AND NOT EXISTS (SELECT 1
1629: FROM ap_prepay_app_dists apad1_rev,
1630: ap_prepay_history_all apph
1631: WHERE apad1_rev.reversed_prepay_app_dist_id = APAD1.prepay_app_dist_id
1632: AND apad1_rev.prepay_history_id = apph.prepay_history_id
1633: AND apph.invoice_id = p_xla_event_rec.source_id_int_1)
1634: )

Line 1661: ap_prepay_history_all apph

1657: AND APAD2.Prepay_Dist_Lookup_Code IN ('TAX DIFF')
1658: AND APAD2.Reversed_Prepay_App_Dist_Id IS NULL
1659: AND NOT EXISTS (SELECT 1
1660: FROM ap_prepay_app_dists apad2_rev,
1661: ap_prepay_history_all apph
1662: WHERE apad2_rev.reversed_prepay_app_dist_id = APAD2.prepay_app_dist_id
1663: AND apad2_rev.prepay_history_id = apph.prepay_history_id
1664: AND apph.invoice_id = p_xla_event_rec.source_id_int_1)
1665: )

Line 1669: ap_prepay_history_all apph

1665: )
1666: AND APAD1.Reversed_Prepay_App_Dist_Id IS NULL
1667: AND NOT EXISTS (SELECT 1
1668: FROM ap_prepay_app_dists apad1_rev,
1669: ap_prepay_history_all apph
1670: WHERE apad1_rev.reversed_prepay_app_dist_id = APAD1.prepay_app_dist_id
1671: AND apad1_rev.prepay_history_id = apph.prepay_history_id
1672: AND apph.invoice_id = p_xla_event_rec.source_id_int_1)
1673: )

Line 2744: ap_prepay_history_all aph, --Bug 9112240

2740: FND_GLOBAL.Conc_Program_ID,
2741: SYSDATE,
2742: FND_GLOBAL.Conc_Request_ID
2743: FROM AP_Prepay_App_Dists APAD,
2744: ap_prepay_history_all aph, --Bug 9112240
2745: ap_prepay_history_all aphr,
2746: xla_events xer
2747: WHERE apad.Prepay_App_Distribution_ID = P_Prepay_Reversal_ID
2748: AND apad.prepay_history_id = aph.prepay_history_id --Bug 9112240

Line 2745: ap_prepay_history_all aphr,

2741: SYSDATE,
2742: FND_GLOBAL.Conc_Request_ID
2743: FROM AP_Prepay_App_Dists APAD,
2744: ap_prepay_history_all aph, --Bug 9112240
2745: ap_prepay_history_all aphr,
2746: xla_events xer
2747: WHERE apad.Prepay_App_Distribution_ID = P_Prepay_Reversal_ID
2748: AND apad.prepay_history_id = aph.prepay_history_id --Bug 9112240
2749: AND aphr.prepay_history_id = p_prepay_hist_rec.prepay_history_id

Line 2830: ap_prepay_history_all aph --Bug 9112240

2826: FND_GLOBAL.Conc_Program_ID,
2827: SYSDATE,
2828: FND_GLOBAL.Conc_Request_ID
2829: FROM AP_Prepay_App_Dists APAD,
2830: ap_prepay_history_all aph --Bug 9112240
2831: WHERE apad.prepay_history_id = aph.prepay_history_id --Bug 9112240
2832: AND APAD.Prepay_App_Distribution_ID = nvl(p_prepay_inv_dist_id,APAD.Prepay_App_Distribution_ID) --7686421
2833: AND APAD.Invoice_Distribution_Id = p_inv_reversal_id --bug9440073
2834: /*AND APAD.Accounting_Event_Id = p_prepay_hist_rec.related_prepay_app_event_id; --bug9440073 */

Line 3022: -- delete from AP_Prepay_history_all is placed after delete from AP_Prepay_App_Dists

3018:
3019: -- Bug fix 5634515
3020: -- rewrite the query to delete the correct prepay application dist record.
3021:
3022: -- delete from AP_Prepay_history_all is placed after delete from AP_Prepay_App_Dists
3023: -- due to bug 7264479
3024:
3025: -- Bug fix 5634515
3026: -- rewrite the query to delete the correct prepay history record.

Line 3041: FROM ap_prepay_history_all apph

3037: --
3038: DELETE FROM ap_prepay_app_dists apad1
3039: WHERE apad1.prepay_history_id IN
3040: (SELECT apph.prepay_history_id
3041: FROM ap_prepay_history_all apph
3042: WHERE nvl(apph.posted_flag, 'N') <> 'Y'
3043: AND apph.invoice_id = p_invoice_id
3044: AND apph.transaction_type <> 'PREPAYMENT APPLICATION ADJ' --bug9973070
3045: AND NOT EXISTS

Line 3053: DELETE FROM ap_prepay_history_all apph1

3049: WHERE apad.prepay_history_id = apph.prepay_history_id
3050: AND apad.prepay_app_distribution_id = aid.invoice_distribution_id
3051: AND (aid.posted_flag = 'Y' OR aid.encumbered_flag = 'Y')));
3052:
3053: DELETE FROM ap_prepay_history_all apph1
3054: WHERE apph1.prepay_history_id IN
3055: (SELECT apph.prepay_history_id
3056: FROM ap_prepay_history_all apph
3057: WHERE nvl(apph.posted_flag, 'N') <> 'Y'

Line 3056: FROM ap_prepay_history_all apph

3052:
3053: DELETE FROM ap_prepay_history_all apph1
3054: WHERE apph1.prepay_history_id IN
3055: (SELECT apph.prepay_history_id
3056: FROM ap_prepay_history_all apph
3057: WHERE nvl(apph.posted_flag, 'N') <> 'Y'
3058: AND apph.invoice_id = p_invoice_id
3059: AND apph.transaction_type <> 'PREPAYMENT APPLICATION ADJ' --bug9973070
3060: AND NOT EXISTS

Line 3134: ap_prepay_history_all aph

3130: WHERE application_id = 200
3131: AND ae_header_id IN
3132: (SELECT ae_header_id
3133: FROM xla_ae_headers aeh,
3134: ap_prepay_history_all aph
3135: WHERE aeh.event_id = aph.accounting_event_id
3136: AND aph.accounting_event_id = p_accounting_event_id
3137: AND aph.invoice_id = p_invoice_id
3138: AND aph.historical_flag = 'Y'