29: l_comparison_type varchar2(1) := 'Y';
30: l_nested_pattern number;
31: l_cur_suffix varchar2(2);
32: l_custom_sql varchar2(10000);
33: l_col_tbl poa_dbi_util_pkg.POA_DBI_COL_TBL;
34: l_url varchar2(300);
35: l_join_tbl poa_dbi_util_pkg.POA_DBI_JOIN_TBL;
36: l_in_join_tbl poa_dbi_util_pkg.POA_DBI_IN_JOIN_TBL;
37: l_where_clause VARCHAR2(2000);
31: l_cur_suffix varchar2(2);
32: l_custom_sql varchar2(10000);
33: l_col_tbl poa_dbi_util_pkg.POA_DBI_COL_TBL;
34: l_url varchar2(300);
35: l_join_tbl poa_dbi_util_pkg.POA_DBI_JOIN_TBL;
36: l_in_join_tbl poa_dbi_util_pkg.POA_DBI_IN_JOIN_TBL;
37: l_where_clause VARCHAR2(2000);
38: l_mv VARCHAR2(30);
39: ERR_MSG VARCHAR2(100);
32: l_custom_sql varchar2(10000);
33: l_col_tbl poa_dbi_util_pkg.POA_DBI_COL_TBL;
34: l_url varchar2(300);
35: l_join_tbl poa_dbi_util_pkg.POA_DBI_JOIN_TBL;
36: l_in_join_tbl poa_dbi_util_pkg.POA_DBI_IN_JOIN_TBL;
37: l_where_clause VARCHAR2(2000);
38: l_mv VARCHAR2(30);
39: ERR_MSG VARCHAR2(100);
40: ERR_CDE NUMBER;
40: ERR_CDE NUMBER;
41: l_context_code VARCHAR2(10);
42: l_to_date_type VARCHAR2(10);
43: BEGIN
44: l_join_tbl := poa_dbi_util_pkg.POA_DBI_JOIN_TBL();
45:
46: l_col_tbl := poa_dbi_util_pkg.POA_DBI_COL_TBL();
47: poa_dbi_sutil_pkg.process_parameters(p_param
48: ,l_view_by
42: l_to_date_type VARCHAR2(10);
43: BEGIN
44: l_join_tbl := poa_dbi_util_pkg.POA_DBI_JOIN_TBL();
45:
46: l_col_tbl := poa_dbi_util_pkg.POA_DBI_COL_TBL();
47: poa_dbi_sutil_pkg.process_parameters(p_param
48: ,l_view_by
49: ,l_view_by_col
50: ,l_view_by_value
71: ELSE
72: l_to_date_type := 'XTD';
73: END IF;
74:
75: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_expt_' || l_cur_suffix, 'amt_expt',p_to_date_type => l_to_date_type);
76: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_early_cnt', 'early_cnt',p_to_date_type => l_to_date_type);
77: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_late_cnt', 'late_cnt',p_to_date_type => l_to_date_type);
78: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_receipt_' || l_cur_suffix, 'amt_receipt',p_to_date_type => l_to_date_type);
79:
72: l_to_date_type := 'XTD';
73: END IF;
74:
75: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_expt_' || l_cur_suffix, 'amt_expt',p_to_date_type => l_to_date_type);
76: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_early_cnt', 'early_cnt',p_to_date_type => l_to_date_type);
77: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_late_cnt', 'late_cnt',p_to_date_type => l_to_date_type);
78: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_receipt_' || l_cur_suffix, 'amt_receipt',p_to_date_type => l_to_date_type);
79:
80: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_receipt_cnt', 'cnt_receipt',p_to_date_type => l_to_date_type);
73: END IF;
74:
75: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_expt_' || l_cur_suffix, 'amt_expt',p_to_date_type => l_to_date_type);
76: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_early_cnt', 'early_cnt',p_to_date_type => l_to_date_type);
77: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_late_cnt', 'late_cnt',p_to_date_type => l_to_date_type);
78: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_receipt_' || l_cur_suffix, 'amt_receipt',p_to_date_type => l_to_date_type);
79:
80: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_receipt_cnt', 'cnt_receipt',p_to_date_type => l_to_date_type);
81: if((l_view_by = 'ITEM+POA_ITEMS')) then
74:
75: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_expt_' || l_cur_suffix, 'amt_expt',p_to_date_type => l_to_date_type);
76: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_early_cnt', 'early_cnt',p_to_date_type => l_to_date_type);
77: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_late_cnt', 'late_cnt',p_to_date_type => l_to_date_type);
78: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_receipt_' || l_cur_suffix, 'amt_receipt',p_to_date_type => l_to_date_type);
79:
80: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_receipt_cnt', 'cnt_receipt',p_to_date_type => l_to_date_type);
81: if((l_view_by = 'ITEM+POA_ITEMS')) then
82: l_url :=
76: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_early_cnt', 'early_cnt',p_to_date_type => l_to_date_type);
77: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_late_cnt', 'late_cnt',p_to_date_type => l_to_date_type);
78: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_receipt_' || l_cur_suffix, 'amt_receipt',p_to_date_type => l_to_date_type);
79:
80: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_receipt_cnt', 'cnt_receipt',p_to_date_type => l_to_date_type);
81: if((l_view_by = 'ITEM+POA_ITEMS')) then
82: l_url :=
83: 'pFunctionName=POA_DBI_RDE_IT_RPT&VIEW_BY_NAME=VIEW_BY_ID&VIEW_BY=ITEM+POA_ITEMS&pParamIds=Y';
84:
115: l_comparison_type varchar2(1) := 'Y';
116: l_nested_pattern number;
117: l_cur_suffix varchar2(2);
118: l_custom_sql varchar2(10000);
119: l_col_tbl poa_dbi_util_pkg.POA_DBI_COL_TBL;
120: l_join_tbl poa_dbi_util_pkg.POA_DBI_JOIN_TBL;
121: l_in_join_tbl poa_dbi_util_pkg.POA_DBI_IN_JOIN_TBL;
122: l_mv VARCHAR2(30);
123: l_where_clause VARCHAR2(2000);
116: l_nested_pattern number;
117: l_cur_suffix varchar2(2);
118: l_custom_sql varchar2(10000);
119: l_col_tbl poa_dbi_util_pkg.POA_DBI_COL_TBL;
120: l_join_tbl poa_dbi_util_pkg.POA_DBI_JOIN_TBL;
121: l_in_join_tbl poa_dbi_util_pkg.POA_DBI_IN_JOIN_TBL;
122: l_mv VARCHAR2(30);
123: l_where_clause VARCHAR2(2000);
124: l_context_code VARCHAR2(10);
117: l_cur_suffix varchar2(2);
118: l_custom_sql varchar2(10000);
119: l_col_tbl poa_dbi_util_pkg.POA_DBI_COL_TBL;
120: l_join_tbl poa_dbi_util_pkg.POA_DBI_JOIN_TBL;
121: l_in_join_tbl poa_dbi_util_pkg.POA_DBI_IN_JOIN_TBL;
122: l_mv VARCHAR2(30);
123: l_where_clause VARCHAR2(2000);
124: l_context_code VARCHAR2(10);
125: l_to_date_type VARCHAR2(10);
123: l_where_clause VARCHAR2(2000);
124: l_context_code VARCHAR2(10);
125: l_to_date_type VARCHAR2(10);
126: BEGIN
127: l_join_tbl := poa_dbi_util_pkg.POA_DBI_JOIN_TBL();
128: l_col_tbl := poa_dbi_util_pkg.POA_DBI_COL_TBL();
129: poa_dbi_sutil_pkg.process_parameters(p_param
130: ,l_view_by
131: ,l_view_by_col
124: l_context_code VARCHAR2(10);
125: l_to_date_type VARCHAR2(10);
126: BEGIN
127: l_join_tbl := poa_dbi_util_pkg.POA_DBI_JOIN_TBL();
128: l_col_tbl := poa_dbi_util_pkg.POA_DBI_COL_TBL();
129: poa_dbi_sutil_pkg.process_parameters(p_param
130: ,l_view_by
131: ,l_view_by_col
132: ,l_view_by_value
147: ELSE
148: l_to_date_type := 'XTD';
149: END IF;
150:
151: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_receipt_' || l_cur_suffix,'amt_receipt', 'N',p_to_date_type => l_to_date_type);
152: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_expt_' || l_cur_suffix,'amt_expt', 'N',p_to_date_type => l_to_date_type);
153: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_receipt_cnt', 'cnt_receipt', 'N',p_to_date_type => l_to_date_type);
154: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_early_cnt','cnt_early', 'N',p_to_date_type => l_to_date_type);
155: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_late_cnt','cnt_late', 'N',p_to_date_type => l_to_date_type);
148: l_to_date_type := 'XTD';
149: END IF;
150:
151: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_receipt_' || l_cur_suffix,'amt_receipt', 'N',p_to_date_type => l_to_date_type);
152: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_expt_' || l_cur_suffix,'amt_expt', 'N',p_to_date_type => l_to_date_type);
153: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_receipt_cnt', 'cnt_receipt', 'N',p_to_date_type => l_to_date_type);
154: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_early_cnt','cnt_early', 'N',p_to_date_type => l_to_date_type);
155: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_late_cnt','cnt_late', 'N',p_to_date_type => l_to_date_type);
156:
149: END IF;
150:
151: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_receipt_' || l_cur_suffix,'amt_receipt', 'N',p_to_date_type => l_to_date_type);
152: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_expt_' || l_cur_suffix,'amt_expt', 'N',p_to_date_type => l_to_date_type);
153: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_receipt_cnt', 'cnt_receipt', 'N',p_to_date_type => l_to_date_type);
154: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_early_cnt','cnt_early', 'N',p_to_date_type => l_to_date_type);
155: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_late_cnt','cnt_late', 'N',p_to_date_type => l_to_date_type);
156:
157:
150:
151: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_receipt_' || l_cur_suffix,'amt_receipt', 'N',p_to_date_type => l_to_date_type);
152: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_expt_' || l_cur_suffix,'amt_expt', 'N',p_to_date_type => l_to_date_type);
153: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_receipt_cnt', 'cnt_receipt', 'N',p_to_date_type => l_to_date_type);
154: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_early_cnt','cnt_early', 'N',p_to_date_type => l_to_date_type);
155: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_late_cnt','cnt_late', 'N',p_to_date_type => l_to_date_type);
156:
157:
158:
151: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_receipt_' || l_cur_suffix,'amt_receipt', 'N',p_to_date_type => l_to_date_type);
152: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_expt_' || l_cur_suffix,'amt_expt', 'N',p_to_date_type => l_to_date_type);
153: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_receipt_cnt', 'cnt_receipt', 'N',p_to_date_type => l_to_date_type);
154: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_early_cnt','cnt_early', 'N',p_to_date_type => l_to_date_type);
155: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_late_cnt','cnt_late', 'N',p_to_date_type => l_to_date_type);
156:
157:
158:
159:
172: FUNCTION get_rate_trend_sel_clause return VARCHAR2 IS
173: l_sel_clause varchar2(4000);
174: BEGIN
175: l_sel_clause :='select cal.name VIEWBY,
176: ' || poa_dbi_util_pkg.rate_clause('c_amt_expt','c_amt_receipt') || ' POA_PERCENT1,
177: ' || poa_dbi_util_pkg.change_clause(poa_dbi_util_pkg.rate_clause('c_amt_expt','c_amt_receipt'),poa_dbi_util_pkg.rate_clause('p_amt_expt','p_amt_receipt'),'P') || ' POA_MEASURE1,
178: ' ||
179: poa_dbi_util_pkg.rate_clause('(nvl(c_cnt_early,0) + nvl(c_cnt_late,0))','c_cnt_receipt') || ' POA_PERCENT3,
180: ' || poa_dbi_util_pkg.change_clause(
173: l_sel_clause varchar2(4000);
174: BEGIN
175: l_sel_clause :='select cal.name VIEWBY,
176: ' || poa_dbi_util_pkg.rate_clause('c_amt_expt','c_amt_receipt') || ' POA_PERCENT1,
177: ' || poa_dbi_util_pkg.change_clause(poa_dbi_util_pkg.rate_clause('c_amt_expt','c_amt_receipt'),poa_dbi_util_pkg.rate_clause('p_amt_expt','p_amt_receipt'),'P') || ' POA_MEASURE1,
178: ' ||
179: poa_dbi_util_pkg.rate_clause('(nvl(c_cnt_early,0) + nvl(c_cnt_late,0))','c_cnt_receipt') || ' POA_PERCENT3,
180: ' || poa_dbi_util_pkg.change_clause(
181: poa_dbi_util_pkg.rate_clause('(nvl(c_cnt_early,0) + nvl(c_cnt_late,0))','c_cnt_receipt'),
175: l_sel_clause :='select cal.name VIEWBY,
176: ' || poa_dbi_util_pkg.rate_clause('c_amt_expt','c_amt_receipt') || ' POA_PERCENT1,
177: ' || poa_dbi_util_pkg.change_clause(poa_dbi_util_pkg.rate_clause('c_amt_expt','c_amt_receipt'),poa_dbi_util_pkg.rate_clause('p_amt_expt','p_amt_receipt'),'P') || ' POA_MEASURE1,
178: ' ||
179: poa_dbi_util_pkg.rate_clause('(nvl(c_cnt_early,0) + nvl(c_cnt_late,0))','c_cnt_receipt') || ' POA_PERCENT3,
180: ' || poa_dbi_util_pkg.change_clause(
181: poa_dbi_util_pkg.rate_clause('(nvl(c_cnt_early,0) + nvl(c_cnt_late,0))','c_cnt_receipt'),
182: poa_dbi_util_pkg.rate_clause('(nvl(p_cnt_early,0) + nvl(p_cnt_late,0))','p_cnt_receipt'),'P') || ' POA_MEASURE2';
183: return l_sel_clause;
176: ' || poa_dbi_util_pkg.rate_clause('c_amt_expt','c_amt_receipt') || ' POA_PERCENT1,
177: ' || poa_dbi_util_pkg.change_clause(poa_dbi_util_pkg.rate_clause('c_amt_expt','c_amt_receipt'),poa_dbi_util_pkg.rate_clause('p_amt_expt','p_amt_receipt'),'P') || ' POA_MEASURE1,
178: ' ||
179: poa_dbi_util_pkg.rate_clause('(nvl(c_cnt_early,0) + nvl(c_cnt_late,0))','c_cnt_receipt') || ' POA_PERCENT3,
180: ' || poa_dbi_util_pkg.change_clause(
181: poa_dbi_util_pkg.rate_clause('(nvl(c_cnt_early,0) + nvl(c_cnt_late,0))','c_cnt_receipt'),
182: poa_dbi_util_pkg.rate_clause('(nvl(p_cnt_early,0) + nvl(p_cnt_late,0))','p_cnt_receipt'),'P') || ' POA_MEASURE2';
183: return l_sel_clause;
184: END;
177: ' || poa_dbi_util_pkg.change_clause(poa_dbi_util_pkg.rate_clause('c_amt_expt','c_amt_receipt'),poa_dbi_util_pkg.rate_clause('p_amt_expt','p_amt_receipt'),'P') || ' POA_MEASURE1,
178: ' ||
179: poa_dbi_util_pkg.rate_clause('(nvl(c_cnt_early,0) + nvl(c_cnt_late,0))','c_cnt_receipt') || ' POA_PERCENT3,
180: ' || poa_dbi_util_pkg.change_clause(
181: poa_dbi_util_pkg.rate_clause('(nvl(c_cnt_early,0) + nvl(c_cnt_late,0))','c_cnt_receipt'),
182: poa_dbi_util_pkg.rate_clause('(nvl(p_cnt_early,0) + nvl(p_cnt_late,0))','p_cnt_receipt'),'P') || ' POA_MEASURE2';
183: return l_sel_clause;
184: END;
185:
178: ' ||
179: poa_dbi_util_pkg.rate_clause('(nvl(c_cnt_early,0) + nvl(c_cnt_late,0))','c_cnt_receipt') || ' POA_PERCENT3,
180: ' || poa_dbi_util_pkg.change_clause(
181: poa_dbi_util_pkg.rate_clause('(nvl(c_cnt_early,0) + nvl(c_cnt_late,0))','c_cnt_receipt'),
182: poa_dbi_util_pkg.rate_clause('(nvl(p_cnt_early,0) + nvl(p_cnt_late,0))','p_cnt_receipt'),'P') || ' POA_MEASURE2';
183: return l_sel_clause;
184: END;
185:
186:
200: l_comparison_type varchar2(1) := 'Y';
201: l_nested_pattern number;
202: l_cur_suffix varchar2(2);
203: l_custom_sql varchar2(10000);
204: l_col_tbl poa_dbi_util_pkg.POA_DBI_COL_TBL;
205: l_url varchar2(300);
206: l_join_tbl poa_dbi_util_pkg.POA_DBI_JOIN_TBL;
207: l_in_join_tbl poa_dbi_util_pkg.POA_DBI_IN_JOIN_TBL;
208: l_where_clause VARCHAR2(2000);
202: l_cur_suffix varchar2(2);
203: l_custom_sql varchar2(10000);
204: l_col_tbl poa_dbi_util_pkg.POA_DBI_COL_TBL;
205: l_url varchar2(300);
206: l_join_tbl poa_dbi_util_pkg.POA_DBI_JOIN_TBL;
207: l_in_join_tbl poa_dbi_util_pkg.POA_DBI_IN_JOIN_TBL;
208: l_where_clause VARCHAR2(2000);
209: l_mv VARCHAR2(30);
210: ERR_MSG VARCHAR2(100);
203: l_custom_sql varchar2(10000);
204: l_col_tbl poa_dbi_util_pkg.POA_DBI_COL_TBL;
205: l_url varchar2(300);
206: l_join_tbl poa_dbi_util_pkg.POA_DBI_JOIN_TBL;
207: l_in_join_tbl poa_dbi_util_pkg.POA_DBI_IN_JOIN_TBL;
208: l_where_clause VARCHAR2(2000);
209: l_mv VARCHAR2(30);
210: ERR_MSG VARCHAR2(100);
211: ERR_CDE NUMBER;
211: ERR_CDE NUMBER;
212: l_context_code VARCHAR2(10);
213: l_to_date_type VARCHAR2(10);
214: BEGIN
215: l_join_tbl := poa_dbi_util_pkg.POA_DBI_JOIN_TBL();
216:
217: l_col_tbl := poa_dbi_util_pkg.POA_DBI_COL_TBL();
218: poa_dbi_sutil_pkg.process_parameters(p_param
219: ,l_view_by
213: l_to_date_type VARCHAR2(10);
214: BEGIN
215: l_join_tbl := poa_dbi_util_pkg.POA_DBI_JOIN_TBL();
216:
217: l_col_tbl := poa_dbi_util_pkg.POA_DBI_COL_TBL();
218: poa_dbi_sutil_pkg.process_parameters(p_param
219: ,l_view_by
220: ,l_view_by_col
221: ,l_view_by_value
242: ELSE
243: l_to_date_type := 'XTD';
244: END IF;
245:
246: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_expt_' || l_cur_suffix, 'amt_expt',p_to_date_type => l_to_date_type);
247: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_receipt_' || l_cur_suffix, 'amt_receipt',p_to_date_type => l_to_date_type);
248: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_beforedue_' || l_cur_suffix, 'amt_early',p_to_date_type => l_to_date_type);
249: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_days_early', 'num_days_early',p_to_date_type => l_to_date_type);
250: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_early_cnt', 'early_cnt',p_to_date_type => l_to_date_type);
243: l_to_date_type := 'XTD';
244: END IF;
245:
246: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_expt_' || l_cur_suffix, 'amt_expt',p_to_date_type => l_to_date_type);
247: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_receipt_' || l_cur_suffix, 'amt_receipt',p_to_date_type => l_to_date_type);
248: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_beforedue_' || l_cur_suffix, 'amt_early',p_to_date_type => l_to_date_type);
249: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_days_early', 'num_days_early',p_to_date_type => l_to_date_type);
250: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_early_cnt', 'early_cnt',p_to_date_type => l_to_date_type);
251: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_afterdue_' || l_cur_suffix, 'amt_late',p_to_date_type => l_to_date_type);
244: END IF;
245:
246: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_expt_' || l_cur_suffix, 'amt_expt',p_to_date_type => l_to_date_type);
247: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_receipt_' || l_cur_suffix, 'amt_receipt',p_to_date_type => l_to_date_type);
248: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_beforedue_' || l_cur_suffix, 'amt_early',p_to_date_type => l_to_date_type);
249: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_days_early', 'num_days_early',p_to_date_type => l_to_date_type);
250: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_early_cnt', 'early_cnt',p_to_date_type => l_to_date_type);
251: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_afterdue_' || l_cur_suffix, 'amt_late',p_to_date_type => l_to_date_type);
252: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_days_late', 'num_days_late',p_to_date_type => l_to_date_type);
245:
246: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_expt_' || l_cur_suffix, 'amt_expt',p_to_date_type => l_to_date_type);
247: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_receipt_' || l_cur_suffix, 'amt_receipt',p_to_date_type => l_to_date_type);
248: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_beforedue_' || l_cur_suffix, 'amt_early',p_to_date_type => l_to_date_type);
249: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_days_early', 'num_days_early',p_to_date_type => l_to_date_type);
250: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_early_cnt', 'early_cnt',p_to_date_type => l_to_date_type);
251: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_afterdue_' || l_cur_suffix, 'amt_late',p_to_date_type => l_to_date_type);
252: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_days_late', 'num_days_late',p_to_date_type => l_to_date_type);
253: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_late_cnt', 'late_cnt',p_to_date_type => l_to_date_type);
246: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_expt_' || l_cur_suffix, 'amt_expt',p_to_date_type => l_to_date_type);
247: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_receipt_' || l_cur_suffix, 'amt_receipt',p_to_date_type => l_to_date_type);
248: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_beforedue_' || l_cur_suffix, 'amt_early',p_to_date_type => l_to_date_type);
249: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_days_early', 'num_days_early',p_to_date_type => l_to_date_type);
250: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_early_cnt', 'early_cnt',p_to_date_type => l_to_date_type);
251: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_afterdue_' || l_cur_suffix, 'amt_late',p_to_date_type => l_to_date_type);
252: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_days_late', 'num_days_late',p_to_date_type => l_to_date_type);
253: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_late_cnt', 'late_cnt',p_to_date_type => l_to_date_type);
254: if((l_view_by = 'ITEM+POA_ITEMS')) then
247: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_receipt_' || l_cur_suffix, 'amt_receipt',p_to_date_type => l_to_date_type);
248: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_beforedue_' || l_cur_suffix, 'amt_early',p_to_date_type => l_to_date_type);
249: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_days_early', 'num_days_early',p_to_date_type => l_to_date_type);
250: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_early_cnt', 'early_cnt',p_to_date_type => l_to_date_type);
251: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_afterdue_' || l_cur_suffix, 'amt_late',p_to_date_type => l_to_date_type);
252: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_days_late', 'num_days_late',p_to_date_type => l_to_date_type);
253: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_late_cnt', 'late_cnt',p_to_date_type => l_to_date_type);
254: if((l_view_by = 'ITEM+POA_ITEMS')) then
255: l_url :=
248: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_beforedue_' || l_cur_suffix, 'amt_early',p_to_date_type => l_to_date_type);
249: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_days_early', 'num_days_early',p_to_date_type => l_to_date_type);
250: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_early_cnt', 'early_cnt',p_to_date_type => l_to_date_type);
251: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_afterdue_' || l_cur_suffix, 'amt_late',p_to_date_type => l_to_date_type);
252: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_days_late', 'num_days_late',p_to_date_type => l_to_date_type);
253: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_late_cnt', 'late_cnt',p_to_date_type => l_to_date_type);
254: if((l_view_by = 'ITEM+POA_ITEMS')) then
255: l_url :=
256: 'pFunctionName=POA_DBI_RDE_IT_RPT&VIEW_BY_NAME=VIEW_BY_ID&VIEW_BY=ITEM+POA_ITEMS&pParamIds=Y';
249: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_days_early', 'num_days_early',p_to_date_type => l_to_date_type);
250: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_early_cnt', 'early_cnt',p_to_date_type => l_to_date_type);
251: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_afterdue_' || l_cur_suffix, 'amt_late',p_to_date_type => l_to_date_type);
252: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_days_late', 'num_days_late',p_to_date_type => l_to_date_type);
253: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_late_cnt', 'late_cnt',p_to_date_type => l_to_date_type);
254: if((l_view_by = 'ITEM+POA_ITEMS')) then
255: l_url :=
256: 'pFunctionName=POA_DBI_RDE_IT_RPT&VIEW_BY_NAME=VIEW_BY_ID&VIEW_BY=ITEM+POA_ITEMS&pParamIds=Y';
257:
290: l_comparison_type varchar2(1) := 'Y';
291: l_nested_pattern number;
292: l_cur_suffix varchar2(2);
293: l_custom_sql varchar2(10000);
294: l_col_tbl poa_dbi_util_pkg.POA_DBI_COL_TBL;
295: l_url varchar2(300);
296: l_join_tbl poa_dbi_util_pkg.POA_DBI_JOIN_TBL;
297: l_in_join_tbl poa_dbi_util_pkg.POA_DBI_IN_JOIN_TBL;
298: l_where_clause VARCHAR2(2000);
292: l_cur_suffix varchar2(2);
293: l_custom_sql varchar2(10000);
294: l_col_tbl poa_dbi_util_pkg.POA_DBI_COL_TBL;
295: l_url varchar2(300);
296: l_join_tbl poa_dbi_util_pkg.POA_DBI_JOIN_TBL;
297: l_in_join_tbl poa_dbi_util_pkg.POA_DBI_IN_JOIN_TBL;
298: l_where_clause VARCHAR2(2000);
299: l_mv VARCHAR2(30);
300: ERR_MSG VARCHAR2(100);
293: l_custom_sql varchar2(10000);
294: l_col_tbl poa_dbi_util_pkg.POA_DBI_COL_TBL;
295: l_url varchar2(300);
296: l_join_tbl poa_dbi_util_pkg.POA_DBI_JOIN_TBL;
297: l_in_join_tbl poa_dbi_util_pkg.POA_DBI_IN_JOIN_TBL;
298: l_where_clause VARCHAR2(2000);
299: l_mv VARCHAR2(30);
300: ERR_MSG VARCHAR2(100);
301: ERR_CDE NUMBER;
301: ERR_CDE NUMBER;
302: l_context_code VARCHAR2(10);
303: l_to_date_type VARCHAR2(10);
304: BEGIN
305: l_join_tbl := poa_dbi_util_pkg.POA_DBI_JOIN_TBL();
306:
307: l_col_tbl := poa_dbi_util_pkg.POA_DBI_COL_TBL();
308: poa_dbi_sutil_pkg.process_parameters(p_param
309: ,l_view_by
303: l_to_date_type VARCHAR2(10);
304: BEGIN
305: l_join_tbl := poa_dbi_util_pkg.POA_DBI_JOIN_TBL();
306:
307: l_col_tbl := poa_dbi_util_pkg.POA_DBI_COL_TBL();
308: poa_dbi_sutil_pkg.process_parameters(p_param
309: ,l_view_by
310: ,l_view_by_col
311: ,l_view_by_value
332: ELSE
333: l_to_date_type := 'XTD';
334: END IF;
335:
336: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_receipt_cnt', 'cnt_receipt',p_to_date_type => l_to_date_type);
337: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_days_early', 'num_days_early',p_to_date_type => l_to_date_type);
338: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_early_cnt', 'early_cnt',p_to_date_type => l_to_date_type);
339: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_days_late', 'num_days_late',p_to_date_type => l_to_date_type);
340: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_late_cnt', 'late_cnt',p_to_date_type => l_to_date_type);
333: l_to_date_type := 'XTD';
334: END IF;
335:
336: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_receipt_cnt', 'cnt_receipt',p_to_date_type => l_to_date_type);
337: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_days_early', 'num_days_early',p_to_date_type => l_to_date_type);
338: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_early_cnt', 'early_cnt',p_to_date_type => l_to_date_type);
339: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_days_late', 'num_days_late',p_to_date_type => l_to_date_type);
340: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_late_cnt', 'late_cnt',p_to_date_type => l_to_date_type);
341: if((l_view_by = 'ITEM+POA_ITEMS')) then
334: END IF;
335:
336: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_receipt_cnt', 'cnt_receipt',p_to_date_type => l_to_date_type);
337: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_days_early', 'num_days_early',p_to_date_type => l_to_date_type);
338: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_early_cnt', 'early_cnt',p_to_date_type => l_to_date_type);
339: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_days_late', 'num_days_late',p_to_date_type => l_to_date_type);
340: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_late_cnt', 'late_cnt',p_to_date_type => l_to_date_type);
341: if((l_view_by = 'ITEM+POA_ITEMS')) then
342: l_url :=
335:
336: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_receipt_cnt', 'cnt_receipt',p_to_date_type => l_to_date_type);
337: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_days_early', 'num_days_early',p_to_date_type => l_to_date_type);
338: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_early_cnt', 'early_cnt',p_to_date_type => l_to_date_type);
339: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_days_late', 'num_days_late',p_to_date_type => l_to_date_type);
340: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_late_cnt', 'late_cnt',p_to_date_type => l_to_date_type);
341: if((l_view_by = 'ITEM+POA_ITEMS')) then
342: l_url :=
343: 'pFunctionName=POA_DBI_RDE_IT_RPT&VIEW_BY_NAME=VIEW_BY_ID&VIEW_BY=ITEM+POA_ITEMS&pParamIds=Y';
336: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_receipt_cnt', 'cnt_receipt',p_to_date_type => l_to_date_type);
337: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_days_early', 'num_days_early',p_to_date_type => l_to_date_type);
338: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_early_cnt', 'early_cnt',p_to_date_type => l_to_date_type);
339: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_days_late', 'num_days_late',p_to_date_type => l_to_date_type);
340: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_late_cnt', 'late_cnt',p_to_date_type => l_to_date_type);
341: if((l_view_by = 'ITEM+POA_ITEMS')) then
342: l_url :=
343: 'pFunctionName=POA_DBI_RDE_IT_RPT&VIEW_BY_NAME=VIEW_BY_ID&VIEW_BY=ITEM+POA_ITEMS&pParamIds=Y';
344:
378: l_comparison_type varchar2(1) := 'Y';
379: l_nested_pattern number;
380: l_cur_suffix varchar2(2);
381: l_custom_sql varchar2(10000);
382: l_col_tbl poa_dbi_util_pkg.POA_DBI_COL_TBL;
383: l_join_tbl poa_dbi_util_pkg.POA_DBI_JOIN_TBL;
384: l_in_join_tbl poa_dbi_util_pkg.POA_DBI_IN_JOIN_TBL;
385: l_where_clause VARCHAR2(2000);
386: l_mv VARCHAR2(30);
379: l_nested_pattern number;
380: l_cur_suffix varchar2(2);
381: l_custom_sql varchar2(10000);
382: l_col_tbl poa_dbi_util_pkg.POA_DBI_COL_TBL;
383: l_join_tbl poa_dbi_util_pkg.POA_DBI_JOIN_TBL;
384: l_in_join_tbl poa_dbi_util_pkg.POA_DBI_IN_JOIN_TBL;
385: l_where_clause VARCHAR2(2000);
386: l_mv VARCHAR2(30);
387: l_context_code VARCHAR2(10);
380: l_cur_suffix varchar2(2);
381: l_custom_sql varchar2(10000);
382: l_col_tbl poa_dbi_util_pkg.POA_DBI_COL_TBL;
383: l_join_tbl poa_dbi_util_pkg.POA_DBI_JOIN_TBL;
384: l_in_join_tbl poa_dbi_util_pkg.POA_DBI_IN_JOIN_TBL;
385: l_where_clause VARCHAR2(2000);
386: l_mv VARCHAR2(30);
387: l_context_code VARCHAR2(10);
388: l_to_date_type VARCHAR2(10);
386: l_mv VARCHAR2(30);
387: l_context_code VARCHAR2(10);
388: l_to_date_type VARCHAR2(10);
389: BEGIN
390: l_join_tbl := poa_dbi_util_pkg.POA_DBI_JOIN_TBL();
391: l_col_tbl := poa_dbi_util_pkg.POA_DBI_COL_TBL();
392:
393: poa_dbi_sutil_pkg.process_parameters(p_param
394: ,l_view_by
387: l_context_code VARCHAR2(10);
388: l_to_date_type VARCHAR2(10);
389: BEGIN
390: l_join_tbl := poa_dbi_util_pkg.POA_DBI_JOIN_TBL();
391: l_col_tbl := poa_dbi_util_pkg.POA_DBI_COL_TBL();
392:
393: poa_dbi_sutil_pkg.process_parameters(p_param
394: ,l_view_by
395: ,l_view_by_col
416: ELSE
417: l_to_date_type := 'XTD';
418: END IF;
419:
420: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_early_cnt', 'early_cnt',p_to_date_type => l_to_date_type);
421: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_late_cnt', 'late_cnt',p_to_date_type => l_to_date_type);
422: poa_dbi_util_pkg.add_column(l_col_tbl, 'qty_beforedue', 'qty_beforedue',p_to_date_type => l_to_date_type);
423:
424: poa_dbi_util_pkg.add_column(l_col_tbl, 'qty_intol', 'qty_intol',p_to_date_type => l_to_date_type);
417: l_to_date_type := 'XTD';
418: END IF;
419:
420: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_early_cnt', 'early_cnt',p_to_date_type => l_to_date_type);
421: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_late_cnt', 'late_cnt',p_to_date_type => l_to_date_type);
422: poa_dbi_util_pkg.add_column(l_col_tbl, 'qty_beforedue', 'qty_beforedue',p_to_date_type => l_to_date_type);
423:
424: poa_dbi_util_pkg.add_column(l_col_tbl, 'qty_intol', 'qty_intol',p_to_date_type => l_to_date_type);
425: poa_dbi_util_pkg.add_column(l_col_tbl, 'qty_afterdue', 'qty_afterdue',p_to_date_type => l_to_date_type);
418: END IF;
419:
420: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_early_cnt', 'early_cnt',p_to_date_type => l_to_date_type);
421: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_late_cnt', 'late_cnt',p_to_date_type => l_to_date_type);
422: poa_dbi_util_pkg.add_column(l_col_tbl, 'qty_beforedue', 'qty_beforedue',p_to_date_type => l_to_date_type);
423:
424: poa_dbi_util_pkg.add_column(l_col_tbl, 'qty_intol', 'qty_intol',p_to_date_type => l_to_date_type);
425: poa_dbi_util_pkg.add_column(l_col_tbl, 'qty_afterdue', 'qty_afterdue',p_to_date_type => l_to_date_type);
426: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_receipt_' || l_cur_suffix, 'amt_receipt',p_to_date_type => l_to_date_type);
420: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_early_cnt', 'early_cnt',p_to_date_type => l_to_date_type);
421: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_late_cnt', 'late_cnt',p_to_date_type => l_to_date_type);
422: poa_dbi_util_pkg.add_column(l_col_tbl, 'qty_beforedue', 'qty_beforedue',p_to_date_type => l_to_date_type);
423:
424: poa_dbi_util_pkg.add_column(l_col_tbl, 'qty_intol', 'qty_intol',p_to_date_type => l_to_date_type);
425: poa_dbi_util_pkg.add_column(l_col_tbl, 'qty_afterdue', 'qty_afterdue',p_to_date_type => l_to_date_type);
426: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_receipt_' || l_cur_suffix, 'amt_receipt',p_to_date_type => l_to_date_type);
427: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_receipt_cnt', 'cnt_receipt',p_to_date_type => l_to_date_type);
428: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_expt_' || l_cur_suffix, 'amt_expt',p_to_date_type => l_to_date_type);
421: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_late_cnt', 'late_cnt',p_to_date_type => l_to_date_type);
422: poa_dbi_util_pkg.add_column(l_col_tbl, 'qty_beforedue', 'qty_beforedue',p_to_date_type => l_to_date_type);
423:
424: poa_dbi_util_pkg.add_column(l_col_tbl, 'qty_intol', 'qty_intol',p_to_date_type => l_to_date_type);
425: poa_dbi_util_pkg.add_column(l_col_tbl, 'qty_afterdue', 'qty_afterdue',p_to_date_type => l_to_date_type);
426: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_receipt_' || l_cur_suffix, 'amt_receipt',p_to_date_type => l_to_date_type);
427: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_receipt_cnt', 'cnt_receipt',p_to_date_type => l_to_date_type);
428: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_expt_' || l_cur_suffix, 'amt_expt',p_to_date_type => l_to_date_type);
429: l_query := get_status_it_sel_clause(l_view_by,l_view_by_col) || ' from
422: poa_dbi_util_pkg.add_column(l_col_tbl, 'qty_beforedue', 'qty_beforedue',p_to_date_type => l_to_date_type);
423:
424: poa_dbi_util_pkg.add_column(l_col_tbl, 'qty_intol', 'qty_intol',p_to_date_type => l_to_date_type);
425: poa_dbi_util_pkg.add_column(l_col_tbl, 'qty_afterdue', 'qty_afterdue',p_to_date_type => l_to_date_type);
426: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_receipt_' || l_cur_suffix, 'amt_receipt',p_to_date_type => l_to_date_type);
427: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_receipt_cnt', 'cnt_receipt',p_to_date_type => l_to_date_type);
428: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_expt_' || l_cur_suffix, 'amt_expt',p_to_date_type => l_to_date_type);
429: l_query := get_status_it_sel_clause(l_view_by,l_view_by_col) || ' from
430: ' || poa_dbi_template_pkg.status_sql(l_mv,
423:
424: poa_dbi_util_pkg.add_column(l_col_tbl, 'qty_intol', 'qty_intol',p_to_date_type => l_to_date_type);
425: poa_dbi_util_pkg.add_column(l_col_tbl, 'qty_afterdue', 'qty_afterdue',p_to_date_type => l_to_date_type);
426: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_receipt_' || l_cur_suffix, 'amt_receipt',p_to_date_type => l_to_date_type);
427: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_receipt_cnt', 'cnt_receipt',p_to_date_type => l_to_date_type);
428: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_expt_' || l_cur_suffix, 'amt_expt',p_to_date_type => l_to_date_type);
429: l_query := get_status_it_sel_clause(l_view_by,l_view_by_col) || ' from
430: ' || poa_dbi_template_pkg.status_sql(l_mv,
431: l_where_clause,
424: poa_dbi_util_pkg.add_column(l_col_tbl, 'qty_intol', 'qty_intol',p_to_date_type => l_to_date_type);
425: poa_dbi_util_pkg.add_column(l_col_tbl, 'qty_afterdue', 'qty_afterdue',p_to_date_type => l_to_date_type);
426: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_receipt_' || l_cur_suffix, 'amt_receipt',p_to_date_type => l_to_date_type);
427: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_receipt_cnt', 'cnt_receipt',p_to_date_type => l_to_date_type);
428: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_expt_' || l_cur_suffix, 'amt_expt',p_to_date_type => l_to_date_type);
429: l_query := get_status_it_sel_clause(l_view_by,l_view_by_col) || ' from
430: ' || poa_dbi_template_pkg.status_sql(l_mv,
431: l_where_clause,
432: l_join_tbl,
550: l_sel_clause := l_sel_clause ||' base_uom,';
551: end if;
552: l_sel_clause := l_sel_clause ||
553: ' nvl(c_amt_expt,0) POA_MEASURE1,
554: ' || poa_dbi_util_pkg.change_clause('c_amt_expt','p_amt_expt') || ' POA_PERCENT1,
555: nvl(c_amt_receipt,0) POA_MEASURE2,
556: ' || poa_dbi_util_pkg.rate_clause('c_amt_expt','c_amt_receipt') || ' POA_PERCENT2,
557: ' || poa_dbi_util_pkg.change_clause(
558: poa_dbi_util_pkg.rate_clause('c_amt_expt', 'c_amt_receipt'),
552: l_sel_clause := l_sel_clause ||
553: ' nvl(c_amt_expt,0) POA_MEASURE1,
554: ' || poa_dbi_util_pkg.change_clause('c_amt_expt','p_amt_expt') || ' POA_PERCENT1,
555: nvl(c_amt_receipt,0) POA_MEASURE2,
556: ' || poa_dbi_util_pkg.rate_clause('c_amt_expt','c_amt_receipt') || ' POA_PERCENT2,
557: ' || poa_dbi_util_pkg.change_clause(
558: poa_dbi_util_pkg.rate_clause('c_amt_expt', 'c_amt_receipt'),
559: poa_dbi_util_pkg.rate_clause('p_amt_expt', 'p_amt_receipt'),
560: 'P') ||
553: ' nvl(c_amt_expt,0) POA_MEASURE1,
554: ' || poa_dbi_util_pkg.change_clause('c_amt_expt','p_amt_expt') || ' POA_PERCENT1,
555: nvl(c_amt_receipt,0) POA_MEASURE2,
556: ' || poa_dbi_util_pkg.rate_clause('c_amt_expt','c_amt_receipt') || ' POA_PERCENT2,
557: ' || poa_dbi_util_pkg.change_clause(
558: poa_dbi_util_pkg.rate_clause('c_amt_expt', 'c_amt_receipt'),
559: poa_dbi_util_pkg.rate_clause('p_amt_expt', 'p_amt_receipt'),
560: 'P') ||
561: ' POA_PERCENT3,
554: ' || poa_dbi_util_pkg.change_clause('c_amt_expt','p_amt_expt') || ' POA_PERCENT1,
555: nvl(c_amt_receipt,0) POA_MEASURE2,
556: ' || poa_dbi_util_pkg.rate_clause('c_amt_expt','c_amt_receipt') || ' POA_PERCENT2,
557: ' || poa_dbi_util_pkg.change_clause(
558: poa_dbi_util_pkg.rate_clause('c_amt_expt', 'c_amt_receipt'),
559: poa_dbi_util_pkg.rate_clause('p_amt_expt', 'p_amt_receipt'),
560: 'P') ||
561: ' POA_PERCENT3,
562: nvl(c_early_cnt,0) + nvl(c_late_cnt,0) POA_MEASURE3,
555: nvl(c_amt_receipt,0) POA_MEASURE2,
556: ' || poa_dbi_util_pkg.rate_clause('c_amt_expt','c_amt_receipt') || ' POA_PERCENT2,
557: ' || poa_dbi_util_pkg.change_clause(
558: poa_dbi_util_pkg.rate_clause('c_amt_expt', 'c_amt_receipt'),
559: poa_dbi_util_pkg.rate_clause('p_amt_expt', 'p_amt_receipt'),
560: 'P') ||
561: ' POA_PERCENT3,
562: nvl(c_early_cnt,0) + nvl(c_late_cnt,0) POA_MEASURE3,
563: ' || poa_dbi_util_pkg.change_clause('(nvl(c_early_cnt,0)+nvl(c_late_cnt,0))','(nvl(p_early_cnt,0)+nvl(p_late_cnt,0))') || ' POA_MEASURE14,
559: poa_dbi_util_pkg.rate_clause('p_amt_expt', 'p_amt_receipt'),
560: 'P') ||
561: ' POA_PERCENT3,
562: nvl(c_early_cnt,0) + nvl(c_late_cnt,0) POA_MEASURE3,
563: ' || poa_dbi_util_pkg.change_clause('(nvl(c_early_cnt,0)+nvl(c_late_cnt,0))','(nvl(p_early_cnt,0)+nvl(p_late_cnt,0))') || ' POA_MEASURE14,
564: ' || poa_dbi_util_pkg.rate_clause('(nvl(c_early_cnt,0) + nvl(c_late_cnt,0))','(nvl(c_cnt_receipt,0))') || ' POA_MEASURE15,
565: ' || poa_dbi_util_pkg.change_clause(
566: poa_dbi_util_pkg.rate_clause('(nvl(c_early_cnt,0) + nvl(c_late_cnt,0))','(nvl(c_cnt_receipt,0))'),
567: poa_dbi_util_pkg.rate_clause('(nvl(p_early_cnt,0) + nvl(p_late_cnt,0))','(nvl(p_cnt_receipt,0))'),
560: 'P') ||
561: ' POA_PERCENT3,
562: nvl(c_early_cnt,0) + nvl(c_late_cnt,0) POA_MEASURE3,
563: ' || poa_dbi_util_pkg.change_clause('(nvl(c_early_cnt,0)+nvl(c_late_cnt,0))','(nvl(p_early_cnt,0)+nvl(p_late_cnt,0))') || ' POA_MEASURE14,
564: ' || poa_dbi_util_pkg.rate_clause('(nvl(c_early_cnt,0) + nvl(c_late_cnt,0))','(nvl(c_cnt_receipt,0))') || ' POA_MEASURE15,
565: ' || poa_dbi_util_pkg.change_clause(
566: poa_dbi_util_pkg.rate_clause('(nvl(c_early_cnt,0) + nvl(c_late_cnt,0))','(nvl(c_cnt_receipt,0))'),
567: poa_dbi_util_pkg.rate_clause('(nvl(p_early_cnt,0) + nvl(p_late_cnt,0))','(nvl(p_cnt_receipt,0))'),
568: 'P') ||
561: ' POA_PERCENT3,
562: nvl(c_early_cnt,0) + nvl(c_late_cnt,0) POA_MEASURE3,
563: ' || poa_dbi_util_pkg.change_clause('(nvl(c_early_cnt,0)+nvl(c_late_cnt,0))','(nvl(p_early_cnt,0)+nvl(p_late_cnt,0))') || ' POA_MEASURE14,
564: ' || poa_dbi_util_pkg.rate_clause('(nvl(c_early_cnt,0) + nvl(c_late_cnt,0))','(nvl(c_cnt_receipt,0))') || ' POA_MEASURE15,
565: ' || poa_dbi_util_pkg.change_clause(
566: poa_dbi_util_pkg.rate_clause('(nvl(c_early_cnt,0) + nvl(c_late_cnt,0))','(nvl(c_cnt_receipt,0))'),
567: poa_dbi_util_pkg.rate_clause('(nvl(p_early_cnt,0) + nvl(p_late_cnt,0))','(nvl(p_cnt_receipt,0))'),
568: 'P') ||
569: ' POA_ATTRIBUTE3,
562: nvl(c_early_cnt,0) + nvl(c_late_cnt,0) POA_MEASURE3,
563: ' || poa_dbi_util_pkg.change_clause('(nvl(c_early_cnt,0)+nvl(c_late_cnt,0))','(nvl(p_early_cnt,0)+nvl(p_late_cnt,0))') || ' POA_MEASURE14,
564: ' || poa_dbi_util_pkg.rate_clause('(nvl(c_early_cnt,0) + nvl(c_late_cnt,0))','(nvl(c_cnt_receipt,0))') || ' POA_MEASURE15,
565: ' || poa_dbi_util_pkg.change_clause(
566: poa_dbi_util_pkg.rate_clause('(nvl(c_early_cnt,0) + nvl(c_late_cnt,0))','(nvl(c_cnt_receipt,0))'),
567: poa_dbi_util_pkg.rate_clause('(nvl(p_early_cnt,0) + nvl(p_late_cnt,0))','(nvl(p_cnt_receipt,0))'),
568: 'P') ||
569: ' POA_ATTRIBUTE3,
570: nvl(c_amt_expt_total,0) POA_MEASURE4,
563: ' || poa_dbi_util_pkg.change_clause('(nvl(c_early_cnt,0)+nvl(c_late_cnt,0))','(nvl(p_early_cnt,0)+nvl(p_late_cnt,0))') || ' POA_MEASURE14,
564: ' || poa_dbi_util_pkg.rate_clause('(nvl(c_early_cnt,0) + nvl(c_late_cnt,0))','(nvl(c_cnt_receipt,0))') || ' POA_MEASURE15,
565: ' || poa_dbi_util_pkg.change_clause(
566: poa_dbi_util_pkg.rate_clause('(nvl(c_early_cnt,0) + nvl(c_late_cnt,0))','(nvl(c_cnt_receipt,0))'),
567: poa_dbi_util_pkg.rate_clause('(nvl(p_early_cnt,0) + nvl(p_late_cnt,0))','(nvl(p_cnt_receipt,0))'),
568: 'P') ||
569: ' POA_ATTRIBUTE3,
570: nvl(c_amt_expt_total,0) POA_MEASURE4,
571: ' || poa_dbi_util_pkg.change_clause('c_amt_expt_total','p_amt_expt_total')
567: poa_dbi_util_pkg.rate_clause('(nvl(p_early_cnt,0) + nvl(p_late_cnt,0))','(nvl(p_cnt_receipt,0))'),
568: 'P') ||
569: ' POA_ATTRIBUTE3,
570: nvl(c_amt_expt_total,0) POA_MEASURE4,
571: ' || poa_dbi_util_pkg.change_clause('c_amt_expt_total','p_amt_expt_total')
572: || ' POA_MEASURE5,
573: nvl(c_amt_receipt_total,0) POA_MEASURE6,
574: ' || poa_dbi_util_pkg.rate_clause('c_amt_expt_total','c_amt_receipt_total')
575: || ' POA_MEASURE7,
570: nvl(c_amt_expt_total,0) POA_MEASURE4,
571: ' || poa_dbi_util_pkg.change_clause('c_amt_expt_total','p_amt_expt_total')
572: || ' POA_MEASURE5,
573: nvl(c_amt_receipt_total,0) POA_MEASURE6,
574: ' || poa_dbi_util_pkg.rate_clause('c_amt_expt_total','c_amt_receipt_total')
575: || ' POA_MEASURE7,
576: ' || poa_dbi_util_pkg.change_clause(
577: poa_dbi_util_pkg.rate_clause('c_amt_expt_total', 'c_amt_receipt_total'),
578: poa_dbi_util_pkg.rate_clause('p_amt_expt_total', 'p_amt_receipt_total'),
572: || ' POA_MEASURE5,
573: nvl(c_amt_receipt_total,0) POA_MEASURE6,
574: ' || poa_dbi_util_pkg.rate_clause('c_amt_expt_total','c_amt_receipt_total')
575: || ' POA_MEASURE7,
576: ' || poa_dbi_util_pkg.change_clause(
577: poa_dbi_util_pkg.rate_clause('c_amt_expt_total', 'c_amt_receipt_total'),
578: poa_dbi_util_pkg.rate_clause('p_amt_expt_total', 'p_amt_receipt_total'),
579: 'P') ||
580: ' POA_MEASURE8,
573: nvl(c_amt_receipt_total,0) POA_MEASURE6,
574: ' || poa_dbi_util_pkg.rate_clause('c_amt_expt_total','c_amt_receipt_total')
575: || ' POA_MEASURE7,
576: ' || poa_dbi_util_pkg.change_clause(
577: poa_dbi_util_pkg.rate_clause('c_amt_expt_total', 'c_amt_receipt_total'),
578: poa_dbi_util_pkg.rate_clause('p_amt_expt_total', 'p_amt_receipt_total'),
579: 'P') ||
580: ' POA_MEASURE8,
581: nvl(c_early_cnt_total,0) + nvl(c_late_cnt_total,0) POA_MEASURE9,
574: ' || poa_dbi_util_pkg.rate_clause('c_amt_expt_total','c_amt_receipt_total')
575: || ' POA_MEASURE7,
576: ' || poa_dbi_util_pkg.change_clause(
577: poa_dbi_util_pkg.rate_clause('c_amt_expt_total', 'c_amt_receipt_total'),
578: poa_dbi_util_pkg.rate_clause('p_amt_expt_total', 'p_amt_receipt_total'),
579: 'P') ||
580: ' POA_MEASURE8,
581: nvl(c_early_cnt_total,0) + nvl(c_late_cnt_total,0) POA_MEASURE9,
582: ' || poa_dbi_util_pkg.change_clause('(nvl(c_early_cnt_total,0)+nvl(c_late_cnt_total,0))','(nvl(p_early_cnt_total,0)+nvl(p_late_cnt_total,0))') || ' POA_MEASURE10,
578: poa_dbi_util_pkg.rate_clause('p_amt_expt_total', 'p_amt_receipt_total'),
579: 'P') ||
580: ' POA_MEASURE8,
581: nvl(c_early_cnt_total,0) + nvl(c_late_cnt_total,0) POA_MEASURE9,
582: ' || poa_dbi_util_pkg.change_clause('(nvl(c_early_cnt_total,0)+nvl(c_late_cnt_total,0))','(nvl(p_early_cnt_total,0)+nvl(p_late_cnt_total,0))') || ' POA_MEASURE10,
583: ' || poa_dbi_util_pkg.rate_clause('(nvl(c_early_cnt_total,0) + nvl(c_late_cnt_total,0))','(nvl(c_cnt_receipt_total,0))') || ' POA_MEASURE11,
584: ' || poa_dbi_util_pkg.change_clause(
585: poa_dbi_util_pkg.rate_clause('(nvl(c_early_cnt_total,0) + nvl(c_late_cnt_total,0))','(nvl(c_cnt_receipt_total,0))'),
586: poa_dbi_util_pkg.rate_clause('(nvl(p_early_cnt_total,0) + nvl(p_late_cnt_total,0))','(nvl(p_cnt_receipt_total,0))'),
579: 'P') ||
580: ' POA_MEASURE8,
581: nvl(c_early_cnt_total,0) + nvl(c_late_cnt_total,0) POA_MEASURE9,
582: ' || poa_dbi_util_pkg.change_clause('(nvl(c_early_cnt_total,0)+nvl(c_late_cnt_total,0))','(nvl(p_early_cnt_total,0)+nvl(p_late_cnt_total,0))') || ' POA_MEASURE10,
583: ' || poa_dbi_util_pkg.rate_clause('(nvl(c_early_cnt_total,0) + nvl(c_late_cnt_total,0))','(nvl(c_cnt_receipt_total,0))') || ' POA_MEASURE11,
584: ' || poa_dbi_util_pkg.change_clause(
585: poa_dbi_util_pkg.rate_clause('(nvl(c_early_cnt_total,0) + nvl(c_late_cnt_total,0))','(nvl(c_cnt_receipt_total,0))'),
586: poa_dbi_util_pkg.rate_clause('(nvl(p_early_cnt_total,0) + nvl(p_late_cnt_total,0))','(nvl(p_cnt_receipt_total,0))'),
587: 'P') ||
580: ' POA_MEASURE8,
581: nvl(c_early_cnt_total,0) + nvl(c_late_cnt_total,0) POA_MEASURE9,
582: ' || poa_dbi_util_pkg.change_clause('(nvl(c_early_cnt_total,0)+nvl(c_late_cnt_total,0))','(nvl(p_early_cnt_total,0)+nvl(p_late_cnt_total,0))') || ' POA_MEASURE10,
583: ' || poa_dbi_util_pkg.rate_clause('(nvl(c_early_cnt_total,0) + nvl(c_late_cnt_total,0))','(nvl(c_cnt_receipt_total,0))') || ' POA_MEASURE11,
584: ' || poa_dbi_util_pkg.change_clause(
585: poa_dbi_util_pkg.rate_clause('(nvl(c_early_cnt_total,0) + nvl(c_late_cnt_total,0))','(nvl(c_cnt_receipt_total,0))'),
586: poa_dbi_util_pkg.rate_clause('(nvl(p_early_cnt_total,0) + nvl(p_late_cnt_total,0))','(nvl(p_cnt_receipt_total,0))'),
587: 'P') ||
588: ' POA_MEASURE12,
581: nvl(c_early_cnt_total,0) + nvl(c_late_cnt_total,0) POA_MEASURE9,
582: ' || poa_dbi_util_pkg.change_clause('(nvl(c_early_cnt_total,0)+nvl(c_late_cnt_total,0))','(nvl(p_early_cnt_total,0)+nvl(p_late_cnt_total,0))') || ' POA_MEASURE10,
583: ' || poa_dbi_util_pkg.rate_clause('(nvl(c_early_cnt_total,0) + nvl(c_late_cnt_total,0))','(nvl(c_cnt_receipt_total,0))') || ' POA_MEASURE11,
584: ' || poa_dbi_util_pkg.change_clause(
585: poa_dbi_util_pkg.rate_clause('(nvl(c_early_cnt_total,0) + nvl(c_late_cnt_total,0))','(nvl(c_cnt_receipt_total,0))'),
586: poa_dbi_util_pkg.rate_clause('(nvl(p_early_cnt_total,0) + nvl(p_late_cnt_total,0))','(nvl(p_cnt_receipt_total,0))'),
587: 'P') ||
588: ' POA_MEASURE12,
589: ' || poa_dbi_util_pkg.rate_clause('p_amt_expt','p_amt_receipt') || ' POA_MEASURE16,
582: ' || poa_dbi_util_pkg.change_clause('(nvl(c_early_cnt_total,0)+nvl(c_late_cnt_total,0))','(nvl(p_early_cnt_total,0)+nvl(p_late_cnt_total,0))') || ' POA_MEASURE10,
583: ' || poa_dbi_util_pkg.rate_clause('(nvl(c_early_cnt_total,0) + nvl(c_late_cnt_total,0))','(nvl(c_cnt_receipt_total,0))') || ' POA_MEASURE11,
584: ' || poa_dbi_util_pkg.change_clause(
585: poa_dbi_util_pkg.rate_clause('(nvl(c_early_cnt_total,0) + nvl(c_late_cnt_total,0))','(nvl(c_cnt_receipt_total,0))'),
586: poa_dbi_util_pkg.rate_clause('(nvl(p_early_cnt_total,0) + nvl(p_late_cnt_total,0))','(nvl(p_cnt_receipt_total,0))'),
587: 'P') ||
588: ' POA_MEASURE12,
589: ' || poa_dbi_util_pkg.rate_clause('p_amt_expt','p_amt_receipt') || ' POA_MEASURE16,
590: ' || poa_dbi_util_pkg.rate_clause('p_amt_expt_total','p_amt_receipt_total') || ' POA_MEASURE20,
585: poa_dbi_util_pkg.rate_clause('(nvl(c_early_cnt_total,0) + nvl(c_late_cnt_total,0))','(nvl(c_cnt_receipt_total,0))'),
586: poa_dbi_util_pkg.rate_clause('(nvl(p_early_cnt_total,0) + nvl(p_late_cnt_total,0))','(nvl(p_cnt_receipt_total,0))'),
587: 'P') ||
588: ' POA_MEASURE12,
589: ' || poa_dbi_util_pkg.rate_clause('p_amt_expt','p_amt_receipt') || ' POA_MEASURE16,
590: ' || poa_dbi_util_pkg.rate_clause('p_amt_expt_total','p_amt_receipt_total') || ' POA_MEASURE20,
591: ' || poa_dbi_util_pkg.rate_clause('(nvl(p_early_cnt,0) + nvl(p_late_cnt,0))','(nvl(p_cnt_receipt,0))') || ' POA_MEASURE17,
592: ' || poa_dbi_util_pkg.rate_clause('(nvl(p_early_cnt_total,0) + nvl(p_late_cnt_total,0))','(nvl(p_cnt_receipt_total,0))') || ' POA_MEASURE22';
593:
586: poa_dbi_util_pkg.rate_clause('(nvl(p_early_cnt_total,0) + nvl(p_late_cnt_total,0))','(nvl(p_cnt_receipt_total,0))'),
587: 'P') ||
588: ' POA_MEASURE12,
589: ' || poa_dbi_util_pkg.rate_clause('p_amt_expt','p_amt_receipt') || ' POA_MEASURE16,
590: ' || poa_dbi_util_pkg.rate_clause('p_amt_expt_total','p_amt_receipt_total') || ' POA_MEASURE20,
591: ' || poa_dbi_util_pkg.rate_clause('(nvl(p_early_cnt,0) + nvl(p_late_cnt,0))','(nvl(p_cnt_receipt,0))') || ' POA_MEASURE17,
592: ' || poa_dbi_util_pkg.rate_clause('(nvl(p_early_cnt_total,0) + nvl(p_late_cnt_total,0))','(nvl(p_cnt_receipt_total,0))') || ' POA_MEASURE22';
593:
594: return l_sel_clause;
587: 'P') ||
588: ' POA_MEASURE12,
589: ' || poa_dbi_util_pkg.rate_clause('p_amt_expt','p_amt_receipt') || ' POA_MEASURE16,
590: ' || poa_dbi_util_pkg.rate_clause('p_amt_expt_total','p_amt_receipt_total') || ' POA_MEASURE20,
591: ' || poa_dbi_util_pkg.rate_clause('(nvl(p_early_cnt,0) + nvl(p_late_cnt,0))','(nvl(p_cnt_receipt,0))') || ' POA_MEASURE17,
592: ' || poa_dbi_util_pkg.rate_clause('(nvl(p_early_cnt_total,0) + nvl(p_late_cnt_total,0))','(nvl(p_cnt_receipt_total,0))') || ' POA_MEASURE22';
593:
594: return l_sel_clause;
595: END;
588: ' POA_MEASURE12,
589: ' || poa_dbi_util_pkg.rate_clause('p_amt_expt','p_amt_receipt') || ' POA_MEASURE16,
590: ' || poa_dbi_util_pkg.rate_clause('p_amt_expt_total','p_amt_receipt_total') || ' POA_MEASURE20,
591: ' || poa_dbi_util_pkg.rate_clause('(nvl(p_early_cnt,0) + nvl(p_late_cnt,0))','(nvl(p_cnt_receipt,0))') || ' POA_MEASURE17,
592: ' || poa_dbi_util_pkg.rate_clause('(nvl(p_early_cnt_total,0) + nvl(p_late_cnt_total,0))','(nvl(p_cnt_receipt_total,0))') || ' POA_MEASURE22';
593:
594: return l_sel_clause;
595: END;
596:
666: l_sel_clause := l_sel_clause ||' base_uom,';
667: end if;
668: l_sel_clause := l_sel_clause ||
669: 'nvl(c_amt_expt,0) POA_MEASURE1,
670: ' || poa_dbi_util_pkg.change_clause('c_amt_expt','p_amt_expt') || ' POA_PERCENT1,
671: nvl(c_amt_receipt,0) POA_MEASURE2,
672: ' || poa_dbi_util_pkg.rate_clause('c_amt_expt','c_amt_receipt') || ' POA_PERCENT2,
673: nvl(c_amt_early,0) POA_MEASURE3,
674: c_num_days_early/decode(c_early_cnt, 0, null, c_early_cnt) POA_MEASURE4,
668: l_sel_clause := l_sel_clause ||
669: 'nvl(c_amt_expt,0) POA_MEASURE1,
670: ' || poa_dbi_util_pkg.change_clause('c_amt_expt','p_amt_expt') || ' POA_PERCENT1,
671: nvl(c_amt_receipt,0) POA_MEASURE2,
672: ' || poa_dbi_util_pkg.rate_clause('c_amt_expt','c_amt_receipt') || ' POA_PERCENT2,
673: nvl(c_amt_early,0) POA_MEASURE3,
674: c_num_days_early/decode(c_early_cnt, 0, null, c_early_cnt) POA_MEASURE4,
675: nvl(c_amt_late,0) POA_MEASURE5,
676: c_num_days_late/decode(c_late_cnt, 0, null, c_late_cnt) POA_MEASURE6,
674: c_num_days_early/decode(c_early_cnt, 0, null, c_early_cnt) POA_MEASURE4,
675: nvl(c_amt_late,0) POA_MEASURE5,
676: c_num_days_late/decode(c_late_cnt, 0, null, c_late_cnt) POA_MEASURE6,
677: nvl(c_amt_expt_total,0) POA_MEASURE7,
678: ' || poa_dbi_util_pkg.change_clause('c_amt_expt_total','p_amt_expt_total') || ' POA_MEASURE8,
679: nvl(c_amt_receipt_total,0) POA_MEASURE9,
680: ' || poa_dbi_util_pkg.rate_clause('c_amt_expt_total','c_amt_receipt_total') || ' POA_MEASURE10,
681: nvl(c_amt_early_total,0) POA_MEASURE11,
682: c_num_days_early_total/decode(c_early_cnt_total, 0, null, c_early_cnt_total) POA_MEASURE12,
676: c_num_days_late/decode(c_late_cnt, 0, null, c_late_cnt) POA_MEASURE6,
677: nvl(c_amt_expt_total,0) POA_MEASURE7,
678: ' || poa_dbi_util_pkg.change_clause('c_amt_expt_total','p_amt_expt_total') || ' POA_MEASURE8,
679: nvl(c_amt_receipt_total,0) POA_MEASURE9,
680: ' || poa_dbi_util_pkg.rate_clause('c_amt_expt_total','c_amt_receipt_total') || ' POA_MEASURE10,
681: nvl(c_amt_early_total,0) POA_MEASURE11,
682: c_num_days_early_total/decode(c_early_cnt_total, 0, null, c_early_cnt_total) POA_MEASURE12,
683: nvl(c_amt_late_total,0) POA_MEASURE13,
684: c_num_days_late_total/decode(c_late_cnt_total, 0, null, c_late_cnt_total) POA_MEASURE14,
760: l_sel_clause := l_sel_clause ||' base_uom,';
761: end if;
762: l_sel_clause := l_sel_clause ||
763: 'nvl(c_early_cnt,0) + nvl(c_late_cnt,0) POA_MEASURE1,
764: ' || poa_dbi_util_pkg.change_clause('(nvl(c_early_cnt,0)+nvl(c_late_cnt,0))','(nvl(p_early_cnt,0)+nvl(p_late_cnt,0))') || ' POA_PERCENT1,
765: nvl(c_cnt_receipt,0) POA_MEASURE2,
766: ' || poa_dbi_util_pkg.rate_clause('(nvl(c_early_cnt,0) + nvl(c_late_cnt,0))','c_cnt_receipt') || ' POA_PERCENT2,
767: nvl(c_early_cnt,0) POA_MEASURE3,
768: c_num_days_early/decode(c_early_cnt, 0, null, c_early_cnt) POA_MEASURE4,
762: l_sel_clause := l_sel_clause ||
763: 'nvl(c_early_cnt,0) + nvl(c_late_cnt,0) POA_MEASURE1,
764: ' || poa_dbi_util_pkg.change_clause('(nvl(c_early_cnt,0)+nvl(c_late_cnt,0))','(nvl(p_early_cnt,0)+nvl(p_late_cnt,0))') || ' POA_PERCENT1,
765: nvl(c_cnt_receipt,0) POA_MEASURE2,
766: ' || poa_dbi_util_pkg.rate_clause('(nvl(c_early_cnt,0) + nvl(c_late_cnt,0))','c_cnt_receipt') || ' POA_PERCENT2,
767: nvl(c_early_cnt,0) POA_MEASURE3,
768: c_num_days_early/decode(c_early_cnt, 0, null, c_early_cnt) POA_MEASURE4,
769: nvl(c_late_cnt,0) POA_MEASURE5,
770: c_num_days_late/decode(c_late_cnt, 0, null, c_late_cnt) POA_MEASURE6,
768: c_num_days_early/decode(c_early_cnt, 0, null, c_early_cnt) POA_MEASURE4,
769: nvl(c_late_cnt,0) POA_MEASURE5,
770: c_num_days_late/decode(c_late_cnt, 0, null, c_late_cnt) POA_MEASURE6,
771: nvl(c_early_cnt_total,0) + nvl(c_late_cnt_total, 0) POA_MEASURE7,
772: ' || poa_dbi_util_pkg.change_clause('(nvl(c_early_cnt_total,0) + nvl(c_late_cnt_total,0))','(nvl(p_early_cnt_total,0) + nvl(p_late_cnt_total,0))') || ' POA_MEASURE8,
773: nvl(c_cnt_receipt_total,0) POA_MEASURE9,
774: ' || poa_dbi_util_pkg.rate_clause('(nvl(c_early_cnt_total,0) + nvl(c_late_cnt_total,0))','c_cnt_receipt_total') || ' POA_MEASURE10,
775: nvl(c_early_cnt_total,0) POA_MEASURE11,
776: c_num_days_early_total/decode(c_early_cnt_total, 0, null, c_early_cnt_total) POA_MEASURE12,
770: c_num_days_late/decode(c_late_cnt, 0, null, c_late_cnt) POA_MEASURE6,
771: nvl(c_early_cnt_total,0) + nvl(c_late_cnt_total, 0) POA_MEASURE7,
772: ' || poa_dbi_util_pkg.change_clause('(nvl(c_early_cnt_total,0) + nvl(c_late_cnt_total,0))','(nvl(p_early_cnt_total,0) + nvl(p_late_cnt_total,0))') || ' POA_MEASURE8,
773: nvl(c_cnt_receipt_total,0) POA_MEASURE9,
774: ' || poa_dbi_util_pkg.rate_clause('(nvl(c_early_cnt_total,0) + nvl(c_late_cnt_total,0))','c_cnt_receipt_total') || ' POA_MEASURE10,
775: nvl(c_early_cnt_total,0) POA_MEASURE11,
776: c_num_days_early_total/decode(c_early_cnt_total, 0, null, c_early_cnt_total) POA_MEASURE12,
777: nvl(c_late_cnt_total,0) POA_MEASURE13,
778: c_num_days_late_total/decode(c_late_cnt_total, 0, null, c_late_cnt_total) POA_MEASURE14,
926: l_comparison_type varchar2(1) := 'Y';
927: l_nested_pattern number;
928: l_cur_suffix varchar2(2);
929: l_custom_sql varchar2(10000);
930: l_col_tbl poa_dbi_util_pkg.POA_DBI_COL_TBL;
931: l_join_tbl poa_dbi_util_pkg.POA_DBI_JOIN_TBL;
932: l_in_join_tbl poa_dbi_util_pkg.POA_DBI_IN_JOIN_TBL;
933: l_mv VARCHAR2(30);
934: l_where_clause VARCHAR2(2000);
927: l_nested_pattern number;
928: l_cur_suffix varchar2(2);
929: l_custom_sql varchar2(10000);
930: l_col_tbl poa_dbi_util_pkg.POA_DBI_COL_TBL;
931: l_join_tbl poa_dbi_util_pkg.POA_DBI_JOIN_TBL;
932: l_in_join_tbl poa_dbi_util_pkg.POA_DBI_IN_JOIN_TBL;
933: l_mv VARCHAR2(30);
934: l_where_clause VARCHAR2(2000);
935: l_context_code VARCHAR2(10);
928: l_cur_suffix varchar2(2);
929: l_custom_sql varchar2(10000);
930: l_col_tbl poa_dbi_util_pkg.POA_DBI_COL_TBL;
931: l_join_tbl poa_dbi_util_pkg.POA_DBI_JOIN_TBL;
932: l_in_join_tbl poa_dbi_util_pkg.POA_DBI_IN_JOIN_TBL;
933: l_mv VARCHAR2(30);
934: l_where_clause VARCHAR2(2000);
935: l_context_code VARCHAR2(10);
936: l_to_date_type VARCHAR2(10);
934: l_where_clause VARCHAR2(2000);
935: l_context_code VARCHAR2(10);
936: l_to_date_type VARCHAR2(10);
937: BEGIN
938: l_join_tbl := poa_dbi_util_pkg.POA_DBI_JOIN_TBL();
939: l_col_tbl := poa_dbi_util_pkg.POA_DBI_COL_TBL();
940: poa_dbi_sutil_pkg.process_parameters(p_param
941: ,l_view_by
942: ,l_view_by_col
935: l_context_code VARCHAR2(10);
936: l_to_date_type VARCHAR2(10);
937: BEGIN
938: l_join_tbl := poa_dbi_util_pkg.POA_DBI_JOIN_TBL();
939: l_col_tbl := poa_dbi_util_pkg.POA_DBI_COL_TBL();
940: poa_dbi_sutil_pkg.process_parameters(p_param
941: ,l_view_by
942: ,l_view_by_col
943: ,l_view_by_value
959: ELSE
960: l_to_date_type := 'XTD';
961: END IF;
962:
963: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_early_cnt', 'early_cnt', 'N',p_to_date_type => l_to_date_type);
964: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_late_cnt', 'late_cnt', 'N',p_to_date_type => l_to_date_type);
965: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_expt_' || l_cur_suffix,'amt_expt', 'N',p_to_date_type => l_to_date_type);
966:
967: l_query := get_trend_sel_clause || ' from
960: l_to_date_type := 'XTD';
961: END IF;
962:
963: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_early_cnt', 'early_cnt', 'N',p_to_date_type => l_to_date_type);
964: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_late_cnt', 'late_cnt', 'N',p_to_date_type => l_to_date_type);
965: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_expt_' || l_cur_suffix,'amt_expt', 'N',p_to_date_type => l_to_date_type);
966:
967: l_query := get_trend_sel_clause || ' from
968: '|| poa_dbi_template_pkg.trend_sql(l_xtd,
961: END IF;
962:
963: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_early_cnt', 'early_cnt', 'N',p_to_date_type => l_to_date_type);
964: poa_dbi_util_pkg.add_column(l_col_tbl, 'num_txns_late_cnt', 'late_cnt', 'N',p_to_date_type => l_to_date_type);
965: poa_dbi_util_pkg.add_column(l_col_tbl, 'amt_expt_' || l_cur_suffix,'amt_expt', 'N',p_to_date_type => l_to_date_type);
966:
967: l_query := get_trend_sel_clause || ' from
968: '|| poa_dbi_template_pkg.trend_sql(l_xtd,
969: l_comparison_type,
980: BEGIN
981: l_sel_clause :='select cal.name VIEWBY,
982: nvl(p_amt_expt,0) POA_MEASURE3,
983: nvl(c_amt_expt,0) POA_MEASURE1,
984: ' || poa_dbi_util_pkg.change_clause('c_amt_expt','p_amt_expt') || ' POA_PERCENT1,
985: nvl(p_early_cnt,0)+nvl(p_late_cnt,0) POA_MEASURE4,
986: nvl(c_early_cnt,0)+nvl(c_late_cnt,0) POA_MEASURE2,
987: ' || poa_dbi_util_pkg.change_clause('(nvl(c_early_cnt,0)+nvl(c_late_cnt,0))','(nvl(p_early_cnt,0)+nvl(p_late_cnt,0))') || ' POA_PERCENT3';
988: return l_sel_clause;
983: nvl(c_amt_expt,0) POA_MEASURE1,
984: ' || poa_dbi_util_pkg.change_clause('c_amt_expt','p_amt_expt') || ' POA_PERCENT1,
985: nvl(p_early_cnt,0)+nvl(p_late_cnt,0) POA_MEASURE4,
986: nvl(c_early_cnt,0)+nvl(c_late_cnt,0) POA_MEASURE2,
987: ' || poa_dbi_util_pkg.change_clause('(nvl(c_early_cnt,0)+nvl(c_late_cnt,0))','(nvl(p_early_cnt,0)+nvl(p_late_cnt,0))') || ' POA_PERCENT3';
988: return l_sel_clause;
989: END;
990: end poa_dbi_rde_pkg;