1: PACKAGE BODY ARP_RECON_REP as
2: /* $Header: ARGLRECB.pls 120.49.12020000.9 2013/04/02 02:34:14 kkikkise ship $ */
3:
4: PG_DEBUG varchar2(1) := NVL(FND_PROFILE.value('AFLOG_ENABLED'), 'N');
5: LOG_LEVEL varchar2(1) := NVL(FND_PROFILE.value('AFLOG_LEVEL'), '6');
16: ========================================================================*/
17:
18: FUNCTION get_reporting_level return VARCHAR2 is
19: BEGIN
20: return arp_recon_rep.var_tname.g_reporting_level;
21: END get_reporting_level;
22:
23: /*========================================================================+
24: Function which returns the global variable g_reporting_entity_id
25: ========================================================================*/
26:
27: FUNCTION get_reporting_entity_id return NUMBER is
28: BEGIN
29: return arp_recon_rep.var_tname.g_reporting_entity_id;
30: END get_reporting_entity_id;
31:
32: /*========================================================================+
33: Function which returns the global variable g_set_of_books_id
34: ========================================================================*/
35:
36: FUNCTION get_set_of_books_id return NUMBER is
37: BEGIN
38: return arp_recon_rep.var_tname.g_set_of_books_id;
39: END get_set_of_books_id;
40:
41: /*========================================================================+
42: Function which returns the global variable g_chart_of_accounts_id
43: ========================================================================*/
44:
45: FUNCTION get_chart_of_accounts_id return NUMBER is
46: BEGIN
47: return arp_recon_rep.var_tname.g_chart_of_accounts_id;
48: END get_chart_of_accounts_id;
49:
50: /*========================================================================+
51: Function which returns the global variable g_gl_date_from
52: ========================================================================*/
53:
54: FUNCTION get_gl_date_from return DATE is
55: BEGIN
56: return arp_recon_rep.var_tname.g_gl_date_from;
57: END get_gl_date_from;
58:
59: /*========================================================================+
60: Function which returns the global variable g_gl_date_to
61: ========================================================================*/
62:
63: FUNCTION get_gl_date_to return DATE is
64: BEGIN
65: return arp_recon_rep.var_tname.g_gl_date_to;
66: END get_gl_date_to;
67:
68: /*========================================================================+
69: Function which returns the global variable g_posting_status
70: ========================================================================*/
71:
72: FUNCTION get_posting_status return VARCHAR2 is
73: BEGIN
74: return arp_recon_rep.var_tname.g_posting_status;
75: END get_posting_status;
76:
77: /*========================================================================+
78: Function which returns the maximum gl_date possible
79: ========================================================================*/
80:
81: FUNCTION get_max_gl_date return DATE IS
82: BEGIN
83: return arp_recon_rep.var_tname.g_max_gl_date;
84: END get_max_gl_date;
85:
86: /*========================================================================+
87: Function which returns the period name
88: ========================================================================*/
89:
90: FUNCTION get_period_name return VARCHAR2 IS
91: BEGIN
92: return arp_recon_rep.var_tname.g_period_name;
93: END get_period_name;
94:
95: /*========================================================================+
96: Function which returns the functional currency
97: ========================================================================*/
98:
99: FUNCTION get_functional_currency return VARCHAR2 IS
100: BEGIN
101: return arp_recon_rep.var_tname.g_functional_currency;
102: END get_functional_currency;
103:
104: /*========================================================================+
105: Function which returns the value of g_out_of_balance_only
106: ========================================================================*/
107:
108: FUNCTION get_out_of_balance_only return VARCHAR2 IS
109: BEGIN
110: return arp_recon_rep.var_tname.g_out_of_balance_only;
111: END get_out_of_balance_only;
112:
113: /*========================================================================+
114: | PUBLIC PROCEDURE GET_DETAIL_ACCOUNTS |
279: * report from reporting responsibility it would still work and in this case even though
280: * report is run for reporting book we still need to point to regular AR views
281: */
282: /* Set the table names based on the sob type */
283: arp_recon_rep.var_tname.l_ar_system_parameters_all := 'ar_system_parameters';
284: arp_recon_rep.var_tname.l_ar_payment_schedules_all := 'ar_payment_schedules';
285: arp_recon_rep.var_tname.l_ar_adjustments_all := 'ar_adjustments';
286: arp_recon_rep.var_tname.l_ar_cash_receipt_history_all := 'ar_cash_receipt_history';
287: arp_recon_rep.var_tname.l_ar_batches_all := 'ar_batches';
280: * report is run for reporting book we still need to point to regular AR views
281: */
282: /* Set the table names based on the sob type */
283: arp_recon_rep.var_tname.l_ar_system_parameters_all := 'ar_system_parameters';
284: arp_recon_rep.var_tname.l_ar_payment_schedules_all := 'ar_payment_schedules';
285: arp_recon_rep.var_tname.l_ar_adjustments_all := 'ar_adjustments';
286: arp_recon_rep.var_tname.l_ar_cash_receipt_history_all := 'ar_cash_receipt_history';
287: arp_recon_rep.var_tname.l_ar_batches_all := 'ar_batches';
288: arp_recon_rep.var_tname.l_ar_cash_receipts_all := 'ar_cash_receipts';
281: */
282: /* Set the table names based on the sob type */
283: arp_recon_rep.var_tname.l_ar_system_parameters_all := 'ar_system_parameters';
284: arp_recon_rep.var_tname.l_ar_payment_schedules_all := 'ar_payment_schedules';
285: arp_recon_rep.var_tname.l_ar_adjustments_all := 'ar_adjustments';
286: arp_recon_rep.var_tname.l_ar_cash_receipt_history_all := 'ar_cash_receipt_history';
287: arp_recon_rep.var_tname.l_ar_batches_all := 'ar_batches';
288: arp_recon_rep.var_tname.l_ar_cash_receipts_all := 'ar_cash_receipts';
289:
282: /* Set the table names based on the sob type */
283: arp_recon_rep.var_tname.l_ar_system_parameters_all := 'ar_system_parameters';
284: arp_recon_rep.var_tname.l_ar_payment_schedules_all := 'ar_payment_schedules';
285: arp_recon_rep.var_tname.l_ar_adjustments_all := 'ar_adjustments';
286: arp_recon_rep.var_tname.l_ar_cash_receipt_history_all := 'ar_cash_receipt_history';
287: arp_recon_rep.var_tname.l_ar_batches_all := 'ar_batches';
288: arp_recon_rep.var_tname.l_ar_cash_receipts_all := 'ar_cash_receipts';
289:
290: -- BUG#4429368 Replace ar_distributions_all by ar_xla_ard_lines_v
283: arp_recon_rep.var_tname.l_ar_system_parameters_all := 'ar_system_parameters';
284: arp_recon_rep.var_tname.l_ar_payment_schedules_all := 'ar_payment_schedules';
285: arp_recon_rep.var_tname.l_ar_adjustments_all := 'ar_adjustments';
286: arp_recon_rep.var_tname.l_ar_cash_receipt_history_all := 'ar_cash_receipt_history';
287: arp_recon_rep.var_tname.l_ar_batches_all := 'ar_batches';
288: arp_recon_rep.var_tname.l_ar_cash_receipts_all := 'ar_cash_receipts';
289:
290: -- BUG#4429368 Replace ar_distributions_all by ar_xla_ard_lines_v
291: arp_recon_rep.var_tname.l_ar_distributions_all := 'ar_xla_ard_lines_v';
284: arp_recon_rep.var_tname.l_ar_payment_schedules_all := 'ar_payment_schedules';
285: arp_recon_rep.var_tname.l_ar_adjustments_all := 'ar_adjustments';
286: arp_recon_rep.var_tname.l_ar_cash_receipt_history_all := 'ar_cash_receipt_history';
287: arp_recon_rep.var_tname.l_ar_batches_all := 'ar_batches';
288: arp_recon_rep.var_tname.l_ar_cash_receipts_all := 'ar_cash_receipts';
289:
290: -- BUG#4429368 Replace ar_distributions_all by ar_xla_ard_lines_v
291: arp_recon_rep.var_tname.l_ar_distributions_all := 'ar_xla_ard_lines_v';
292:
287: arp_recon_rep.var_tname.l_ar_batches_all := 'ar_batches';
288: arp_recon_rep.var_tname.l_ar_cash_receipts_all := 'ar_cash_receipts';
289:
290: -- BUG#4429368 Replace ar_distributions_all by ar_xla_ard_lines_v
291: arp_recon_rep.var_tname.l_ar_distributions_all := 'ar_xla_ard_lines_v';
292:
293: arp_recon_rep.var_tname.l_ra_customer_trx_all := 'ra_customer_trx';
294: arp_recon_rep.var_tname.l_ra_batches_all := 'ra_batches';
295:
289:
290: -- BUG#4429368 Replace ar_distributions_all by ar_xla_ard_lines_v
291: arp_recon_rep.var_tname.l_ar_distributions_all := 'ar_xla_ard_lines_v';
292:
293: arp_recon_rep.var_tname.l_ra_customer_trx_all := 'ra_customer_trx';
294: arp_recon_rep.var_tname.l_ra_batches_all := 'ra_batches';
295:
296: -- BUG#4429368 Replace ra_cust_trx_line_gl_dist_all by ar_xla_ctlgd_lines_v
297: arp_recon_rep.var_tname.l_ra_cust_trx_gl_dist_all := 'ar_xla_ctlgd_lines_v';
290: -- BUG#4429368 Replace ar_distributions_all by ar_xla_ard_lines_v
291: arp_recon_rep.var_tname.l_ar_distributions_all := 'ar_xla_ard_lines_v';
292:
293: arp_recon_rep.var_tname.l_ra_customer_trx_all := 'ra_customer_trx';
294: arp_recon_rep.var_tname.l_ra_batches_all := 'ra_batches';
295:
296: -- BUG#4429368 Replace ra_cust_trx_line_gl_dist_all by ar_xla_ctlgd_lines_v
297: arp_recon_rep.var_tname.l_ra_cust_trx_gl_dist_all := 'ar_xla_ctlgd_lines_v';
298:
293: arp_recon_rep.var_tname.l_ra_customer_trx_all := 'ra_customer_trx';
294: arp_recon_rep.var_tname.l_ra_batches_all := 'ra_batches';
295:
296: -- BUG#4429368 Replace ra_cust_trx_line_gl_dist_all by ar_xla_ctlgd_lines_v
297: arp_recon_rep.var_tname.l_ra_cust_trx_gl_dist_all := 'ar_xla_ctlgd_lines_v';
298:
299: arp_recon_rep.var_tname.l_ar_misc_cash_dists_all := 'ar_misc_cash_distributions';
300: arp_recon_rep.var_tname.l_ar_rate_adjustments_all := 'ar_rate_adjustments';
301: arp_recon_rep.var_tname.l_ar_receivable_apps_all := 'ar_receivable_applications';
295:
296: -- BUG#4429368 Replace ra_cust_trx_line_gl_dist_all by ar_xla_ctlgd_lines_v
297: arp_recon_rep.var_tname.l_ra_cust_trx_gl_dist_all := 'ar_xla_ctlgd_lines_v';
298:
299: arp_recon_rep.var_tname.l_ar_misc_cash_dists_all := 'ar_misc_cash_distributions';
300: arp_recon_rep.var_tname.l_ar_rate_adjustments_all := 'ar_rate_adjustments';
301: arp_recon_rep.var_tname.l_ar_receivable_apps_all := 'ar_receivable_applications';
302:
303: log('INIT (-)');
296: -- BUG#4429368 Replace ra_cust_trx_line_gl_dist_all by ar_xla_ctlgd_lines_v
297: arp_recon_rep.var_tname.l_ra_cust_trx_gl_dist_all := 'ar_xla_ctlgd_lines_v';
298:
299: arp_recon_rep.var_tname.l_ar_misc_cash_dists_all := 'ar_misc_cash_distributions';
300: arp_recon_rep.var_tname.l_ar_rate_adjustments_all := 'ar_rate_adjustments';
301: arp_recon_rep.var_tname.l_ar_receivable_apps_all := 'ar_receivable_applications';
302:
303: log('INIT (-)');
304:
297: arp_recon_rep.var_tname.l_ra_cust_trx_gl_dist_all := 'ar_xla_ctlgd_lines_v';
298:
299: arp_recon_rep.var_tname.l_ar_misc_cash_dists_all := 'ar_misc_cash_distributions';
300: arp_recon_rep.var_tname.l_ar_rate_adjustments_all := 'ar_rate_adjustments';
301: arp_recon_rep.var_tname.l_ar_receivable_apps_all := 'ar_receivable_applications';
302:
303: log('INIT (-)');
304:
305: END INIT;
421:
422: log ('aradj_journal_load_xml (+)');
423:
424: /* Assign the input parameters to the global variables */
425: arp_recon_rep.var_tname.g_reporting_level := p_reporting_level;
426: arp_recon_rep.var_tname.g_reporting_entity_id := p_reporting_entity_id;
427: /* bug 5654975 p_coa_id,p_sob_id is passed incorrectly when the user
428: has access to multiple Ledgers */
429: -- arp_recon_rep.var_tname.g_set_of_books_id := p_sob_id;
422: log ('aradj_journal_load_xml (+)');
423:
424: /* Assign the input parameters to the global variables */
425: arp_recon_rep.var_tname.g_reporting_level := p_reporting_level;
426: arp_recon_rep.var_tname.g_reporting_entity_id := p_reporting_entity_id;
427: /* bug 5654975 p_coa_id,p_sob_id is passed incorrectly when the user
428: has access to multiple Ledgers */
429: -- arp_recon_rep.var_tname.g_set_of_books_id := p_sob_id;
430: -- arp_recon_rep.var_tname.g_chart_of_accounts_id := p_coa_id;
425: arp_recon_rep.var_tname.g_reporting_level := p_reporting_level;
426: arp_recon_rep.var_tname.g_reporting_entity_id := p_reporting_entity_id;
427: /* bug 5654975 p_coa_id,p_sob_id is passed incorrectly when the user
428: has access to multiple Ledgers */
429: -- arp_recon_rep.var_tname.g_set_of_books_id := p_sob_id;
430: -- arp_recon_rep.var_tname.g_chart_of_accounts_id := p_coa_id;
431: arp_recon_rep.var_tname.g_gl_date_from := fnd_date.canonical_to_date(p_gl_date_from);
432: arp_recon_rep.var_tname.g_gl_date_to := fnd_date.canonical_to_date(p_gl_date_to);
433: arp_recon_rep.var_tname.g_posting_status := p_posting_status;
426: arp_recon_rep.var_tname.g_reporting_entity_id := p_reporting_entity_id;
427: /* bug 5654975 p_coa_id,p_sob_id is passed incorrectly when the user
428: has access to multiple Ledgers */
429: -- arp_recon_rep.var_tname.g_set_of_books_id := p_sob_id;
430: -- arp_recon_rep.var_tname.g_chart_of_accounts_id := p_coa_id;
431: arp_recon_rep.var_tname.g_gl_date_from := fnd_date.canonical_to_date(p_gl_date_from);
432: arp_recon_rep.var_tname.g_gl_date_to := fnd_date.canonical_to_date(p_gl_date_to);
433: arp_recon_rep.var_tname.g_posting_status := p_posting_status;
434:
427: /* bug 5654975 p_coa_id,p_sob_id is passed incorrectly when the user
428: has access to multiple Ledgers */
429: -- arp_recon_rep.var_tname.g_set_of_books_id := p_sob_id;
430: -- arp_recon_rep.var_tname.g_chart_of_accounts_id := p_coa_id;
431: arp_recon_rep.var_tname.g_gl_date_from := fnd_date.canonical_to_date(p_gl_date_from);
432: arp_recon_rep.var_tname.g_gl_date_to := fnd_date.canonical_to_date(p_gl_date_to);
433: arp_recon_rep.var_tname.g_posting_status := p_posting_status;
434:
435: /* Added Conditional Implication to address bug:5181586*/
428: has access to multiple Ledgers */
429: -- arp_recon_rep.var_tname.g_set_of_books_id := p_sob_id;
430: -- arp_recon_rep.var_tname.g_chart_of_accounts_id := p_coa_id;
431: arp_recon_rep.var_tname.g_gl_date_from := fnd_date.canonical_to_date(p_gl_date_from);
432: arp_recon_rep.var_tname.g_gl_date_to := fnd_date.canonical_to_date(p_gl_date_to);
433: arp_recon_rep.var_tname.g_posting_status := p_posting_status;
434:
435: /* Added Conditional Implication to address bug:5181586*/
436: IF p_reporting_level = 1000 THEN
429: -- arp_recon_rep.var_tname.g_set_of_books_id := p_sob_id;
430: -- arp_recon_rep.var_tname.g_chart_of_accounts_id := p_coa_id;
431: arp_recon_rep.var_tname.g_gl_date_from := fnd_date.canonical_to_date(p_gl_date_from);
432: arp_recon_rep.var_tname.g_gl_date_to := fnd_date.canonical_to_date(p_gl_date_to);
433: arp_recon_rep.var_tname.g_posting_status := p_posting_status;
434:
435: /* Added Conditional Implication to address bug:5181586*/
436: IF p_reporting_level = 1000 THEN
437: SELECT sob.name sob_name,
442: l_sob_id,
443: l_functional_currency,
444: l_coa_id
445: FROM gl_sets_of_books sob
446: WHERE sob.set_of_books_id = arp_recon_rep.var_tname.g_reporting_entity_id;
447:
448: ELSIF p_reporting_level = 3000 THEN
449: SELECT sob.name sob_name,
450: sob.set_of_books_id,
456: l_coa_id
457: FROM gl_sets_of_books sob,
458: ar_system_parameters sysparam
459: WHERE sob.set_of_books_id = sysparam.set_of_books_id
460: AND sysparam.org_id = arp_recon_rep.var_tname.g_reporting_entity_id;
461:
462: END IF;
463: /* Changes for bug:5181586 ends*/
464:
461:
462: END IF;
463: /* Changes for bug:5181586 ends*/
464:
465: arp_recon_rep.var_tname.g_chart_of_accounts_id := l_coa_id;
466: arp_recon_rep.var_tname.g_set_of_books_id := l_sob_id;
467:
468: /* Initialize the reporting context */
469: init(p_sob_id);
462: END IF;
463: /* Changes for bug:5181586 ends*/
464:
465: arp_recon_rep.var_tname.g_chart_of_accounts_id := l_coa_id;
466: arp_recon_rep.var_tname.g_set_of_books_id := l_sob_id;
467:
468: /* Initialize the reporting context */
469: init(p_sob_id);
470:
483: l_sysparam_org_where := XLA_MO_REPORTING_API.Get_Predicate('sysparam',NULL);
484:
485: /* Replace the bind variables with global functions */
486: l_adj_org_where := replace(l_adj_org_where,
487: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
488: l_ard_org_where := replace(l_ard_org_where,
489: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
490: l_trx_org_where := replace(l_trx_org_where,
491: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
485: /* Replace the bind variables with global functions */
486: l_adj_org_where := replace(l_adj_org_where,
487: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
488: l_ard_org_where := replace(l_ard_org_where,
489: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
490: l_trx_org_where := replace(l_trx_org_where,
491: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
492: l_pay_org_where := replace(l_pay_org_where,
493: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
487: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
488: l_ard_org_where := replace(l_ard_org_where,
489: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
490: l_trx_org_where := replace(l_trx_org_where,
491: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
492: l_pay_org_where := replace(l_pay_org_where,
493: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
494: l_rec_org_where := replace(l_rec_org_where,
495: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
489: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
490: l_trx_org_where := replace(l_trx_org_where,
491: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
492: l_pay_org_where := replace(l_pay_org_where,
493: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
494: l_rec_org_where := replace(l_rec_org_where,
495: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
496: l_type_org_where := replace(l_type_org_where,
497: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
491: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
492: l_pay_org_where := replace(l_pay_org_where,
493: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
494: l_rec_org_where := replace(l_rec_org_where,
495: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
496: l_type_org_where := replace(l_type_org_where,
497: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
498: l_sysparam_org_where := replace(l_sysparam_org_where,
499: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
493: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
494: l_rec_org_where := replace(l_rec_org_where,
495: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
496: l_type_org_where := replace(l_type_org_where,
497: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
498: l_sysparam_org_where := replace(l_sysparam_org_where,
499: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
500:
501:
495: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
496: l_type_org_where := replace(l_type_org_where,
497: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
498: l_sysparam_org_where := replace(l_sysparam_org_where,
499: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
500:
501:
502: l_reporting_entity_name := substrb(XLA_MO_REPORTING_API.get_reporting_entity_name,1,80);
503: l_reporting_level_name := substrb(XLA_MO_REPORTING_API.get_reporting_level_name,1,30);
514:
515: /* Bug fix 4942083*/
516: IF arp_util.Open_Period_Exists(p_reporting_level,
517: p_reporting_entity_id,
518: arp_recon_rep.var_tname.g_gl_date_from,
519: arp_recon_rep.var_tname.g_gl_date_to) THEN
520: FND_MESSAGE.SET_NAME('AR','AR_REPORT_ACC_NOT_GEN');--Changed as per Bug 5578884 the parameter to AR from FND as the message is in AR product
521: l_message_acct := FND_MESSAGE.Get;
522: END IF;
515: /* Bug fix 4942083*/
516: IF arp_util.Open_Period_Exists(p_reporting_level,
517: p_reporting_entity_id,
518: arp_recon_rep.var_tname.g_gl_date_from,
519: arp_recon_rep.var_tname.g_gl_date_to) THEN
520: FND_MESSAGE.SET_NAME('AR','AR_REPORT_ACC_NOT_GEN');--Changed as per Bug 5578884 the parameter to AR from FND as the message is in AR product
521: l_message_acct := FND_MESSAGE.Get;
522: END IF;
523:
525: IF p_reporting_level = '3000' THEN
526: select substrb(hou.name,1,60)
527: into l_organization
528: from hr_organization_units hou
529: where hou.organization_id = arp_recon_rep.var_tname.g_reporting_entity_id;
530: ELSE
531: select meaning
532: into l_organization
533: from ar_lookups
574:
575: IF p_gl_date_from IS NULL and p_gl_date_to IS NULL THEN
576: l_gl_date_where := NULL;
577: ELSIF p_gl_date_from IS NULL THEN
578: l_gl_date_where :=' and adj.gl_date <= arp_recon_rep.get_gl_date_to()';
579: ELSIF p_gl_date_to IS NULL THEN
580: l_gl_date_where :=' and adj.gl_date >= arp_recon_rep.get_gl_date_from() ' ;
581: ELSE
582: l_gl_date_where := ' and adj.gl_date between arp_recon_rep.get_gl_date_from() and arp_recon_rep.get_gl_date_to() ';
576: l_gl_date_where := NULL;
577: ELSIF p_gl_date_from IS NULL THEN
578: l_gl_date_where :=' and adj.gl_date <= arp_recon_rep.get_gl_date_to()';
579: ELSIF p_gl_date_to IS NULL THEN
580: l_gl_date_where :=' and adj.gl_date >= arp_recon_rep.get_gl_date_from() ' ;
581: ELSE
582: l_gl_date_where := ' and adj.gl_date between arp_recon_rep.get_gl_date_from() and arp_recon_rep.get_gl_date_to() ';
583: END IF;
584:
578: l_gl_date_where :=' and adj.gl_date <= arp_recon_rep.get_gl_date_to()';
579: ELSIF p_gl_date_to IS NULL THEN
580: l_gl_date_where :=' and adj.gl_date >= arp_recon_rep.get_gl_date_from() ' ;
581: ELSE
582: l_gl_date_where := ' and adj.gl_date between arp_recon_rep.get_gl_date_from() and arp_recon_rep.get_gl_date_to() ';
583: END IF;
584:
585: IF p_gl_account_low IS NOT NULL AND p_gl_account_high IS NOT NULL THEN
586: l_account_where := ' AND ' || AR_CALC_AGING.FLEX_SQL(
603: FROM fnd_segment_attribute_values fcav,
604: fnd_id_flex_segments fifs
605: WHERE fcav.application_id = 101
606: AND fcav.id_flex_code = 'GL#'
607: AND fcav.id_flex_num = arp_recon_rep.var_tname.g_chart_of_accounts_id
608: AND fcav.attribute_value = 'Y'
609: AND fcav.segment_attribute_type = 'GL_ACCOUNT'
610: AND fifs.application_id = fcav.application_id
611: AND fifs.id_flex_code = fcav.id_flex_code
639: select meaning
640: into l_status_meaning
641: from ar_lookups
642: where lookup_type = 'POSTED_STATUS'
643: and lookup_code = arp_recon_rep.var_tname.g_posting_status;
644:
645: l_posting_status_where := 'and nvl(adj.gl_posted_date,TO_DATE(''01/01/0001'',''MM/DD/YYYY'')) =
646: decode(arp_recon_rep.get_posting_status(),
647: ''POSTED'',adj.gl_posted_date,
642: where lookup_type = 'POSTED_STATUS'
643: and lookup_code = arp_recon_rep.var_tname.g_posting_status;
644:
645: l_posting_status_where := 'and nvl(adj.gl_posted_date,TO_DATE(''01/01/0001'',''MM/DD/YYYY'')) =
646: decode(arp_recon_rep.get_posting_status(),
647: ''POSTED'',adj.gl_posted_date,
648: ''UNPOSTED'',TO_DATE(''01/01/0001'',''MM/DD/YYYY''),
649: nvl(adj.gl_posted_date,TO_DATE(''01/01/0001'',''MM/DD/YYYY'')))';
650: ELSE
672: nvl(ard.acctd_amount_dr,0) acctd_debit,
673: nvl(ard.acctd_amount_cr,0) acctd_credit,
674: gc.code_combination_id account_code_combination_id,
675: l_cat.meaning category,
676: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
677: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
678: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
679: from hz_cust_accounts cust,
680: hz_parties party,
673: nvl(ard.acctd_amount_cr,0) acctd_credit,
674: gc.code_combination_id account_code_combination_id,
675: l_cat.meaning category,
676: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
677: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
678: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
679: from hz_cust_accounts cust,
680: hz_parties party,
681: ra_cust_trx_types type,
674: gc.code_combination_id account_code_combination_id,
675: l_cat.meaning category,
676: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
677: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
678: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
679: from hz_cust_accounts cust,
680: hz_parties party,
681: ra_cust_trx_types type,
682: gl_code_combinations gc,
679: from hz_cust_accounts cust,
680: hz_parties party,
681: ra_cust_trx_types type,
682: gl_code_combinations gc,
683: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' pay,
684: ar_receivables_trx rec,
685: '||arp_recon_rep.var_tname.l_ra_customer_trx_all||' trx,
686: '||arp_recon_rep.var_tname.l_ar_adjustments_all||' adj,
687: '||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
681: ra_cust_trx_types type,
682: gl_code_combinations gc,
683: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' pay,
684: ar_receivables_trx rec,
685: '||arp_recon_rep.var_tname.l_ra_customer_trx_all||' trx,
686: '||arp_recon_rep.var_tname.l_ar_adjustments_all||' adj,
687: '||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
688: ar_lookups look,
689: ar_lookups l_cat
682: gl_code_combinations gc,
683: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' pay,
684: ar_receivables_trx rec,
685: '||arp_recon_rep.var_tname.l_ra_customer_trx_all||' trx,
686: '||arp_recon_rep.var_tname.l_ar_adjustments_all||' adj,
687: '||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
688: ar_lookups look,
689: ar_lookups l_cat
690: where trx.complete_flag = ''Y''
683: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' pay,
684: ar_receivables_trx rec,
685: '||arp_recon_rep.var_tname.l_ra_customer_trx_all||' trx,
686: '||arp_recon_rep.var_tname.l_ar_adjustments_all||' adj,
687: '||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
688: ar_lookups look,
689: ar_lookups l_cat
690: where trx.complete_flag = ''Y''
691: and cust.cust_account_id = trx.bill_to_customer_id
689: ar_lookups l_cat
690: where trx.complete_flag = ''Y''
691: and cust.cust_account_id = trx.bill_to_customer_id
692: and cust.party_id = party.party_id
693: and trx.set_of_books_id = arp_recon_rep.get_set_of_books_id()
694: and trx.cust_trx_type_id = type.cust_trx_type_id
695: and trx.customer_trx_id = pay.customer_trx_id
696: and pay.payment_schedule_id = adj.payment_schedule_id
697: and nvl(adj.status, ''A'') = ''A''
706: and nvl(rec.org_id,-99) = nvl(trx.org_id,-99)
707: and ard.source_id = adj.adjustment_id
708: and ard.source_table = ''ADJ''
709: and gc.code_combination_id = ard.code_combination_id
710: and gc.chart_of_accounts_id = arp_recon_rep.get_chart_of_accounts_id()
711: and l_cat.lookup_type = ''ARRGTA_FUNCTION_MAPPING''
712: and l_cat.lookup_code = (''ADJ_''||ard.source_type)
713: '||l_adj_org_where||'
714: '||l_ard_org_where||'
941:
942:
943:
944: /* Assign the input parameters to the global variables */
945: arp_recon_rep.var_tname.g_reporting_level := p_reporting_level;
946: arp_recon_rep.var_tname.g_reporting_entity_id := p_reporting_entity_id;
947: /* bug 5654975 p_sob_id is passed incorrectly when the user
948: has access to multiple Ledgers */
949: -- arp_recon_rep.var_tname.g_set_of_books_id := p_sob_id;
942:
943:
944: /* Assign the input parameters to the global variables */
945: arp_recon_rep.var_tname.g_reporting_level := p_reporting_level;
946: arp_recon_rep.var_tname.g_reporting_entity_id := p_reporting_entity_id;
947: /* bug 5654975 p_sob_id is passed incorrectly when the user
948: has access to multiple Ledgers */
949: -- arp_recon_rep.var_tname.g_set_of_books_id := p_sob_id;
950: /* Bug fix 5678284
945: arp_recon_rep.var_tname.g_reporting_level := p_reporting_level;
946: arp_recon_rep.var_tname.g_reporting_entity_id := p_reporting_entity_id;
947: /* bug 5654975 p_sob_id is passed incorrectly when the user
948: has access to multiple Ledgers */
949: -- arp_recon_rep.var_tname.g_set_of_books_id := p_sob_id;
950: /* Bug fix 5678284
951: p_coa_id is passed incorrectly when the user has access to multiple Ledgers */
952: --arp_recon_rep.var_tname.g_chart_of_accounts_id := p_coa_id;
953: arp_recon_rep.var_tname.g_gl_date_from := fnd_date.canonical_to_date(p_gl_date_from);
948: has access to multiple Ledgers */
949: -- arp_recon_rep.var_tname.g_set_of_books_id := p_sob_id;
950: /* Bug fix 5678284
951: p_coa_id is passed incorrectly when the user has access to multiple Ledgers */
952: --arp_recon_rep.var_tname.g_chart_of_accounts_id := p_coa_id;
953: arp_recon_rep.var_tname.g_gl_date_from := fnd_date.canonical_to_date(p_gl_date_from);
954: arp_recon_rep.var_tname.g_gl_date_to := fnd_date.canonical_to_date(p_gl_date_to);
955: arp_recon_rep.var_tname.g_posting_status := p_posting_status;
956: arp_recon_rep.var_tname.g_max_gl_date := to_date('31-12-4712','DD-MM-YYYY');
949: -- arp_recon_rep.var_tname.g_set_of_books_id := p_sob_id;
950: /* Bug fix 5678284
951: p_coa_id is passed incorrectly when the user has access to multiple Ledgers */
952: --arp_recon_rep.var_tname.g_chart_of_accounts_id := p_coa_id;
953: arp_recon_rep.var_tname.g_gl_date_from := fnd_date.canonical_to_date(p_gl_date_from);
954: arp_recon_rep.var_tname.g_gl_date_to := fnd_date.canonical_to_date(p_gl_date_to);
955: arp_recon_rep.var_tname.g_posting_status := p_posting_status;
956: arp_recon_rep.var_tname.g_max_gl_date := to_date('31-12-4712','DD-MM-YYYY');
957:
950: /* Bug fix 5678284
951: p_coa_id is passed incorrectly when the user has access to multiple Ledgers */
952: --arp_recon_rep.var_tname.g_chart_of_accounts_id := p_coa_id;
953: arp_recon_rep.var_tname.g_gl_date_from := fnd_date.canonical_to_date(p_gl_date_from);
954: arp_recon_rep.var_tname.g_gl_date_to := fnd_date.canonical_to_date(p_gl_date_to);
955: arp_recon_rep.var_tname.g_posting_status := p_posting_status;
956: arp_recon_rep.var_tname.g_max_gl_date := to_date('31-12-4712','DD-MM-YYYY');
957:
958:
951: p_coa_id is passed incorrectly when the user has access to multiple Ledgers */
952: --arp_recon_rep.var_tname.g_chart_of_accounts_id := p_coa_id;
953: arp_recon_rep.var_tname.g_gl_date_from := fnd_date.canonical_to_date(p_gl_date_from);
954: arp_recon_rep.var_tname.g_gl_date_to := fnd_date.canonical_to_date(p_gl_date_to);
955: arp_recon_rep.var_tname.g_posting_status := p_posting_status;
956: arp_recon_rep.var_tname.g_max_gl_date := to_date('31-12-4712','DD-MM-YYYY');
957:
958:
959:
952: --arp_recon_rep.var_tname.g_chart_of_accounts_id := p_coa_id;
953: arp_recon_rep.var_tname.g_gl_date_from := fnd_date.canonical_to_date(p_gl_date_from);
954: arp_recon_rep.var_tname.g_gl_date_to := fnd_date.canonical_to_date(p_gl_date_to);
955: arp_recon_rep.var_tname.g_posting_status := p_posting_status;
956: arp_recon_rep.var_tname.g_max_gl_date := to_date('31-12-4712','DD-MM-YYYY');
957:
958:
959:
960: /* Added Conditional Implication to address bug:5181586*/
968: l_sob_id,
969: l_functional_currency,
970: l_coa_id
971: FROM gl_sets_of_books sob
972: WHERE sob.set_of_books_id = arp_recon_rep.var_tname.g_reporting_entity_id;
973:
974: ELSIF p_reporting_level = 3000 THEN
975: SELECT sob.name sob_name,
976: sob.set_of_books_id,
982: l_coa_id
983: FROM gl_sets_of_books sob,
984: ar_system_parameters sysparam
985: WHERE sob.set_of_books_id = sysparam.set_of_books_id
986: AND sysparam.org_id = arp_recon_rep.var_tname.g_reporting_entity_id;
987:
988: END IF;
989: /* Changes for bug:5181586 ends*/
990:
987:
988: END IF;
989: /* Changes for bug:5181586 ends*/
990:
991: arp_recon_rep.var_tname.g_set_of_books_id := l_sob_id;
992: arp_recon_rep.var_tname.g_chart_of_accounts_id := l_coa_id;
993:
994: /* Initialize the reporting context */
995: init(p_sob_id);
988: END IF;
989: /* Changes for bug:5181586 ends*/
990:
991: arp_recon_rep.var_tname.g_set_of_books_id := l_sob_id;
992: arp_recon_rep.var_tname.g_chart_of_accounts_id := l_coa_id;
993:
994: /* Initialize the reporting context */
995: init(p_sob_id);
996:
1008: l_sysparam_org_where := XLA_MO_REPORTING_API.Get_Predicate('sysparam',NULL);
1009:
1010: /* Replace the bind variables with global functions */
1011: l_ra_org_where := replace(l_ra_org_where,
1012: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
1013: l_ard_org_where := replace(l_ard_org_where,
1014: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
1015: l_ps_org_where := replace(l_ps_org_where,
1016: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
1010: /* Replace the bind variables with global functions */
1011: l_ra_org_where := replace(l_ra_org_where,
1012: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
1013: l_ard_org_where := replace(l_ard_org_where,
1014: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
1015: l_ps_org_where := replace(l_ps_org_where,
1016: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
1017: l_cr_org_where := replace(l_cr_org_where,
1018: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
1012: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
1013: l_ard_org_where := replace(l_ard_org_where,
1014: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
1015: l_ps_org_where := replace(l_ps_org_where,
1016: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
1017: l_cr_org_where := replace(l_cr_org_where,
1018: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
1019: l_crh_org_where := replace(l_crh_org_where,
1020: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
1014: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
1015: l_ps_org_where := replace(l_ps_org_where,
1016: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
1017: l_cr_org_where := replace(l_cr_org_where,
1018: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
1019: l_crh_org_where := replace(l_crh_org_where,
1020: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
1021: l_bat_org_where := replace(l_bat_org_where,
1022: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
1016: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
1017: l_cr_org_where := replace(l_cr_org_where,
1018: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
1019: l_crh_org_where := replace(l_crh_org_where,
1020: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
1021: l_bat_org_where := replace(l_bat_org_where,
1022: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
1023: l_bs_org_where := replace(l_bs_org_where,
1024: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
1018: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
1019: l_crh_org_where := replace(l_crh_org_where,
1020: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
1021: l_bat_org_where := replace(l_bat_org_where,
1022: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
1023: l_bs_org_where := replace(l_bs_org_where,
1024: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
1025:
1026: l_reporting_entity_name := substrb(XLA_MO_REPORTING_API.get_reporting_entity_name,1,80);
1020: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
1021: l_bat_org_where := replace(l_bat_org_where,
1022: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
1023: l_bs_org_where := replace(l_bs_org_where,
1024: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
1025:
1026: l_reporting_entity_name := substrb(XLA_MO_REPORTING_API.get_reporting_entity_name,1,80);
1027: l_reporting_level_name := substrb(XLA_MO_REPORTING_API.get_reporting_level_name,1,30);
1028:
1038:
1039: /* Bug fix 4942083*/
1040: IF arp_util.Open_Period_Exists(p_reporting_level,
1041: p_reporting_entity_id,
1042: arp_recon_rep.var_tname.g_gl_date_from,
1043: arp_recon_rep.var_tname.g_gl_date_to) THEN
1044: FND_MESSAGE.SET_NAME('AR','AR_REPORT_ACC_NOT_GEN');--Changed as per Bug 5578884 the parameter to AR from FND as the message is in AR product
1045: l_message_acct := FND_MESSAGE.Get;
1046: END IF;
1039: /* Bug fix 4942083*/
1040: IF arp_util.Open_Period_Exists(p_reporting_level,
1041: p_reporting_entity_id,
1042: arp_recon_rep.var_tname.g_gl_date_from,
1043: arp_recon_rep.var_tname.g_gl_date_to) THEN
1044: FND_MESSAGE.SET_NAME('AR','AR_REPORT_ACC_NOT_GEN');--Changed as per Bug 5578884 the parameter to AR from FND as the message is in AR product
1045: l_message_acct := FND_MESSAGE.Get;
1046: END IF;
1047:
1049: IF p_reporting_level = '3000' THEN
1050: select substrb(hou.name,1,60)
1051: into l_organization
1052: from hr_organization_units hou
1053: where hou.organization_id = arp_recon_rep.var_tname.g_reporting_entity_id;
1054: ELSE
1055: select meaning
1056: into l_organization
1057: from ar_lookups
1100: IF p_gl_date_from IS NULL and p_gl_date_to IS NULL THEN
1101: l_gl_date_where := NULL;
1102: l_gl_date_ard_where := NULL;
1103: ELSIF p_gl_date_from IS NULL THEN
1104: l_gl_date_where :=' and ra.gl_date <= arp_recon_rep.get_gl_date_to()';
1105: l_gl_date_crh_where := ' and crh.gl_date <= arp_recon_rep.get_gl_date_to()';
1106: --l_gl_date_ard_where :=' and hd.accounting_date <= arp_recon_rep.get_gl_date_to()';
1107: ELSIF p_gl_date_to IS NULL THEN
1108: l_gl_date_where :=' and ra.gl_date >= arp_recon_rep.get_gl_date_from() ' ;
1101: l_gl_date_where := NULL;
1102: l_gl_date_ard_where := NULL;
1103: ELSIF p_gl_date_from IS NULL THEN
1104: l_gl_date_where :=' and ra.gl_date <= arp_recon_rep.get_gl_date_to()';
1105: l_gl_date_crh_where := ' and crh.gl_date <= arp_recon_rep.get_gl_date_to()';
1106: --l_gl_date_ard_where :=' and hd.accounting_date <= arp_recon_rep.get_gl_date_to()';
1107: ELSIF p_gl_date_to IS NULL THEN
1108: l_gl_date_where :=' and ra.gl_date >= arp_recon_rep.get_gl_date_from() ' ;
1109: l_gl_date_crh_where := ' and crh.gl_date >= arp_recon_rep.get_gl_date_from() ' ;
1102: l_gl_date_ard_where := NULL;
1103: ELSIF p_gl_date_from IS NULL THEN
1104: l_gl_date_where :=' and ra.gl_date <= arp_recon_rep.get_gl_date_to()';
1105: l_gl_date_crh_where := ' and crh.gl_date <= arp_recon_rep.get_gl_date_to()';
1106: --l_gl_date_ard_where :=' and hd.accounting_date <= arp_recon_rep.get_gl_date_to()';
1107: ELSIF p_gl_date_to IS NULL THEN
1108: l_gl_date_where :=' and ra.gl_date >= arp_recon_rep.get_gl_date_from() ' ;
1109: l_gl_date_crh_where := ' and crh.gl_date >= arp_recon_rep.get_gl_date_from() ' ;
1110: --l_gl_date_ard_where :=' and hd.accounting_date >= arp_recon_rep.get_gl_date_from() ' ;
1104: l_gl_date_where :=' and ra.gl_date <= arp_recon_rep.get_gl_date_to()';
1105: l_gl_date_crh_where := ' and crh.gl_date <= arp_recon_rep.get_gl_date_to()';
1106: --l_gl_date_ard_where :=' and hd.accounting_date <= arp_recon_rep.get_gl_date_to()';
1107: ELSIF p_gl_date_to IS NULL THEN
1108: l_gl_date_where :=' and ra.gl_date >= arp_recon_rep.get_gl_date_from() ' ;
1109: l_gl_date_crh_where := ' and crh.gl_date >= arp_recon_rep.get_gl_date_from() ' ;
1110: --l_gl_date_ard_where :=' and hd.accounting_date >= arp_recon_rep.get_gl_date_from() ' ;
1111: ELSE
1112: l_gl_date_where := ' and ra.gl_date between arp_recon_rep.get_gl_date_from() and arp_recon_rep.get_gl_date_to() ';
1105: l_gl_date_crh_where := ' and crh.gl_date <= arp_recon_rep.get_gl_date_to()';
1106: --l_gl_date_ard_where :=' and hd.accounting_date <= arp_recon_rep.get_gl_date_to()';
1107: ELSIF p_gl_date_to IS NULL THEN
1108: l_gl_date_where :=' and ra.gl_date >= arp_recon_rep.get_gl_date_from() ' ;
1109: l_gl_date_crh_where := ' and crh.gl_date >= arp_recon_rep.get_gl_date_from() ' ;
1110: --l_gl_date_ard_where :=' and hd.accounting_date >= arp_recon_rep.get_gl_date_from() ' ;
1111: ELSE
1112: l_gl_date_where := ' and ra.gl_date between arp_recon_rep.get_gl_date_from() and arp_recon_rep.get_gl_date_to() ';
1113: l_gl_date_crh_where := ' and crh.gl_date between arp_recon_rep.get_gl_date_from() and arp_recon_rep.get_gl_date_to() ';
1106: --l_gl_date_ard_where :=' and hd.accounting_date <= arp_recon_rep.get_gl_date_to()';
1107: ELSIF p_gl_date_to IS NULL THEN
1108: l_gl_date_where :=' and ra.gl_date >= arp_recon_rep.get_gl_date_from() ' ;
1109: l_gl_date_crh_where := ' and crh.gl_date >= arp_recon_rep.get_gl_date_from() ' ;
1110: --l_gl_date_ard_where :=' and hd.accounting_date >= arp_recon_rep.get_gl_date_from() ' ;
1111: ELSE
1112: l_gl_date_where := ' and ra.gl_date between arp_recon_rep.get_gl_date_from() and arp_recon_rep.get_gl_date_to() ';
1113: l_gl_date_crh_where := ' and crh.gl_date between arp_recon_rep.get_gl_date_from() and arp_recon_rep.get_gl_date_to() ';
1114: --l_gl_date_ard_where := ' and hd.accounting_date between arp_recon_rep.get_gl_date_from() and arp_recon_rep.get_gl_date_to() ';
1108: l_gl_date_where :=' and ra.gl_date >= arp_recon_rep.get_gl_date_from() ' ;
1109: l_gl_date_crh_where := ' and crh.gl_date >= arp_recon_rep.get_gl_date_from() ' ;
1110: --l_gl_date_ard_where :=' and hd.accounting_date >= arp_recon_rep.get_gl_date_from() ' ;
1111: ELSE
1112: l_gl_date_where := ' and ra.gl_date between arp_recon_rep.get_gl_date_from() and arp_recon_rep.get_gl_date_to() ';
1113: l_gl_date_crh_where := ' and crh.gl_date between arp_recon_rep.get_gl_date_from() and arp_recon_rep.get_gl_date_to() ';
1114: --l_gl_date_ard_where := ' and hd.accounting_date between arp_recon_rep.get_gl_date_from() and arp_recon_rep.get_gl_date_to() ';
1115: END IF;
1116:
1109: l_gl_date_crh_where := ' and crh.gl_date >= arp_recon_rep.get_gl_date_from() ' ;
1110: --l_gl_date_ard_where :=' and hd.accounting_date >= arp_recon_rep.get_gl_date_from() ' ;
1111: ELSE
1112: l_gl_date_where := ' and ra.gl_date between arp_recon_rep.get_gl_date_from() and arp_recon_rep.get_gl_date_to() ';
1113: l_gl_date_crh_where := ' and crh.gl_date between arp_recon_rep.get_gl_date_from() and arp_recon_rep.get_gl_date_to() ';
1114: --l_gl_date_ard_where := ' and hd.accounting_date between arp_recon_rep.get_gl_date_from() and arp_recon_rep.get_gl_date_to() ';
1115: END IF;
1116:
1117: IF p_gl_date_from IS NULL and p_gl_date_to IS NULL THEN
1110: --l_gl_date_ard_where :=' and hd.accounting_date >= arp_recon_rep.get_gl_date_from() ' ;
1111: ELSE
1112: l_gl_date_where := ' and ra.gl_date between arp_recon_rep.get_gl_date_from() and arp_recon_rep.get_gl_date_to() ';
1113: l_gl_date_crh_where := ' and crh.gl_date between arp_recon_rep.get_gl_date_from() and arp_recon_rep.get_gl_date_to() ';
1114: --l_gl_date_ard_where := ' and hd.accounting_date between arp_recon_rep.get_gl_date_from() and arp_recon_rep.get_gl_date_to() ';
1115: END IF;
1116:
1117: IF p_gl_date_from IS NULL and p_gl_date_to IS NULL THEN
1118: l_gl_date_closed_where := 'and ps.gl_date_closed = arp_recon_rep.get_max_gl_date()';
1114: --l_gl_date_ard_where := ' and hd.accounting_date between arp_recon_rep.get_gl_date_from() and arp_recon_rep.get_gl_date_to() ';
1115: END IF;
1116:
1117: IF p_gl_date_from IS NULL and p_gl_date_to IS NULL THEN
1118: l_gl_date_closed_where := 'and ps.gl_date_closed = arp_recon_rep.get_max_gl_date()';
1119: ELSIF p_gl_date_from IS NOT NULL THEN
1120: l_gl_date_closed_where := 'and ps.gl_date_closed >= arp_recon_rep.get_gl_date_from() ';
1121: ELSIF p_gl_date_to IS NOT NULL THEN
1122: l_gl_date_closed_where := 'and ps.gl_date_closed >= arp_recon_rep.get_gl_date_to()';
1116:
1117: IF p_gl_date_from IS NULL and p_gl_date_to IS NULL THEN
1118: l_gl_date_closed_where := 'and ps.gl_date_closed = arp_recon_rep.get_max_gl_date()';
1119: ELSIF p_gl_date_from IS NOT NULL THEN
1120: l_gl_date_closed_where := 'and ps.gl_date_closed >= arp_recon_rep.get_gl_date_from() ';
1121: ELSIF p_gl_date_to IS NOT NULL THEN
1122: l_gl_date_closed_where := 'and ps.gl_date_closed >= arp_recon_rep.get_gl_date_to()';
1123: END IF;
1124:
1118: l_gl_date_closed_where := 'and ps.gl_date_closed = arp_recon_rep.get_max_gl_date()';
1119: ELSIF p_gl_date_from IS NOT NULL THEN
1120: l_gl_date_closed_where := 'and ps.gl_date_closed >= arp_recon_rep.get_gl_date_from() ';
1121: ELSIF p_gl_date_to IS NOT NULL THEN
1122: l_gl_date_closed_where := 'and ps.gl_date_closed >= arp_recon_rep.get_gl_date_to()';
1123: END IF;
1124:
1125: IF p_gl_account_low IS NOT NULL AND p_gl_account_high IS NOT NULL THEN
1126: l_account_where := ' AND ' || AR_CALC_AGING.FLEX_SQL(
1143: FROM fnd_segment_attribute_values fcav,
1144: fnd_id_flex_segments fifs
1145: WHERE fcav.application_id = 101
1146: AND fcav.id_flex_code = 'GL#'
1147: AND fcav.id_flex_num = arp_recon_rep.var_tname.g_chart_of_accounts_id
1148: AND fcav.attribute_value = 'Y'
1149: AND fcav.segment_attribute_type = 'GL_ACCOUNT'
1150: AND fifs.application_id = fcav.application_id
1151: AND fifs.id_flex_code = fcav.id_flex_code
1188: select meaning
1189: into l_status_meaning
1190: from ar_lookups
1191: where lookup_type = 'POSTED_STATUS'
1192: and lookup_code = arp_recon_rep.var_tname.g_posting_status;
1193:
1194: l_posting_status_where := 'and nvl(ra.gl_posted_date,TO_DATE(''01/01/0001'',''MM/DD/YYYY'')) =
1195: decode(arp_recon_rep.get_posting_status(),
1196: ''POSTED'',ra.gl_posted_date,
1191: where lookup_type = 'POSTED_STATUS'
1192: and lookup_code = arp_recon_rep.var_tname.g_posting_status;
1193:
1194: l_posting_status_where := 'and nvl(ra.gl_posted_date,TO_DATE(''01/01/0001'',''MM/DD/YYYY'')) =
1195: decode(arp_recon_rep.get_posting_status(),
1196: ''POSTED'',ra.gl_posted_date,
1197: ''UNPOSTED'',TO_DATE(''01/01/0001'',''MM/DD/YYYY''),
1198: nvl(ra.gl_posted_date,TO_DATE(''01/01/0001'',''MM/DD/YYYY'')))';
1199:
1197: ''UNPOSTED'',TO_DATE(''01/01/0001'',''MM/DD/YYYY''),
1198: nvl(ra.gl_posted_date,TO_DATE(''01/01/0001'',''MM/DD/YYYY'')))';
1199:
1200: l_posting_status_nul_where := 'and nvl(NULL,TO_DATE(''01/01/0001'',''MM/DD/YYYY'')) =
1201: decode(arp_recon_rep.get_posting_status(),
1202: ''POSTED'',ra.gl_posted_date,
1203: ''UNPOSTED'',TO_DATE(''01/01/0001'',''MM/DD/YYYY''),
1204: nvl(ra.gl_posted_date,TO_DATE(''01/01/0001'',''MM/DD/YYYY'')))';
1205: /* Bug fix 5678284 : Added l_posting_status_ard_where*/
1203: ''UNPOSTED'',TO_DATE(''01/01/0001'',''MM/DD/YYYY''),
1204: nvl(ra.gl_posted_date,TO_DATE(''01/01/0001'',''MM/DD/YYYY'')))';
1205: /* Bug fix 5678284 : Added l_posting_status_ard_where*/
1206: l_posting_status_ard_where := 'and nvl(ard.gl_posted_date,TO_DATE(''01/01/0001'',''MM/DD/YYYY'')) =
1207: decode(arp_recon_rep.get_posting_status(),
1208: ''POSTED'',ard.gl_posted_date,
1209: ''UNPOSTED'',TO_DATE(''01/01/0001'',''MM/DD/YYYY''),
1210: nvl(ard.gl_posted_date,TO_DATE(''01/01/0001'',''MM/DD/YYYY'')))';
1211:
1209: ''UNPOSTED'',TO_DATE(''01/01/0001'',''MM/DD/YYYY''),
1210: nvl(ard.gl_posted_date,TO_DATE(''01/01/0001'',''MM/DD/YYYY'')))';
1211:
1212: l_posting_status_crh_where := 'and nvl(crh.gl_posted_date,TO_DATE(''01/01/0001'',''MM/DD/YYYY'')) =
1213: decode(arp_recon_rep.get_posting_status(),
1214: ''POSTED'',crh.gl_posted_date,
1215: ''UNPOSTED'',TO_DATE(''01/01/0001'',''MM/DD/YYYY''),
1216: nvl(crh.gl_posted_date,TO_DATE(''01/01/0001'',''MM/DD/YYYY'')))';
1217: ELSE
1239: bat.name batch_name,
1240: l_cat.meaning category,
1241: /* 7008877 */
1242: ard.line_id,
1243: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
1244: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
1245: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
1246: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
1247: ar_receipt_methods arm,
1240: l_cat.meaning category,
1241: /* 7008877 */
1242: ard.line_id,
1243: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
1244: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
1245: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
1246: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
1247: ar_receipt_methods arm,
1248: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
1241: /* 7008877 */
1242: ard.line_id,
1243: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
1244: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
1245: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
1246: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
1247: ar_receipt_methods arm,
1248: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
1249: gl_code_combinations gc,
1242: ard.line_id,
1243: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
1244: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
1245: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
1246: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
1247: ar_receipt_methods arm,
1248: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
1249: gl_code_combinations gc,
1250: hz_cust_accounts cust,
1244: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
1245: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
1246: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
1247: ar_receipt_methods arm,
1248: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
1249: gl_code_combinations gc,
1250: hz_cust_accounts cust,
1251: hz_parties party,
1252: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
1248: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
1249: gl_code_combinations gc,
1250: hz_cust_accounts cust,
1251: hz_parties party,
1252: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
1253: ar_batch_sources bs,
1254: '||arp_recon_rep.var_tname.l_ar_receivable_apps_all||' ra,
1255: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
1256: ar_distributions_all ard,
1250: hz_cust_accounts cust,
1251: hz_parties party,
1252: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
1253: ar_batch_sources bs,
1254: '||arp_recon_rep.var_tname.l_ar_receivable_apps_all||' ra,
1255: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
1256: ar_distributions_all ard,
1257: xla_distribution_links lk,
1258: xla_ae_lines ae,
1251: hz_parties party,
1252: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
1253: ar_batch_sources bs,
1254: '||arp_recon_rep.var_tname.l_ar_receivable_apps_all||' ra,
1255: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
1256: ar_distributions_all ard,
1257: xla_distribution_links lk,
1258: xla_ae_lines ae,
1259: xla_ae_headers hd,
1284: AND crh.batch_id = bat.batch_id(+)
1285: AND bat.batch_source_id = bs.batch_source_id(+)
1286: AND bat.org_id = bs.org_id(+)
1287: AND gc.code_combination_id = ae.code_combination_id
1288: AND gc.chart_of_accounts_id = arp_recon_rep.get_chart_of_accounts_id()
1289: AND ard.source_id = ra.receivable_application_id
1290: AND cr.pay_from_customer = cust.cust_account_id(+)
1291: AND cust.party_id = party.party_id(+)
1292: AND ard.line_id = lk.source_distribution_id_num_1
1335: bat.name batch_name,
1336: l_cat.meaning category,
1337: /* 7008877 */
1338: ard.line_id,
1339: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
1340: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
1341: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
1342: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
1343: ar_receipt_methods arm,
1336: l_cat.meaning category,
1337: /* 7008877 */
1338: ard.line_id,
1339: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
1340: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
1341: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
1342: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
1343: ar_receipt_methods arm,
1344: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
1337: /* 7008877 */
1338: ard.line_id,
1339: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
1340: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
1341: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
1342: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
1343: ar_receipt_methods arm,
1344: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
1345: gl_code_combinations gc,
1338: ard.line_id,
1339: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
1340: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
1341: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
1342: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
1343: ar_receipt_methods arm,
1344: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
1345: gl_code_combinations gc,
1346: hz_cust_accounts cust,
1340: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
1341: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
1342: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
1343: ar_receipt_methods arm,
1344: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
1345: gl_code_combinations gc,
1346: hz_cust_accounts cust,
1347: hz_parties party,
1348: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
1344: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
1345: gl_code_combinations gc,
1346: hz_cust_accounts cust,
1347: hz_parties party,
1348: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
1349: ar_batch_sources bs,
1350: '||arp_recon_rep.var_tname.l_ar_receivable_apps_all||' ra,
1351: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
1352: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
1346: hz_cust_accounts cust,
1347: hz_parties party,
1348: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
1349: ar_batch_sources bs,
1350: '||arp_recon_rep.var_tname.l_ar_receivable_apps_all||' ra,
1351: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
1352: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
1353: ar_lookups l_cat
1354: where
1347: hz_parties party,
1348: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
1349: ar_batch_sources bs,
1350: '||arp_recon_rep.var_tname.l_ar_receivable_apps_all||' ra,
1351: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
1352: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
1353: ar_lookups l_cat
1354: where
1355: ra.status IN (''ACC'', ''OTHER ACC'')
1348: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
1349: ar_batch_sources bs,
1350: '||arp_recon_rep.var_tname.l_ar_receivable_apps_all||' ra,
1351: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
1352: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
1353: ar_lookups l_cat
1354: where
1355: ra.status IN (''ACC'', ''OTHER ACC'')
1356: AND ps.cash_receipt_id = ra.cash_receipt_id
1364: AND crh.batch_id = bat.batch_id(+)
1365: AND bat.batch_source_id = bs.batch_source_id(+)
1366: AND bat.org_id = bs.org_id(+)
1367: AND gc.code_combination_id = ard.code_combination_id
1368: AND gc.chart_of_accounts_id = arp_recon_rep.get_chart_of_accounts_id()
1369: AND ard.source_id = ra.receivable_application_id
1370: AND ard.source_table = ''RA''
1371: AND crh.first_posted_record_flag = ''Y''
1372: AND nvl(cr.confirmed_flag,''Y'') = ''Y''
1407: bat.name batch_name,
1408: l_cat.meaning category,
1409: /* 7008877 */
1410: ard.line_id,
1411: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
1412: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
1413: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
1414: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
1415: ar_receipt_methods arm,
1408: l_cat.meaning category,
1409: /* 7008877 */
1410: ard.line_id,
1411: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
1412: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
1413: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
1414: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
1415: ar_receipt_methods arm,
1416: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
1409: /* 7008877 */
1410: ard.line_id,
1411: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
1412: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
1413: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
1414: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
1415: ar_receipt_methods arm,
1416: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
1417: gl_code_combinations gc,
1410: ard.line_id,
1411: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
1412: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
1413: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
1414: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
1415: ar_receipt_methods arm,
1416: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
1417: gl_code_combinations gc,
1418: hz_cust_accounts cust,
1412: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
1413: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
1414: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
1415: ar_receipt_methods arm,
1416: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
1417: gl_code_combinations gc,
1418: hz_cust_accounts cust,
1419: hz_parties party,
1420: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
1416: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
1417: gl_code_combinations gc,
1418: hz_cust_accounts cust,
1419: hz_parties party,
1420: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
1421: ar_batch_sources bs,
1422: '||arp_recon_rep.var_tname.l_ar_receivable_apps_all||' ra,
1423: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
1424: ar_distributions_all ard,
1418: hz_cust_accounts cust,
1419: hz_parties party,
1420: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
1421: ar_batch_sources bs,
1422: '||arp_recon_rep.var_tname.l_ar_receivable_apps_all||' ra,
1423: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
1424: ar_distributions_all ard,
1425: ar_lookups l_cat
1426: where ra.status IN (''UNAPP'', ''UNID'')
1419: hz_parties party,
1420: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
1421: ar_batch_sources bs,
1422: '||arp_recon_rep.var_tname.l_ar_receivable_apps_all||' ra,
1423: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
1424: ar_distributions_all ard,
1425: ar_lookups l_cat
1426: where ra.status IN (''UNAPP'', ''UNID'')
1427: AND EXISTS
1434: '||l_gl_date_closed_where||'
1435: AND crh.batch_id = bat.batch_id(+)
1436: AND bat.batch_source_id = bs.batch_source_id(+)
1437: AND bat.org_id = bs.org_id(+)
1438: AND gc.chart_of_accounts_id = arp_recon_rep.get_chart_of_accounts_id()
1439: AND cr.pay_from_customer = cust.cust_account_id(+)
1440: AND cust.party_id = party.party_id(+)
1441: AND ard.source_id = ra.receivable_application_id
1442: AND ps.cash_receipt_id = ra.cash_receipt_id
1489: bat.name batch_name,
1490: l_cat.meaning category,
1491: /* 7008877 */
1492: ard.line_id,
1493: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
1494: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
1495: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
1496: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
1497: ar_receipt_methods arm,
1490: l_cat.meaning category,
1491: /* 7008877 */
1492: ard.line_id,
1493: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
1494: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
1495: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
1496: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
1497: ar_receipt_methods arm,
1498: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
1491: /* 7008877 */
1492: ard.line_id,
1493: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
1494: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
1495: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
1496: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
1497: ar_receipt_methods arm,
1498: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
1499: gl_code_combinations gc,
1492: ard.line_id,
1493: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
1494: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
1495: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
1496: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
1497: ar_receipt_methods arm,
1498: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
1499: gl_code_combinations gc,
1500: hz_cust_accounts cust,
1494: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
1495: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
1496: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
1497: ar_receipt_methods arm,
1498: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
1499: gl_code_combinations gc,
1500: hz_cust_accounts cust,
1501: hz_parties party,
1502: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
1498: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
1499: gl_code_combinations gc,
1500: hz_cust_accounts cust,
1501: hz_parties party,
1502: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
1503: ar_batch_sources bs,
1504: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
1505: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
1506: xla_distribution_links lk,
1500: hz_cust_accounts cust,
1501: hz_parties party,
1502: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
1503: ar_batch_sources bs,
1504: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
1505: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
1506: xla_distribution_links lk,
1507: xla_ae_lines ae,
1508: xla_ae_headers hd,
1501: hz_parties party,
1502: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
1503: ar_batch_sources bs,
1504: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
1505: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
1506: xla_distribution_links lk,
1507: xla_ae_lines ae,
1508: xla_ae_headers hd,
1509: ar_lookups l_cat
1535: AND ard.source_id = crh.cash_receipt_history_id
1536: AND cr.pay_from_customer = cust.cust_account_id(+)
1537: AND cust.party_id = party.party_id(+)
1538: AND ard.line_id = lk.source_distribution_id_num_1
1539: AND gc.chart_of_accounts_id = arp_recon_rep.get_chart_of_accounts_id()
1540: AND l_cat.lookup_type = ''ARRGTA_FUNCTION_MAPPING''
1541: AND l_cat.lookup_code = ''TRADE_''||decode (ae.accounting_class_code, ''UNAPP'', ''UNAPP'', ard.source_type)
1542: AND lk.application_id = 222
1543: AND lk.source_distribution_type = ''AR_DISTRIBUTIONS_ALL''
1580: bat.name batch_name,
1581: l_cat.meaning category,
1582: /* 7008877 */
1583: ard.line_id,
1584: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
1585: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
1586: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
1587: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
1588: ar_receipt_methods arm,
1581: l_cat.meaning category,
1582: /* 7008877 */
1583: ard.line_id,
1584: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
1585: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
1586: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
1587: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
1588: ar_receipt_methods arm,
1589: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
1582: /* 7008877 */
1583: ard.line_id,
1584: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
1585: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
1586: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
1587: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
1588: ar_receipt_methods arm,
1589: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
1590: gl_code_combinations gc,
1583: ard.line_id,
1584: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
1585: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
1586: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
1587: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
1588: ar_receipt_methods arm,
1589: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
1590: gl_code_combinations gc,
1591: hz_cust_accounts cust,
1585: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
1586: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
1587: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
1588: ar_receipt_methods arm,
1589: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
1590: gl_code_combinations gc,
1591: hz_cust_accounts cust,
1592: hz_parties party,
1593: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
1589: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
1590: gl_code_combinations gc,
1591: hz_cust_accounts cust,
1592: hz_parties party,
1593: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
1594: ar_batch_sources bs,
1595: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
1596: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
1597: ar_lookups l_cat
1591: hz_cust_accounts cust,
1592: hz_parties party,
1593: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
1594: ar_batch_sources bs,
1595: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
1596: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
1597: ar_lookups l_cat
1598: where ps.class = ''PMT'' --ps.cash_receipt_id = ard.cash_receipt_id
1599: '||l_gl_date_closed_where||'
1592: hz_parties party,
1593: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
1594: ar_batch_sources bs,
1595: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
1596: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
1597: ar_lookups l_cat
1598: where ps.class = ''PMT'' --ps.cash_receipt_id = ard.cash_receipt_id
1599: '||l_gl_date_closed_where||'
1600: AND cr.cash_receipt_id = ps.cash_receipt_id
1607: --AND ard.cash_receipt_id = ps.cash_receipt_id
1608: AND ard.source_id = crh.cash_receipt_history_id
1609: AND cr.pay_from_customer = cust.cust_account_id(+)
1610: AND cust.party_id = party.party_id(+)
1611: AND gc.chart_of_accounts_id = arp_recon_rep.get_chart_of_accounts_id()
1612: AND ard.source_table = ''CRH''
1613: AND l_cat.lookup_type = ''ARRGTA_FUNCTION_MAPPING''
1614: AND l_cat.lookup_code = ''TRADE_''||ard.source_type
1615: AND crh.event_id IS NULL
1652: bat.name batch_name,
1653: l_cat.meaning category,
1654: /* 7008877 */
1655: ard.line_id,
1656: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
1657: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
1658: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
1659: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
1660: ar_receipt_methods arm,
1653: l_cat.meaning category,
1654: /* 7008877 */
1655: ard.line_id,
1656: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
1657: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
1658: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
1659: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
1660: ar_receipt_methods arm,
1661: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
1654: /* 7008877 */
1655: ard.line_id,
1656: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
1657: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
1658: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
1659: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
1660: ar_receipt_methods arm,
1661: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
1662: gl_code_combinations gc,
1655: ard.line_id,
1656: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
1657: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
1658: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
1659: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
1660: ar_receipt_methods arm,
1661: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
1662: gl_code_combinations gc,
1663: hz_cust_accounts cust,
1657: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
1658: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
1659: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
1660: ar_receipt_methods arm,
1661: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
1662: gl_code_combinations gc,
1663: hz_cust_accounts cust,
1664: hz_parties party,
1665: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
1661: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
1662: gl_code_combinations gc,
1663: hz_cust_accounts cust,
1664: hz_parties party,
1665: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
1666: ar_batch_sources bs,
1667: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
1668: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
1669: ar_receivable_applications ra,
1663: hz_cust_accounts cust,
1664: hz_parties party,
1665: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
1666: ar_batch_sources bs,
1667: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
1668: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
1669: ar_receivable_applications ra,
1670: xla_distribution_links lk,
1671: xla_ae_lines ae,
1664: hz_parties party,
1665: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
1666: ar_batch_sources bs,
1667: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
1668: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
1669: ar_receivable_applications ra,
1670: xla_distribution_links lk,
1671: xla_ae_lines ae,
1672: xla_ae_headers hd,
1700: AND lk.ae_header_id = ae.ae_header_id
1701: AND lk.ae_line_num = ae.ae_line_num
1702: AND lk.ae_header_id = hd.ae_header_id
1703: AND ra.set_of_books_id = hd.ledger_id
1704: AND gc.chart_of_accounts_id = arp_recon_rep.get_chart_of_accounts_id()
1705: AND hd.event_type_code <> ''MANUAL''
1706: AND crh.first_posted_record_flag = ''Y''
1707: AND nvl(cr.confirmed_flag,''Y'') = ''Y''
1708: AND lk.application_id = 222
1749: bat.name batch_name,
1750: l_cat.meaning category,
1751: /* 7008877 */
1752: ard.line_id,
1753: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
1754: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
1755: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
1756: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
1757: ar_receipt_methods arm,
1750: l_cat.meaning category,
1751: /* 7008877 */
1752: ard.line_id,
1753: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
1754: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
1755: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
1756: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
1757: ar_receipt_methods arm,
1758: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
1751: /* 7008877 */
1752: ard.line_id,
1753: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
1754: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
1755: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
1756: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
1757: ar_receipt_methods arm,
1758: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
1759: gl_code_combinations gc,
1752: ard.line_id,
1753: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
1754: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
1755: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
1756: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
1757: ar_receipt_methods arm,
1758: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
1759: gl_code_combinations gc,
1760: hz_cust_accounts cust,
1754: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
1755: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
1756: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
1757: ar_receipt_methods arm,
1758: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
1759: gl_code_combinations gc,
1760: hz_cust_accounts cust,
1761: hz_parties party,
1762: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
1758: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
1759: gl_code_combinations gc,
1760: hz_cust_accounts cust,
1761: hz_parties party,
1762: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
1763: ar_batch_sources bs,
1764: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
1765: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
1766: ar_receivable_applications ra,
1760: hz_cust_accounts cust,
1761: hz_parties party,
1762: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
1763: ar_batch_sources bs,
1764: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
1765: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
1766: ar_receivable_applications ra,
1767: ar_lookups l_cat
1768: where ra.status IN (''APP'', ''ACC'', ''ACTIVITY'', ''OTHER ACC'')
1761: hz_parties party,
1762: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
1763: ar_batch_sources bs,
1764: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
1765: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
1766: ar_receivable_applications ra,
1767: ar_lookups l_cat
1768: where ra.status IN (''APP'', ''ACC'', ''ACTIVITY'', ''OTHER ACC'')
1769: --AND ps.cash_receipt_id = ard.cash_receipt_id
1779: --AND ard.cash_receipt_id = ps.cash_receipt_id
1780: AND ard.source_id = ra.receivable_application_id
1781: AND cr.pay_from_customer = cust.cust_account_id(+)
1782: AND cust.party_id = party.party_id(+)
1783: AND gc.chart_of_accounts_id = arp_recon_rep.get_chart_of_accounts_id()
1784: AND l_cat.lookup_type = ''ARRGTA_FUNCTION_MAPPING''
1785: AND l_cat.lookup_code = ''TRADE_''||ard.source_type
1786: AND ard.source_type = ''UNAPP''
1787: AND nvl(cr.confirmed_flag,''Y'') = ''Y''
1819: bat.name batch_name,
1820: l_cat.meaning category,
1821: /* 7008877 */
1822: ard.line_id,
1823: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
1824: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
1825: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
1826: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
1827: ar_receipt_methods arm,
1820: l_cat.meaning category,
1821: /* 7008877 */
1822: ard.line_id,
1823: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
1824: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
1825: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
1826: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
1827: ar_receipt_methods arm,
1828: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
1821: /* 7008877 */
1822: ard.line_id,
1823: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
1824: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
1825: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
1826: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
1827: ar_receipt_methods arm,
1828: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
1829: gl_code_combinations gc,
1822: ard.line_id,
1823: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
1824: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
1825: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
1826: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
1827: ar_receipt_methods arm,
1828: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
1829: gl_code_combinations gc,
1830: hz_cust_accounts cust,
1824: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
1825: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
1826: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
1827: ar_receipt_methods arm,
1828: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
1829: gl_code_combinations gc,
1830: hz_cust_accounts cust,
1831: hz_parties party,
1832: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
1828: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
1829: gl_code_combinations gc,
1830: hz_cust_accounts cust,
1831: hz_parties party,
1832: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
1833: ar_batch_sources bs,
1834: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
1835: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
1836: ar_receivable_applications ra,
1830: hz_cust_accounts cust,
1831: hz_parties party,
1832: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
1833: ar_batch_sources bs,
1834: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
1835: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
1836: ar_receivable_applications ra,
1837: ar_lookups l_cat
1838: where ra.status IN (''UNAPP'', ''UNID'')
1831: hz_parties party,
1832: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
1833: ar_batch_sources bs,
1834: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
1835: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
1836: ar_receivable_applications ra,
1837: ar_lookups l_cat
1838: where ra.status IN (''UNAPP'', ''UNID'')
1839: --AND ps.cash_receipt_id = ard.cash_receipt_id
1845: AND crh.batch_id = bat.batch_id(+)
1846: AND bat.batch_source_id = bs.batch_source_id(+)
1847: AND bat.org_id = bs.org_id(+)
1848: AND gc.code_combination_id = ard.code_combination_id
1849: AND gc.chart_of_accounts_id = arp_recon_rep.get_chart_of_accounts_id()
1850: --AND ard.cash_receipt_id = ps.cash_receipt_id
1851: AND ard.source_id = ra.receivable_application_id
1852: AND cr.pay_from_customer = cust.cust_account_id(+)
1853: AND cust.party_id = party.party_id(+)
2157:
2158: log('arapp_journal_load_xml (+)');
2159:
2160: /* Assign the input parameters to the global variables */
2161: arp_recon_rep.var_tname.g_reporting_level := p_reporting_level;
2162: arp_recon_rep.var_tname.g_reporting_entity_id := p_reporting_entity_id;
2163: /* bug 5654975 p_coa_id,p_sob_id is passed incorrectly when the user
2164: has access to multiple Ledgers */
2165: -- arp_recon_rep.var_tname.g_set_of_books_id := p_sob_id;
2158: log('arapp_journal_load_xml (+)');
2159:
2160: /* Assign the input parameters to the global variables */
2161: arp_recon_rep.var_tname.g_reporting_level := p_reporting_level;
2162: arp_recon_rep.var_tname.g_reporting_entity_id := p_reporting_entity_id;
2163: /* bug 5654975 p_coa_id,p_sob_id is passed incorrectly when the user
2164: has access to multiple Ledgers */
2165: -- arp_recon_rep.var_tname.g_set_of_books_id := p_sob_id;
2166: -- arp_recon_rep.var_tname.g_chart_of_accounts_id := p_coa_id;
2161: arp_recon_rep.var_tname.g_reporting_level := p_reporting_level;
2162: arp_recon_rep.var_tname.g_reporting_entity_id := p_reporting_entity_id;
2163: /* bug 5654975 p_coa_id,p_sob_id is passed incorrectly when the user
2164: has access to multiple Ledgers */
2165: -- arp_recon_rep.var_tname.g_set_of_books_id := p_sob_id;
2166: -- arp_recon_rep.var_tname.g_chart_of_accounts_id := p_coa_id;
2167: arp_recon_rep.var_tname.g_gl_date_from := fnd_date.canonical_to_date(p_gl_date_from);
2168: arp_recon_rep.var_tname.g_gl_date_to := fnd_date.canonical_to_date(p_gl_date_to);
2169: arp_recon_rep.var_tname.g_posting_status := p_posting_status;
2162: arp_recon_rep.var_tname.g_reporting_entity_id := p_reporting_entity_id;
2163: /* bug 5654975 p_coa_id,p_sob_id is passed incorrectly when the user
2164: has access to multiple Ledgers */
2165: -- arp_recon_rep.var_tname.g_set_of_books_id := p_sob_id;
2166: -- arp_recon_rep.var_tname.g_chart_of_accounts_id := p_coa_id;
2167: arp_recon_rep.var_tname.g_gl_date_from := fnd_date.canonical_to_date(p_gl_date_from);
2168: arp_recon_rep.var_tname.g_gl_date_to := fnd_date.canonical_to_date(p_gl_date_to);
2169: arp_recon_rep.var_tname.g_posting_status := p_posting_status;
2170:
2163: /* bug 5654975 p_coa_id,p_sob_id is passed incorrectly when the user
2164: has access to multiple Ledgers */
2165: -- arp_recon_rep.var_tname.g_set_of_books_id := p_sob_id;
2166: -- arp_recon_rep.var_tname.g_chart_of_accounts_id := p_coa_id;
2167: arp_recon_rep.var_tname.g_gl_date_from := fnd_date.canonical_to_date(p_gl_date_from);
2168: arp_recon_rep.var_tname.g_gl_date_to := fnd_date.canonical_to_date(p_gl_date_to);
2169: arp_recon_rep.var_tname.g_posting_status := p_posting_status;
2170:
2171: /* Added Conditional Implication to address bug:5181586*/
2164: has access to multiple Ledgers */
2165: -- arp_recon_rep.var_tname.g_set_of_books_id := p_sob_id;
2166: -- arp_recon_rep.var_tname.g_chart_of_accounts_id := p_coa_id;
2167: arp_recon_rep.var_tname.g_gl_date_from := fnd_date.canonical_to_date(p_gl_date_from);
2168: arp_recon_rep.var_tname.g_gl_date_to := fnd_date.canonical_to_date(p_gl_date_to);
2169: arp_recon_rep.var_tname.g_posting_status := p_posting_status;
2170:
2171: /* Added Conditional Implication to address bug:5181586*/
2172: /*Added set of books id and char of accounts id for bug fix 5654975 */
2165: -- arp_recon_rep.var_tname.g_set_of_books_id := p_sob_id;
2166: -- arp_recon_rep.var_tname.g_chart_of_accounts_id := p_coa_id;
2167: arp_recon_rep.var_tname.g_gl_date_from := fnd_date.canonical_to_date(p_gl_date_from);
2168: arp_recon_rep.var_tname.g_gl_date_to := fnd_date.canonical_to_date(p_gl_date_to);
2169: arp_recon_rep.var_tname.g_posting_status := p_posting_status;
2170:
2171: /* Added Conditional Implication to address bug:5181586*/
2172: /*Added set of books id and char of accounts id for bug fix 5654975 */
2173: IF p_reporting_level = 1000 THEN
2179: l_sob_id,
2180: l_functional_currency,
2181: l_coa_id
2182: FROM gl_sets_of_books sob
2183: WHERE sob.set_of_books_id = arp_recon_rep.var_tname.g_reporting_entity_id;
2184:
2185: ELSIF p_reporting_level = 3000 THEN
2186: SELECT sob.name sob_name,
2187: sob.set_of_books_id,
2193: l_coa_id
2194: FROM gl_sets_of_books sob,
2195: ar_system_parameters sysparam
2196: WHERE sob.set_of_books_id = sysparam.set_of_books_id
2197: AND sysparam.org_id = arp_recon_rep.var_tname.g_reporting_entity_id;
2198:
2199: END IF;
2200: /* Changes for bug:5181586 ends*/
2201:
2198:
2199: END IF;
2200: /* Changes for bug:5181586 ends*/
2201:
2202: arp_recon_rep.var_tname.g_set_of_books_id := l_sob_id;
2203: arp_recon_rep.var_tname.g_chart_of_accounts_id := l_coa_id;
2204:
2205: /* Initialize the reporting context */
2206: init(p_sob_id);
2199: END IF;
2200: /* Changes for bug:5181586 ends*/
2201:
2202: arp_recon_rep.var_tname.g_set_of_books_id := l_sob_id;
2203: arp_recon_rep.var_tname.g_chart_of_accounts_id := l_coa_id;
2204:
2205: /* Initialize the reporting context */
2206: init(p_sob_id);
2207:
2220: l_sysparam_org_where := XLA_MO_REPORTING_API.Get_Predicate('sysparam',NULL);
2221:
2222: /* Replace the bind variables with global functions */
2223: l_ra_org_where := replace(l_ra_org_where,
2224: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
2225: l_ard_org_where := replace(l_ard_org_where,
2226: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
2227: l_ard1_org_where := replace(l_ard1_org_where,
2228: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
2222: /* Replace the bind variables with global functions */
2223: l_ra_org_where := replace(l_ra_org_where,
2224: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
2225: l_ard_org_where := replace(l_ard_org_where,
2226: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
2227: l_ard1_org_where := replace(l_ard1_org_where,
2228: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
2229: l_ps_org_where := replace(l_ps_org_where,
2230: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
2224: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
2225: l_ard_org_where := replace(l_ard_org_where,
2226: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
2227: l_ard1_org_where := replace(l_ard1_org_where,
2228: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
2229: l_ps_org_where := replace(l_ps_org_where,
2230: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
2231: l_cr_org_where := replace(l_cr_org_where,
2232: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
2226: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
2227: l_ard1_org_where := replace(l_ard1_org_where,
2228: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
2229: l_ps_org_where := replace(l_ps_org_where,
2230: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
2231: l_cr_org_where := replace(l_cr_org_where,
2232: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
2233: l_crh_org_where := replace(l_crh_org_where,
2234: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
2228: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
2229: l_ps_org_where := replace(l_ps_org_where,
2230: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
2231: l_cr_org_where := replace(l_cr_org_where,
2232: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
2233: l_crh_org_where := replace(l_crh_org_where,
2234: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
2235: l_bat_org_where := replace(l_bat_org_where,
2236: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
2230: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
2231: l_cr_org_where := replace(l_cr_org_where,
2232: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
2233: l_crh_org_where := replace(l_crh_org_where,
2234: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
2235: l_bat_org_where := replace(l_bat_org_where,
2236: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
2237: l_bs_org_where := replace(l_bs_org_where,
2238: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
2232: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
2233: l_crh_org_where := replace(l_crh_org_where,
2234: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
2235: l_bat_org_where := replace(l_bat_org_where,
2236: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
2237: l_bs_org_where := replace(l_bs_org_where,
2238: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
2239: l_sysparam_org_where := replace(l_sysparam_org_where,
2240: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
2234: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
2235: l_bat_org_where := replace(l_bat_org_where,
2236: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
2237: l_bs_org_where := replace(l_bs_org_where,
2238: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
2239: l_sysparam_org_where := replace(l_sysparam_org_where,
2240: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
2241:
2242:
2236: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
2237: l_bs_org_where := replace(l_bs_org_where,
2238: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
2239: l_sysparam_org_where := replace(l_sysparam_org_where,
2240: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
2241:
2242:
2243: l_reporting_entity_name := substrb(XLA_MO_REPORTING_API.get_reporting_entity_name,1,80);
2244: l_reporting_level_name := substrb(XLA_MO_REPORTING_API.get_reporting_level_name,1,30);
2255:
2256: /* Bug fix 4942083*/
2257: IF arp_util.Open_Period_Exists(p_reporting_level,
2258: p_reporting_entity_id,
2259: arp_recon_rep.var_tname.g_gl_date_from,
2260: arp_recon_rep.var_tname.g_gl_date_to) THEN
2261: FND_MESSAGE.SET_NAME('AR','AR_REPORT_ACC_NOT_GEN');--Changed as per Bug 5578884 the parameter to AR from FND as the message is in AR product
2262: l_message_acct := FND_MESSAGE.Get;
2263: END IF;
2256: /* Bug fix 4942083*/
2257: IF arp_util.Open_Period_Exists(p_reporting_level,
2258: p_reporting_entity_id,
2259: arp_recon_rep.var_tname.g_gl_date_from,
2260: arp_recon_rep.var_tname.g_gl_date_to) THEN
2261: FND_MESSAGE.SET_NAME('AR','AR_REPORT_ACC_NOT_GEN');--Changed as per Bug 5578884 the parameter to AR from FND as the message is in AR product
2262: l_message_acct := FND_MESSAGE.Get;
2263: END IF;
2264:
2266: IF p_reporting_level = '3000' THEN
2267: select substrb(hou.name,1,60)
2268: into l_organization
2269: from hr_organization_units hou
2270: where hou.organization_id = arp_recon_rep.var_tname.g_reporting_entity_id;
2271: ELSE
2272: select meaning
2273: into l_organization
2274: from ar_lookups
2318: IF p_gl_date_from IS NULL and p_gl_date_to IS NULL THEN
2319: l_gl_date_where := NULL;
2320: l_gl_date_ard_where := NULL;
2321: ELSIF p_gl_date_from IS NULL THEN
2322: l_gl_date_where :=' and ra.gl_date <= arp_recon_rep.get_gl_date_to()';
2323: l_gl_date_ard_where :=' and hd.accounting_date <= arp_recon_rep.get_gl_date_to()';
2324: ELSIF p_gl_date_to IS NULL THEN
2325: l_gl_date_where :=' and ra.gl_date >= arp_recon_rep.get_gl_date_from() ' ;
2326: l_gl_date_ard_where :=' and hd.accounting_date >= arp_recon_rep.get_gl_date_from() ' ;
2319: l_gl_date_where := NULL;
2320: l_gl_date_ard_where := NULL;
2321: ELSIF p_gl_date_from IS NULL THEN
2322: l_gl_date_where :=' and ra.gl_date <= arp_recon_rep.get_gl_date_to()';
2323: l_gl_date_ard_where :=' and hd.accounting_date <= arp_recon_rep.get_gl_date_to()';
2324: ELSIF p_gl_date_to IS NULL THEN
2325: l_gl_date_where :=' and ra.gl_date >= arp_recon_rep.get_gl_date_from() ' ;
2326: l_gl_date_ard_where :=' and hd.accounting_date >= arp_recon_rep.get_gl_date_from() ' ;
2327: ELSE
2321: ELSIF p_gl_date_from IS NULL THEN
2322: l_gl_date_where :=' and ra.gl_date <= arp_recon_rep.get_gl_date_to()';
2323: l_gl_date_ard_where :=' and hd.accounting_date <= arp_recon_rep.get_gl_date_to()';
2324: ELSIF p_gl_date_to IS NULL THEN
2325: l_gl_date_where :=' and ra.gl_date >= arp_recon_rep.get_gl_date_from() ' ;
2326: l_gl_date_ard_where :=' and hd.accounting_date >= arp_recon_rep.get_gl_date_from() ' ;
2327: ELSE
2328: l_gl_date_where := ' and ra.gl_date between arp_recon_rep.get_gl_date_from() and arp_recon_rep.get_gl_date_to() ';
2329: l_gl_date_ard_where := ' and hd.accounting_date between arp_recon_rep.get_gl_date_from() and arp_recon_rep.get_gl_date_to() ';
2322: l_gl_date_where :=' and ra.gl_date <= arp_recon_rep.get_gl_date_to()';
2323: l_gl_date_ard_where :=' and hd.accounting_date <= arp_recon_rep.get_gl_date_to()';
2324: ELSIF p_gl_date_to IS NULL THEN
2325: l_gl_date_where :=' and ra.gl_date >= arp_recon_rep.get_gl_date_from() ' ;
2326: l_gl_date_ard_where :=' and hd.accounting_date >= arp_recon_rep.get_gl_date_from() ' ;
2327: ELSE
2328: l_gl_date_where := ' and ra.gl_date between arp_recon_rep.get_gl_date_from() and arp_recon_rep.get_gl_date_to() ';
2329: l_gl_date_ard_where := ' and hd.accounting_date between arp_recon_rep.get_gl_date_from() and arp_recon_rep.get_gl_date_to() ';
2330: END IF;
2324: ELSIF p_gl_date_to IS NULL THEN
2325: l_gl_date_where :=' and ra.gl_date >= arp_recon_rep.get_gl_date_from() ' ;
2326: l_gl_date_ard_where :=' and hd.accounting_date >= arp_recon_rep.get_gl_date_from() ' ;
2327: ELSE
2328: l_gl_date_where := ' and ra.gl_date between arp_recon_rep.get_gl_date_from() and arp_recon_rep.get_gl_date_to() ';
2329: l_gl_date_ard_where := ' and hd.accounting_date between arp_recon_rep.get_gl_date_from() and arp_recon_rep.get_gl_date_to() ';
2330: END IF;
2331:
2332: IF p_gl_account_low IS NOT NULL AND p_gl_account_high IS NOT NULL THEN
2325: l_gl_date_where :=' and ra.gl_date >= arp_recon_rep.get_gl_date_from() ' ;
2326: l_gl_date_ard_where :=' and hd.accounting_date >= arp_recon_rep.get_gl_date_from() ' ;
2327: ELSE
2328: l_gl_date_where := ' and ra.gl_date between arp_recon_rep.get_gl_date_from() and arp_recon_rep.get_gl_date_to() ';
2329: l_gl_date_ard_where := ' and hd.accounting_date between arp_recon_rep.get_gl_date_from() and arp_recon_rep.get_gl_date_to() ';
2330: END IF;
2331:
2332: IF p_gl_account_low IS NOT NULL AND p_gl_account_high IS NOT NULL THEN
2333: l_account_where := ' AND ' || AR_CALC_AGING.FLEX_SQL(
2350: FROM fnd_segment_attribute_values fcav,
2351: fnd_id_flex_segments fifs
2352: WHERE fcav.application_id = 101
2353: AND fcav.id_flex_code = 'GL#'
2354: AND fcav.id_flex_num = arp_recon_rep.var_tname.g_chart_of_accounts_id
2355: AND fcav.attribute_value = 'Y'
2356: AND fcav.segment_attribute_type = 'GL_ACCOUNT'
2357: AND fifs.application_id = fcav.application_id
2358: AND fifs.id_flex_code = fcav.id_flex_code
2373: , decode (sign (nvl (lk.unrounded_accounted_cr, 0) - nvl (lk.unrounded_accounted_dr, 0)), - 1
2374: , ''EXCH_LOSS'', ''EXCH_GAIN''), ard.source_type) = ''REC'')
2375: OR (ps.class =''BR''
2376: and not exists (select line_id
2377: from ar_distributions_all ard1, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard1
2378: xla_distribution_links lk1,
2379: xla_ae_lines ae1,
2380: xla_ae_headers hd1
2381: where
2413:
2414: l_source_type_ard_where := ' and ((ard.source_type = ''REC'')
2415: OR (ps.class =''BR''
2416: and not exists (select line_id
2417: from ar_distributions_all ard1 ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard1
2418: where ard1.source_id = ra.receivable_application_id
2419: and ard1.source_type = ''REC''
2420: and ard1.source_table =''RA''
2421: '|| l_ard1_org_where || ')
2440: select meaning
2441: into l_status_meaning
2442: from ar_lookups
2443: where lookup_type = 'POSTED_STATUS'
2444: and lookup_code = arp_recon_rep.var_tname.g_posting_status;
2445:
2446: l_posting_status_where := 'and nvl(ra.gl_posted_date,TO_DATE(''01/01/0001'',''MM/DD/YYYY'')) =
2447: decode(arp_recon_rep.get_posting_status(),
2448: ''POSTED'',ra.gl_posted_date,
2443: where lookup_type = 'POSTED_STATUS'
2444: and lookup_code = arp_recon_rep.var_tname.g_posting_status;
2445:
2446: l_posting_status_where := 'and nvl(ra.gl_posted_date,TO_DATE(''01/01/0001'',''MM/DD/YYYY'')) =
2447: decode(arp_recon_rep.get_posting_status(),
2448: ''POSTED'',ra.gl_posted_date,
2449: ''UNPOSTED'',TO_DATE(''01/01/0001'',''MM/DD/YYYY''),
2450: nvl(ra.gl_posted_date,TO_DATE(''01/01/0001'',''MM/DD/YYYY'')))';
2451:
2449: ''UNPOSTED'',TO_DATE(''01/01/0001'',''MM/DD/YYYY''),
2450: nvl(ra.gl_posted_date,TO_DATE(''01/01/0001'',''MM/DD/YYYY'')))';
2451:
2452: l_posting_status_nul_where := 'and nvl(NULL,TO_DATE(''01/01/0001'',''MM/DD/YYYY'')) =
2453: decode(arp_recon_rep.get_posting_status(),
2454: ''POSTED'',ra.gl_posted_date,
2455: ''UNPOSTED'',TO_DATE(''01/01/0001'',''MM/DD/YYYY''),
2456: nvl(ra.gl_posted_date,TO_DATE(''01/01/0001'',''MM/DD/YYYY'')))';
2457:
2455: ''UNPOSTED'',TO_DATE(''01/01/0001'',''MM/DD/YYYY''),
2456: nvl(ra.gl_posted_date,TO_DATE(''01/01/0001'',''MM/DD/YYYY'')))';
2457:
2458: l_posting_status_ard_where := 'and nvl(ard.gl_posted_date,TO_DATE(''01/01/0001'',''MM/DD/YYYY'')) =
2459: decode(arp_recon_rep.get_posting_status(),
2460: ''POSTED'',ard.gl_posted_date,
2461: ''UNPOSTED'',TO_DATE(''01/01/0001'',''MM/DD/YYYY''),
2462: nvl(ard.gl_posted_date,TO_DATE(''01/01/0001'',''MM/DD/YYYY'')))';
2463: ELSE
2482: bs.name receipt_source,
2483: bat.name batch_name,
2484: l_cat.meaning category,
2485: ard.currency_code currency_code,
2486: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
2487: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
2488: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
2489: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
2490: ar_receipt_methods arm,
2483: bat.name batch_name,
2484: l_cat.meaning category,
2485: ard.currency_code currency_code,
2486: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
2487: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
2488: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
2489: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
2490: ar_receipt_methods arm,
2491: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
2484: l_cat.meaning category,
2485: ard.currency_code currency_code,
2486: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
2487: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
2488: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
2489: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
2490: ar_receipt_methods arm,
2491: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
2492: gl_code_combinations gc,
2485: ard.currency_code currency_code,
2486: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
2487: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
2488: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
2489: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
2490: ar_receipt_methods arm,
2491: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
2492: gl_code_combinations gc,
2493: hz_cust_accounts cust,
2487: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
2488: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
2489: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
2490: ar_receipt_methods arm,
2491: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
2492: gl_code_combinations gc,
2493: hz_cust_accounts cust,
2494: hz_parties party,
2495: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
2491: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
2492: gl_code_combinations gc,
2493: hz_cust_accounts cust,
2494: hz_parties party,
2495: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
2496: ar_batch_sources bs,
2497: '||arp_recon_rep.var_tname.l_ar_receivable_apps_all||' ra,
2498: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
2499: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
2493: hz_cust_accounts cust,
2494: hz_parties party,
2495: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
2496: ar_batch_sources bs,
2497: '||arp_recon_rep.var_tname.l_ar_receivable_apps_all||' ra,
2498: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
2499: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
2500: xla_distribution_links lk,
2501: xla_ae_lines ae,
2494: hz_parties party,
2495: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
2496: ar_batch_sources bs,
2497: '||arp_recon_rep.var_tname.l_ar_receivable_apps_all||' ra,
2498: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
2499: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
2500: xla_distribution_links lk,
2501: xla_ae_lines ae,
2502: xla_ae_headers hd,
2495: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
2496: ar_batch_sources bs,
2497: '||arp_recon_rep.var_tname.l_ar_receivable_apps_all||' ra,
2498: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
2499: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
2500: xla_distribution_links lk,
2501: xla_ae_lines ae,
2502: xla_ae_headers hd,
2503: ar_lookups l_cat
2541: or(ps.class =''BR'' and l_cat.lookup_code = (''BR_''||decode (ae.accounting_class_code, ''UNAPP''
2542: , ''UNAPP'', ''EXCHANGE_GAIN_LOSS''
2543: , decode (sign (nvl (lk.unrounded_accounted_cr, 0) - nvl (lk.unrounded_accounted_dr, 0)), - 1
2544: , ''EXCH_LOSS'', ''EXCH_GAIN''), ard.source_type))))
2545: AND gc.chart_of_accounts_id = arp_recon_rep.get_chart_of_accounts_id()
2546: AND lk.application_id = 222
2547: AND lk.source_distribution_type IN (''AR_DISTRIBUTIONS_ALL'', ''MFAR_DISTRIBUTIONS_ALL'')
2548: AND ae.application_id = 222
2549: AND nvl(ra.confirmed_flag,''Y'') = ''Y''
2586: bs.name receipt_source,
2587: bat.name batch_name,
2588: l_cat.meaning category,
2589: ard.currency_code currency_code,
2590: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
2591: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
2592: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
2593: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
2594: ar_receipt_methods arm,
2587: bat.name batch_name,
2588: l_cat.meaning category,
2589: ard.currency_code currency_code,
2590: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
2591: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
2592: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
2593: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
2594: ar_receipt_methods arm,
2595: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
2588: l_cat.meaning category,
2589: ard.currency_code currency_code,
2590: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
2591: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
2592: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
2593: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
2594: ar_receipt_methods arm,
2595: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
2596: gl_code_combinations gc,
2589: ard.currency_code currency_code,
2590: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
2591: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
2592: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
2593: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
2594: ar_receipt_methods arm,
2595: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
2596: gl_code_combinations gc,
2597: hz_cust_accounts cust,
2591: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
2592: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
2593: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
2594: ar_receipt_methods arm,
2595: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
2596: gl_code_combinations gc,
2597: hz_cust_accounts cust,
2598: hz_parties party,
2599: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
2595: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
2596: gl_code_combinations gc,
2597: hz_cust_accounts cust,
2598: hz_parties party,
2599: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
2600: ar_batch_sources bs,
2601: '||arp_recon_rep.var_tname.l_ar_receivable_apps_all||' ra,
2602: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
2603: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
2597: hz_cust_accounts cust,
2598: hz_parties party,
2599: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
2600: ar_batch_sources bs,
2601: '||arp_recon_rep.var_tname.l_ar_receivable_apps_all||' ra,
2602: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
2603: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
2604: ar_lookups l_cat
2605: where ra.status IN (''APP'',''ACC'', ''ACTIVITY'', ''OTHER ACC'')
2598: hz_parties party,
2599: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
2600: ar_batch_sources bs,
2601: '||arp_recon_rep.var_tname.l_ar_receivable_apps_all||' ra,
2602: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
2603: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
2604: ar_lookups l_cat
2605: where ra.status IN (''APP'',''ACC'', ''ACTIVITY'', ''OTHER ACC'')
2606: AND cr.cash_receipt_id = ra.cash_receipt_id
2599: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
2600: ar_batch_sources bs,
2601: '||arp_recon_rep.var_tname.l_ar_receivable_apps_all||' ra,
2602: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
2603: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
2604: ar_lookups l_cat
2605: where ra.status IN (''APP'',''ACC'', ''ACTIVITY'', ''OTHER ACC'')
2606: AND cr.cash_receipt_id = ra.cash_receipt_id
2607: AND cr.receipt_method_id = arm.receipt_method_id
2619: and l_cat.lookup_code = (''TRADE_''||ard.source_type))
2620: or( ra.amount_applied_from IS NOT NULL
2621: and l_cat.lookup_code = (''CCURR_''||ard.source_type))
2622: or(ps.class =''BR'' and l_cat.lookup_code = (''BR_''||ard.source_type)))
2623: AND gc.chart_of_accounts_id = arp_recon_rep.get_chart_of_accounts_id()
2624: AND ra.posting_control_id <> - 3
2625: AND nvl(ra.confirmed_flag,''Y'') = ''Y''
2626: AND nvl(cr.confirmed_flag,''Y'') = ''Y''
2627: AND crh.first_posted_record_flag = ''Y''
2660: bs.name receipt_source,
2661: bat.name batch_name,
2662: l_cat.meaning category,
2663: ard.currency_code currency_code,
2664: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
2665: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
2666: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
2667: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
2668: ar_receipt_methods arm,
2661: bat.name batch_name,
2662: l_cat.meaning category,
2663: ard.currency_code currency_code,
2664: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
2665: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
2666: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
2667: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
2668: ar_receipt_methods arm,
2669: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
2662: l_cat.meaning category,
2663: ard.currency_code currency_code,
2664: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
2665: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
2666: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
2667: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
2668: ar_receipt_methods arm,
2669: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
2670: gl_code_combinations gc,
2663: ard.currency_code currency_code,
2664: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
2665: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
2666: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
2667: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
2668: ar_receipt_methods arm,
2669: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
2670: gl_code_combinations gc,
2671: hz_cust_accounts cust,
2665: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
2666: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
2667: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
2668: ar_receipt_methods arm,
2669: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
2670: gl_code_combinations gc,
2671: hz_cust_accounts cust,
2672: hz_parties party,
2673: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
2669: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
2670: gl_code_combinations gc,
2671: hz_cust_accounts cust,
2672: hz_parties party,
2673: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
2674: ar_batch_sources bs,
2675: '||arp_recon_rep.var_tname.l_ar_receivable_apps_all||' ra,
2676: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
2677: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
2671: hz_cust_accounts cust,
2672: hz_parties party,
2673: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
2674: ar_batch_sources bs,
2675: '||arp_recon_rep.var_tname.l_ar_receivable_apps_all||' ra,
2676: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
2677: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
2678: ar_lookups l_cat
2679: where ra.status IN (''UNAPP'', ''UNID'')
2672: hz_parties party,
2673: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
2674: ar_batch_sources bs,
2675: '||arp_recon_rep.var_tname.l_ar_receivable_apps_all||' ra,
2676: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
2677: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
2678: ar_lookups l_cat
2679: where ra.status IN (''UNAPP'', ''UNID'')
2680: AND cr.cash_receipt_id = ra.cash_receipt_id
2673: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
2674: ar_batch_sources bs,
2675: '||arp_recon_rep.var_tname.l_ar_receivable_apps_all||' ra,
2676: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
2677: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
2678: ar_lookups l_cat
2679: where ra.status IN (''UNAPP'', ''UNID'')
2680: AND cr.cash_receipt_id = ra.cash_receipt_id
2681: AND cr.receipt_method_id = arm.receipt_method_id
2684: AND ps.payment_schedule_id = ra.applied_payment_schedule_id
2685: AND bat.batch_source_id = bs.batch_source_id(+)
2686: AND bat.org_id = bs.org_id(+)
2687: AND gc.code_combination_id = ard.code_combination_id
2688: AND gc.chart_of_accounts_id = arp_recon_rep.get_chart_of_accounts_id()
2689: AND ard.source_id = ra.receivable_application_id
2690: AND cr.pay_from_customer = cust.cust_account_id(+)
2691: AND cust.party_id = party.party_id(+)
2692: AND ((ra.amount_applied_from IS NULL
2745: bs.name receipt_source,
2746: bat.name batch_name,
2747: l_cat.meaning category,
2748: ard.currency_code currency_code,
2749: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
2750: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
2751: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
2752: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
2753: ar_receipt_methods arm,
2746: bat.name batch_name,
2747: l_cat.meaning category,
2748: ard.currency_code currency_code,
2749: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
2750: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
2751: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
2752: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
2753: ar_receipt_methods arm,
2754: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
2747: l_cat.meaning category,
2748: ard.currency_code currency_code,
2749: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
2750: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
2751: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
2752: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
2753: ar_receipt_methods arm,
2754: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
2755: gl_code_combinations gc,
2748: ard.currency_code currency_code,
2749: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
2750: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
2751: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
2752: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
2753: ar_receipt_methods arm,
2754: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
2755: gl_code_combinations gc,
2756: hz_cust_accounts cust,
2750: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
2751: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
2752: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
2753: ar_receipt_methods arm,
2754: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
2755: gl_code_combinations gc,
2756: hz_cust_accounts cust,
2757: hz_parties party,
2758: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
2754: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
2755: gl_code_combinations gc,
2756: hz_cust_accounts cust,
2757: hz_parties party,
2758: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
2759: ar_batch_sources bs,
2760: '||arp_recon_rep.var_tname.l_ar_receivable_apps_all||' ra,
2761: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
2762: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
2756: hz_cust_accounts cust,
2757: hz_parties party,
2758: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
2759: ar_batch_sources bs,
2760: '||arp_recon_rep.var_tname.l_ar_receivable_apps_all||' ra,
2761: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
2762: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
2763: xla_distribution_links lk,
2764: xla_ae_lines ae,
2757: hz_parties party,
2758: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
2759: ar_batch_sources bs,
2760: '||arp_recon_rep.var_tname.l_ar_receivable_apps_all||' ra,
2761: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
2762: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
2763: xla_distribution_links lk,
2764: xla_ae_lines ae,
2765: xla_ae_headers hd,
2758: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
2759: ar_batch_sources bs,
2760: '||arp_recon_rep.var_tname.l_ar_receivable_apps_all||' ra,
2761: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
2762: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
2763: xla_distribution_links lk,
2764: xla_ae_lines ae,
2765: xla_ae_headers hd,
2766: ar_lookups l_cat
2804: AND lk.ae_header_id = ae.ae_header_id
2805: AND lk.ae_line_num = ae.ae_line_num
2806: AND lk.ae_header_id = hd.ae_header_id
2807: AND ra.set_of_books_id = hd.ledger_id
2808: AND gc.chart_of_accounts_id = arp_recon_rep.get_chart_of_accounts_id()
2809: AND hd.event_type_code <> ''MANUAL''
2810: AND lk.application_id = 222
2811: AND ra.event_id IS NOT NULL
2812: AND lk.source_distribution_type IN (''AR_DISTRIBUTIONS_ALL'', ''MFAR_DISTRIBUTIONS_ALL'')
2849: bs.name receipt_source,
2850: bat.name batch_name,
2851: l_cat.meaning category,
2852: ard.currency_code currency_code,
2853: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
2854: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
2855: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
2856: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
2857: ar_receipt_methods arm,
2850: bat.name batch_name,
2851: l_cat.meaning category,
2852: ard.currency_code currency_code,
2853: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
2854: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
2855: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
2856: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
2857: ar_receipt_methods arm,
2858: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
2851: l_cat.meaning category,
2852: ard.currency_code currency_code,
2853: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
2854: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
2855: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
2856: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
2857: ar_receipt_methods arm,
2858: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
2859: gl_code_combinations gc,
2852: ard.currency_code currency_code,
2853: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
2854: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
2855: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
2856: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
2857: ar_receipt_methods arm,
2858: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
2859: gl_code_combinations gc,
2860: hz_cust_accounts cust,
2854: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
2855: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
2856: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
2857: ar_receipt_methods arm,
2858: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
2859: gl_code_combinations gc,
2860: hz_cust_accounts cust,
2861: hz_parties party,
2862: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
2858: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
2859: gl_code_combinations gc,
2860: hz_cust_accounts cust,
2861: hz_parties party,
2862: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
2863: ar_batch_sources bs,
2864: '||arp_recon_rep.var_tname.l_ar_receivable_apps_all||' ra,
2865: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
2866: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
2860: hz_cust_accounts cust,
2861: hz_parties party,
2862: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
2863: ar_batch_sources bs,
2864: '||arp_recon_rep.var_tname.l_ar_receivable_apps_all||' ra,
2865: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
2866: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
2867: ar_lookups l_cat
2868: where ra.status IN (''APP'', ''ACC'', ''ACTIVITY'', ''OTHER ACC'')
2861: hz_parties party,
2862: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
2863: ar_batch_sources bs,
2864: '||arp_recon_rep.var_tname.l_ar_receivable_apps_all||' ra,
2865: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
2866: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
2867: ar_lookups l_cat
2868: where ra.status IN (''APP'', ''ACC'', ''ACTIVITY'', ''OTHER ACC'')
2869: AND cr.cash_receipt_id = ra.cash_receipt_id
2862: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
2863: ar_batch_sources bs,
2864: '||arp_recon_rep.var_tname.l_ar_receivable_apps_all||' ra,
2865: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
2866: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
2867: ar_lookups l_cat
2868: where ra.status IN (''APP'', ''ACC'', ''ACTIVITY'', ''OTHER ACC'')
2869: AND cr.cash_receipt_id = ra.cash_receipt_id
2870: AND cr.receipt_method_id = arm.receipt_method_id
2873: AND ps.payment_schedule_id = ra.applied_payment_schedule_id
2874: AND bat.batch_source_id = bs.batch_source_id(+)
2875: AND bat.org_id = bs.org_id(+)
2876: AND gc.code_combination_id = ard.code_combination_id
2877: AND gc.chart_of_accounts_id = arp_recon_rep.get_chart_of_accounts_id()
2878: AND ard.source_id = ra.receivable_application_id
2879: AND cr.pay_from_customer = cust.cust_account_id(+)
2880: AND cust.party_id = party.party_id(+)
2881: AND ((ra.amount_applied_from IS NULL
2923: bs.name receipt_source,
2924: bat.name batch_name,
2925: l_cat.meaning category,
2926: ard.currency_code currency_code,
2927: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
2928: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
2929: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
2930: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
2931: ar_receipt_methods arm,
2924: bat.name batch_name,
2925: l_cat.meaning category,
2926: ard.currency_code currency_code,
2927: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
2928: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
2929: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
2930: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
2931: ar_receipt_methods arm,
2932: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
2925: l_cat.meaning category,
2926: ard.currency_code currency_code,
2927: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
2928: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
2929: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
2930: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
2931: ar_receipt_methods arm,
2932: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
2933: gl_code_combinations gc,
2926: ard.currency_code currency_code,
2927: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
2928: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
2929: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
2930: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
2931: ar_receipt_methods arm,
2932: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
2933: gl_code_combinations gc,
2934: hz_cust_accounts cust,
2928: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
2929: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
2930: from '||arp_recon_rep.var_tname.l_ar_cash_receipts_all||' cr,
2931: ar_receipt_methods arm,
2932: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
2933: gl_code_combinations gc,
2934: hz_cust_accounts cust,
2935: hz_parties party,
2936: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
2932: '||arp_recon_rep.var_tname.l_ar_cash_receipt_history_all||' crh,
2933: gl_code_combinations gc,
2934: hz_cust_accounts cust,
2935: hz_parties party,
2936: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
2937: ar_batch_sources bs,
2938: '||arp_recon_rep.var_tname.l_ar_receivable_apps_all||' ra,
2939: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
2940: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
2934: hz_cust_accounts cust,
2935: hz_parties party,
2936: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
2937: ar_batch_sources bs,
2938: '||arp_recon_rep.var_tname.l_ar_receivable_apps_all||' ra,
2939: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
2940: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
2941: ar_lookups l_cat
2942: where ra.status IN (''UNAPP'', ''UNID'')
2935: hz_parties party,
2936: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
2937: ar_batch_sources bs,
2938: '||arp_recon_rep.var_tname.l_ar_receivable_apps_all||' ra,
2939: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
2940: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
2941: ar_lookups l_cat
2942: where ra.status IN (''UNAPP'', ''UNID'')
2943: AND cr.cash_receipt_id = ra.cash_receipt_id
2936: '||arp_recon_rep.var_tname.l_ar_batches_all||' bat,
2937: ar_batch_sources bs,
2938: '||arp_recon_rep.var_tname.l_ar_receivable_apps_all||' ra,
2939: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps,
2940: ar_distributions_all ard, ---'||arp_recon_rep.var_tname.l_ar_distributions_all||' ard,
2941: ar_lookups l_cat
2942: where ra.status IN (''UNAPP'', ''UNID'')
2943: AND cr.cash_receipt_id = ra.cash_receipt_id
2944: AND cr.receipt_method_id = arm.receipt_method_id
2955: and l_cat.lookup_code = (''TRADE_''||ard.source_type))
2956: or( ra.amount_applied_from IS NOT NULL
2957: and l_cat.lookup_code = (''CCURR_''||ard.source_type))
2958: or(ps.class =''BR'' and l_cat.lookup_code = (''BR_''||ard.source_type)))
2959: AND gc.chart_of_accounts_id = arp_recon_rep.get_chart_of_accounts_id()
2960: AND ra.posting_control_id <> - 3
2961: AND ra.status = ''APP''
2962: AND cr.reversal_date IS NOT NULL
2963: AND nvl(ra.confirmed_flag,''Y'') = ''Y''
3242:
3243: log('arcm_journal_load_xml (+)');
3244:
3245: /* Assign the input parameters to the global variables */
3246: arp_recon_rep.var_tname.g_reporting_level := p_reporting_level;
3247: arp_recon_rep.var_tname.g_reporting_entity_id := p_reporting_entity_id;
3248: /* bug 5654975 p_coa_id,p_sob_id is passed incorrectly when the user
3249: has access to multiple Ledgers */
3250: -- arp_recon_rep.var_tname.g_set_of_books_id := p_sob_id;
3243: log('arcm_journal_load_xml (+)');
3244:
3245: /* Assign the input parameters to the global variables */
3246: arp_recon_rep.var_tname.g_reporting_level := p_reporting_level;
3247: arp_recon_rep.var_tname.g_reporting_entity_id := p_reporting_entity_id;
3248: /* bug 5654975 p_coa_id,p_sob_id is passed incorrectly when the user
3249: has access to multiple Ledgers */
3250: -- arp_recon_rep.var_tname.g_set_of_books_id := p_sob_id;
3251: -- arp_recon_rep.var_tname.g_chart_of_accounts_id := p_coa_id;
3246: arp_recon_rep.var_tname.g_reporting_level := p_reporting_level;
3247: arp_recon_rep.var_tname.g_reporting_entity_id := p_reporting_entity_id;
3248: /* bug 5654975 p_coa_id,p_sob_id is passed incorrectly when the user
3249: has access to multiple Ledgers */
3250: -- arp_recon_rep.var_tname.g_set_of_books_id := p_sob_id;
3251: -- arp_recon_rep.var_tname.g_chart_of_accounts_id := p_coa_id;
3252: arp_recon_rep.var_tname.g_gl_date_from := fnd_date.canonical_to_date(p_gl_date_from);
3253: arp_recon_rep.var_tname.g_gl_date_to := fnd_date.canonical_to_date(p_gl_date_to);
3254: arp_recon_rep.var_tname.g_posting_status := p_posting_status;
3247: arp_recon_rep.var_tname.g_reporting_entity_id := p_reporting_entity_id;
3248: /* bug 5654975 p_coa_id,p_sob_id is passed incorrectly when the user
3249: has access to multiple Ledgers */
3250: -- arp_recon_rep.var_tname.g_set_of_books_id := p_sob_id;
3251: -- arp_recon_rep.var_tname.g_chart_of_accounts_id := p_coa_id;
3252: arp_recon_rep.var_tname.g_gl_date_from := fnd_date.canonical_to_date(p_gl_date_from);
3253: arp_recon_rep.var_tname.g_gl_date_to := fnd_date.canonical_to_date(p_gl_date_to);
3254: arp_recon_rep.var_tname.g_posting_status := p_posting_status;
3255:
3248: /* bug 5654975 p_coa_id,p_sob_id is passed incorrectly when the user
3249: has access to multiple Ledgers */
3250: -- arp_recon_rep.var_tname.g_set_of_books_id := p_sob_id;
3251: -- arp_recon_rep.var_tname.g_chart_of_accounts_id := p_coa_id;
3252: arp_recon_rep.var_tname.g_gl_date_from := fnd_date.canonical_to_date(p_gl_date_from);
3253: arp_recon_rep.var_tname.g_gl_date_to := fnd_date.canonical_to_date(p_gl_date_to);
3254: arp_recon_rep.var_tname.g_posting_status := p_posting_status;
3255:
3256: /* Added Conditional Implication to address bug:5181586*/
3249: has access to multiple Ledgers */
3250: -- arp_recon_rep.var_tname.g_set_of_books_id := p_sob_id;
3251: -- arp_recon_rep.var_tname.g_chart_of_accounts_id := p_coa_id;
3252: arp_recon_rep.var_tname.g_gl_date_from := fnd_date.canonical_to_date(p_gl_date_from);
3253: arp_recon_rep.var_tname.g_gl_date_to := fnd_date.canonical_to_date(p_gl_date_to);
3254: arp_recon_rep.var_tname.g_posting_status := p_posting_status;
3255:
3256: /* Added Conditional Implication to address bug:5181586*/
3257: /* Added set of books id and chart of accounts id for bug fix 565497*/
3250: -- arp_recon_rep.var_tname.g_set_of_books_id := p_sob_id;
3251: -- arp_recon_rep.var_tname.g_chart_of_accounts_id := p_coa_id;
3252: arp_recon_rep.var_tname.g_gl_date_from := fnd_date.canonical_to_date(p_gl_date_from);
3253: arp_recon_rep.var_tname.g_gl_date_to := fnd_date.canonical_to_date(p_gl_date_to);
3254: arp_recon_rep.var_tname.g_posting_status := p_posting_status;
3255:
3256: /* Added Conditional Implication to address bug:5181586*/
3257: /* Added set of books id and chart of accounts id for bug fix 565497*/
3258: IF p_reporting_level = 1000 THEN
3264: l_sob_id,
3265: l_functional_currency,
3266: l_coa_id
3267: FROM gl_sets_of_books sob
3268: WHERE sob.set_of_books_id = arp_recon_rep.var_tname.g_reporting_entity_id;
3269:
3270: ELSIF p_reporting_level = 3000 THEN
3271: SELECT sob.name sob_name,
3272: sob.set_of_books_id,
3278: l_coa_id
3279: FROM gl_sets_of_books sob,
3280: ar_system_parameters sysparam
3281: WHERE sob.set_of_books_id = sysparam.set_of_books_id
3282: AND sysparam.org_id = arp_recon_rep.var_tname.g_reporting_entity_id;
3283:
3284: END IF;
3285: /* Changes for bug:5181586 ends*/
3286: arp_recon_rep.var_tname.g_set_of_books_id := l_sob_id;
3282: AND sysparam.org_id = arp_recon_rep.var_tname.g_reporting_entity_id;
3283:
3284: END IF;
3285: /* Changes for bug:5181586 ends*/
3286: arp_recon_rep.var_tname.g_set_of_books_id := l_sob_id;
3287: arp_recon_rep.var_tname.g_chart_of_accounts_id := l_coa_id;
3288:
3289:
3290: /* Initialize the reporting context */
3283:
3284: END IF;
3285: /* Changes for bug:5181586 ends*/
3286: arp_recon_rep.var_tname.g_set_of_books_id := l_sob_id;
3287: arp_recon_rep.var_tname.g_chart_of_accounts_id := l_coa_id;
3288:
3289:
3290: /* Initialize the reporting context */
3291: init(p_sob_id);
3302:
3303:
3304: /* Replace the bind variables with global functions */
3305: l_ra_org_where := replace(l_ra_org_where,
3306: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3307: l_ard_org_where := replace(l_ard_org_where,
3308: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3309: l_ps_org_where := replace(l_ps_org_where,
3310: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3304: /* Replace the bind variables with global functions */
3305: l_ra_org_where := replace(l_ra_org_where,
3306: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3307: l_ard_org_where := replace(l_ard_org_where,
3308: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3309: l_ps_org_where := replace(l_ps_org_where,
3310: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3311: l_ps1_org_where := replace(l_ps1_org_where,
3312: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3306: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3307: l_ard_org_where := replace(l_ard_org_where,
3308: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3309: l_ps_org_where := replace(l_ps_org_where,
3310: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3311: l_ps1_org_where := replace(l_ps1_org_where,
3312: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3313: l_sysparam_org_where := replace(l_sysparam_org_where,
3314: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3308: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3309: l_ps_org_where := replace(l_ps_org_where,
3310: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3311: l_ps1_org_where := replace(l_ps1_org_where,
3312: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3313: l_sysparam_org_where := replace(l_sysparam_org_where,
3314: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3315: l_reporting_entity_name := substrb(XLA_MO_REPORTING_API.get_reporting_entity_name,1,80);
3316: l_reporting_level_name := substrb(XLA_MO_REPORTING_API.get_reporting_level_name,1,30);
3310: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3311: l_ps1_org_where := replace(l_ps1_org_where,
3312: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3313: l_sysparam_org_where := replace(l_sysparam_org_where,
3314: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3315: l_reporting_entity_name := substrb(XLA_MO_REPORTING_API.get_reporting_entity_name,1,80);
3316: l_reporting_level_name := substrb(XLA_MO_REPORTING_API.get_reporting_level_name,1,30);
3317:
3318: /* Multi Org Uptake: Show appropriate message to the user depending upon the security profile */
3327:
3328: /* Bug fix 4942083*/
3329: IF arp_util.Open_Period_Exists(p_reporting_level,
3330: p_reporting_entity_id,
3331: arp_recon_rep.var_tname.g_gl_date_from,
3332: arp_recon_rep.var_tname.g_gl_date_to) THEN
3333: FND_MESSAGE.SET_NAME('AR','AR_REPORT_ACC_NOT_GEN');--Changed as per Bug 5578884 the parameter to AR from FND as the message is in AR product
3334: l_message_acct := FND_MESSAGE.Get;
3335: END IF;
3328: /* Bug fix 4942083*/
3329: IF arp_util.Open_Period_Exists(p_reporting_level,
3330: p_reporting_entity_id,
3331: arp_recon_rep.var_tname.g_gl_date_from,
3332: arp_recon_rep.var_tname.g_gl_date_to) THEN
3333: FND_MESSAGE.SET_NAME('AR','AR_REPORT_ACC_NOT_GEN');--Changed as per Bug 5578884 the parameter to AR from FND as the message is in AR product
3334: l_message_acct := FND_MESSAGE.Get;
3335: END IF;
3336:
3337: IF p_reporting_level = '3000' THEN
3338: select substrb(hou.name,1,60)
3339: into l_organization
3340: from hr_organization_units hou
3341: where hou.organization_id = arp_recon_rep.var_tname.g_reporting_entity_id;
3342: ELSE
3343: select meaning
3344: into l_organization
3345: from ar_lookups
3386:
3387: IF p_gl_date_from IS NULL and p_gl_date_to IS NULL THEN
3388: l_gl_date_where := NULL;
3389: ELSIF p_gl_date_from IS NULL THEN
3390: l_gl_date_where :=' and ra.gl_date <= arp_recon_rep.get_gl_date_to()';
3391: ELSIF p_gl_date_to IS NULL THEN
3392: l_gl_date_where :=' and ra.gl_date >= arp_recon_rep.get_gl_date_from() ' ;
3393: ELSE
3394: l_gl_date_where := ' and ra.gl_date between arp_recon_rep.get_gl_date_from() and arp_recon_rep.get_gl_date_to() ';
3388: l_gl_date_where := NULL;
3389: ELSIF p_gl_date_from IS NULL THEN
3390: l_gl_date_where :=' and ra.gl_date <= arp_recon_rep.get_gl_date_to()';
3391: ELSIF p_gl_date_to IS NULL THEN
3392: l_gl_date_where :=' and ra.gl_date >= arp_recon_rep.get_gl_date_from() ' ;
3393: ELSE
3394: l_gl_date_where := ' and ra.gl_date between arp_recon_rep.get_gl_date_from() and arp_recon_rep.get_gl_date_to() ';
3395: END IF;
3396:
3390: l_gl_date_where :=' and ra.gl_date <= arp_recon_rep.get_gl_date_to()';
3391: ELSIF p_gl_date_to IS NULL THEN
3392: l_gl_date_where :=' and ra.gl_date >= arp_recon_rep.get_gl_date_from() ' ;
3393: ELSE
3394: l_gl_date_where := ' and ra.gl_date between arp_recon_rep.get_gl_date_from() and arp_recon_rep.get_gl_date_to() ';
3395: END IF;
3396:
3397: IF p_gl_account_low IS NOT NULL AND p_gl_account_high IS NOT NULL THEN
3398: l_account_where := ' AND ' || AR_CALC_AGING.FLEX_SQL(
3415: FROM fnd_segment_attribute_values fcav,
3416: fnd_id_flex_segments fifs
3417: WHERE fcav.application_id = 101
3418: AND fcav.id_flex_code = 'GL#'
3419: AND fcav.id_flex_num = arp_recon_rep.var_tname.g_chart_of_accounts_id
3420: AND fcav.attribute_value = 'Y'
3421: AND fcav.segment_attribute_type = 'GL_ACCOUNT'
3422: AND fifs.application_id = fcav.application_id
3423: AND fifs.id_flex_code = fcav.id_flex_code
3451: select meaning
3452: into l_status_meaning
3453: from ar_lookups
3454: where lookup_type = 'POSTED_STATUS'
3455: and lookup_code = arp_recon_rep.var_tname.g_posting_status;
3456:
3457: l_posting_status_where := 'and nvl(ra.gl_posted_date,TO_DATE(''01/01/0001'',''MM/DD/YYYY'')) =
3458: decode(arp_recon_rep.get_posting_status(),
3459: ''POSTED'',ra.gl_posted_date,
3454: where lookup_type = 'POSTED_STATUS'
3455: and lookup_code = arp_recon_rep.var_tname.g_posting_status;
3456:
3457: l_posting_status_where := 'and nvl(ra.gl_posted_date,TO_DATE(''01/01/0001'',''MM/DD/YYYY'')) =
3458: decode(arp_recon_rep.get_posting_status(),
3459: ''POSTED'',ra.gl_posted_date,
3460: ''UNPOSTED'',TO_DATE(''01/01/0001'',''MM/DD/YYYY''),
3461: nvl(ra.gl_posted_date,TO_DATE(''01/01/0001'',''MM/DD/YYYY'')))';
3462: ELSE
3484: to_char(ps1.exchange_date,''YYYY-MM-DD'') trx_exchange_date,
3485: ps.exchange_rate cm_exchange_rate,
3486: ps1.exchange_rate trx_exchange_rate,
3487: l_cat.meaning category,
3488: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
3489: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
3490: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
3491: from '||arp_recon_rep.var_tname.l_ar_receivable_apps_all||' ra ,
3492: '||arp_recon_rep.var_tname.l_ar_distributions_all||' ard ,
3485: ps.exchange_rate cm_exchange_rate,
3486: ps1.exchange_rate trx_exchange_rate,
3487: l_cat.meaning category,
3488: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
3489: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
3490: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
3491: from '||arp_recon_rep.var_tname.l_ar_receivable_apps_all||' ra ,
3492: '||arp_recon_rep.var_tname.l_ar_distributions_all||' ard ,
3493: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps ,
3486: ps1.exchange_rate trx_exchange_rate,
3487: l_cat.meaning category,
3488: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
3489: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
3490: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
3491: from '||arp_recon_rep.var_tname.l_ar_receivable_apps_all||' ra ,
3492: '||arp_recon_rep.var_tname.l_ar_distributions_all||' ard ,
3493: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps ,
3494: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps1 ,
3487: l_cat.meaning category,
3488: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
3489: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
3490: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
3491: from '||arp_recon_rep.var_tname.l_ar_receivable_apps_all||' ra ,
3492: '||arp_recon_rep.var_tname.l_ar_distributions_all||' ard ,
3493: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps ,
3494: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps1 ,
3495: gl_code_combinations gc,
3488: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''ALL'',gc.code_combination_id) account,
3489: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
3490: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
3491: from '||arp_recon_rep.var_tname.l_ar_receivable_apps_all||' ra ,
3492: '||arp_recon_rep.var_tname.l_ar_distributions_all||' ard ,
3493: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps ,
3494: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps1 ,
3495: gl_code_combinations gc,
3496: hz_cust_accounts cust,
3489: ar_calc_aging.get_value(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_BALANCING'',gc.code_combination_id) company,
3490: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
3491: from '||arp_recon_rep.var_tname.l_ar_receivable_apps_all||' ra ,
3492: '||arp_recon_rep.var_tname.l_ar_distributions_all||' ard ,
3493: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps ,
3494: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps1 ,
3495: gl_code_combinations gc,
3496: hz_cust_accounts cust,
3497: hz_parties party,
3490: ar_calc_aging.get_description(101,''GL#'',arp_recon_rep.get_chart_of_accounts_id(),''GL_ACCOUNT'',gc.code_combination_id) account_desc
3491: from '||arp_recon_rep.var_tname.l_ar_receivable_apps_all||' ra ,
3492: '||arp_recon_rep.var_tname.l_ar_distributions_all||' ard ,
3493: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps ,
3494: '||arp_recon_rep.var_tname.l_ar_payment_schedules_all||' ps1 ,
3495: gl_code_combinations gc,
3496: hz_cust_accounts cust,
3497: hz_parties party,
3498: ar_lookups l_cat
3505: and ra.applied_payment_schedule_id = ps1.payment_schedule_id
3506: and cust.cust_account_id = ps.customer_id
3507: and cust.party_id = party.party_id
3508: and gc.code_combination_id = ard.code_combination_id
3509: and gc.chart_of_accounts_id = arp_recon_rep.get_chart_of_accounts_id()
3510: and l_cat.lookup_type = ''ARRGTA_FUNCTION_MAPPING''
3511: and l_cat.lookup_code = (''CMAPP_''||ard.source_type)
3512: '||l_ard_org_where||'
3513: '||l_ra_org_where||'
3726: /* Assign the input parameters to the global variables */
3727: /* AR to GL Reconciliation Report can be run only for the Set of Books
3728: So hard coding the reporting_level and context */
3729:
3730: arp_recon_rep.var_tname.g_reporting_level := 1000;
3731: arp_recon_rep.var_tname.g_reporting_entity_id := p_reporting_entity_id;
3732: arp_recon_rep.var_tname.g_set_of_books_id := p_reporting_entity_id;
3733: arp_recon_rep.var_tname.g_chart_of_accounts_id := p_coa_id;
3734: arp_recon_rep.var_tname.g_period_name := p_period_name;
3727: /* AR to GL Reconciliation Report can be run only for the Set of Books
3728: So hard coding the reporting_level and context */
3729:
3730: arp_recon_rep.var_tname.g_reporting_level := 1000;
3731: arp_recon_rep.var_tname.g_reporting_entity_id := p_reporting_entity_id;
3732: arp_recon_rep.var_tname.g_set_of_books_id := p_reporting_entity_id;
3733: arp_recon_rep.var_tname.g_chart_of_accounts_id := p_coa_id;
3734: arp_recon_rep.var_tname.g_period_name := p_period_name;
3735: arp_recon_rep.var_tname.g_out_of_balance_only := p_out_of_balance_only;
3728: So hard coding the reporting_level and context */
3729:
3730: arp_recon_rep.var_tname.g_reporting_level := 1000;
3731: arp_recon_rep.var_tname.g_reporting_entity_id := p_reporting_entity_id;
3732: arp_recon_rep.var_tname.g_set_of_books_id := p_reporting_entity_id;
3733: arp_recon_rep.var_tname.g_chart_of_accounts_id := p_coa_id;
3734: arp_recon_rep.var_tname.g_period_name := p_period_name;
3735: arp_recon_rep.var_tname.g_out_of_balance_only := p_out_of_balance_only;
3736:
3729:
3730: arp_recon_rep.var_tname.g_reporting_level := 1000;
3731: arp_recon_rep.var_tname.g_reporting_entity_id := p_reporting_entity_id;
3732: arp_recon_rep.var_tname.g_set_of_books_id := p_reporting_entity_id;
3733: arp_recon_rep.var_tname.g_chart_of_accounts_id := p_coa_id;
3734: arp_recon_rep.var_tname.g_period_name := p_period_name;
3735: arp_recon_rep.var_tname.g_out_of_balance_only := p_out_of_balance_only;
3736:
3737: /* Initialize the reporting context */
3730: arp_recon_rep.var_tname.g_reporting_level := 1000;
3731: arp_recon_rep.var_tname.g_reporting_entity_id := p_reporting_entity_id;
3732: arp_recon_rep.var_tname.g_set_of_books_id := p_reporting_entity_id;
3733: arp_recon_rep.var_tname.g_chart_of_accounts_id := p_coa_id;
3734: arp_recon_rep.var_tname.g_period_name := p_period_name;
3735: arp_recon_rep.var_tname.g_out_of_balance_only := p_out_of_balance_only;
3736:
3737: /* Initialize the reporting context */
3738: init(p_sob_id);
3731: arp_recon_rep.var_tname.g_reporting_entity_id := p_reporting_entity_id;
3732: arp_recon_rep.var_tname.g_set_of_books_id := p_reporting_entity_id;
3733: arp_recon_rep.var_tname.g_chart_of_accounts_id := p_coa_id;
3734: arp_recon_rep.var_tname.g_period_name := p_period_name;
3735: arp_recon_rep.var_tname.g_out_of_balance_only := p_out_of_balance_only;
3736:
3737: /* Initialize the reporting context */
3738: init(p_sob_id);
3739:
3752: l_ath_org_where := XLA_MO_REPORTING_API.Get_Predicate('ard',NULL);
3753:
3754: /* Replace the bind variables with global functions */
3755: l_ra_org_where := replace(l_ra_org_where,
3756: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3757: l_adj_org_where := replace(l_adj_org_where,
3758: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3759: l_ard_org_where := replace(l_ard_org_where,
3760: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3754: /* Replace the bind variables with global functions */
3755: l_ra_org_where := replace(l_ra_org_where,
3756: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3757: l_adj_org_where := replace(l_adj_org_where,
3758: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3759: l_ard_org_where := replace(l_ard_org_where,
3760: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3761: l_gl_dist_org_where := replace(l_gl_dist_org_where,
3762: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3756: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3757: l_adj_org_where := replace(l_adj_org_where,
3758: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3759: l_ard_org_where := replace(l_ard_org_where,
3760: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3761: l_gl_dist_org_where := replace(l_gl_dist_org_where,
3762: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3763: l_sysparam_org_where := replace(l_sysparam_org_where,
3764: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3758: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3759: l_ard_org_where := replace(l_ard_org_where,
3760: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3761: l_gl_dist_org_where := replace(l_gl_dist_org_where,
3762: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3763: l_sysparam_org_where := replace(l_sysparam_org_where,
3764: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3765: l_mcd_org_where := replace(l_mcd_org_where,
3766: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3760: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3761: l_gl_dist_org_where := replace(l_gl_dist_org_where,
3762: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3763: l_sysparam_org_where := replace(l_sysparam_org_where,
3764: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3765: l_mcd_org_where := replace(l_mcd_org_where,
3766: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3767: l_crh_org_where := replace(l_crh_org_where,
3768: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3762: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3763: l_sysparam_org_where := replace(l_sysparam_org_where,
3764: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3765: l_mcd_org_where := replace(l_mcd_org_where,
3766: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3767: l_crh_org_where := replace(l_crh_org_where,
3768: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3769: /* Bug fix 6432847 */
3770: l_cr_org_where := replace(l_cr_org_where,
3764: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3765: l_mcd_org_where := replace(l_mcd_org_where,
3766: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3767: l_crh_org_where := replace(l_crh_org_where,
3768: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3769: /* Bug fix 6432847 */
3770: l_cr_org_where := replace(l_cr_org_where,
3771: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3772: l_ath_org_where := replace(l_ath_org_where,
3767: l_crh_org_where := replace(l_crh_org_where,
3768: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3769: /* Bug fix 6432847 */
3770: l_cr_org_where := replace(l_cr_org_where,
3771: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3772: l_ath_org_where := replace(l_ath_org_where,
3773: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3774:
3775: l_reporting_entity_name := substrb(XLA_MO_REPORTING_API.get_reporting_entity_name,1,80);
3769: /* Bug fix 6432847 */
3770: l_cr_org_where := replace(l_cr_org_where,
3771: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3772: l_ath_org_where := replace(l_ath_org_where,
3773: ':p_reporting_entity_id','arp_recon_rep.get_reporting_entity_id()');
3774:
3775: l_reporting_entity_name := substrb(XLA_MO_REPORTING_API.get_reporting_entity_name,1,80);
3776: l_reporting_level_name := substrb(XLA_MO_REPORTING_API.get_reporting_level_name,1,30);
3777:
3839: FROM fnd_segment_attribute_values fcav,
3840: fnd_id_flex_segments fifs
3841: WHERE fcav.application_id = 101
3842: AND fcav.id_flex_code = 'GL#'
3843: AND fcav.id_flex_num = arp_recon_rep.var_tname.g_chart_of_accounts_id
3844: AND fcav.attribute_value = 'Y'
3845: AND fcav.segment_attribute_type = 'GL_ACCOUNT'
3846: AND fifs.application_id = fcav.application_id
3847: AND fifs.id_flex_code = fcav.id_flex_code
3862: sob.currency_code functional_currency
3863: INTO l_sob_name,
3864: l_functional_currency
3865: FROM gl_sets_of_books sob
3866: WHERE sob.set_of_books_id = arp_recon_rep.var_tname.g_reporting_entity_id;
3867:
3868: ELSIF p_reporting_level = 3000 THEN
3869: SELECT sob.name sob_name,
3870: sob.currency_code functional_currency
3872: l_functional_currency
3873: FROM gl_sets_of_books sob,
3874: ar_system_parameters sysparam
3875: WHERE sob.set_of_books_id = sysparam.set_of_books_id
3876: AND sysparam.org_id = arp_recon_rep.var_tname.g_reporting_entity_id;
3877:
3878: END IF;
3879: /* Changes for bug:5181586 ends*/
3880:
3877:
3878: END IF;
3879: /* Changes for bug:5181586 ends*/
3880:
3881: arp_recon_rep.var_tname.g_functional_currency := l_functional_currency;
3882:
3883: /* Get the format mask for the function currency */
3884: select fnd_currency.get_format_mask(l_functional_currency,40)
3885: into l_format
3889: INTO l_gl_date_from , l_gl_date_to
3890: FROM gl_periods p, gl_sets_of_books b
3891: WHERE p.period_set_name = b.period_set_name
3892: AND p.period_type = b.accounted_period_type
3893: AND b.set_of_books_id = arp_recon_rep.var_tname.g_set_of_books_id
3894: AND p.period_name = arp_recon_rep.var_tname.g_period_name;
3895: arp_recon_rep.var_tname.g_gl_date_from := l_gl_date_from;
3896: arp_recon_rep.var_tname.g_gl_date_to := l_gl_date_to;
3897:
3890: FROM gl_periods p, gl_sets_of_books b
3891: WHERE p.period_set_name = b.period_set_name
3892: AND p.period_type = b.accounted_period_type
3893: AND b.set_of_books_id = arp_recon_rep.var_tname.g_set_of_books_id
3894: AND p.period_name = arp_recon_rep.var_tname.g_period_name;
3895: arp_recon_rep.var_tname.g_gl_date_from := l_gl_date_from;
3896: arp_recon_rep.var_tname.g_gl_date_to := l_gl_date_to;
3897:
3898: /* Bug fix 4942083*/
3891: WHERE p.period_set_name = b.period_set_name
3892: AND p.period_type = b.accounted_period_type
3893: AND b.set_of_books_id = arp_recon_rep.var_tname.g_set_of_books_id
3894: AND p.period_name = arp_recon_rep.var_tname.g_period_name;
3895: arp_recon_rep.var_tname.g_gl_date_from := l_gl_date_from;
3896: arp_recon_rep.var_tname.g_gl_date_to := l_gl_date_to;
3897:
3898: /* Bug fix 4942083*/
3899: IF arp_util.Open_Period_Exists(p_reporting_level,
3892: AND p.period_type = b.accounted_period_type
3893: AND b.set_of_books_id = arp_recon_rep.var_tname.g_set_of_books_id
3894: AND p.period_name = arp_recon_rep.var_tname.g_period_name;
3895: arp_recon_rep.var_tname.g_gl_date_from := l_gl_date_from;
3896: arp_recon_rep.var_tname.g_gl_date_to := l_gl_date_to;
3897:
3898: /* Bug fix 4942083*/
3899: IF arp_util.Open_Period_Exists(p_reporting_level,
3900: p_reporting_entity_id,
3897:
3898: /* Bug fix 4942083*/
3899: IF arp_util.Open_Period_Exists(p_reporting_level,
3900: p_reporting_entity_id,
3901: arp_recon_rep.var_tname.g_gl_date_from,
3902: arp_recon_rep.var_tname.g_gl_date_to) THEN
3903: FND_MESSAGE.SET_NAME('AR','AR_REPORT_ACC_NOT_GEN');--Changed as per Bug 5578884 the parameter to AR from FND as the message is in AR product
3904: l_message_acct := FND_MESSAGE.Get;
3905: END IF;
3898: /* Bug fix 4942083*/
3899: IF arp_util.Open_Period_Exists(p_reporting_level,
3900: p_reporting_entity_id,
3901: arp_recon_rep.var_tname.g_gl_date_from,
3902: arp_recon_rep.var_tname.g_gl_date_to) THEN
3903: FND_MESSAGE.SET_NAME('AR','AR_REPORT_ACC_NOT_GEN');--Changed as per Bug 5578884 the parameter to AR from FND as the message is in AR product
3904: l_message_acct := FND_MESSAGE.Get;
3905: END IF;
3906:
4750: 'ar_gl_recon_gt' is 240, but the return value's length can up to 2000, so cut the
4751: description of it's more than 240./*
4752: /*update ar_gl_recon_gt
4753: set account_desc = ar_calc_aging.get_description (101,'GL#',
4754: arp_recon_rep.get_chart_of_accounts_id(),'GL_ACCOUNT',code_combination_id);*/
4755:
4756:
4757: -- Fix for bug 16357135 .. pass "code_combination_id" in place of
4758: -- "account" for the get_decription function
4757: -- Fix for bug 16357135 .. pass "code_combination_id" in place of
4758: -- "account" for the get_decription function
4759: update ar_gl_recon_gt
4760: set account_desc = substr(get_description(101,'GL#',
4761: arp_recon_rep.get_chart_of_accounts_id(),'GL_ACCOUNT',code_combination_id),1,235);
4762:
4763: l_xml_query := '
4764: select code_combination_id,
4765: account_type,
4783: nvl(gl_interface_cr,0) gl_interface_credit,
4784: nvl(receivables_dr,0) receivables_debit,
4785: nvl(receivables_cr,0) receivables_credit
4786: from ar_gl_recon_gt
4787: where ''N'' = arp_recon_rep.get_out_of_balance_only()
4788: or nvl(receivables_dr,0)- nvl(subledger_rec_dr,0) <> 0
4789: or nvl(receivables_cr,0)- nvl(subledger_rec_cr,0) <> 0
4790: order by account_type_code,
4791: company,
4961: return l_description;
4962:
4963: END get_description;
4964:
4965: END ARP_RECON_REP;