30: end if;
31: elsif p_frequency_type = 'MONTH' then
32: l_start_date := add_months(p_reset_date, floor(months_between(p_effective_date, p_reset_date) / p_frequency) * p_frequency);
33: else
34: fnd_message.set_name('PAY', 'PAY_JP_DIM_INVALID_FREQ_TYPE');
35: fnd_message.set_token('FREQUENCY_TYPE', p_frequency_type);
36: fnd_message.raise_error;
37: end if;
38: --
31: elsif p_frequency_type = 'MONTH' then
32: l_start_date := add_months(p_reset_date, floor(months_between(p_effective_date, p_reset_date) / p_frequency) * p_frequency);
33: else
34: fnd_message.set_name('PAY', 'PAY_JP_DIM_INVALID_FREQ_TYPE');
35: fnd_message.set_token('FREQUENCY_TYPE', p_frequency_type);
36: fnd_message.raise_error;
37: end if;
38: --
39: return l_start_date;
32: l_start_date := add_months(p_reset_date, floor(months_between(p_effective_date, p_reset_date) / p_frequency) * p_frequency);
33: else
34: fnd_message.set_name('PAY', 'PAY_JP_DIM_INVALID_FREQ_TYPE');
35: fnd_message.set_token('FREQUENCY_TYPE', p_frequency_type);
36: fnd_message.raise_error;
37: end if;
38: --
39: return l_start_date;
40: end start_date;
64: end if;
65: elsif p_frequency_type = 'MONTH' then
66: l_end_date := add_months(start_date(p_effective_date, p_reset_date, p_frequency_type, p_frequency), p_frequency) - 1;
67: else
68: fnd_message.set_name('PAY', 'PAY_JP_DIM_INVALID_FREQ_TYPE');
69: fnd_message.set_token('FREQUENCY_TYPE', p_frequency_type);
70: fnd_message.raise_error;
71: end if;
72: --
65: elsif p_frequency_type = 'MONTH' then
66: l_end_date := add_months(start_date(p_effective_date, p_reset_date, p_frequency_type, p_frequency), p_frequency) - 1;
67: else
68: fnd_message.set_name('PAY', 'PAY_JP_DIM_INVALID_FREQ_TYPE');
69: fnd_message.set_token('FREQUENCY_TYPE', p_frequency_type);
70: fnd_message.raise_error;
71: end if;
72: --
73: return l_end_date;
66: l_end_date := add_months(start_date(p_effective_date, p_reset_date, p_frequency_type, p_frequency), p_frequency) - 1;
67: else
68: fnd_message.set_name('PAY', 'PAY_JP_DIM_INVALID_FREQ_TYPE');
69: fnd_message.set_token('FREQUENCY_TYPE', p_frequency_type);
70: fnd_message.raise_error;
71: end if;
72: --
73: return l_end_date;
74: end end_date;
137: p_argument => 'frequency',
138: p_argument_value => p_frequency);
139: --
140: if p_date_type not in ('DP', 'DE') then
141: fnd_message.set_name('PAY', 'PAY_JP_DIM_INVALID_DATE_TYPE');
142: fnd_message.set_token('DATE_TYPE', p_date_type);
143: fnd_message.raise_error;
144: end if;
145: --
138: p_argument_value => p_frequency);
139: --
140: if p_date_type not in ('DP', 'DE') then
141: fnd_message.set_name('PAY', 'PAY_JP_DIM_INVALID_DATE_TYPE');
142: fnd_message.set_token('DATE_TYPE', p_date_type);
143: fnd_message.raise_error;
144: end if;
145: --
146: if p_reset_date <> trunc(p_reset_date) then
139: --
140: if p_date_type not in ('DP', 'DE') then
141: fnd_message.set_name('PAY', 'PAY_JP_DIM_INVALID_DATE_TYPE');
142: fnd_message.set_token('DATE_TYPE', p_date_type);
143: fnd_message.raise_error;
144: end if;
145: --
146: if p_reset_date <> trunc(p_reset_date) then
147: fnd_message.set_name('PAY', 'PAY_JP_DIM_INVALID_RESET_DATE');
143: fnd_message.raise_error;
144: end if;
145: --
146: if p_reset_date <> trunc(p_reset_date) then
147: fnd_message.set_name('PAY', 'PAY_JP_DIM_INVALID_RESET_DATE');
148: fnd_message.set_token('RESET_DATE', fnd_date.date_to_chardt(p_reset_date));
149: fnd_message.raise_error;
150: end if;
151: --
144: end if;
145: --
146: if p_reset_date <> trunc(p_reset_date) then
147: fnd_message.set_name('PAY', 'PAY_JP_DIM_INVALID_RESET_DATE');
148: fnd_message.set_token('RESET_DATE', fnd_date.date_to_chardt(p_reset_date));
149: fnd_message.raise_error;
150: end if;
151: --
152: if p_frequency_type not in ('DAY', 'SMONTH', 'MONTH') then
145: --
146: if p_reset_date <> trunc(p_reset_date) then
147: fnd_message.set_name('PAY', 'PAY_JP_DIM_INVALID_RESET_DATE');
148: fnd_message.set_token('RESET_DATE', fnd_date.date_to_chardt(p_reset_date));
149: fnd_message.raise_error;
150: end if;
151: --
152: if p_frequency_type not in ('DAY', 'SMONTH', 'MONTH') then
153: fnd_message.set_name('PAY', 'PAY_JP_DIM_INVALID_FREQ_TYPE');
149: fnd_message.raise_error;
150: end if;
151: --
152: if p_frequency_type not in ('DAY', 'SMONTH', 'MONTH') then
153: fnd_message.set_name('PAY', 'PAY_JP_DIM_INVALID_FREQ_TYPE');
154: fnd_message.set_token('FREQUENCY_TYPE', p_frequency_type);
155: fnd_message.raise_error;
156: end if;
157: --
150: end if;
151: --
152: if p_frequency_type not in ('DAY', 'SMONTH', 'MONTH') then
153: fnd_message.set_name('PAY', 'PAY_JP_DIM_INVALID_FREQ_TYPE');
154: fnd_message.set_token('FREQUENCY_TYPE', p_frequency_type);
155: fnd_message.raise_error;
156: end if;
157: --
158: if not (p_frequency between 1 and 99999)
151: --
152: if p_frequency_type not in ('DAY', 'SMONTH', 'MONTH') then
153: fnd_message.set_name('PAY', 'PAY_JP_DIM_INVALID_FREQ_TYPE');
154: fnd_message.set_token('FREQUENCY_TYPE', p_frequency_type);
155: fnd_message.raise_error;
156: end if;
157: --
158: if not (p_frequency between 1 and 99999)
159: or p_frequency <> trunc(p_frequency) then
156: end if;
157: --
158: if not (p_frequency between 1 and 99999)
159: or p_frequency <> trunc(p_frequency) then
160: fnd_message.set_name('PAY', 'PAY_JP_DIM_INVALID_FREQUENCY');
161: fnd_message.set_token('FREQUENCY', p_frequency);
162: fnd_message.raise_error;
163: end if;
164: end validate_parameters;
157: --
158: if not (p_frequency between 1 and 99999)
159: or p_frequency <> trunc(p_frequency) then
160: fnd_message.set_name('PAY', 'PAY_JP_DIM_INVALID_FREQUENCY');
161: fnd_message.set_token('FREQUENCY', p_frequency);
162: fnd_message.raise_error;
163: end if;
164: end validate_parameters;
165: -- ----------------------------------------------------------------------------
158: if not (p_frequency between 1 and 99999)
159: or p_frequency <> trunc(p_frequency) then
160: fnd_message.set_name('PAY', 'PAY_JP_DIM_INVALID_FREQUENCY');
161: fnd_message.set_token('FREQUENCY', p_frequency);
162: fnd_message.raise_error;
163: end if;
164: end validate_parameters;
165: -- ----------------------------------------------------------------------------
166: -- |------------------------------< utilities >-------------------------------|
527: l_balance_type_column pay_dimension_routes.balance_type_column%type;
528: l_run_dimension_id number;
529: begin
530: if p_route_type = 'SRB' and p_date_type = 'DE' then
531: fnd_message.set_name('PAY', 'PAY_JP_DIM_DE_SRB_NOT_SUPPORT');
532: fnd_message.raise_error;
533: end if;
534: --
535: create_route(
528: l_run_dimension_id number;
529: begin
530: if p_route_type = 'SRB' and p_date_type = 'DE' then
531: fnd_message.set_name('PAY', 'PAY_JP_DIM_DE_SRB_NOT_SUPPORT');
532: fnd_message.raise_error;
533: end if;
534: --
535: create_route(
536: p_route_type => p_route_type,
589: and nvl(business_group_id, p_business_group_id) = p_business_group_id
590: and nvl(legislation_code, 'JP') = 'JP';
591: --
592: if l_count > 0 then
593: fnd_message.set_name('PAY', 'PAY_JP_DIM_DUP_DIM_NAME');
594: fnd_message.set_token('DIMENSION_NAME', p_dimension_name);
595: fnd_message.raise_error;
596: end if;
597: end chk_dimension_name;
590: and nvl(legislation_code, 'JP') = 'JP';
591: --
592: if l_count > 0 then
593: fnd_message.set_name('PAY', 'PAY_JP_DIM_DUP_DIM_NAME');
594: fnd_message.set_token('DIMENSION_NAME', p_dimension_name);
595: fnd_message.raise_error;
596: end if;
597: end chk_dimension_name;
598: -- ----------------------------------------------------------------------------
591: --
592: if l_count > 0 then
593: fnd_message.set_name('PAY', 'PAY_JP_DIM_DUP_DIM_NAME');
594: fnd_message.set_token('DIMENSION_NAME', p_dimension_name);
595: fnd_message.raise_error;
596: end if;
597: end chk_dimension_name;
598: -- ----------------------------------------------------------------------------
599: -- |-----------------------< chk_database_item_suffix >-----------------------|
634: and nvl(business_group_id, p_business_group_id) = p_business_group_id
635: and nvl(legislation_code, 'JP') = 'JP';
636: --
637: if l_count > 0 then
638: fnd_message.set_name('PAY', 'PAY_JP_DIM_DUP_DBI_SUFFIX');
639: fnd_message.set_token('DATABASE_ITEM_SUFFIX', p_database_item_suffix);
640: fnd_message.raise_error;
641: end if;
642: end chk_database_item_suffix;
635: and nvl(legislation_code, 'JP') = 'JP';
636: --
637: if l_count > 0 then
638: fnd_message.set_name('PAY', 'PAY_JP_DIM_DUP_DBI_SUFFIX');
639: fnd_message.set_token('DATABASE_ITEM_SUFFIX', p_database_item_suffix);
640: fnd_message.raise_error;
641: end if;
642: end chk_database_item_suffix;
643: -- ----------------------------------------------------------------------------
636: --
637: if l_count > 0 then
638: fnd_message.set_name('PAY', 'PAY_JP_DIM_DUP_DBI_SUFFIX');
639: fnd_message.set_token('DATABASE_ITEM_SUFFIX', p_database_item_suffix);
640: fnd_message.raise_error;
641: end if;
642: end chk_database_item_suffix;
643: -- ----------------------------------------------------------------------------
644: -- |-----------------------< create_balance_dimension >-----------------------|
870: --
871: -- Only user defined dimension is allowed to be updated.
872: --
873: if l_business_group_id is null then
874: fnd_message.set_name('PAY', 'PAY_JP_DIM_SEEDUPD_NOT_ALLOWED');
875: fnd_message.raise_error;
876: end if;
877: --
878: validate_parameters(
871: -- Only user defined dimension is allowed to be updated.
872: --
873: if l_business_group_id is null then
874: fnd_message.set_name('PAY', 'PAY_JP_DIM_SEEDUPD_NOT_ALLOWED');
875: fnd_message.raise_error;
876: end if;
877: --
878: validate_parameters(
879: p_date_type => p_date_type,
1113: add_body(' end if;');
1114: add_body(' elsif p_frequency_type = ''MONTH'' then');
1115: add_body(' l_start_date := add_months(p_reset_date, floor(months_between(p_effective_date, p_reset_date) / p_frequency) * p_frequency);');
1116: add_body(' else');
1117: add_body(' fnd_message.set_name(''PAY'', ''PAY_JP_DIM_INVALID_FREQ_TYPE'');');
1118: add_body(' fnd_message.set_token(''FREQUENCY_TYPE'', p_frequency_type);');
1119: add_body(' fnd_message.raise_error;');
1120: add_body(' end if;');
1121: add_body(' --');
1114: add_body(' elsif p_frequency_type = ''MONTH'' then');
1115: add_body(' l_start_date := add_months(p_reset_date, floor(months_between(p_effective_date, p_reset_date) / p_frequency) * p_frequency);');
1116: add_body(' else');
1117: add_body(' fnd_message.set_name(''PAY'', ''PAY_JP_DIM_INVALID_FREQ_TYPE'');');
1118: add_body(' fnd_message.set_token(''FREQUENCY_TYPE'', p_frequency_type);');
1119: add_body(' fnd_message.raise_error;');
1120: add_body(' end if;');
1121: add_body(' --');
1122: add_body(' return l_start_date;');
1115: add_body(' l_start_date := add_months(p_reset_date, floor(months_between(p_effective_date, p_reset_date) / p_frequency) * p_frequency);');
1116: add_body(' else');
1117: add_body(' fnd_message.set_name(''PAY'', ''PAY_JP_DIM_INVALID_FREQ_TYPE'');');
1118: add_body(' fnd_message.set_token(''FREQUENCY_TYPE'', p_frequency_type);');
1119: add_body(' fnd_message.raise_error;');
1120: add_body(' end if;');
1121: add_body(' --');
1122: add_body(' return l_start_date;');
1123: add_body('end start_date;');
1147: add_body(' end if;');
1148: add_body(' elsif p_frequency_type = ''MONTH'' then');
1149: add_body(' l_end_date := add_months(start_date(p_effective_date, p_reset_date, p_frequency_type, p_frequency), p_frequency) - 1;');
1150: add_body(' else');
1151: add_body(' fnd_message.set_name(''PAY'', ''PAY_JP_DIM_INVALID_FREQ_TYPE'');');
1152: add_body(' fnd_message.set_token(''FREQUENCY_TYPE'', p_frequency_type);');
1153: add_body(' fnd_message.raise_error;');
1154: add_body(' end if;');
1155: add_body(' --');
1148: add_body(' elsif p_frequency_type = ''MONTH'' then');
1149: add_body(' l_end_date := add_months(start_date(p_effective_date, p_reset_date, p_frequency_type, p_frequency), p_frequency) - 1;');
1150: add_body(' else');
1151: add_body(' fnd_message.set_name(''PAY'', ''PAY_JP_DIM_INVALID_FREQ_TYPE'');');
1152: add_body(' fnd_message.set_token(''FREQUENCY_TYPE'', p_frequency_type);');
1153: add_body(' fnd_message.raise_error;');
1154: add_body(' end if;');
1155: add_body(' --');
1156: add_body(' return l_end_date;');
1149: add_body(' l_end_date := add_months(start_date(p_effective_date, p_reset_date, p_frequency_type, p_frequency), p_frequency) - 1;');
1150: add_body(' else');
1151: add_body(' fnd_message.set_name(''PAY'', ''PAY_JP_DIM_INVALID_FREQ_TYPE'');');
1152: add_body(' fnd_message.set_token(''FREQUENCY_TYPE'', p_frequency_type);');
1153: add_body(' fnd_message.raise_error;');
1154: add_body(' end if;');
1155: add_body(' --');
1156: add_body(' return l_end_date;');
1157: add_body('end end_date;');