44: l_unapp_end_select_sql VARCHAR2(2000);
45:
46: BEGIN
47: -- Reset all the global variables to NULL or to the default value
48: fii_ar_util_pkg.reset_globals;
49:
50: -- Get the parameters and set the global variables
51: fii_ar_util_pkg.get_parameters(p_page_parameter_tbl);
52:
47: -- Reset all the global variables to NULL or to the default value
48: fii_ar_util_pkg.reset_globals;
49:
50: -- Get the parameters and set the global variables
51: fii_ar_util_pkg.get_parameters(p_page_parameter_tbl);
52:
53: fii_ar_util_pkg.g_view_by := 'ORGANIZATION+FII_OPERATING_UNITS';
54:
55: -- Retrieve values for global variables
49:
50: -- Get the parameters and set the global variables
51: fii_ar_util_pkg.get_parameters(p_page_parameter_tbl);
52:
53: fii_ar_util_pkg.g_view_by := 'ORGANIZATION+FII_OPERATING_UNITS';
54:
55: -- Retrieve values for global variables
56: l_as_of_date := fii_ar_util_pkg.g_as_of_date;
57: l_curr_suffix := fii_ar_util_pkg.g_curr_suffix;
52:
53: fii_ar_util_pkg.g_view_by := 'ORGANIZATION+FII_OPERATING_UNITS';
54:
55: -- Retrieve values for global variables
56: l_as_of_date := fii_ar_util_pkg.g_as_of_date;
57: l_curr_suffix := fii_ar_util_pkg.g_curr_suffix;
58: l_collector_id := fii_ar_util_pkg.g_collector_id;
59: l_cust_id := fii_ar_util_pkg.g_party_id;
60: l_industry_id := fii_ar_util_pkg.g_industry_id;
53: fii_ar_util_pkg.g_view_by := 'ORGANIZATION+FII_OPERATING_UNITS';
54:
55: -- Retrieve values for global variables
56: l_as_of_date := fii_ar_util_pkg.g_as_of_date;
57: l_curr_suffix := fii_ar_util_pkg.g_curr_suffix;
58: l_collector_id := fii_ar_util_pkg.g_collector_id;
59: l_cust_id := fii_ar_util_pkg.g_party_id;
60: l_industry_id := fii_ar_util_pkg.g_industry_id;
61: l_itd_bitand := fii_ar_util_pkg.g_bitand_inc_todate;
54:
55: -- Retrieve values for global variables
56: l_as_of_date := fii_ar_util_pkg.g_as_of_date;
57: l_curr_suffix := fii_ar_util_pkg.g_curr_suffix;
58: l_collector_id := fii_ar_util_pkg.g_collector_id;
59: l_cust_id := fii_ar_util_pkg.g_party_id;
60: l_industry_id := fii_ar_util_pkg.g_industry_id;
61: l_itd_bitand := fii_ar_util_pkg.g_bitand_inc_todate;
62:
55: -- Retrieve values for global variables
56: l_as_of_date := fii_ar_util_pkg.g_as_of_date;
57: l_curr_suffix := fii_ar_util_pkg.g_curr_suffix;
58: l_collector_id := fii_ar_util_pkg.g_collector_id;
59: l_cust_id := fii_ar_util_pkg.g_party_id;
60: l_industry_id := fii_ar_util_pkg.g_industry_id;
61: l_itd_bitand := fii_ar_util_pkg.g_bitand_inc_todate;
62:
63: -- Populate global temp table based on the parameters chosen
56: l_as_of_date := fii_ar_util_pkg.g_as_of_date;
57: l_curr_suffix := fii_ar_util_pkg.g_curr_suffix;
58: l_collector_id := fii_ar_util_pkg.g_collector_id;
59: l_cust_id := fii_ar_util_pkg.g_party_id;
60: l_industry_id := fii_ar_util_pkg.g_industry_id;
61: l_itd_bitand := fii_ar_util_pkg.g_bitand_inc_todate;
62:
63: -- Populate global temp table based on the parameters chosen
64: fii_ar_util_pkg.populate_summary_gt_tables;
57: l_curr_suffix := fii_ar_util_pkg.g_curr_suffix;
58: l_collector_id := fii_ar_util_pkg.g_collector_id;
59: l_cust_id := fii_ar_util_pkg.g_party_id;
60: l_industry_id := fii_ar_util_pkg.g_industry_id;
61: l_itd_bitand := fii_ar_util_pkg.g_bitand_inc_todate;
62:
63: -- Populate global temp table based on the parameters chosen
64: fii_ar_util_pkg.populate_summary_gt_tables;
65:
60: l_industry_id := fii_ar_util_pkg.g_industry_id;
61: l_itd_bitand := fii_ar_util_pkg.g_bitand_inc_todate;
62:
63: -- Populate global temp table based on the parameters chosen
64: fii_ar_util_pkg.populate_summary_gt_tables;
65:
66: -- Set the currency suffix for use in the amount columns
67: IF (l_curr_suffix = '_p_v') THEN
68: l_currency := '_prim';
106:
107: -- Only add the join on cust_acct_id if we have a specific customer acct
108: -- selected
109:
110: IF fii_ar_util_pkg.g_cust_account <> '-111' THEN
111: --l_from_table := l_from_table || ' fii_cust_accounts acct, ';
112: l_where_clause := l_where_clause ||
113: ' AND f.bill_to_customer_id= :CUST_ACCOUNT
114: AND acct.parent_party_id = :PARTY_ID
282:
283: ----------------------------------------------------------------
284: -- Find out the sort order column and construct the order clause
285: ----------------------------------------------------------------
286: l_order_clause := fii_ar_util_pkg.g_order_by;
287:
288: -- Set the default order by clause for displaying NULL last when
289: -- we sort in descending order
290: IF (instr(l_order_clause, 'DATE') <> 0) THEN
308: -- based on the receipt amount value.
309: -------------------------------------------------------------
310: IF l_source_report <> 'FII_AR_APP_RCT_DTL' THEN
311: --In case of Unapplied Receipt Detail source the sql structure is different
312: l_order_column := substr(fii_ar_util_pkg.g_order_by, 1,
313: instr(l_order_clause, ' DESC'));
314: IF (l_order_column is NULL) THEN
315: --Ascending order
316: l_order_by := ' &ORDER_BY_CLAUSE';
345: -------------------------------------------------------------
346: -- User has asked for a descending order sort. We'll also
347: -- make sure NULL will appear last with the default order clause.
348: -------------------------------------------------------------
349: l_order_column := substr(fii_ar_util_pkg.g_order_by, 1,
350: instr(l_order_clause, ' DESC'));
351: l_order_by := ' ORDER BY NVL('|| l_order_column || ', '
352: || l_order_null || ' ) DESC';
353:
444: FII_AR_RCT_AMT_DRILL,
445: FII_AR_RCT_APP_AMT_DRILL ' || l_order_by;
446:
447: -- Bind variables so that no literal will be used in the pmv report
448: fii_ar_util_pkg.bind_variable
449: (p_sqlstmt => l_sqlstmt,
450: p_page_parameter_tbl => p_page_parameter_tbl,
451: p_sql_output => p_pastdue_rec_aging_sql,
452: p_bind_output_table => p_pastdue_rec_aging_output);
475: l_rct_amt_url VARCHAR2(500) := NULL;
476:
477: BEGIN
478: -- Reset all the global variables to NULL or to the default value
479: fii_ar_util_pkg.reset_globals;
480:
481: -- Get the parameters and set the global variables
482: fii_ar_util_pkg.get_parameters(p_page_parameter_tbl);
483:
478: -- Reset all the global variables to NULL or to the default value
479: fii_ar_util_pkg.reset_globals;
480:
481: -- Get the parameters and set the global variables
482: fii_ar_util_pkg.get_parameters(p_page_parameter_tbl);
483:
484: fii_ar_util_pkg.g_view_by := 'ORGANIZATION+FII_OPERATING_UNITS';
485:
486: -- Retrieve values for global variables
480:
481: -- Get the parameters and set the global variables
482: fii_ar_util_pkg.get_parameters(p_page_parameter_tbl);
483:
484: fii_ar_util_pkg.g_view_by := 'ORGANIZATION+FII_OPERATING_UNITS';
485:
486: -- Retrieve values for global variables
487: l_as_of_date := fii_ar_util_pkg.g_as_of_date;
488: l_collector_id := fii_ar_util_pkg.g_collector_id;
483:
484: fii_ar_util_pkg.g_view_by := 'ORGANIZATION+FII_OPERATING_UNITS';
485:
486: -- Retrieve values for global variables
487: l_as_of_date := fii_ar_util_pkg.g_as_of_date;
488: l_collector_id := fii_ar_util_pkg.g_collector_id;
489: l_cust_id := fii_ar_util_pkg.g_party_id;
490: l_itd_bitand := fii_ar_util_pkg.g_bitand_inc_todate;
491:
484: fii_ar_util_pkg.g_view_by := 'ORGANIZATION+FII_OPERATING_UNITS';
485:
486: -- Retrieve values for global variables
487: l_as_of_date := fii_ar_util_pkg.g_as_of_date;
488: l_collector_id := fii_ar_util_pkg.g_collector_id;
489: l_cust_id := fii_ar_util_pkg.g_party_id;
490: l_itd_bitand := fii_ar_util_pkg.g_bitand_inc_todate;
491:
492: -- Populate global temp table based on the parameters chosen
485:
486: -- Retrieve values for global variables
487: l_as_of_date := fii_ar_util_pkg.g_as_of_date;
488: l_collector_id := fii_ar_util_pkg.g_collector_id;
489: l_cust_id := fii_ar_util_pkg.g_party_id;
490: l_itd_bitand := fii_ar_util_pkg.g_bitand_inc_todate;
491:
492: -- Populate global temp table based on the parameters chosen
493: fii_ar_util_pkg.populate_summary_gt_tables;
486: -- Retrieve values for global variables
487: l_as_of_date := fii_ar_util_pkg.g_as_of_date;
488: l_collector_id := fii_ar_util_pkg.g_collector_id;
489: l_cust_id := fii_ar_util_pkg.g_party_id;
490: l_itd_bitand := fii_ar_util_pkg.g_bitand_inc_todate;
491:
492: -- Populate global temp table based on the parameters chosen
493: fii_ar_util_pkg.populate_summary_gt_tables;
494:
489: l_cust_id := fii_ar_util_pkg.g_party_id;
490: l_itd_bitand := fii_ar_util_pkg.g_bitand_inc_todate;
491:
492: -- Populate global temp table based on the parameters chosen
493: fii_ar_util_pkg.populate_summary_gt_tables;
494:
495: IF (p_page_parameter_tbl.count > 0) THEN
496: FOR i IN p_page_parameter_tbl.first..p_page_parameter_tbl.last LOOP
497:
590: ''UNAPP'', 4, ''CASH'', 5, ''PREPAY'', 6,
591: ''OTHER'', 7 )';
592:
593: -- Bind variables so that no literal will be used in the pmv report
594: fii_ar_util_pkg.bind_variable
595: (p_sqlstmt => l_sqlstmt,
596: p_page_parameter_tbl => p_page_parameter_tbl,
597: p_sql_output => p_pastdue_rec_aging_sql,
598: p_bind_output_table => p_pastdue_rec_aging_output);