[Home] [Help]
31: -- payment history table based on the exchange rates of payment transactions.
32: --
33: --------------------------------------------------------------------------------
34: PROCEDURE Update_Gain_Loss_Ind
35: (P_XLA_Event_Rec IN ap_accounting_pay_pkg.r_xla_event_info
36: ,P_Pay_Hist_Rec IN ap_accounting_pay_pkg.r_pay_hist_info
37: ,P_Calling_Sequence IN VARCHAR2
38: ) IS
39:
32: --
33: --------------------------------------------------------------------------------
34: PROCEDURE Update_Gain_Loss_Ind
35: (P_XLA_Event_Rec IN ap_accounting_pay_pkg.r_xla_event_info
36: ,P_Pay_Hist_Rec IN ap_accounting_pay_pkg.r_pay_hist_info
37: ,P_Calling_Sequence IN VARCHAR2
38: ) IS
39:
40: l_curr_calling_sequence VARCHAR2(2000);
298: -- distributions of the invoice and generate the payment history distribution.
299: --
300: --------------------------------------------------------------------------------
301: PROCEDURE Primary_Pay_Events
302: (P_XLA_Event_Rec IN ap_accounting_pay_pkg.r_xla_event_info
303: ,P_Calling_Sequence IN VARCHAR2
304: ) IS
305:
306: l_curr_calling_sequence VARCHAR2(2000);
310: l_pay_history_id NUMBER;
311: l_mat_history_id NUMBER;
312:
313: l_inv_pay_rec r_inv_pay_info;
314: l_pay_hist_rec ap_accounting_pay_pkg.r_pay_hist_info;
315: l_inv_rec ap_accounting_pay_pkg.r_invoices_info;
316: l_inv_dist_rec ap_accounting_pay_pkg.r_inv_dist_info;
317:
318: -- Logging Infra:
311: l_mat_history_id NUMBER;
312:
313: l_inv_pay_rec r_inv_pay_info;
314: l_pay_hist_rec ap_accounting_pay_pkg.r_pay_hist_info;
315: l_inv_rec ap_accounting_pay_pkg.r_invoices_info;
316: l_inv_dist_rec ap_accounting_pay_pkg.r_inv_dist_info;
317:
318: -- Logging Infra:
319: l_procedure_name CONSTANT VARCHAR2(30) := 'Primary_Pay_Events';
312:
313: l_inv_pay_rec r_inv_pay_info;
314: l_pay_hist_rec ap_accounting_pay_pkg.r_pay_hist_info;
315: l_inv_rec ap_accounting_pay_pkg.r_invoices_info;
316: l_inv_dist_rec ap_accounting_pay_pkg.r_inv_dist_info;
317:
318: -- Logging Infra:
319: l_procedure_name CONSTANT VARCHAR2(30) := 'Primary_Pay_Events';
320: l_log_msg FND_LOG_MESSAGES.MESSAGE_TEXT%TYPE;
394: to calculate the base amounts for the prior events using the
395: exchange rate info from the payment hist table */
396:
397: -- Null out Global Variable 9849243 start
398: ap_accounting_pay_pkg.g_mat_to_base_xrate_type := NULL;
399: ap_accounting_pay_pkg.g_mat_to_base_xrate_date := NULL;
400: ap_accounting_pay_pkg.g_mat_to_base_xrate := NULL; -- 9849243 End
401:
402: --11698822, added l_txn_curr_code
395: exchange rate info from the payment hist table */
396:
397: -- Null out Global Variable 9849243 start
398: ap_accounting_pay_pkg.g_mat_to_base_xrate_type := NULL;
399: ap_accounting_pay_pkg.g_mat_to_base_xrate_date := NULL;
400: ap_accounting_pay_pkg.g_mat_to_base_xrate := NULL; -- 9849243 End
401:
402: --11698822, added l_txn_curr_code
403: IF (P_XLA_Event_Rec.Event_Type_Code IN ('PAYMENT MATURED')) THEN
396:
397: -- Null out Global Variable 9849243 start
398: ap_accounting_pay_pkg.g_mat_to_base_xrate_type := NULL;
399: ap_accounting_pay_pkg.g_mat_to_base_xrate_date := NULL;
400: ap_accounting_pay_pkg.g_mat_to_base_xrate := NULL; -- 9849243 End
401:
402: --11698822, added l_txn_curr_code
403: IF (P_XLA_Event_Rec.Event_Type_Code IN ('PAYMENT MATURED')) THEN
404:
412: APH.Pmt_To_Base_XRate_Type,
413: APH.Pmt_To_Base_XRate_Date,
414: APH.Pmt_To_Base_XRate
415: INTO l_pay_history_id,
416: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type,
417: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date,
418: ap_accounting_pay_pkg.g_pmt_to_base_xrate
419: FROM AP_Payment_History_All APH
420: WHERE APH.Payment_History_ID =
413: APH.Pmt_To_Base_XRate_Date,
414: APH.Pmt_To_Base_XRate
415: INTO l_pay_history_id,
416: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type,
417: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date,
418: ap_accounting_pay_pkg.g_pmt_to_base_xrate
419: FROM AP_Payment_History_All APH
420: WHERE APH.Payment_History_ID =
421: (SELECT MAX(APH1.Payment_History_ID)
414: APH.Pmt_To_Base_XRate
415: INTO l_pay_history_id,
416: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type,
417: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date,
418: ap_accounting_pay_pkg.g_pmt_to_base_xrate
419: FROM AP_Payment_History_All APH
420: WHERE APH.Payment_History_ID =
421: (SELECT MAX(APH1.Payment_History_ID)
422: FROM AP_Payment_History_All APH1
425:
426:
427: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
428: l_log_msg := 'Payment_History_ID for payment = '|| l_pay_history_id
429: || 'ap_accounting_pay_pkg.g_pmt_to_base_xrate_type'
430: || ap_accounting_pay_pkg.g_pmt_to_base_xrate_type
431: || 'ap_accounting_pay_pkg.g_pmt_to_base_xrate_date'
432: || ap_accounting_pay_pkg.g_pmt_to_base_xrate_date
433: || 'ap_accounting_pay_pkg.g_pmt_to_base_xrate'
426:
427: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
428: l_log_msg := 'Payment_History_ID for payment = '|| l_pay_history_id
429: || 'ap_accounting_pay_pkg.g_pmt_to_base_xrate_type'
430: || ap_accounting_pay_pkg.g_pmt_to_base_xrate_type
431: || 'ap_accounting_pay_pkg.g_pmt_to_base_xrate_date'
432: || ap_accounting_pay_pkg.g_pmt_to_base_xrate_date
433: || 'ap_accounting_pay_pkg.g_pmt_to_base_xrate'
434: || ap_accounting_pay_pkg.g_pmt_to_base_xrate;
427: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
428: l_log_msg := 'Payment_History_ID for payment = '|| l_pay_history_id
429: || 'ap_accounting_pay_pkg.g_pmt_to_base_xrate_type'
430: || ap_accounting_pay_pkg.g_pmt_to_base_xrate_type
431: || 'ap_accounting_pay_pkg.g_pmt_to_base_xrate_date'
432: || ap_accounting_pay_pkg.g_pmt_to_base_xrate_date
433: || 'ap_accounting_pay_pkg.g_pmt_to_base_xrate'
434: || ap_accounting_pay_pkg.g_pmt_to_base_xrate;
435:
428: l_log_msg := 'Payment_History_ID for payment = '|| l_pay_history_id
429: || 'ap_accounting_pay_pkg.g_pmt_to_base_xrate_type'
430: || ap_accounting_pay_pkg.g_pmt_to_base_xrate_type
431: || 'ap_accounting_pay_pkg.g_pmt_to_base_xrate_date'
432: || ap_accounting_pay_pkg.g_pmt_to_base_xrate_date
433: || 'ap_accounting_pay_pkg.g_pmt_to_base_xrate'
434: || ap_accounting_pay_pkg.g_pmt_to_base_xrate;
435:
436: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME || l_procedure_name, l_log_msg);
429: || 'ap_accounting_pay_pkg.g_pmt_to_base_xrate_type'
430: || ap_accounting_pay_pkg.g_pmt_to_base_xrate_type
431: || 'ap_accounting_pay_pkg.g_pmt_to_base_xrate_date'
432: || ap_accounting_pay_pkg.g_pmt_to_base_xrate_date
433: || 'ap_accounting_pay_pkg.g_pmt_to_base_xrate'
434: || ap_accounting_pay_pkg.g_pmt_to_base_xrate;
435:
436: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME || l_procedure_name, l_log_msg);
437: END IF;
430: || ap_accounting_pay_pkg.g_pmt_to_base_xrate_type
431: || 'ap_accounting_pay_pkg.g_pmt_to_base_xrate_date'
432: || ap_accounting_pay_pkg.g_pmt_to_base_xrate_date
433: || 'ap_accounting_pay_pkg.g_pmt_to_base_xrate'
434: || ap_accounting_pay_pkg.g_pmt_to_base_xrate;
435:
436: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME || l_procedure_name, l_log_msg);
437: END IF;
438:
435:
436: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME || l_procedure_name, l_log_msg);
437: END IF;
438:
439: ap_accounting_pay_pkg.g_pay_pmt_history_id := l_pay_history_id;
440:
441: ap_accounting_pay_pkg.g_mat_pmt_history_id := l_pay_hist_rec.payment_history_id;
442: ap_accounting_pay_pkg.g_mat_to_base_xrate_type :=
443: l_pay_hist_rec.pmt_to_base_xrate_type;
437: END IF;
438:
439: ap_accounting_pay_pkg.g_pay_pmt_history_id := l_pay_history_id;
440:
441: ap_accounting_pay_pkg.g_mat_pmt_history_id := l_pay_hist_rec.payment_history_id;
442: ap_accounting_pay_pkg.g_mat_to_base_xrate_type :=
443: l_pay_hist_rec.pmt_to_base_xrate_type;
444: ap_accounting_pay_pkg.g_mat_to_base_xrate_date :=
445: l_pay_hist_rec.pmt_to_base_xrate_date;
438:
439: ap_accounting_pay_pkg.g_pay_pmt_history_id := l_pay_history_id;
440:
441: ap_accounting_pay_pkg.g_mat_pmt_history_id := l_pay_hist_rec.payment_history_id;
442: ap_accounting_pay_pkg.g_mat_to_base_xrate_type :=
443: l_pay_hist_rec.pmt_to_base_xrate_type;
444: ap_accounting_pay_pkg.g_mat_to_base_xrate_date :=
445: l_pay_hist_rec.pmt_to_base_xrate_date;
446: ap_accounting_pay_pkg.g_mat_to_base_xrate := l_pay_hist_rec.pmt_to_base_xrate;
440:
441: ap_accounting_pay_pkg.g_mat_pmt_history_id := l_pay_hist_rec.payment_history_id;
442: ap_accounting_pay_pkg.g_mat_to_base_xrate_type :=
443: l_pay_hist_rec.pmt_to_base_xrate_type;
444: ap_accounting_pay_pkg.g_mat_to_base_xrate_date :=
445: l_pay_hist_rec.pmt_to_base_xrate_date;
446: ap_accounting_pay_pkg.g_mat_to_base_xrate := l_pay_hist_rec.pmt_to_base_xrate;
447: l_txn_curr_code := l_pay_hist_rec.pmt_currency_code;
448:
442: ap_accounting_pay_pkg.g_mat_to_base_xrate_type :=
443: l_pay_hist_rec.pmt_to_base_xrate_type;
444: ap_accounting_pay_pkg.g_mat_to_base_xrate_date :=
445: l_pay_hist_rec.pmt_to_base_xrate_date;
446: ap_accounting_pay_pkg.g_mat_to_base_xrate := l_pay_hist_rec.pmt_to_base_xrate;
447: l_txn_curr_code := l_pay_hist_rec.pmt_currency_code;
448:
449: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
450: l_log_msg := 'After assign maturity related global variables and ' ||
447: l_txn_curr_code := l_pay_hist_rec.pmt_currency_code;
448:
449: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
450: l_log_msg := 'After assign maturity related global variables and ' ||
451: 'ap_accounting_pay_pkg.g_pay_pmt_history_id '||
452: ap_accounting_pay_pkg.g_pay_pmt_history_id ||
453: 'ap_accounting_pay_pkg.g_mat_to_base_xrate_type' ||
454: ap_accounting_pay_pkg.g_mat_to_base_xrate_type ||
455: 'ap_accounting_pay_pkg.g_mat_to_base_xrate_date' ||
448:
449: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
450: l_log_msg := 'After assign maturity related global variables and ' ||
451: 'ap_accounting_pay_pkg.g_pay_pmt_history_id '||
452: ap_accounting_pay_pkg.g_pay_pmt_history_id ||
453: 'ap_accounting_pay_pkg.g_mat_to_base_xrate_type' ||
454: ap_accounting_pay_pkg.g_mat_to_base_xrate_type ||
455: 'ap_accounting_pay_pkg.g_mat_to_base_xrate_date' ||
456: ap_accounting_pay_pkg.g_mat_to_base_xrate_date ||
449: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
450: l_log_msg := 'After assign maturity related global variables and ' ||
451: 'ap_accounting_pay_pkg.g_pay_pmt_history_id '||
452: ap_accounting_pay_pkg.g_pay_pmt_history_id ||
453: 'ap_accounting_pay_pkg.g_mat_to_base_xrate_type' ||
454: ap_accounting_pay_pkg.g_mat_to_base_xrate_type ||
455: 'ap_accounting_pay_pkg.g_mat_to_base_xrate_date' ||
456: ap_accounting_pay_pkg.g_mat_to_base_xrate_date ||
457: 'ap_accounting_pay_pkg.g_mat_to_base_xrate' ||
450: l_log_msg := 'After assign maturity related global variables and ' ||
451: 'ap_accounting_pay_pkg.g_pay_pmt_history_id '||
452: ap_accounting_pay_pkg.g_pay_pmt_history_id ||
453: 'ap_accounting_pay_pkg.g_mat_to_base_xrate_type' ||
454: ap_accounting_pay_pkg.g_mat_to_base_xrate_type ||
455: 'ap_accounting_pay_pkg.g_mat_to_base_xrate_date' ||
456: ap_accounting_pay_pkg.g_mat_to_base_xrate_date ||
457: 'ap_accounting_pay_pkg.g_mat_to_base_xrate' ||
458: ap_accounting_pay_pkg.g_mat_to_base_xrate;
451: 'ap_accounting_pay_pkg.g_pay_pmt_history_id '||
452: ap_accounting_pay_pkg.g_pay_pmt_history_id ||
453: 'ap_accounting_pay_pkg.g_mat_to_base_xrate_type' ||
454: ap_accounting_pay_pkg.g_mat_to_base_xrate_type ||
455: 'ap_accounting_pay_pkg.g_mat_to_base_xrate_date' ||
456: ap_accounting_pay_pkg.g_mat_to_base_xrate_date ||
457: 'ap_accounting_pay_pkg.g_mat_to_base_xrate' ||
458: ap_accounting_pay_pkg.g_mat_to_base_xrate;
459:
452: ap_accounting_pay_pkg.g_pay_pmt_history_id ||
453: 'ap_accounting_pay_pkg.g_mat_to_base_xrate_type' ||
454: ap_accounting_pay_pkg.g_mat_to_base_xrate_type ||
455: 'ap_accounting_pay_pkg.g_mat_to_base_xrate_date' ||
456: ap_accounting_pay_pkg.g_mat_to_base_xrate_date ||
457: 'ap_accounting_pay_pkg.g_mat_to_base_xrate' ||
458: ap_accounting_pay_pkg.g_mat_to_base_xrate;
459:
460: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME || l_procedure_name, l_log_msg);
453: 'ap_accounting_pay_pkg.g_mat_to_base_xrate_type' ||
454: ap_accounting_pay_pkg.g_mat_to_base_xrate_type ||
455: 'ap_accounting_pay_pkg.g_mat_to_base_xrate_date' ||
456: ap_accounting_pay_pkg.g_mat_to_base_xrate_date ||
457: 'ap_accounting_pay_pkg.g_mat_to_base_xrate' ||
458: ap_accounting_pay_pkg.g_mat_to_base_xrate;
459:
460: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME || l_procedure_name, l_log_msg);
461: END IF;
454: ap_accounting_pay_pkg.g_mat_to_base_xrate_type ||
455: 'ap_accounting_pay_pkg.g_mat_to_base_xrate_date' ||
456: ap_accounting_pay_pkg.g_mat_to_base_xrate_date ||
457: 'ap_accounting_pay_pkg.g_mat_to_base_xrate' ||
458: ap_accounting_pay_pkg.g_mat_to_base_xrate;
459:
460: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME || l_procedure_name, l_log_msg);
461: END IF;
462:
472: APH.Pmt_To_Base_XRate_Type,
473: APH.Pmt_To_Base_XRate_Date,
474: APH.Pmt_To_Base_XRate
475: INTO l_pay_history_id,
476: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type,
477: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date,
478: ap_accounting_pay_pkg.g_pmt_to_base_xrate
479: FROM AP_Payment_History_All APH
480: WHERE APH.Payment_History_ID =
473: APH.Pmt_To_Base_XRate_Date,
474: APH.Pmt_To_Base_XRate
475: INTO l_pay_history_id,
476: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type,
477: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date,
478: ap_accounting_pay_pkg.g_pmt_to_base_xrate
479: FROM AP_Payment_History_All APH
480: WHERE APH.Payment_History_ID =
481: (SELECT MAX(APH1.Payment_History_ID)
474: APH.Pmt_To_Base_XRate
475: INTO l_pay_history_id,
476: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type,
477: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date,
478: ap_accounting_pay_pkg.g_pmt_to_base_xrate
479: FROM AP_Payment_History_All APH
480: WHERE APH.Payment_History_ID =
481: (SELECT MAX(APH1.Payment_History_ID)
482: FROM AP_Payment_History_All APH1
502:
503: SELECT APH.Pmt_To_Base_XRate_Type,
504: APH.Pmt_To_Base_XRate_Date,
505: APH.Pmt_To_Base_XRate
506: INTO ap_accounting_pay_pkg.g_mat_to_base_xrate_type,
507: ap_accounting_pay_pkg.g_mat_to_base_xrate_date,
508: ap_accounting_pay_pkg.g_mat_to_base_xrate
509: FROM AP_Payment_History_All APH
510: WHERE APH.Payment_History_ID = l_mat_history_id;
503: SELECT APH.Pmt_To_Base_XRate_Type,
504: APH.Pmt_To_Base_XRate_Date,
505: APH.Pmt_To_Base_XRate
506: INTO ap_accounting_pay_pkg.g_mat_to_base_xrate_type,
507: ap_accounting_pay_pkg.g_mat_to_base_xrate_date,
508: ap_accounting_pay_pkg.g_mat_to_base_xrate
509: FROM AP_Payment_History_All APH
510: WHERE APH.Payment_History_ID = l_mat_history_id;
511:
504: APH.Pmt_To_Base_XRate_Date,
505: APH.Pmt_To_Base_XRate
506: INTO ap_accounting_pay_pkg.g_mat_to_base_xrate_type,
507: ap_accounting_pay_pkg.g_mat_to_base_xrate_date,
508: ap_accounting_pay_pkg.g_mat_to_base_xrate
509: FROM AP_Payment_History_All APH
510: WHERE APH.Payment_History_ID = l_mat_history_id;
511:
512: END IF;
511:
512: END IF;
513:
514:
515: ap_accounting_pay_pkg.g_pay_pmt_history_id := l_pay_history_id;
516: ap_accounting_pay_pkg.g_mat_pmt_history_id := l_mat_history_id;
517:
518: ap_accounting_pay_pkg.g_clr_pmt_history_id := l_pay_hist_rec.payment_history_id;
519: ap_accounting_pay_pkg.g_clr_to_base_xrate_type :=
512: END IF;
513:
514:
515: ap_accounting_pay_pkg.g_pay_pmt_history_id := l_pay_history_id;
516: ap_accounting_pay_pkg.g_mat_pmt_history_id := l_mat_history_id;
517:
518: ap_accounting_pay_pkg.g_clr_pmt_history_id := l_pay_hist_rec.payment_history_id;
519: ap_accounting_pay_pkg.g_clr_to_base_xrate_type :=
520: l_pay_hist_rec.pmt_to_base_xrate_type;
514:
515: ap_accounting_pay_pkg.g_pay_pmt_history_id := l_pay_history_id;
516: ap_accounting_pay_pkg.g_mat_pmt_history_id := l_mat_history_id;
517:
518: ap_accounting_pay_pkg.g_clr_pmt_history_id := l_pay_hist_rec.payment_history_id;
519: ap_accounting_pay_pkg.g_clr_to_base_xrate_type :=
520: l_pay_hist_rec.pmt_to_base_xrate_type;
521: ap_accounting_pay_pkg.g_clr_to_base_xrate_date :=
522: l_pay_hist_rec.pmt_to_base_xrate_date;
515: ap_accounting_pay_pkg.g_pay_pmt_history_id := l_pay_history_id;
516: ap_accounting_pay_pkg.g_mat_pmt_history_id := l_mat_history_id;
517:
518: ap_accounting_pay_pkg.g_clr_pmt_history_id := l_pay_hist_rec.payment_history_id;
519: ap_accounting_pay_pkg.g_clr_to_base_xrate_type :=
520: l_pay_hist_rec.pmt_to_base_xrate_type;
521: ap_accounting_pay_pkg.g_clr_to_base_xrate_date :=
522: l_pay_hist_rec.pmt_to_base_xrate_date;
523: ap_accounting_pay_pkg.g_clr_to_base_xrate := l_pay_hist_rec.pmt_to_base_xrate;
517:
518: ap_accounting_pay_pkg.g_clr_pmt_history_id := l_pay_hist_rec.payment_history_id;
519: ap_accounting_pay_pkg.g_clr_to_base_xrate_type :=
520: l_pay_hist_rec.pmt_to_base_xrate_type;
521: ap_accounting_pay_pkg.g_clr_to_base_xrate_date :=
522: l_pay_hist_rec.pmt_to_base_xrate_date;
523: ap_accounting_pay_pkg.g_clr_to_base_xrate := l_pay_hist_rec.pmt_to_base_xrate;
524: --l_txn_curr_code := l_pay_hist_rec.bank_currency_code;
525: IF ( l_pay_hist_rec.pmt_currency_code <> l_pay_hist_rec.bank_currency_code
519: ap_accounting_pay_pkg.g_clr_to_base_xrate_type :=
520: l_pay_hist_rec.pmt_to_base_xrate_type;
521: ap_accounting_pay_pkg.g_clr_to_base_xrate_date :=
522: l_pay_hist_rec.pmt_to_base_xrate_date;
523: ap_accounting_pay_pkg.g_clr_to_base_xrate := l_pay_hist_rec.pmt_to_base_xrate;
524: --l_txn_curr_code := l_pay_hist_rec.bank_currency_code;
525: IF ( l_pay_hist_rec.pmt_currency_code <> l_pay_hist_rec.bank_currency_code
526: AND l_pay_hist_rec.bank_currency_code is not NULL ) THEN -- 12328487
527: l_txn_curr_code := l_pay_hist_rec.pmt_currency_code;
529: END IF; --l_pay_hist_rec.pmt_currency_code <> l_pay_hist_rec.bank_currency_code
530:
531: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
532: l_log_msg := 'after set clearing global varaiables, they are'||
533: 'ap_accounting_pay_pkg.g_pay_pmt_history_id=' ||
534: ap_accounting_pay_pkg.g_pay_pmt_history_id ||
535: 'ap_accounting_pay_pkg.g_mat_pmt_history_id =' ||
536: ap_accounting_pay_pkg.g_mat_pmt_history_id ||
537: ' ap_accounting_pay_pkg.g_clr_pmt_history_id =' ||
530:
531: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
532: l_log_msg := 'after set clearing global varaiables, they are'||
533: 'ap_accounting_pay_pkg.g_pay_pmt_history_id=' ||
534: ap_accounting_pay_pkg.g_pay_pmt_history_id ||
535: 'ap_accounting_pay_pkg.g_mat_pmt_history_id =' ||
536: ap_accounting_pay_pkg.g_mat_pmt_history_id ||
537: ' ap_accounting_pay_pkg.g_clr_pmt_history_id =' ||
538: ap_accounting_pay_pkg.g_clr_pmt_history_id ||
531: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
532: l_log_msg := 'after set clearing global varaiables, they are'||
533: 'ap_accounting_pay_pkg.g_pay_pmt_history_id=' ||
534: ap_accounting_pay_pkg.g_pay_pmt_history_id ||
535: 'ap_accounting_pay_pkg.g_mat_pmt_history_id =' ||
536: ap_accounting_pay_pkg.g_mat_pmt_history_id ||
537: ' ap_accounting_pay_pkg.g_clr_pmt_history_id =' ||
538: ap_accounting_pay_pkg.g_clr_pmt_history_id ||
539: 'ap_accounting_pay_pkg.g_clr_to_base_xrate_type=' ||
532: l_log_msg := 'after set clearing global varaiables, they are'||
533: 'ap_accounting_pay_pkg.g_pay_pmt_history_id=' ||
534: ap_accounting_pay_pkg.g_pay_pmt_history_id ||
535: 'ap_accounting_pay_pkg.g_mat_pmt_history_id =' ||
536: ap_accounting_pay_pkg.g_mat_pmt_history_id ||
537: ' ap_accounting_pay_pkg.g_clr_pmt_history_id =' ||
538: ap_accounting_pay_pkg.g_clr_pmt_history_id ||
539: 'ap_accounting_pay_pkg.g_clr_to_base_xrate_type=' ||
540: ap_accounting_pay_pkg.g_clr_to_base_xrate_type ||
533: 'ap_accounting_pay_pkg.g_pay_pmt_history_id=' ||
534: ap_accounting_pay_pkg.g_pay_pmt_history_id ||
535: 'ap_accounting_pay_pkg.g_mat_pmt_history_id =' ||
536: ap_accounting_pay_pkg.g_mat_pmt_history_id ||
537: ' ap_accounting_pay_pkg.g_clr_pmt_history_id =' ||
538: ap_accounting_pay_pkg.g_clr_pmt_history_id ||
539: 'ap_accounting_pay_pkg.g_clr_to_base_xrate_type=' ||
540: ap_accounting_pay_pkg.g_clr_to_base_xrate_type ||
541: 'ap_accounting_pay_pkg.g_clr_to_base_xrate_date=' ||
534: ap_accounting_pay_pkg.g_pay_pmt_history_id ||
535: 'ap_accounting_pay_pkg.g_mat_pmt_history_id =' ||
536: ap_accounting_pay_pkg.g_mat_pmt_history_id ||
537: ' ap_accounting_pay_pkg.g_clr_pmt_history_id =' ||
538: ap_accounting_pay_pkg.g_clr_pmt_history_id ||
539: 'ap_accounting_pay_pkg.g_clr_to_base_xrate_type=' ||
540: ap_accounting_pay_pkg.g_clr_to_base_xrate_type ||
541: 'ap_accounting_pay_pkg.g_clr_to_base_xrate_date=' ||
542: ap_accounting_pay_pkg.g_clr_to_base_xrate_date ||
535: 'ap_accounting_pay_pkg.g_mat_pmt_history_id =' ||
536: ap_accounting_pay_pkg.g_mat_pmt_history_id ||
537: ' ap_accounting_pay_pkg.g_clr_pmt_history_id =' ||
538: ap_accounting_pay_pkg.g_clr_pmt_history_id ||
539: 'ap_accounting_pay_pkg.g_clr_to_base_xrate_type=' ||
540: ap_accounting_pay_pkg.g_clr_to_base_xrate_type ||
541: 'ap_accounting_pay_pkg.g_clr_to_base_xrate_date=' ||
542: ap_accounting_pay_pkg.g_clr_to_base_xrate_date ||
543: 'ap_accounting_pay_pkg.g_clr_to_base_xrate=' ||
536: ap_accounting_pay_pkg.g_mat_pmt_history_id ||
537: ' ap_accounting_pay_pkg.g_clr_pmt_history_id =' ||
538: ap_accounting_pay_pkg.g_clr_pmt_history_id ||
539: 'ap_accounting_pay_pkg.g_clr_to_base_xrate_type=' ||
540: ap_accounting_pay_pkg.g_clr_to_base_xrate_type ||
541: 'ap_accounting_pay_pkg.g_clr_to_base_xrate_date=' ||
542: ap_accounting_pay_pkg.g_clr_to_base_xrate_date ||
543: 'ap_accounting_pay_pkg.g_clr_to_base_xrate=' ||
544: ap_accounting_pay_pkg.g_clr_to_base_xrate;
537: ' ap_accounting_pay_pkg.g_clr_pmt_history_id =' ||
538: ap_accounting_pay_pkg.g_clr_pmt_history_id ||
539: 'ap_accounting_pay_pkg.g_clr_to_base_xrate_type=' ||
540: ap_accounting_pay_pkg.g_clr_to_base_xrate_type ||
541: 'ap_accounting_pay_pkg.g_clr_to_base_xrate_date=' ||
542: ap_accounting_pay_pkg.g_clr_to_base_xrate_date ||
543: 'ap_accounting_pay_pkg.g_clr_to_base_xrate=' ||
544: ap_accounting_pay_pkg.g_clr_to_base_xrate;
545:
538: ap_accounting_pay_pkg.g_clr_pmt_history_id ||
539: 'ap_accounting_pay_pkg.g_clr_to_base_xrate_type=' ||
540: ap_accounting_pay_pkg.g_clr_to_base_xrate_type ||
541: 'ap_accounting_pay_pkg.g_clr_to_base_xrate_date=' ||
542: ap_accounting_pay_pkg.g_clr_to_base_xrate_date ||
543: 'ap_accounting_pay_pkg.g_clr_to_base_xrate=' ||
544: ap_accounting_pay_pkg.g_clr_to_base_xrate;
545:
546: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME || l_procedure_name, l_log_msg);
539: 'ap_accounting_pay_pkg.g_clr_to_base_xrate_type=' ||
540: ap_accounting_pay_pkg.g_clr_to_base_xrate_type ||
541: 'ap_accounting_pay_pkg.g_clr_to_base_xrate_date=' ||
542: ap_accounting_pay_pkg.g_clr_to_base_xrate_date ||
543: 'ap_accounting_pay_pkg.g_clr_to_base_xrate=' ||
544: ap_accounting_pay_pkg.g_clr_to_base_xrate;
545:
546: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME || l_procedure_name, l_log_msg);
547: END IF;
540: ap_accounting_pay_pkg.g_clr_to_base_xrate_type ||
541: 'ap_accounting_pay_pkg.g_clr_to_base_xrate_date=' ||
542: ap_accounting_pay_pkg.g_clr_to_base_xrate_date ||
543: 'ap_accounting_pay_pkg.g_clr_to_base_xrate=' ||
544: ap_accounting_pay_pkg.g_clr_to_base_xrate;
545:
546: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME || l_procedure_name, l_log_msg);
547: END IF;
548:
553: P_XLA_Event_Rec.Event_Type_Code;
554: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME || l_procedure_name, l_log_msg);
555: END IF;
556:
557: ap_accounting_pay_pkg.g_pay_pmt_history_id := l_pay_hist_rec.payment_history_id;
558: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type :=
559: l_pay_hist_rec.pmt_to_base_xrate_type;
560: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date :=
561: l_pay_hist_rec.pmt_to_base_xrate_date;
554: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME || l_procedure_name, l_log_msg);
555: END IF;
556:
557: ap_accounting_pay_pkg.g_pay_pmt_history_id := l_pay_hist_rec.payment_history_id;
558: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type :=
559: l_pay_hist_rec.pmt_to_base_xrate_type;
560: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date :=
561: l_pay_hist_rec.pmt_to_base_xrate_date;
562: ap_accounting_pay_pkg.g_pmt_to_base_xrate := l_pay_hist_rec.pmt_to_base_xrate;
556:
557: ap_accounting_pay_pkg.g_pay_pmt_history_id := l_pay_hist_rec.payment_history_id;
558: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type :=
559: l_pay_hist_rec.pmt_to_base_xrate_type;
560: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date :=
561: l_pay_hist_rec.pmt_to_base_xrate_date;
562: ap_accounting_pay_pkg.g_pmt_to_base_xrate := l_pay_hist_rec.pmt_to_base_xrate;
563: l_txn_curr_code := l_pay_hist_rec.pmt_currency_code;
564:
558: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type :=
559: l_pay_hist_rec.pmt_to_base_xrate_type;
560: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date :=
561: l_pay_hist_rec.pmt_to_base_xrate_date;
562: ap_accounting_pay_pkg.g_pmt_to_base_xrate := l_pay_hist_rec.pmt_to_base_xrate;
563: l_txn_curr_code := l_pay_hist_rec.pmt_currency_code;
564:
565: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
566: l_log_msg := 'Payment_History_ID for payment = '||
723: /* Check if the invoice is fully paid */
724: -- bug 9850638, removed change for bug 8987496, l_inv_pay_rec.amount <> 0
725: -- 9011207 Added l_count_bank_curr to the condition
726: -- bug 9108925, added the call to Is_Final_Event
727: IF AP_Accounting_Pay_Pkg.Is_Final_Payment
728: (l_inv_rec,
729: l_inv_pay_rec.amount,
730: l_inv_pay_rec.discount_taken,
731: 0, -- prepay amount
735: l_log_msg := 'Final payment of Invoice_ID '||l_inv_rec.invoice_id;
736: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME || l_procedure_name, l_log_msg);
737: END IF;
738:
739: l_final_payment := AP_ACCOUNTING_PAY_PKG.Is_Final_Event
740: (l_inv_rec,
741: p_xla_event_rec,
742: NULL,
743: l_curr_calling_sequence);
1122: FND_LOG.STRING(G_LEVEL_PROCEDURE, G_MODULE_NAME||l_procedure_name, l_log_msg);
1123: END IF;
1124:
1125: --11698822, call update_gain_loss_ind only for foreign currency txns
1126: IF l_txn_curr_code <> ap_accounting_pay_pkg.g_base_currency_code THEN
1127: Update_Gain_Loss_Ind
1128: (p_xla_event_rec,
1129: l_pay_hist_rec,
1130: l_curr_calling_sequence);
1163: -- generate the payment history distribution.
1164: --
1165: --------------------------------------------------------------------------------
1166: PROCEDURE Manual_Pay_Adj_Events
1167: (P_XLA_Event_Rec IN ap_accounting_pay_pkg.r_xla_event_info
1168: ,P_Calling_Sequence IN VARCHAR2
1169: ) IS
1170:
1171: l_curr_calling_sequence VARCHAR2(2000);
1172: l_total_paid_amt NUMBER;
1173: l_final_payment BOOLEAN := FALSE;
1174:
1175: l_inv_pay_rec r_inv_pay_info;
1176: l_pay_hist_rec ap_accounting_pay_pkg.r_pay_hist_info;
1177: l_inv_rec ap_accounting_pay_pkg.r_invoices_info;
1178: l_inv_dist_rec ap_accounting_pay_pkg.r_inv_dist_info;
1179: --Bug 8524600
1180: l_curr_pay_awt_tot NUMBER :=0;
1173: l_final_payment BOOLEAN := FALSE;
1174:
1175: l_inv_pay_rec r_inv_pay_info;
1176: l_pay_hist_rec ap_accounting_pay_pkg.r_pay_hist_info;
1177: l_inv_rec ap_accounting_pay_pkg.r_invoices_info;
1178: l_inv_dist_rec ap_accounting_pay_pkg.r_inv_dist_info;
1179: --Bug 8524600
1180: l_curr_pay_awt_tot NUMBER :=0;
1181: l_inv_time_awt NUMBER :=0;
1174:
1175: l_inv_pay_rec r_inv_pay_info;
1176: l_pay_hist_rec ap_accounting_pay_pkg.r_pay_hist_info;
1177: l_inv_rec ap_accounting_pay_pkg.r_invoices_info;
1178: l_inv_dist_rec ap_accounting_pay_pkg.r_inv_dist_info;
1179: --Bug 8524600
1180: l_curr_pay_awt_tot NUMBER :=0;
1181: l_inv_time_awt NUMBER :=0;
1182: l_inv_time_dist_total NUMBER :=0;
1284: /* Check if the invoice is fully paid */
1285: -- bug 9108925, added the call to Is_Final_Event
1286: IF l_inv_pay_rec.amount <> 0 THEN --bug 8987496
1287:
1288: IF AP_Accounting_Pay_Pkg.Is_Final_Payment
1289: (l_inv_rec,
1290: l_inv_pay_rec.amount,
1291: l_inv_pay_rec.discount_taken,
1292: 0, -- prepay amount
1296: l_log_msg := 'Final payment of Invoice_ID '||l_inv_rec.invoice_id;
1297: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME || l_procedure_name, l_log_msg);
1298: END IF;
1299:
1300: l_final_payment := AP_ACCOUNTING_PAY_PKG.Is_Final_Event
1301: (l_inv_rec,
1302: p_xla_event_rec,
1303: NULL,
1304: l_curr_calling_sequence);
1502: FND_LOG.STRING(G_LEVEL_PROCEDURE, G_MODULE_NAME||l_procedure_name, l_log_msg);
1503: END IF;
1504:
1505: --11698822, call update_gain_loss_ind only for foreign currency txns
1506: IF l_pay_hist_rec.pmt_currency_code <> ap_accounting_pay_pkg.g_base_currency_code THEN
1507: Update_Gain_Loss_Ind
1508: (p_xla_event_rec,
1509: l_pay_hist_rec,
1510: l_curr_calling_sequence);
1545: -- unmatured and insert into the payment hist distribution table.
1546: --
1547: --------------------------------------------------------------------------------
1548: PROCEDURE Cancel_Primary_Pay_Events
1549: (P_XLA_Event_Rec IN ap_accounting_pay_pkg.r_xla_event_info
1550: ,P_Calling_Sequence IN VARCHAR2
1551: ) IS
1552:
1553: l_curr_calling_sequence VARCHAR2(2000);
1551: ) IS
1552:
1553: l_curr_calling_sequence VARCHAR2(2000);
1554:
1555: l_pay_hist_rec ap_accounting_pay_pkg.r_pay_hist_info;
1556:
1557: -- Logging Infra:
1558: l_procedure_name CONSTANT VARCHAR2(30) := 'Cancel_Primary_Pay_Events';
1559: l_log_msg FND_LOG_MESSAGES.MESSAGE_TEXT%TYPE;
1608: FND_LOG.STRING(G_LEVEL_PROCEDURE, G_MODULE_NAME||l_procedure_name, l_log_msg);
1609: END IF;
1610:
1611: -- If Validation is added for 11721100
1612: IF l_pay_hist_rec.pmt_currency_code <> ap_accounting_pay_pkg.g_base_currency_code THEN
1613:
1614: IF (G_LEVEL_PROCEDURE >= G_CURRENT_RUNTIME_LEVEL ) THEN
1615: l_log_msg := 'Calling procedure Update_Gain_Loss_Ind for payments';
1616: FND_LOG.STRING(G_LEVEL_PROCEDURE, G_MODULE_NAME||l_procedure_name, l_log_msg);
1647: -- payment history distribution.
1648: --
1649: --------------------------------------------------------------------------------
1650: PROCEDURE Pay_Dist_Cascade_Adj_Events
1651: (P_XLA_Event_Rec IN ap_accounting_pay_pkg.r_xla_event_info
1652: ,P_Calling_Sequence IN VARCHAR2
1653: ) IS
1654:
1655: l_curr_calling_sequence VARCHAR2(2000);
1663: l_pay_history_id NUMBER;
1664: l_mat_history_id NUMBER;
1665:
1666: l_inv_pay_rec r_inv_pay_info;
1667: l_pay_hist_rec ap_accounting_pay_pkg.r_pay_hist_info;
1668: l_inv_rec ap_accounting_pay_pkg.r_invoices_info;
1669: l_inv_dist_rec ap_accounting_pay_pkg.r_inv_dist_info;
1670: --Bug 8524600
1671: l_curr_pay_awt_tot NUMBER :=0;
1664: l_mat_history_id NUMBER;
1665:
1666: l_inv_pay_rec r_inv_pay_info;
1667: l_pay_hist_rec ap_accounting_pay_pkg.r_pay_hist_info;
1668: l_inv_rec ap_accounting_pay_pkg.r_invoices_info;
1669: l_inv_dist_rec ap_accounting_pay_pkg.r_inv_dist_info;
1670: --Bug 8524600
1671: l_curr_pay_awt_tot NUMBER :=0;
1672: l_inv_time_awt NUMBER :=0;
1665:
1666: l_inv_pay_rec r_inv_pay_info;
1667: l_pay_hist_rec ap_accounting_pay_pkg.r_pay_hist_info;
1668: l_inv_rec ap_accounting_pay_pkg.r_invoices_info;
1669: l_inv_dist_rec ap_accounting_pay_pkg.r_inv_dist_info;
1670: --Bug 8524600
1671: l_curr_pay_awt_tot NUMBER :=0;
1672: l_inv_time_awt NUMBER :=0;
1673: l_inv_time_dist_total NUMBER :=0;
1787:
1788: SELECT APH.Pmt_To_Base_XRate_Type,
1789: APH.Pmt_To_Base_XRate_Date,
1790: APH.Pmt_To_Base_XRate
1791: INTO ap_accounting_pay_pkg.g_pmt_to_base_xrate_type,
1792: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date,
1793: ap_accounting_pay_pkg.g_pmt_to_base_xrate
1794: FROM AP_Payment_History_All APH
1795: WHERE APH.Payment_History_ID = l_pay_history_id;
1788: SELECT APH.Pmt_To_Base_XRate_Type,
1789: APH.Pmt_To_Base_XRate_Date,
1790: APH.Pmt_To_Base_XRate
1791: INTO ap_accounting_pay_pkg.g_pmt_to_base_xrate_type,
1792: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date,
1793: ap_accounting_pay_pkg.g_pmt_to_base_xrate
1794: FROM AP_Payment_History_All APH
1795: WHERE APH.Payment_History_ID = l_pay_history_id;
1796:
1789: APH.Pmt_To_Base_XRate_Date,
1790: APH.Pmt_To_Base_XRate
1791: INTO ap_accounting_pay_pkg.g_pmt_to_base_xrate_type,
1792: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date,
1793: ap_accounting_pay_pkg.g_pmt_to_base_xrate
1794: FROM AP_Payment_History_All APH
1795: WHERE APH.Payment_History_ID = l_pay_history_id;
1796:
1797: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
1799: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME || l_procedure_name, l_log_msg);
1800: END IF;
1801:
1802:
1803: ap_accounting_pay_pkg.g_pay_pmt_history_id := l_pay_history_id;
1804:
1805: ap_accounting_pay_pkg.g_mat_pmt_history_id := l_pay_hist_rec.payment_history_id;
1806: ap_accounting_pay_pkg.g_mat_to_base_xrate_type :=
1807: l_pay_hist_rec.pmt_to_base_xrate_type;
1801:
1802:
1803: ap_accounting_pay_pkg.g_pay_pmt_history_id := l_pay_history_id;
1804:
1805: ap_accounting_pay_pkg.g_mat_pmt_history_id := l_pay_hist_rec.payment_history_id;
1806: ap_accounting_pay_pkg.g_mat_to_base_xrate_type :=
1807: l_pay_hist_rec.pmt_to_base_xrate_type;
1808: ap_accounting_pay_pkg.g_mat_to_base_xrate_date :=
1809: l_pay_hist_rec.pmt_to_base_xrate_date;
1802:
1803: ap_accounting_pay_pkg.g_pay_pmt_history_id := l_pay_history_id;
1804:
1805: ap_accounting_pay_pkg.g_mat_pmt_history_id := l_pay_hist_rec.payment_history_id;
1806: ap_accounting_pay_pkg.g_mat_to_base_xrate_type :=
1807: l_pay_hist_rec.pmt_to_base_xrate_type;
1808: ap_accounting_pay_pkg.g_mat_to_base_xrate_date :=
1809: l_pay_hist_rec.pmt_to_base_xrate_date;
1810: ap_accounting_pay_pkg.g_mat_to_base_xrate := l_pay_hist_rec.pmt_to_base_xrate;
1804:
1805: ap_accounting_pay_pkg.g_mat_pmt_history_id := l_pay_hist_rec.payment_history_id;
1806: ap_accounting_pay_pkg.g_mat_to_base_xrate_type :=
1807: l_pay_hist_rec.pmt_to_base_xrate_type;
1808: ap_accounting_pay_pkg.g_mat_to_base_xrate_date :=
1809: l_pay_hist_rec.pmt_to_base_xrate_date;
1810: ap_accounting_pay_pkg.g_mat_to_base_xrate := l_pay_hist_rec.pmt_to_base_xrate;
1811: l_txn_curr_code := l_pay_hist_rec.pmt_currency_code;
1812:
1806: ap_accounting_pay_pkg.g_mat_to_base_xrate_type :=
1807: l_pay_hist_rec.pmt_to_base_xrate_type;
1808: ap_accounting_pay_pkg.g_mat_to_base_xrate_date :=
1809: l_pay_hist_rec.pmt_to_base_xrate_date;
1810: ap_accounting_pay_pkg.g_mat_to_base_xrate := l_pay_hist_rec.pmt_to_base_xrate;
1811: l_txn_curr_code := l_pay_hist_rec.pmt_currency_code;
1812:
1813: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
1814: l_log_msg := 'Payment_History_ID for maturity = '||
1827:
1828: SELECT APH.Pmt_To_Base_XRate_Type,
1829: APH.Pmt_To_Base_XRate_Date,
1830: APH.Pmt_To_Base_XRate
1831: INTO ap_accounting_pay_pkg.g_pmt_to_base_xrate_type,
1832: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date,
1833: ap_accounting_pay_pkg.g_pmt_to_base_xrate
1834: FROM AP_Payment_History_All APH
1835: WHERE APH.Payment_History_ID = l_pay_history_id;
1828: SELECT APH.Pmt_To_Base_XRate_Type,
1829: APH.Pmt_To_Base_XRate_Date,
1830: APH.Pmt_To_Base_XRate
1831: INTO ap_accounting_pay_pkg.g_pmt_to_base_xrate_type,
1832: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date,
1833: ap_accounting_pay_pkg.g_pmt_to_base_xrate
1834: FROM AP_Payment_History_All APH
1835: WHERE APH.Payment_History_ID = l_pay_history_id;
1836:
1829: APH.Pmt_To_Base_XRate_Date,
1830: APH.Pmt_To_Base_XRate
1831: INTO ap_accounting_pay_pkg.g_pmt_to_base_xrate_type,
1832: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date,
1833: ap_accounting_pay_pkg.g_pmt_to_base_xrate
1834: FROM AP_Payment_History_All APH
1835: WHERE APH.Payment_History_ID = l_pay_history_id;
1836:
1837: SELECT MAX(APH.Payment_History_ID)
1845:
1846: SELECT APH.Pmt_To_Base_XRate_Type,
1847: APH.Pmt_To_Base_XRate_Date,
1848: APH.Pmt_To_Base_XRate
1849: INTO ap_accounting_pay_pkg.g_mat_to_base_xrate_type,
1850: ap_accounting_pay_pkg.g_mat_to_base_xrate_date,
1851: ap_accounting_pay_pkg.g_mat_to_base_xrate
1852: FROM AP_Payment_History_All APH
1853: WHERE APH.Payment_History_ID = l_mat_history_id;
1846: SELECT APH.Pmt_To_Base_XRate_Type,
1847: APH.Pmt_To_Base_XRate_Date,
1848: APH.Pmt_To_Base_XRate
1849: INTO ap_accounting_pay_pkg.g_mat_to_base_xrate_type,
1850: ap_accounting_pay_pkg.g_mat_to_base_xrate_date,
1851: ap_accounting_pay_pkg.g_mat_to_base_xrate
1852: FROM AP_Payment_History_All APH
1853: WHERE APH.Payment_History_ID = l_mat_history_id;
1854:
1847: APH.Pmt_To_Base_XRate_Date,
1848: APH.Pmt_To_Base_XRate
1849: INTO ap_accounting_pay_pkg.g_mat_to_base_xrate_type,
1850: ap_accounting_pay_pkg.g_mat_to_base_xrate_date,
1851: ap_accounting_pay_pkg.g_mat_to_base_xrate
1852: FROM AP_Payment_History_All APH
1853: WHERE APH.Payment_History_ID = l_mat_history_id;
1854:
1855: END IF;
1864: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME || l_procedure_name, l_log_msg);
1865: END IF;
1866:
1867:
1868: ap_accounting_pay_pkg.g_pay_pmt_history_id := l_pay_history_id;
1869: ap_accounting_pay_pkg.g_mat_pmt_history_id := l_mat_history_id;
1870:
1871: ap_accounting_pay_pkg.g_clr_pmt_history_id := l_pay_hist_rec.payment_history_id;
1872: ap_accounting_pay_pkg.g_clr_to_base_xrate_type :=
1865: END IF;
1866:
1867:
1868: ap_accounting_pay_pkg.g_pay_pmt_history_id := l_pay_history_id;
1869: ap_accounting_pay_pkg.g_mat_pmt_history_id := l_mat_history_id;
1870:
1871: ap_accounting_pay_pkg.g_clr_pmt_history_id := l_pay_hist_rec.payment_history_id;
1872: ap_accounting_pay_pkg.g_clr_to_base_xrate_type :=
1873: l_pay_hist_rec.pmt_to_base_xrate_type;
1867:
1868: ap_accounting_pay_pkg.g_pay_pmt_history_id := l_pay_history_id;
1869: ap_accounting_pay_pkg.g_mat_pmt_history_id := l_mat_history_id;
1870:
1871: ap_accounting_pay_pkg.g_clr_pmt_history_id := l_pay_hist_rec.payment_history_id;
1872: ap_accounting_pay_pkg.g_clr_to_base_xrate_type :=
1873: l_pay_hist_rec.pmt_to_base_xrate_type;
1874: ap_accounting_pay_pkg.g_clr_to_base_xrate_date :=
1875: l_pay_hist_rec.pmt_to_base_xrate_date;
1868: ap_accounting_pay_pkg.g_pay_pmt_history_id := l_pay_history_id;
1869: ap_accounting_pay_pkg.g_mat_pmt_history_id := l_mat_history_id;
1870:
1871: ap_accounting_pay_pkg.g_clr_pmt_history_id := l_pay_hist_rec.payment_history_id;
1872: ap_accounting_pay_pkg.g_clr_to_base_xrate_type :=
1873: l_pay_hist_rec.pmt_to_base_xrate_type;
1874: ap_accounting_pay_pkg.g_clr_to_base_xrate_date :=
1875: l_pay_hist_rec.pmt_to_base_xrate_date;
1876: ap_accounting_pay_pkg.g_clr_to_base_xrate := l_pay_hist_rec.pmt_to_base_xrate;
1870:
1871: ap_accounting_pay_pkg.g_clr_pmt_history_id := l_pay_hist_rec.payment_history_id;
1872: ap_accounting_pay_pkg.g_clr_to_base_xrate_type :=
1873: l_pay_hist_rec.pmt_to_base_xrate_type;
1874: ap_accounting_pay_pkg.g_clr_to_base_xrate_date :=
1875: l_pay_hist_rec.pmt_to_base_xrate_date;
1876: ap_accounting_pay_pkg.g_clr_to_base_xrate := l_pay_hist_rec.pmt_to_base_xrate;
1877: l_txn_curr_code := l_pay_hist_rec.bank_currency_code;
1878:
1872: ap_accounting_pay_pkg.g_clr_to_base_xrate_type :=
1873: l_pay_hist_rec.pmt_to_base_xrate_type;
1874: ap_accounting_pay_pkg.g_clr_to_base_xrate_date :=
1875: l_pay_hist_rec.pmt_to_base_xrate_date;
1876: ap_accounting_pay_pkg.g_clr_to_base_xrate := l_pay_hist_rec.pmt_to_base_xrate;
1877: l_txn_curr_code := l_pay_hist_rec.bank_currency_code;
1878:
1879: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
1880: l_log_msg := 'Payment_History_ID for clearing = '||
1883: END IF;
1884:
1885: ELSE
1886:
1887: ap_accounting_pay_pkg.g_pay_pmt_history_id := l_pay_hist_rec.payment_history_id;
1888: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type :=
1889: l_pay_hist_rec.pmt_to_base_xrate_type;
1890: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date :=
1891: l_pay_hist_rec.pmt_to_base_xrate_date;
1884:
1885: ELSE
1886:
1887: ap_accounting_pay_pkg.g_pay_pmt_history_id := l_pay_hist_rec.payment_history_id;
1888: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type :=
1889: l_pay_hist_rec.pmt_to_base_xrate_type;
1890: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date :=
1891: l_pay_hist_rec.pmt_to_base_xrate_date;
1892: ap_accounting_pay_pkg.g_pmt_to_base_xrate := l_pay_hist_rec.pmt_to_base_xrate;
1886:
1887: ap_accounting_pay_pkg.g_pay_pmt_history_id := l_pay_hist_rec.payment_history_id;
1888: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type :=
1889: l_pay_hist_rec.pmt_to_base_xrate_type;
1890: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date :=
1891: l_pay_hist_rec.pmt_to_base_xrate_date;
1892: ap_accounting_pay_pkg.g_pmt_to_base_xrate := l_pay_hist_rec.pmt_to_base_xrate;
1893: l_txn_curr_code := l_pay_hist_rec.pmt_currency_code;
1894:
1888: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type :=
1889: l_pay_hist_rec.pmt_to_base_xrate_type;
1890: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date :=
1891: l_pay_hist_rec.pmt_to_base_xrate_date;
1892: ap_accounting_pay_pkg.g_pmt_to_base_xrate := l_pay_hist_rec.pmt_to_base_xrate;
1893: l_txn_curr_code := l_pay_hist_rec.pmt_currency_code;
1894:
1895: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
1896: l_log_msg := 'Payment_History_ID for payment = '||
1985: -- Bug 8524600 End
1986:
1987: --bug 9495429 start
1988: IF (l_inv_pay_rec.amount <> 0 ) THEN
1989: IF AP_Accounting_Pay_Pkg.Is_Final_Payment (l_inv_rec,
1990: 0, --l_inv_pay_rec.amount
1991: 0, -- l_inv_pay_rec.discount_taken, Bug 13081266
1992: 0, -- prepay amount
1993: p_xla_event_rec.event_type_code,
1995: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
1996: l_log_msg := 'Final payment of Invoice_ID '||l_inv_rec.invoice_id;
1997: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME || l_procedure_name, l_log_msg);
1998: END IF;
1999: l_final_payment := AP_ACCOUNTING_PAY_PKG.Is_Final_Event (l_inv_rec,
2000: p_xla_event_rec,
2001: NULL,
2002: l_curr_calling_sequence);
2003: ELSE
2247: UPDATE AP_Payment_Hist_Dists APD
2248: SET APD.Amount = APD.amount + l_tech_disc_rnd_amt,
2249: APD.bank_curr_amount = APD.bank_curr_amount + l_tech_disc_rnd_amt,
2250: APD.Cleared_Base_Amount = Decode(l_pay_hist_rec.bank_currency_code,
2251: ap_accounting_pay_pkg.g_base_currency_code,
2252: APD.Cleared_Base_Amount + l_tech_disc_rnd_amt,
2253: APD.Cleared_Base_Amount),
2254: APD.Paid_Base_Amount = Decode(l_pay_hist_rec.bank_currency_code,
2255: ap_accounting_pay_pkg.g_base_currency_code,
2251: ap_accounting_pay_pkg.g_base_currency_code,
2252: APD.Cleared_Base_Amount + l_tech_disc_rnd_amt,
2253: APD.Cleared_Base_Amount),
2254: APD.Paid_Base_Amount = Decode(l_pay_hist_rec.bank_currency_code,
2255: ap_accounting_pay_pkg.g_base_currency_code,
2256: APD.Paid_Base_Amount + l_tech_disc_rnd_amt,
2257: APD.Paid_Base_Amount),
2258: APD.Matured_Base_Amount = Decode(l_pay_hist_rec.bank_currency_code,
2259: ap_accounting_pay_pkg.g_base_currency_code,
2255: ap_accounting_pay_pkg.g_base_currency_code,
2256: APD.Paid_Base_Amount + l_tech_disc_rnd_amt,
2257: APD.Paid_Base_Amount),
2258: APD.Matured_Base_Amount = Decode(l_pay_hist_rec.bank_currency_code,
2259: ap_accounting_pay_pkg.g_base_currency_code,
2260: APD.Matured_Base_Amount + l_tech_disc_rnd_amt,
2261: APD.Matured_Base_Amount),
2262: APD.Invoice_Dist_Base_Amount = Decode(l_pay_hist_rec.bank_currency_code,
2263: ap_accounting_pay_pkg.g_base_currency_code,
2259: ap_accounting_pay_pkg.g_base_currency_code,
2260: APD.Matured_Base_Amount + l_tech_disc_rnd_amt,
2261: APD.Matured_Base_Amount),
2262: APD.Invoice_Dist_Base_Amount = Decode(l_pay_hist_rec.bank_currency_code,
2263: ap_accounting_pay_pkg.g_base_currency_code,
2264: Decode(l_pay_hist_rec.bank_currency_code,
2265: l_inv_rec.invoice_currency_code,
2266: APD.Invoice_Dist_Base_Amount + l_tech_disc_rnd_amt,
2267: APD.Invoice_Dist_Base_Amount),
2496: FND_LOG.STRING(G_LEVEL_PROCEDURE, G_MODULE_NAME||l_procedure_name, l_log_msg);
2497: END IF;
2498:
2499: --11698822, call update_gain_loss_ind only for foreign currency txns
2500: IF l_txn_curr_code <> ap_accounting_pay_pkg.g_base_currency_code THEN
2501: Update_Gain_Loss_Ind
2502: (p_xla_event_rec,
2503: l_pay_hist_rec,
2504: l_curr_calling_sequence);
2537: -- Also calculates discounts and ERV
2538: ---------------------------------------------------------------------
2539:
2540: PROCEDURE Pay_Dist_Proc
2541: (p_xla_event_rec IN ap_accounting_pay_pkg.r_xla_event_info
2542: ,p_inv_pay_rec IN r_inv_pay_info
2543: ,p_pay_hist_rec IN ap_accounting_pay_pkg.r_pay_hist_info
2544: ,p_inv_rec IN ap_accounting_pay_pkg.r_invoices_info
2545: ,p_inv_dist_rec IN ap_accounting_pay_pkg.r_inv_dist_info
2539:
2540: PROCEDURE Pay_Dist_Proc
2541: (p_xla_event_rec IN ap_accounting_pay_pkg.r_xla_event_info
2542: ,p_inv_pay_rec IN r_inv_pay_info
2543: ,p_pay_hist_rec IN ap_accounting_pay_pkg.r_pay_hist_info
2544: ,p_inv_rec IN ap_accounting_pay_pkg.r_invoices_info
2545: ,p_inv_dist_rec IN ap_accounting_pay_pkg.r_inv_dist_info
2546: ,p_calc_mode IN VARCHAR2
2547: ,p_final_payment IN BOOLEAN
2540: PROCEDURE Pay_Dist_Proc
2541: (p_xla_event_rec IN ap_accounting_pay_pkg.r_xla_event_info
2542: ,p_inv_pay_rec IN r_inv_pay_info
2543: ,p_pay_hist_rec IN ap_accounting_pay_pkg.r_pay_hist_info
2544: ,p_inv_rec IN ap_accounting_pay_pkg.r_invoices_info
2545: ,p_inv_dist_rec IN ap_accounting_pay_pkg.r_inv_dist_info
2546: ,p_calc_mode IN VARCHAR2
2547: ,p_final_payment IN BOOLEAN
2548: ,p_calling_sequence IN VARCHAR2
2541: (p_xla_event_rec IN ap_accounting_pay_pkg.r_xla_event_info
2542: ,p_inv_pay_rec IN r_inv_pay_info
2543: ,p_pay_hist_rec IN ap_accounting_pay_pkg.r_pay_hist_info
2544: ,p_inv_rec IN ap_accounting_pay_pkg.r_invoices_info
2545: ,p_inv_dist_rec IN ap_accounting_pay_pkg.r_inv_dist_info
2546: ,p_calc_mode IN VARCHAR2
2547: ,p_final_payment IN BOOLEAN
2548: ,p_calling_sequence IN VARCHAR2
2549: ) IS
2815:
2816: IF p_final_payment = TRUE THEN
2817:
2818: IF (G_LEVEL_PROCEDURE >= G_CURRENT_RUNTIME_LEVEL ) THEN
2819: l_log_msg := 'This is a final payment and now calling AP_Accounting_Pay_Pkg.Get_Pay_Sum';
2820: FND_LOG.STRING(G_LEVEL_PROCEDURE, G_MODULE_NAME||l_procedure_name, l_log_msg);
2821: END IF;
2822:
2823: AP_Accounting_Pay_Pkg.Get_Pay_Sum
2819: l_log_msg := 'This is a final payment and now calling AP_Accounting_Pay_Pkg.Get_Pay_Sum';
2820: FND_LOG.STRING(G_LEVEL_PROCEDURE, G_MODULE_NAME||l_procedure_name, l_log_msg);
2821: END IF;
2822:
2823: AP_Accounting_Pay_Pkg.Get_Pay_Sum
2824: (p_inv_dist_rec.invoice_distribution_id,
2825: p_xla_event_rec.event_type_code,
2826: l_total_paid_amt,
2827: l_tot_paid_amt_inv_curr,
2828: l_tot_paid_amt_bank_curr,
2829: l_curr_calling_sequence);
2830:
2831: IF (G_LEVEL_PROCEDURE >= G_CURRENT_RUNTIME_LEVEL ) THEN
2832: l_log_msg := 'After Calling function AP_Accounting_Pay_Pkg.Get_Pay_Sum' ||
2833: 'l_total_paid_amt==' || nvl(l_total_paid_amt,0) ||
2834: 'l_tot_paid_amt_inv_curr=' || nvl(l_tot_paid_amt_inv_curr,0) ||
2835: 'l_tot_paid_amt_bank_curr =' || nvl(l_tot_paid_amt_bank_curr,0);
2836: FND_LOG.STRING(G_LEVEL_PROCEDURE, G_MODULE_NAME||l_procedure_name, l_log_msg);
2837: END IF;
2838:
2839: --Bug 9282465
2840: /* 14121992 . re-placed the below function call in the AWT Block
2841: AP_Accounting_Pay_Pkg.Get_Pay_Base_Sum
2842: (p_inv_dist_rec.invoice_distribution_id,
2843: p_xla_event_rec.event_type_code,
2844: l_total_paid_base_amt,
2845: l_tot_paid_inv_base_amt,
2846: l_tot_paid_cleared_base_amt,
2847: l_curr_calling_sequence);
2848:
2849: IF (G_LEVEL_PROCEDURE >= G_CURRENT_RUNTIME_LEVEL ) THEN
2850: l_log_msg := 'After Calling function AP_Accounting_Pay_Pkg.Get_Pay_Base_Sum' ||
2851: 'l_total_paid_base_amt==' || nvl(l_total_paid_base_amt,0) ||
2852: 'l_tot_paid_inv_base_amt=' || nvl(l_tot_paid_inv_base_amt,0) ||
2853: 'l_tot_paid_cleared_base_amt =' || nvl(l_tot_paid_cleared_base_amt,0);
2854: FND_LOG.STRING(G_LEVEL_PROCEDURE, G_MODULE_NAME||l_procedure_name, l_log_msg);
2853: 'l_tot_paid_cleared_base_amt =' || nvl(l_tot_paid_cleared_base_amt,0);
2854: FND_LOG.STRING(G_LEVEL_PROCEDURE, G_MODULE_NAME||l_procedure_name, l_log_msg);
2855: END IF;
2856: */
2857: l_total_prepaid_amt := AP_Accounting_Pay_Pkg.Get_Prepay_Sum
2858: (p_inv_dist_rec.invoice_distribution_id,
2859: l_curr_calling_sequence);
2860:
2861: IF (G_LEVEL_PROCEDURE >= G_CURRENT_RUNTIME_LEVEL ) THEN
2867: END IF;
2868:
2869: --Bug 9282465
2870: /* 14121992 . re-placed the below function call in the AWT Block
2871: AP_Accounting_Pay_Pkg.Get_Prepay_Base_Sum(
2872: p_inv_dist_rec.invoice_distribution_id,
2873: l_total_prepaid_base_amt,
2874: l_total_prepaid_inv_base_amt,
2875: l_total_prepaid_clr_base_amt,
2943: - NVL(l_tot_prepaid_amt_pay_curr, 0);
2944: l_inv_dist_amount := NVL(p_inv_dist_rec.amount, 0) + NVL(l_tot_paid_amt_inv_curr, 0)
2945: - NVL(l_total_prepaid_amt, 0);
2946:
2947: AP_Accounting_Pay_Pkg.Get_Pay_Base_Sum
2948: (p_inv_dist_rec.invoice_distribution_id,
2949: p_xla_event_rec.event_type_code,
2950: l_total_paid_base_amt,
2951: l_tot_paid_inv_base_amt,
2952: l_tot_paid_cleared_base_amt,
2953: l_curr_calling_sequence);
2954:
2955: IF (G_LEVEL_PROCEDURE >= G_CURRENT_RUNTIME_LEVEL ) THEN
2956: l_log_msg := 'After Calling function AP_Accounting_Pay_Pkg.Get_Pay_Base_Sum' ||
2957: 'l_total_paid_base_amt==' || nvl(l_total_paid_base_amt,0) ||
2958: 'l_tot_paid_inv_base_amt=' || nvl(l_tot_paid_inv_base_amt,0) ||
2959: 'l_tot_paid_cleared_base_amt =' || nvl(l_tot_paid_cleared_base_amt,0);
2960: FND_LOG.STRING(G_LEVEL_PROCEDURE, G_MODULE_NAME||l_procedure_name, l_log_msg);
2959: 'l_tot_paid_cleared_base_amt =' || nvl(l_tot_paid_cleared_base_amt,0);
2960: FND_LOG.STRING(G_LEVEL_PROCEDURE, G_MODULE_NAME||l_procedure_name, l_log_msg);
2961: END IF;
2962:
2963: AP_Accounting_Pay_Pkg.Get_Prepay_Base_Sum(
2964: p_inv_dist_rec.invoice_distribution_id,
2965: l_total_prepaid_base_amt,
2966: l_total_prepaid_inv_base_amt,
2967: l_total_prepaid_clr_base_amt,
2983: NVL((p_inv_dist_rec.base_amount * nvl(p_inv_rec.exchange_rate, 1)
2984: / (nvl(p_pay_hist_rec.pmt_to_base_xrate,1) * nvl(p_inv_rec.payment_cross_rate ,1)))
2985: + NVL(l_tot_paid_inv_base_amt,0) - NVL(l_total_prepaid_inv_base_amt,0),
2986: l_inv_dist_amount),
2987: ap_accounting_pay_pkg.g_base_currency_code);
2988: l_paid_base_amount := NVL(p_inv_dist_rec.base_amount, 0) + NVL(l_total_paid_base_amt, 0); --bug 11066774
2989: ELSE
2990: l_inv_dist_base_amount := NVL(p_inv_dist_rec.base_amount + NVL(l_tot_paid_inv_base_amt,0)
2991: - NVL(l_total_prepaid_inv_base_amt,0),l_inv_dist_amount);
3128: l_inv_dist_base_amount := AP_Utilities_Pkg.AP_Round_Currency(
3129: NVL(p_inv_dist_rec.base_amount * nvl(p_inv_rec.exchange_rate, 1)
3130: / (nvl(p_pay_hist_rec.pmt_to_base_xrate, 1) * nvl(p_inv_rec.payment_cross_rate , 1))
3131: , l_inv_dist_amount),
3132: ap_accounting_pay_pkg.g_base_currency_code);
3133: l_paid_base_amount := p_inv_dist_rec.base_amount;
3134: l_prorated_amount := GL_Currency_API.Convert_Amount(
3135: p_inv_rec.invoice_currency_code,
3136: p_inv_rec.payment_currency_code,
3339: p_inv_rec.payment_currency_code,
3340: p_inv_rec.payment_cross_rate_date,
3341: 'EMU FIXED',
3342: p_inv_dist_rec.amount) +
3343: AP_Accounting_Pay_Pkg.get_casc_pay_sum
3344: (p_inv_dist_rec.invoice_distribution_id,
3345: p_pay_hist_rec.related_event_id,
3346: p_inv_pay_rec.invoice_payment_id,
3347: l_curr_calling_sequence);
3346: p_inv_pay_rec.invoice_payment_id,
3347: l_curr_calling_sequence);
3348:
3349: l_inv_dist_amount := p_inv_dist_rec.amount +
3350: AP_Accounting_Pay_Pkg.get_casc_inv_dist_sum
3351: (p_inv_dist_rec.invoice_distribution_id,
3352: p_pay_hist_rec.related_event_id,
3353: p_inv_pay_rec.invoice_payment_id,
3354: l_curr_calling_sequence);
3360: l_bank_curr_amount := AP_Utilities_Pkg.AP_Round_Currency(
3361: l_prorated_amount * p_pay_hist_rec.pmt_to_base_xrate
3362: /p_pay_hist_rec.bank_to_base_xrate,
3363: p_pay_hist_rec.bank_currency_code) -
3364: AP_Accounting_Pay_Pkg.get_casc_bank_curr_sum(
3365: p_inv_dist_rec.invoice_distribution_id,
3366: p_pay_hist_rec.related_event_id,
3367: p_inv_pay_rec.invoice_payment_id,
3368: l_curr_calling_sequence);
3369:
3370: ELSE
3371:
3372: l_bank_curr_amount := l_prorated_amount -
3373: AP_Accounting_Pay_Pkg.get_casc_bank_curr_sum(
3374: p_inv_dist_rec.invoice_distribution_id,
3375: p_pay_hist_rec.related_event_id,
3376: p_inv_pay_rec.invoice_payment_id,
3377: l_curr_calling_sequence);
3416: --Need to recalculate the l_inv_dist_amount as the difference between the amount to be prorated for the
3417: -- distribution and the already prorated amount
3418:
3419: IF p_inv_dist_rec.line_type_lookup_code ='AWT' THEN
3420: l_inv_dist_amount := AP_Accounting_Pay_Pkg.get_casc_inv_dist_sum
3421: (p_inv_dist_rec.invoice_distribution_id,
3422: p_pay_hist_rec.related_event_id,
3423: p_inv_pay_rec.invoice_payment_id,
3424: l_curr_calling_sequence) + l_inv_dist_amount;
3422: p_pay_hist_rec.related_event_id,
3423: p_inv_pay_rec.invoice_payment_id,
3424: l_curr_calling_sequence) + l_inv_dist_amount;
3425: ELSE
3426: l_inv_dist_amount := l_inv_dist_amount- AP_Accounting_Pay_Pkg.get_casc_inv_dist_sum
3427: (p_inv_dist_rec.invoice_distribution_id,
3428: p_pay_hist_rec.related_event_id,
3429: p_inv_pay_rec.invoice_payment_id,
3430: l_curr_calling_sequence);
3482: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME || l_procedure_name, l_log_msg);
3483: END IF;
3484:
3485: IF (G_LEVEL_PROCEDURE >= G_CURRENT_RUNTIME_LEVEL ) THEN
3486: l_log_msg := 'Now calling AP_Accounting_Pay_Pkg.Get_Base_Amount before insert';
3487: FND_LOG.STRING(G_LEVEL_PROCEDURE, G_MODULE_NAME||l_procedure_name, l_log_msg);
3488: END IF;
3489:
3490: l_prorated_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
3486: l_log_msg := 'Now calling AP_Accounting_Pay_Pkg.Get_Base_Amount before insert';
3487: FND_LOG.STRING(G_LEVEL_PROCEDURE, G_MODULE_NAME||l_procedure_name, l_log_msg);
3488: END IF;
3489:
3490: l_prorated_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
3491: (l_prorated_amount,
3492: p_pay_hist_rec.pmt_currency_code,
3493: ap_accounting_pay_pkg.g_base_currency_code,
3494: p_pay_hist_rec.pmt_to_base_xrate_type,
3489:
3490: l_prorated_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
3491: (l_prorated_amount,
3492: p_pay_hist_rec.pmt_currency_code,
3493: ap_accounting_pay_pkg.g_base_currency_code,
3494: p_pay_hist_rec.pmt_to_base_xrate_type,
3495: p_pay_hist_rec.pmt_to_base_xrate_date,
3496: p_pay_hist_rec.pmt_to_base_xrate,
3497: l_curr_calling_sequence);
3496: p_pay_hist_rec.pmt_to_base_xrate,
3497: l_curr_calling_sequence);
3498:
3499: IF (G_LEVEL_PROCEDURE >= G_CURRENT_RUNTIME_LEVEL ) THEN
3500: l_log_msg := 'after call AP_Accounting_Pay_Pkg.Get_Base_Amoun and ' ||
3501: 'l_prorated_base_amount=' || nvl(l_prorated_base_amount,0) ||
3502: 'l_prorated_amount= ' || nvl(l_prorated_amount,0);
3503: FND_LOG.STRING(G_LEVEL_PROCEDURE, G_MODULE_NAME||l_procedure_name, l_log_msg);
3504: END IF;
3525: ,l_prorated_amount));
3526: l_inv_dist_base_amount := -1 * l_inv_dist_base_amount;
3527: l_prorated_amount := -1 * l_prorated_amount;
3528: l_prorated_base_amount := -1 * ap_utilities_pkg.ap_round_currency
3529: (l_prorated_base_amount,ap_accounting_pay_pkg.g_base_currency_code);
3530: l_inv_dist_amount := -1 * l_inv_dist_amount;
3531: l_bank_curr_amount := -1 * l_bank_curr_amount;
3532: l_cleared_base_amount := -1 * l_cleared_base_amount; --11698822
3533: ELSE
3544: ('PAYMENT CLEARED', 'PAYMENT CLEARING ADJUSTED') THEN
3545: --Bug 9282465
3546: IF (p_inv_dist_rec.line_type_lookup_code = 'AWT' AND l_cleared_base_amount is not null) THEN
3547: l_pd_rec.cleared_base_amount := ap_utilities_pkg.ap_round_currency
3548: (l_cleared_base_amount,ap_accounting_pay_pkg.g_base_currency_code);
3549: ELSE
3550:
3551: l_pd_rec.cleared_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
3552: (l_bank_curr_amount,
3547: l_pd_rec.cleared_base_amount := ap_utilities_pkg.ap_round_currency
3548: (l_cleared_base_amount,ap_accounting_pay_pkg.g_base_currency_code);
3549: ELSE
3550:
3551: l_pd_rec.cleared_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
3552: (l_bank_curr_amount,
3553: p_pay_hist_rec.bank_currency_code,
3554: ap_accounting_pay_pkg.g_base_currency_code,
3555: p_pay_hist_rec.bank_to_base_xrate_type,
3550:
3551: l_pd_rec.cleared_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
3552: (l_bank_curr_amount,
3553: p_pay_hist_rec.bank_currency_code,
3554: ap_accounting_pay_pkg.g_base_currency_code,
3555: p_pay_hist_rec.bank_to_base_xrate_type,
3556: p_pay_hist_rec.bank_to_base_xrate_date,
3557: p_pay_hist_rec.bank_to_base_xrate,
3558: l_curr_calling_sequence);
3562: IF (p_inv_dist_rec.line_type_lookup_code = 'AWT' AND (l_inv_dist_base_amount is not null or l_inv_dist_amount is not null) ) THEN
3563: l_pd_rec.paid_base_amount :=ap_utilities_pkg.ap_round_currency
3564: ( nvl(l_inv_dist_base_amount,l_inv_dist_amount)
3565: * nvl(p_inv_rec.payment_cross_rate ,1)
3566: * nvl(ap_accounting_pay_pkg.g_pmt_to_base_xrate,1)
3567: / nvl(p_inv_rec.exchange_rate,1),ap_accounting_pay_pkg.g_base_currency_code);
3568: ELSE
3569:
3570: l_pd_rec.paid_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
3563: l_pd_rec.paid_base_amount :=ap_utilities_pkg.ap_round_currency
3564: ( nvl(l_inv_dist_base_amount,l_inv_dist_amount)
3565: * nvl(p_inv_rec.payment_cross_rate ,1)
3566: * nvl(ap_accounting_pay_pkg.g_pmt_to_base_xrate,1)
3567: / nvl(p_inv_rec.exchange_rate,1),ap_accounting_pay_pkg.g_base_currency_code);
3568: ELSE
3569:
3570: l_pd_rec.paid_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
3571: (l_prorated_amount,
3566: * nvl(ap_accounting_pay_pkg.g_pmt_to_base_xrate,1)
3567: / nvl(p_inv_rec.exchange_rate,1),ap_accounting_pay_pkg.g_base_currency_code);
3568: ELSE
3569:
3570: l_pd_rec.paid_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
3571: (l_prorated_amount,
3572: p_pay_hist_rec.pmt_currency_code,
3573: ap_accounting_pay_pkg.g_base_currency_code,
3574: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type,
3569:
3570: l_pd_rec.paid_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
3571: (l_prorated_amount,
3572: p_pay_hist_rec.pmt_currency_code,
3573: ap_accounting_pay_pkg.g_base_currency_code,
3574: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type,
3575: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date,
3576: ap_accounting_pay_pkg.g_pmt_to_base_xrate,
3577: l_curr_calling_sequence);
3570: l_pd_rec.paid_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
3571: (l_prorated_amount,
3572: p_pay_hist_rec.pmt_currency_code,
3573: ap_accounting_pay_pkg.g_base_currency_code,
3574: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type,
3575: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date,
3576: ap_accounting_pay_pkg.g_pmt_to_base_xrate,
3577: l_curr_calling_sequence);
3578: END IF;
3571: (l_prorated_amount,
3572: p_pay_hist_rec.pmt_currency_code,
3573: ap_accounting_pay_pkg.g_base_currency_code,
3574: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type,
3575: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date,
3576: ap_accounting_pay_pkg.g_pmt_to_base_xrate,
3577: l_curr_calling_sequence);
3578: END IF;
3579:
3572: p_pay_hist_rec.pmt_currency_code,
3573: ap_accounting_pay_pkg.g_base_currency_code,
3574: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type,
3575: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date,
3576: ap_accounting_pay_pkg.g_pmt_to_base_xrate,
3577: l_curr_calling_sequence);
3578: END IF;
3579:
3580: IF ap_accounting_pay_pkg.g_mat_to_base_xrate IS NOT NULL THEN
3576: ap_accounting_pay_pkg.g_pmt_to_base_xrate,
3577: l_curr_calling_sequence);
3578: END IF;
3579:
3580: IF ap_accounting_pay_pkg.g_mat_to_base_xrate IS NOT NULL THEN
3581:
3582: l_pd_rec.matured_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
3583: (l_prorated_amount,
3584: p_pay_hist_rec.pmt_currency_code,
3578: END IF;
3579:
3580: IF ap_accounting_pay_pkg.g_mat_to_base_xrate IS NOT NULL THEN
3581:
3582: l_pd_rec.matured_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
3583: (l_prorated_amount,
3584: p_pay_hist_rec.pmt_currency_code,
3585: ap_accounting_pay_pkg.g_base_currency_code,
3586: ap_accounting_pay_pkg.g_mat_to_base_xrate_type,
3581:
3582: l_pd_rec.matured_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
3583: (l_prorated_amount,
3584: p_pay_hist_rec.pmt_currency_code,
3585: ap_accounting_pay_pkg.g_base_currency_code,
3586: ap_accounting_pay_pkg.g_mat_to_base_xrate_type,
3587: ap_accounting_pay_pkg.g_mat_to_base_xrate_date,
3588: ap_accounting_pay_pkg.g_mat_to_base_xrate,
3589: l_curr_calling_sequence);
3582: l_pd_rec.matured_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
3583: (l_prorated_amount,
3584: p_pay_hist_rec.pmt_currency_code,
3585: ap_accounting_pay_pkg.g_base_currency_code,
3586: ap_accounting_pay_pkg.g_mat_to_base_xrate_type,
3587: ap_accounting_pay_pkg.g_mat_to_base_xrate_date,
3588: ap_accounting_pay_pkg.g_mat_to_base_xrate,
3589: l_curr_calling_sequence);
3590: END IF ;
3583: (l_prorated_amount,
3584: p_pay_hist_rec.pmt_currency_code,
3585: ap_accounting_pay_pkg.g_base_currency_code,
3586: ap_accounting_pay_pkg.g_mat_to_base_xrate_type,
3587: ap_accounting_pay_pkg.g_mat_to_base_xrate_date,
3588: ap_accounting_pay_pkg.g_mat_to_base_xrate,
3589: l_curr_calling_sequence);
3590: END IF ;
3591:
3584: p_pay_hist_rec.pmt_currency_code,
3585: ap_accounting_pay_pkg.g_base_currency_code,
3586: ap_accounting_pay_pkg.g_mat_to_base_xrate_type,
3587: ap_accounting_pay_pkg.g_mat_to_base_xrate_date,
3588: ap_accounting_pay_pkg.g_mat_to_base_xrate,
3589: l_curr_calling_sequence);
3590: END IF ;
3591:
3592: ELSIF p_xla_event_rec.event_type_code IN
3592: ELSIF p_xla_event_rec.event_type_code IN
3593: ('PAYMENT MATURED', 'PAYMENT MATURITY ADJUSTED') THEN
3594: l_pd_rec.matured_base_amount := l_prorated_base_amount;
3595:
3596: l_pd_rec.paid_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
3597: (l_prorated_amount,
3598: p_pay_hist_rec.pmt_currency_code,
3599: ap_accounting_pay_pkg.g_base_currency_code,
3600: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type,
3595:
3596: l_pd_rec.paid_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
3597: (l_prorated_amount,
3598: p_pay_hist_rec.pmt_currency_code,
3599: ap_accounting_pay_pkg.g_base_currency_code,
3600: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type,
3601: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date,
3602: ap_accounting_pay_pkg.g_pmt_to_base_xrate,
3603: l_curr_calling_sequence);
3596: l_pd_rec.paid_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
3597: (l_prorated_amount,
3598: p_pay_hist_rec.pmt_currency_code,
3599: ap_accounting_pay_pkg.g_base_currency_code,
3600: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type,
3601: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date,
3602: ap_accounting_pay_pkg.g_pmt_to_base_xrate,
3603: l_curr_calling_sequence);
3604:
3597: (l_prorated_amount,
3598: p_pay_hist_rec.pmt_currency_code,
3599: ap_accounting_pay_pkg.g_base_currency_code,
3600: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type,
3601: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date,
3602: ap_accounting_pay_pkg.g_pmt_to_base_xrate,
3603: l_curr_calling_sequence);
3604:
3605: ELSE
3598: p_pay_hist_rec.pmt_currency_code,
3599: ap_accounting_pay_pkg.g_base_currency_code,
3600: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type,
3601: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date,
3602: ap_accounting_pay_pkg.g_pmt_to_base_xrate,
3603: l_curr_calling_sequence);
3604:
3605: ELSE
3606: l_pd_rec.paid_base_amount := l_prorated_base_amount;
3629:
3630: ELSE
3631:
3632: l_pd_rec.invoice_dist_base_amount :=
3633: AP_Accounting_Pay_Pkg.Get_Base_Amount
3634: (l_inv_dist_amount,
3635: p_inv_rec.invoice_currency_code,
3636: ap_accounting_pay_pkg.g_base_currency_code,
3637: p_inv_rec.exchange_rate_type,
3632: l_pd_rec.invoice_dist_base_amount :=
3633: AP_Accounting_Pay_Pkg.Get_Base_Amount
3634: (l_inv_dist_amount,
3635: p_inv_rec.invoice_currency_code,
3636: ap_accounting_pay_pkg.g_base_currency_code,
3637: p_inv_rec.exchange_rate_type,
3638: p_inv_rec.exchange_date,
3639: p_inv_rec.exchange_rate,
3640: l_curr_calling_sequence);
3672: l_base_qty_variance := AP_Utilities_PKG.AP_Round_Currency(
3673: ((p_inv_dist_rec.base_quantity_variance
3674: * l_pd_rec.invoice_dist_base_amount)
3675: / p_inv_dist_rec.base_amount),
3676: ap_accounting_pay_pkg.g_base_currency_code);
3677: END IF;
3678: END IF;
3679:
3680: IF p_inv_dist_rec.amount_variance IS NOT NULL THEN
3699: l_base_amt_variance := AP_Utilities_PKG.AP_Round_Currency(
3700: ((p_inv_dist_rec.base_amount_variance
3701: * l_pd_rec.invoice_dist_base_amount)
3702: / p_inv_dist_rec.base_amount),
3703: ap_accounting_pay_pkg.g_base_currency_code);
3704: END IF;
3705: END IF;
3706:
3707: l_pd_rec.quantity_variance := l_qty_variance;
3730:
3731:
3732: IF ((p_xla_event_rec.event_type_code NOT IN
3733: ('PAYMENT MATURED', 'PAYMENT MATURITY ADJUSTED')) AND
3734: (p_inv_rec.payment_currency_code <> ap_accounting_pay_pkg.g_base_currency_code) AND
3735: p_inv_dist_rec.po_distribution_id IS NOT NULL AND
3736: p_inv_dist_rec.line_type_lookup_code <> 'AWT') THEN
3737:
3738: -----------------------------------------------------------------------------
3791: -- and inserts the calculated values into payment hist dists table
3792: ---------------------------------------------------------------------
3793:
3794: PROCEDURE Pay_Dist_Discount
3795: (p_xla_event_rec IN ap_accounting_pay_pkg.r_xla_event_info
3796: ,p_inv_pay_rec IN r_inv_pay_info
3797: ,p_pay_hist_rec IN ap_accounting_pay_pkg.r_pay_hist_info
3798: ,p_inv_rec IN ap_accounting_pay_pkg.r_invoices_info
3799: ,p_inv_dist_rec IN ap_accounting_pay_pkg.r_inv_dist_info
3793:
3794: PROCEDURE Pay_Dist_Discount
3795: (p_xla_event_rec IN ap_accounting_pay_pkg.r_xla_event_info
3796: ,p_inv_pay_rec IN r_inv_pay_info
3797: ,p_pay_hist_rec IN ap_accounting_pay_pkg.r_pay_hist_info
3798: ,p_inv_rec IN ap_accounting_pay_pkg.r_invoices_info
3799: ,p_inv_dist_rec IN ap_accounting_pay_pkg.r_inv_dist_info
3800: ,p_calc_mode IN VARCHAR2
3801: ,p_disc_pay_amount IN OUT NOCOPY NUMBER
3794: PROCEDURE Pay_Dist_Discount
3795: (p_xla_event_rec IN ap_accounting_pay_pkg.r_xla_event_info
3796: ,p_inv_pay_rec IN r_inv_pay_info
3797: ,p_pay_hist_rec IN ap_accounting_pay_pkg.r_pay_hist_info
3798: ,p_inv_rec IN ap_accounting_pay_pkg.r_invoices_info
3799: ,p_inv_dist_rec IN ap_accounting_pay_pkg.r_inv_dist_info
3800: ,p_calc_mode IN VARCHAR2
3801: ,p_disc_pay_amount IN OUT NOCOPY NUMBER
3802: ,p_disc_dist_amount IN OUT NOCOPY NUMBER
3795: (p_xla_event_rec IN ap_accounting_pay_pkg.r_xla_event_info
3796: ,p_inv_pay_rec IN r_inv_pay_info
3797: ,p_pay_hist_rec IN ap_accounting_pay_pkg.r_pay_hist_info
3798: ,p_inv_rec IN ap_accounting_pay_pkg.r_invoices_info
3799: ,p_inv_dist_rec IN ap_accounting_pay_pkg.r_inv_dist_info
3800: ,p_calc_mode IN VARCHAR2
3801: ,p_disc_pay_amount IN OUT NOCOPY NUMBER
3802: ,p_disc_dist_amount IN OUT NOCOPY NUMBER
3803: ,p_disc_bank_amount IN OUT NOCOPY NUMBER
4065: l_prorated_disc_amt := AP_UTILITIES_PKG.AP_ROUND_CURRENCY
4066: (p_inv_pay_rec.discount_taken * p_inv_dist_rec.amount
4067: / l_invoice_amount,
4068: p_pay_hist_rec.pmt_currency_code)
4069: - ap_accounting_pay_pkg.get_casc_discount_sum
4070: (p_inv_dist_rec.invoice_distribution_id,
4071: p_pay_hist_rec.related_event_id,
4072: p_inv_pay_rec.invoice_payment_id,
4073: l_curr_calling_sequence);
4075: l_inv_dist_amount := AP_UTILITIES_PKG.AP_ROUND_CURRENCY
4076: (l_disc_amt_inv_curr * p_inv_dist_rec.amount
4077: / l_invoice_amount,
4078: p_inv_rec.invoice_currency_code)
4079: - ap_accounting_pay_pkg.get_casc_inv_dist_disc_sum
4080: (p_inv_dist_rec.invoice_distribution_id,
4081: p_pay_hist_rec.related_event_id,
4082: p_inv_pay_rec.invoice_payment_id,
4083: l_curr_calling_sequence);
4087: l_bank_curr_amount := AP_UTILITIES_PKG.AP_ROUND_CURRENCY
4088: (l_disc_amt_bank_curr * p_inv_dist_rec.amount
4089: / l_invoice_amount,
4090: p_pay_hist_rec.bank_currency_code)
4091: - ap_accounting_pay_pkg.get_casc_bank_curr_disc_sum
4092: (p_inv_dist_rec.invoice_distribution_id,
4093: p_pay_hist_rec.related_event_id,
4094: p_inv_pay_rec.invoice_payment_id,
4095: l_curr_calling_sequence);
4116: l_pd_rec.invoice_payment_id := p_inv_pay_rec.invoice_payment_id;
4117:
4118: l_pd_rec.bank_curr_amount := l_bank_curr_amount;
4119:
4120: l_prorated_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
4121: (l_prorated_disc_amt,
4122: p_pay_hist_rec.pmt_currency_code,
4123: ap_accounting_pay_pkg.g_base_currency_code,
4124: p_pay_hist_rec.pmt_to_base_xrate_type,
4119:
4120: l_prorated_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
4121: (l_prorated_disc_amt,
4122: p_pay_hist_rec.pmt_currency_code,
4123: ap_accounting_pay_pkg.g_base_currency_code,
4124: p_pay_hist_rec.pmt_to_base_xrate_type,
4125: p_pay_hist_rec.pmt_to_base_xrate_date,
4126: p_pay_hist_rec.pmt_to_base_xrate,
4127: l_curr_calling_sequence);
4128:
4129: IF p_xla_event_rec.event_type_code IN
4130: ('PAYMENT CLEARED', 'PAYMENT CLEARING ADJUSTED') THEN
4131:
4132: l_pd_rec.cleared_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
4133: (l_bank_curr_amount,
4134: p_pay_hist_rec.bank_currency_code,
4135: ap_accounting_pay_pkg.g_base_currency_code,
4136: p_pay_hist_rec.bank_to_base_xrate_type,
4131:
4132: l_pd_rec.cleared_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
4133: (l_bank_curr_amount,
4134: p_pay_hist_rec.bank_currency_code,
4135: ap_accounting_pay_pkg.g_base_currency_code,
4136: p_pay_hist_rec.bank_to_base_xrate_type,
4137: p_pay_hist_rec.bank_to_base_xrate_date,
4138: p_pay_hist_rec.bank_to_base_xrate,
4139: l_curr_calling_sequence);
4137: p_pay_hist_rec.bank_to_base_xrate_date,
4138: p_pay_hist_rec.bank_to_base_xrate,
4139: l_curr_calling_sequence);
4140:
4141: l_pd_rec.paid_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
4142: (l_prorated_disc_amt,
4143: p_pay_hist_rec.pmt_currency_code,
4144: ap_accounting_pay_pkg.g_base_currency_code,
4145: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type,
4140:
4141: l_pd_rec.paid_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
4142: (l_prorated_disc_amt,
4143: p_pay_hist_rec.pmt_currency_code,
4144: ap_accounting_pay_pkg.g_base_currency_code,
4145: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type,
4146: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date,
4147: ap_accounting_pay_pkg.g_pmt_to_base_xrate,
4148: l_curr_calling_sequence);
4141: l_pd_rec.paid_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
4142: (l_prorated_disc_amt,
4143: p_pay_hist_rec.pmt_currency_code,
4144: ap_accounting_pay_pkg.g_base_currency_code,
4145: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type,
4146: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date,
4147: ap_accounting_pay_pkg.g_pmt_to_base_xrate,
4148: l_curr_calling_sequence);
4149:
4142: (l_prorated_disc_amt,
4143: p_pay_hist_rec.pmt_currency_code,
4144: ap_accounting_pay_pkg.g_base_currency_code,
4145: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type,
4146: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date,
4147: ap_accounting_pay_pkg.g_pmt_to_base_xrate,
4148: l_curr_calling_sequence);
4149:
4150: IF ap_accounting_pay_pkg.g_mat_to_base_xrate IS NOT NULL THEN
4143: p_pay_hist_rec.pmt_currency_code,
4144: ap_accounting_pay_pkg.g_base_currency_code,
4145: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type,
4146: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date,
4147: ap_accounting_pay_pkg.g_pmt_to_base_xrate,
4148: l_curr_calling_sequence);
4149:
4150: IF ap_accounting_pay_pkg.g_mat_to_base_xrate IS NOT NULL THEN
4151:
4146: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date,
4147: ap_accounting_pay_pkg.g_pmt_to_base_xrate,
4148: l_curr_calling_sequence);
4149:
4150: IF ap_accounting_pay_pkg.g_mat_to_base_xrate IS NOT NULL THEN
4151:
4152: l_pd_rec.matured_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
4153: (l_prorated_disc_amt,
4154: p_pay_hist_rec.pmt_currency_code,
4148: l_curr_calling_sequence);
4149:
4150: IF ap_accounting_pay_pkg.g_mat_to_base_xrate IS NOT NULL THEN
4151:
4152: l_pd_rec.matured_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
4153: (l_prorated_disc_amt,
4154: p_pay_hist_rec.pmt_currency_code,
4155: ap_accounting_pay_pkg.g_base_currency_code,
4156: ap_accounting_pay_pkg.g_mat_to_base_xrate_type,
4151:
4152: l_pd_rec.matured_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
4153: (l_prorated_disc_amt,
4154: p_pay_hist_rec.pmt_currency_code,
4155: ap_accounting_pay_pkg.g_base_currency_code,
4156: ap_accounting_pay_pkg.g_mat_to_base_xrate_type,
4157: ap_accounting_pay_pkg.g_mat_to_base_xrate_date,
4158: ap_accounting_pay_pkg.g_mat_to_base_xrate,
4159: l_curr_calling_sequence);
4152: l_pd_rec.matured_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
4153: (l_prorated_disc_amt,
4154: p_pay_hist_rec.pmt_currency_code,
4155: ap_accounting_pay_pkg.g_base_currency_code,
4156: ap_accounting_pay_pkg.g_mat_to_base_xrate_type,
4157: ap_accounting_pay_pkg.g_mat_to_base_xrate_date,
4158: ap_accounting_pay_pkg.g_mat_to_base_xrate,
4159: l_curr_calling_sequence);
4160: END IF ;
4153: (l_prorated_disc_amt,
4154: p_pay_hist_rec.pmt_currency_code,
4155: ap_accounting_pay_pkg.g_base_currency_code,
4156: ap_accounting_pay_pkg.g_mat_to_base_xrate_type,
4157: ap_accounting_pay_pkg.g_mat_to_base_xrate_date,
4158: ap_accounting_pay_pkg.g_mat_to_base_xrate,
4159: l_curr_calling_sequence);
4160: END IF ;
4161:
4154: p_pay_hist_rec.pmt_currency_code,
4155: ap_accounting_pay_pkg.g_base_currency_code,
4156: ap_accounting_pay_pkg.g_mat_to_base_xrate_type,
4157: ap_accounting_pay_pkg.g_mat_to_base_xrate_date,
4158: ap_accounting_pay_pkg.g_mat_to_base_xrate,
4159: l_curr_calling_sequence);
4160: END IF ;
4161:
4162: ELSIF p_xla_event_rec.event_type_code IN
4162: ELSIF p_xla_event_rec.event_type_code IN
4163: ('PAYMENT MATURED', 'PAYMENT MATURITY ADJUSTED') THEN
4164: l_pd_rec.matured_base_amount := l_prorated_base_amount;
4165:
4166: l_pd_rec.paid_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
4167: (l_prorated_disc_amt,
4168: p_pay_hist_rec.pmt_currency_code,
4169: ap_accounting_pay_pkg.g_base_currency_code,
4170: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type,
4165:
4166: l_pd_rec.paid_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
4167: (l_prorated_disc_amt,
4168: p_pay_hist_rec.pmt_currency_code,
4169: ap_accounting_pay_pkg.g_base_currency_code,
4170: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type,
4171: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date,
4172: ap_accounting_pay_pkg.g_pmt_to_base_xrate,
4173: l_curr_calling_sequence);
4166: l_pd_rec.paid_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
4167: (l_prorated_disc_amt,
4168: p_pay_hist_rec.pmt_currency_code,
4169: ap_accounting_pay_pkg.g_base_currency_code,
4170: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type,
4171: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date,
4172: ap_accounting_pay_pkg.g_pmt_to_base_xrate,
4173: l_curr_calling_sequence);
4174:
4167: (l_prorated_disc_amt,
4168: p_pay_hist_rec.pmt_currency_code,
4169: ap_accounting_pay_pkg.g_base_currency_code,
4170: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type,
4171: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date,
4172: ap_accounting_pay_pkg.g_pmt_to_base_xrate,
4173: l_curr_calling_sequence);
4174:
4175: ELSE
4168: p_pay_hist_rec.pmt_currency_code,
4169: ap_accounting_pay_pkg.g_base_currency_code,
4170: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type,
4171: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date,
4172: ap_accounting_pay_pkg.g_pmt_to_base_xrate,
4173: l_curr_calling_sequence);
4174:
4175: ELSE
4176: l_pd_rec.paid_base_amount := l_prorated_base_amount;
4191:
4192: ELSE
4193:
4194: l_pd_rec.invoice_dist_base_amount :=
4195: AP_Accounting_Pay_Pkg.Get_Base_Amount
4196: (l_inv_dist_amount,
4197: p_inv_rec.invoice_currency_code,
4198: ap_accounting_pay_pkg.g_base_currency_code,
4199: p_inv_rec.exchange_rate_type,
4194: l_pd_rec.invoice_dist_base_amount :=
4195: AP_Accounting_Pay_Pkg.Get_Base_Amount
4196: (l_inv_dist_amount,
4197: p_inv_rec.invoice_currency_code,
4198: ap_accounting_pay_pkg.g_base_currency_code,
4199: p_inv_rec.exchange_rate_type,
4200: p_inv_rec.exchange_date,
4201: p_inv_rec.exchange_rate,
4202: l_curr_calling_sequence);
4243: -- and inserts the calculated values into payment hist dists table
4244: ---------------------------------------------------------------------
4245:
4246: PROCEDURE Pay_Dist_ERV
4247: (p_xla_event_rec IN ap_accounting_pay_pkg.r_xla_event_info
4248: ,p_inv_pay_rec IN r_inv_pay_info
4249: ,p_pay_hist_rec IN ap_accounting_pay_pkg.r_pay_hist_info
4250: ,p_inv_rec IN ap_accounting_pay_pkg.r_invoices_info
4251: ,p_inv_dist_rec IN ap_accounting_pay_pkg.r_inv_dist_info
4245:
4246: PROCEDURE Pay_Dist_ERV
4247: (p_xla_event_rec IN ap_accounting_pay_pkg.r_xla_event_info
4248: ,p_inv_pay_rec IN r_inv_pay_info
4249: ,p_pay_hist_rec IN ap_accounting_pay_pkg.r_pay_hist_info
4250: ,p_inv_rec IN ap_accounting_pay_pkg.r_invoices_info
4251: ,p_inv_dist_rec IN ap_accounting_pay_pkg.r_inv_dist_info
4252: ,p_prorated_amount IN NUMBER
4253: ,p_calling_sequence IN VARCHAR2
4246: PROCEDURE Pay_Dist_ERV
4247: (p_xla_event_rec IN ap_accounting_pay_pkg.r_xla_event_info
4248: ,p_inv_pay_rec IN r_inv_pay_info
4249: ,p_pay_hist_rec IN ap_accounting_pay_pkg.r_pay_hist_info
4250: ,p_inv_rec IN ap_accounting_pay_pkg.r_invoices_info
4251: ,p_inv_dist_rec IN ap_accounting_pay_pkg.r_inv_dist_info
4252: ,p_prorated_amount IN NUMBER
4253: ,p_calling_sequence IN VARCHAR2
4254: ) IS
4247: (p_xla_event_rec IN ap_accounting_pay_pkg.r_xla_event_info
4248: ,p_inv_pay_rec IN r_inv_pay_info
4249: ,p_pay_hist_rec IN ap_accounting_pay_pkg.r_pay_hist_info
4250: ,p_inv_rec IN ap_accounting_pay_pkg.r_invoices_info
4251: ,p_inv_dist_rec IN ap_accounting_pay_pkg.r_inv_dist_info
4252: ,p_prorated_amount IN NUMBER
4253: ,p_calling_sequence IN VARCHAR2
4254: ) IS
4255:
4417: -- and inserts the calculated values into payment hist dists table
4418: ---------------------------------------------------------------------
4419:
4420: PROCEDURE Pay_Dist_Err_Chrg
4421: (p_xla_event_rec IN ap_accounting_pay_pkg.r_xla_event_info
4422: ,p_pay_hist_rec IN ap_accounting_pay_pkg.r_pay_hist_info
4423: ,p_distribute_mode IN VARCHAR2
4424: ,p_calling_sequence IN VARCHAR2
4425: ) IS
4418: ---------------------------------------------------------------------
4419:
4420: PROCEDURE Pay_Dist_Err_Chrg
4421: (p_xla_event_rec IN ap_accounting_pay_pkg.r_xla_event_info
4422: ,p_pay_hist_rec IN ap_accounting_pay_pkg.r_pay_hist_info
4423: ,p_distribute_mode IN VARCHAR2
4424: ,p_calling_sequence IN VARCHAR2
4425: ) IS
4426:
4551: /*Commented code removed*/
4552: -- Bug6901436. l_prorated_amount is in bank currency. Bank to base
4553: -- exchange rate details needs to be provided to Get_Base_Amount
4554: -- procedure.
4555: l_prorated_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
4556: (l_prorated_amt,
4557: p_pay_hist_rec.bank_currency_code,
4558: ap_accounting_pay_pkg.g_base_currency_code,
4559: p_pay_hist_rec.bank_to_base_xrate_type,
4554: -- procedure.
4555: l_prorated_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
4556: (l_prorated_amt,
4557: p_pay_hist_rec.bank_currency_code,
4558: ap_accounting_pay_pkg.g_base_currency_code,
4559: p_pay_hist_rec.bank_to_base_xrate_type,
4560: p_pay_hist_rec.bank_to_base_xrate_date,
4561: p_pay_hist_rec.bank_to_base_xrate,
4562: l_curr_calling_sequence);
4566: IF p_xla_event_rec.event_type_code IN
4567: ('PAYMENT CLEARED', 'PAYMENT CLEARING ADJUSTED') THEN
4568: l_pd_rec.cleared_base_amount := l_prorated_base_amount;
4569:
4570: l_pd_rec.paid_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
4571: (l_prorated_amt,
4572: p_pay_hist_rec.pmt_currency_code,
4573: ap_accounting_pay_pkg.g_base_currency_code,
4574: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type,
4569:
4570: l_pd_rec.paid_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
4571: (l_prorated_amt,
4572: p_pay_hist_rec.pmt_currency_code,
4573: ap_accounting_pay_pkg.g_base_currency_code,
4574: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type,
4575: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date,
4576: ap_accounting_pay_pkg.g_pmt_to_base_xrate,
4577: l_curr_calling_sequence);
4570: l_pd_rec.paid_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
4571: (l_prorated_amt,
4572: p_pay_hist_rec.pmt_currency_code,
4573: ap_accounting_pay_pkg.g_base_currency_code,
4574: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type,
4575: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date,
4576: ap_accounting_pay_pkg.g_pmt_to_base_xrate,
4577: l_curr_calling_sequence);
4578:
4571: (l_prorated_amt,
4572: p_pay_hist_rec.pmt_currency_code,
4573: ap_accounting_pay_pkg.g_base_currency_code,
4574: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type,
4575: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date,
4576: ap_accounting_pay_pkg.g_pmt_to_base_xrate,
4577: l_curr_calling_sequence);
4578:
4579: IF ap_accounting_pay_pkg.g_mat_to_base_xrate IS NOT NULL THEN
4572: p_pay_hist_rec.pmt_currency_code,
4573: ap_accounting_pay_pkg.g_base_currency_code,
4574: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type,
4575: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date,
4576: ap_accounting_pay_pkg.g_pmt_to_base_xrate,
4577: l_curr_calling_sequence);
4578:
4579: IF ap_accounting_pay_pkg.g_mat_to_base_xrate IS NOT NULL THEN
4580:
4575: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date,
4576: ap_accounting_pay_pkg.g_pmt_to_base_xrate,
4577: l_curr_calling_sequence);
4578:
4579: IF ap_accounting_pay_pkg.g_mat_to_base_xrate IS NOT NULL THEN
4580:
4581: l_pd_rec.matured_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
4582: (l_prorated_amt,
4583: p_pay_hist_rec.pmt_currency_code,
4577: l_curr_calling_sequence);
4578:
4579: IF ap_accounting_pay_pkg.g_mat_to_base_xrate IS NOT NULL THEN
4580:
4581: l_pd_rec.matured_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
4582: (l_prorated_amt,
4583: p_pay_hist_rec.pmt_currency_code,
4584: ap_accounting_pay_pkg.g_base_currency_code,
4585: ap_accounting_pay_pkg.g_mat_to_base_xrate_type,
4580:
4581: l_pd_rec.matured_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
4582: (l_prorated_amt,
4583: p_pay_hist_rec.pmt_currency_code,
4584: ap_accounting_pay_pkg.g_base_currency_code,
4585: ap_accounting_pay_pkg.g_mat_to_base_xrate_type,
4586: ap_accounting_pay_pkg.g_mat_to_base_xrate_date,
4587: ap_accounting_pay_pkg.g_mat_to_base_xrate,
4588: l_curr_calling_sequence);
4581: l_pd_rec.matured_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
4582: (l_prorated_amt,
4583: p_pay_hist_rec.pmt_currency_code,
4584: ap_accounting_pay_pkg.g_base_currency_code,
4585: ap_accounting_pay_pkg.g_mat_to_base_xrate_type,
4586: ap_accounting_pay_pkg.g_mat_to_base_xrate_date,
4587: ap_accounting_pay_pkg.g_mat_to_base_xrate,
4588: l_curr_calling_sequence);
4589: END IF ;
4582: (l_prorated_amt,
4583: p_pay_hist_rec.pmt_currency_code,
4584: ap_accounting_pay_pkg.g_base_currency_code,
4585: ap_accounting_pay_pkg.g_mat_to_base_xrate_type,
4586: ap_accounting_pay_pkg.g_mat_to_base_xrate_date,
4587: ap_accounting_pay_pkg.g_mat_to_base_xrate,
4588: l_curr_calling_sequence);
4589: END IF ;
4590: ELSIF p_xla_event_rec.event_type_code IN
4583: p_pay_hist_rec.pmt_currency_code,
4584: ap_accounting_pay_pkg.g_base_currency_code,
4585: ap_accounting_pay_pkg.g_mat_to_base_xrate_type,
4586: ap_accounting_pay_pkg.g_mat_to_base_xrate_date,
4587: ap_accounting_pay_pkg.g_mat_to_base_xrate,
4588: l_curr_calling_sequence);
4589: END IF ;
4590: ELSIF p_xla_event_rec.event_type_code IN
4591: ('PAYMENT MATURED', 'PAYMENT MATURITY ADJUSTED') THEN
4590: ELSIF p_xla_event_rec.event_type_code IN
4591: ('PAYMENT MATURED', 'PAYMENT MATURITY ADJUSTED') THEN
4592: l_pd_rec.matured_base_amount := l_prorated_base_amount;
4593:
4594: l_pd_rec.paid_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
4595: (l_prorated_amt,
4596: p_pay_hist_rec.pmt_currency_code,
4597: ap_accounting_pay_pkg.g_base_currency_code,
4598: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type,
4593:
4594: l_pd_rec.paid_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
4595: (l_prorated_amt,
4596: p_pay_hist_rec.pmt_currency_code,
4597: ap_accounting_pay_pkg.g_base_currency_code,
4598: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type,
4599: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date,
4600: ap_accounting_pay_pkg.g_pmt_to_base_xrate,
4601: l_curr_calling_sequence);
4594: l_pd_rec.paid_base_amount := AP_Accounting_Pay_Pkg.Get_Base_Amount
4595: (l_prorated_amt,
4596: p_pay_hist_rec.pmt_currency_code,
4597: ap_accounting_pay_pkg.g_base_currency_code,
4598: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type,
4599: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date,
4600: ap_accounting_pay_pkg.g_pmt_to_base_xrate,
4601: l_curr_calling_sequence);
4602:
4595: (l_prorated_amt,
4596: p_pay_hist_rec.pmt_currency_code,
4597: ap_accounting_pay_pkg.g_base_currency_code,
4598: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type,
4599: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date,
4600: ap_accounting_pay_pkg.g_pmt_to_base_xrate,
4601: l_curr_calling_sequence);
4602:
4603: ELSE
4596: p_pay_hist_rec.pmt_currency_code,
4597: ap_accounting_pay_pkg.g_base_currency_code,
4598: ap_accounting_pay_pkg.g_pmt_to_base_xrate_type,
4599: ap_accounting_pay_pkg.g_pmt_to_base_xrate_date,
4600: ap_accounting_pay_pkg.g_pmt_to_base_xrate,
4601: l_curr_calling_sequence);
4602:
4603: ELSE
4604: l_pd_rec.paid_base_amount := l_prorated_base_amount;
4648: ---------------------------------------------------------------------
4649:
4650: -- Bug 6887295. Added parameter p_inv_dist_rec
4651: PROCEDURE Pay_Dist_Reverse
4652: (p_xla_event_rec IN ap_accounting_pay_pkg.r_xla_event_info
4653: ,p_inv_pay_rec IN r_inv_pay_info
4654: ,p_pay_hist_rec IN ap_accounting_pay_pkg.r_pay_hist_info
4655: ,p_reversal_inv_pmt_id IN NUMBER
4656: ,p_related_event_id IN NUMBER
4650: -- Bug 6887295. Added parameter p_inv_dist_rec
4651: PROCEDURE Pay_Dist_Reverse
4652: (p_xla_event_rec IN ap_accounting_pay_pkg.r_xla_event_info
4653: ,p_inv_pay_rec IN r_inv_pay_info
4654: ,p_pay_hist_rec IN ap_accounting_pay_pkg.r_pay_hist_info
4655: ,p_reversal_inv_pmt_id IN NUMBER
4656: ,p_related_event_id IN NUMBER
4657: ,p_invoice_dist_id IN NUMBER
4658: ,p_inv_dist_rec IN ap_accounting_pay_pkg.r_inv_dist_info
4654: ,p_pay_hist_rec IN ap_accounting_pay_pkg.r_pay_hist_info
4655: ,p_reversal_inv_pmt_id IN NUMBER
4656: ,p_related_event_id IN NUMBER
4657: ,p_invoice_dist_id IN NUMBER
4658: ,p_inv_dist_rec IN ap_accounting_pay_pkg.r_inv_dist_info
4659: ,p_calling_sequence IN VARCHAR2
4660: ) IS
4661:
4662: l_curr_calling_sequence VARCHAR2(2000);
5383: -- ap_payment_hist_dists table
5384: ----------------------------------------------------------------------------------
5385:
5386: PROCEDURE Upg_Dist_Links_Insert
5387: (p_xla_event_rec IN ap_accounting_pay_pkg.r_xla_event_info
5388: ,p_payment_history_id IN NUMBER
5389: ,p_accounting_event_id IN NUMBER
5390: ,p_calling_sequence IN VARCHAR2
5391: ) IS