DBA Data[Home] [Help]

APPS.GCS_TRANS_HRATES_DYNAMIC_PKG dependencies on GCS_HISTORICAL_RATES

Line 116: 'UPDATE gcs_historical_rates ghr' || g_nl ||

112: write_to_log(module, FND_LOG.LEVEL_PROCEDURE,g_module_enter);
113:
114: --Bugfix 6111815: Added Standard RE Rate Flag
115: write_to_log(module, FND_LOG.LEVEL_STATEMENT,
116: 'UPDATE gcs_historical_rates ghr' || g_nl ||
117: 'SET (translated_rate, translated_amount, rate_type_code, ' ||
118: 'last_update_date, last_updated_by, last_update_login) =' || g_nl ||
119: ' (SELECT ghr1.translated_rate, ghr1.translated_amount, ''P'', ' ||
120: 'sysdate, ' || gcs_translation_pkg.g_fnd_user_id || ', ' ||

Line 122: ' FROM gcs_historical_rates ghr1' || g_nl ||

118: 'last_update_date, last_updated_by, last_update_login) =' || g_nl ||
119: ' (SELECT ghr1.translated_rate, ghr1.translated_amount, ''P'', ' ||
120: 'sysdate, ' || gcs_translation_pkg.g_fnd_user_id || ', ' ||
121: gcs_translation_pkg.g_fnd_login_id || g_nl ||
122: ' FROM gcs_historical_rates ghr1' || g_nl ||
123: ' WHERE ghr1.entity_id = ghr.entity_id' || g_nl ||
124: ' AND ghr1.hierarchy_id = ghr.hierarchy_id' || g_nl ||
125: ' AND ghr1.from_currency = ghr.from_currency' || g_nl ||
126: ' AND ghr1.to_currency = ghr.to_currency' || g_nl ||

Line 131: ' FROM GCS_HISTORICAL_RATES ghr2, ' || g_nl ||

127: ' AND ghr1.line_item_id = ghr.line_item_id' || g_nl ||
128: ' AND ghr1.standard_re_rate_flag IS NULL ' || g_nl ||' AND ghr1.cal_period_id = ' || p_prev_period_id || ')' || g_nl ||
129: 'WHERE ghr.rowid IN ( ' || g_nl ||
130: ' SELECT ghr3.rowid' || g_nl ||
131: ' FROM GCS_HISTORICAL_RATES ghr2, ' || g_nl ||
132: ' GCS_HISTORICAL_RATES ghr3' || g_nl ||
133: ' WHERE ghr2.entity_id = ' || p_entity_id || g_nl ||
134: ' AND ghr2.hierarchy_id = ' || p_hierarchy_id || g_nl ||
135: ' AND ghr2.from_currency = ''' || p_from_ccy || '''' || g_nl ||

Line 132: ' GCS_HISTORICAL_RATES ghr3' || g_nl ||

128: ' AND ghr1.standard_re_rate_flag IS NULL ' || g_nl ||' AND ghr1.cal_period_id = ' || p_prev_period_id || ')' || g_nl ||
129: 'WHERE ghr.rowid IN ( ' || g_nl ||
130: ' SELECT ghr3.rowid' || g_nl ||
131: ' FROM GCS_HISTORICAL_RATES ghr2, ' || g_nl ||
132: ' GCS_HISTORICAL_RATES ghr3' || g_nl ||
133: ' WHERE ghr2.entity_id = ' || p_entity_id || g_nl ||
134: ' AND ghr2.hierarchy_id = ' || p_hierarchy_id || g_nl ||
135: ' AND ghr2.from_currency = ''' || p_from_ccy || '''' || g_nl ||
136: ' AND ghr2.to_currency = ''' || p_to_ccy || '''' || g_nl ||

Line 162: UPDATE gcs_historical_rates ghr

158: -- is Prior or Historical.
159: -- 3. The historical rates of current and previous periods are different.
160: -- 4. The historical rate is not marked with stop rolling forward.
161: -- Bugfix 6111815: Added Standard RE Rate Flag
162: UPDATE gcs_historical_rates ghr
163: SET (translated_rate, translated_amount, rate_type_code,
164: last_update_date, last_updated_by, last_update_login) =
165: (SELECT ghr1.translated_rate, ghr1.translated_amount, 'P', sysdate,
166: gcs_translation_pkg.g_fnd_user_id, gcs_translation_pkg.g_fnd_login_id

Line 167: FROM gcs_historical_rates ghr1

163: SET (translated_rate, translated_amount, rate_type_code,
164: last_update_date, last_updated_by, last_update_login) =
165: (SELECT ghr1.translated_rate, ghr1.translated_amount, 'P', sysdate,
166: gcs_translation_pkg.g_fnd_user_id, gcs_translation_pkg.g_fnd_login_id
167: FROM gcs_historical_rates ghr1
168: WHERE ghr1.entity_id = ghr.entity_id
169: AND ghr1.hierarchy_id = ghr.hierarchy_id
170: AND ghr1.from_currency = ghr.from_currency
171: AND ghr1.to_currency = ghr.to_currency

Line 176: FROM GCS_HISTORICAL_RATES ghr2,

172: AND ghr1.line_item_id = ghr.line_item_id
173: AND ghr1.standard_re_rate_flag IS NULL AND ghr1.cal_period_id = p_prev_period_id)
174: WHERE ghr.rowid IN (
175: SELECT ghr3.rowid
176: FROM GCS_HISTORICAL_RATES ghr2,
177: GCS_HISTORICAL_RATES ghr3
178: WHERE ghr2.entity_id = p_entity_id
179: AND ghr2.hierarchy_id = p_hierarchy_id
180: AND ghr2.from_currency = p_from_ccy

Line 177: GCS_HISTORICAL_RATES ghr3

173: AND ghr1.standard_re_rate_flag IS NULL AND ghr1.cal_period_id = p_prev_period_id)
174: WHERE ghr.rowid IN (
175: SELECT ghr3.rowid
176: FROM GCS_HISTORICAL_RATES ghr2,
177: GCS_HISTORICAL_RATES ghr3
178: WHERE ghr2.entity_id = p_entity_id
179: AND ghr2.hierarchy_id = p_hierarchy_id
180: AND ghr2.from_currency = p_from_ccy
181: AND ghr2.to_currency = p_to_ccy

Line 201: 'DELETE FROM gcs_historical_rates ghr' || g_nl ||

197: nvl(to_char(ghr3.translated_amount), 'X')));
198:
199: --Bugfix 6111815: Added Standard RE Rate Flag
200: write_to_log(module, FND_LOG.LEVEL_STATEMENT,
201: 'DELETE FROM gcs_historical_rates ghr' || g_nl ||
202: 'WHERE (rowid, ''E'') IN (' || g_nl ||
203: ' SELECT ghr3.rowid, nvl(ghr2.rate_type_code, ''E'')' || g_nl ||
204: ' FROM GCS_HISTORICAL_RATES ghr3, ' || g_nl ||
205: ' GCS_HISTORICAL_RATES ghr2' || g_nl ||

Line 204: ' FROM GCS_HISTORICAL_RATES ghr3, ' || g_nl ||

200: write_to_log(module, FND_LOG.LEVEL_STATEMENT,
201: 'DELETE FROM gcs_historical_rates ghr' || g_nl ||
202: 'WHERE (rowid, ''E'') IN (' || g_nl ||
203: ' SELECT ghr3.rowid, nvl(ghr2.rate_type_code, ''E'')' || g_nl ||
204: ' FROM GCS_HISTORICAL_RATES ghr3, ' || g_nl ||
205: ' GCS_HISTORICAL_RATES ghr2' || g_nl ||
206: ' WHERE ghr3.entity_id = ' || p_entity_id || g_nl ||
207: ' AND ghr3.hierarchy_id = ' || p_hierarchy_id || g_nl ||
208: ' AND ghr3.rate_type_code = ''P''' || g_nl ||

Line 205: ' GCS_HISTORICAL_RATES ghr2' || g_nl ||

201: 'DELETE FROM gcs_historical_rates ghr' || g_nl ||
202: 'WHERE (rowid, ''E'') IN (' || g_nl ||
203: ' SELECT ghr3.rowid, nvl(ghr2.rate_type_code, ''E'')' || g_nl ||
204: ' FROM GCS_HISTORICAL_RATES ghr3, ' || g_nl ||
205: ' GCS_HISTORICAL_RATES ghr2' || g_nl ||
206: ' WHERE ghr3.entity_id = ' || p_entity_id || g_nl ||
207: ' AND ghr3.hierarchy_id = ' || p_hierarchy_id || g_nl ||
208: ' AND ghr3.rate_type_code = ''P''' || g_nl ||
209: ' AND ghr3.account_type_code IN (''ASSET'',''LIABILITY'',decode(''' || p_eq_xlate_mode || ''', ''YTD'', ''EQUITY'', NULL))' || g_nl ||

Line 228: DELETE FROM gcs_historical_rates ghr

224: -- type is Prior.
225: -- 2. There is no historical rate in the previous period or a historical
226: -- rate exists in the previous period with the rate type Period.
227: -- Bugfix 6111815: Added Standard RE Rate Flag
228: DELETE FROM gcs_historical_rates ghr
229: WHERE (rowid, 'E') IN (
230: SELECT ghr3.rowid, nvl(ghr2.rate_type_code, 'E')
231: FROM GCS_HISTORICAL_RATES ghr3,
232: GCS_HISTORICAL_RATES ghr2

Line 231: FROM GCS_HISTORICAL_RATES ghr3,

227: -- Bugfix 6111815: Added Standard RE Rate Flag
228: DELETE FROM gcs_historical_rates ghr
229: WHERE (rowid, 'E') IN (
230: SELECT ghr3.rowid, nvl(ghr2.rate_type_code, 'E')
231: FROM GCS_HISTORICAL_RATES ghr3,
232: GCS_HISTORICAL_RATES ghr2
233: WHERE ghr3.entity_id = p_entity_id
234: AND ghr3.hierarchy_id = p_hierarchy_id
235: AND ghr3.rate_type_code = 'P'

Line 232: GCS_HISTORICAL_RATES ghr2

228: DELETE FROM gcs_historical_rates ghr
229: WHERE (rowid, 'E') IN (
230: SELECT ghr3.rowid, nvl(ghr2.rate_type_code, 'E')
231: FROM GCS_HISTORICAL_RATES ghr3,
232: GCS_HISTORICAL_RATES ghr2
233: WHERE ghr3.entity_id = p_entity_id
234: AND ghr3.hierarchy_id = p_hierarchy_id
235: AND ghr3.rate_type_code = 'P'
236: AND ghr3.account_type_code IN ('ASSET','LIABILITY',decode(p_eq_xlate_mode, 'YTD', 'EQUITY', NULL))

Line 251: 'INSERT /*+ parallel (gcs_historical_rates) */ INTO gcs_historical_rates(entity_id, hierarchy_id, ' ||

247: AND ghr3.standard_re_rate_flag IS NULL );
248:
249: --Bugfix 6111815: Added Standard RE Rate Flag
250: write_to_log(module, FND_LOG.LEVEL_STATEMENT,
251: 'INSERT /*+ parallel (gcs_historical_rates) */ INTO gcs_historical_rates(entity_id, hierarchy_id, ' ||
252: 'cal_period_id, from_currency, to_currency, line_item_id, ' ||
253: 'company_cost_center_org_id, intercompany_id, financial_elem_id, ' ||
254: 'product_id, natural_account_id, channel_id, project_id, customer_id, task_id, ' ||
255: 'user_dim1_id, user_dim2_id, user_dim3_id, user_dim4_id, user_dim5_id, ' ||

Line 266: 'FROM gcs_historical_rates ghr' || g_nl ||

262: 'ghr.from_currency, ghr.to_currency, ghr.line_item_id, ' ||'NULL, ' ||'NULL, ' ||'NULL, ' ||'NULL, ' ||'NULL, ' ||'NULL, ' ||'NULL, ' ||'NULL, ' ||'NULL, ' ||'NULL, ' ||'NULL, ' ||'NULL, ' ||'NULL, ' ||'NULL, ' ||'NULL, ' ||'NULL, ' ||'NULL, ' ||'NULL, ' ||'NULL, ' ||'ghr.translated_rate, ghr.translated_amount, ''P'', ''N'', ' ||
263: 'ghr.account_type_code, ''N'', sysdate, ' ||
264: gcs_translation_pkg.g_fnd_user_id || ', ' || gcs_translation_pkg.g_fnd_login_id ||
265: ', sysdate, ' || gcs_translation_pkg.g_fnd_user_id || g_nl ||
266: 'FROM gcs_historical_rates ghr' || g_nl ||
267: 'WHERE ghr.entity_id = ' || p_entity_id || g_nl ||
268: 'AND ghr.hierarchy_id = ' || p_hierarchy_id || g_nl ||
269: 'AND ghr.to_currency = ''' || p_to_ccy || '''' || g_nl ||
270: 'AND ghr.from_currency = ''' || p_from_ccy || '''' || g_nl ||

Line 277: ' SELECT 1 FROM gcs_historical_rates ghr1' || g_nl ||

273: 'AND ghr.account_type_code IN (''ASSET'',''LIABILITY'',decode(''' || p_eq_xlate_mode || ''', ''YTD'', ''EQUITY'', NULL))' || g_nl ||
274: 'AND ghr.stop_rollforward_flag = ''N''' || g_nl ||
275: 'AND ghr.standard_re_rate_flag IS NULL ' || g_nl ||
276: ' AND NOT EXISTS (' || g_nl ||
277: ' SELECT 1 FROM gcs_historical_rates ghr1' || g_nl ||
278: ' WHERE ghr1.entity_id = p_entity_id' || g_nl ||
279: ' AND ghr1.hierarchy_id = p_hierarchy_id' || g_nl ||
280: ' AND ghr1.cal_period_id = p_cal_period_id' || g_nl ||
281: ' AND ghr1.line_item_id = ghr.line_item_id' || g_nl ||' AND ghr1.update_flag = ''N''' || g_nl ||

Line 289: INSERT /*+ parallel (gcs_historical_rates) */ INTO gcs_historical_rates(

285: -- Next, insert historical rates for balance sheet accounts if:
286: -- 1. No historical rate exists for the current period.
287: -- 2. A historical rate is defined for the previous period with Prior or
288: -- Historical rate type and the stop roll forward flag is not checked.
289: INSERT /*+ parallel (gcs_historical_rates) */ INTO gcs_historical_rates(
290: entity_id, hierarchy_id, cal_period_id, from_currency,
291: to_currency, line_item_id, company_cost_center_org_id, intercompany_id,
292: financial_elem_id, product_id, natural_account_id,
293: channel_id, project_id, customer_id, task_id, user_dim1_id, user_dim2_id,

Line 306: FROM gcs_historical_rates ghr

302: ghr.line_item_id, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, ghr.translated_rate, ghr.translated_amount, 'P', 'N',
303: ghr.account_type_code, 'N', sysdate, gcs_translation_pkg.g_fnd_user_id,
304: gcs_translation_pkg.g_fnd_login_id, sysdate,
305: gcs_translation_pkg.g_fnd_user_id
306: FROM gcs_historical_rates ghr
307: WHERE ghr.entity_id = p_entity_id
308: AND ghr.hierarchy_id = p_hierarchy_id
309: AND ghr.to_currency = p_to_ccy
310: AND ghr.from_currency = p_from_ccy

Line 317: SELECT 1 FROM gcs_historical_rates ghr1

313: AND ghr.account_type_code IN ('ASSET','LIABILITY',decode(p_eq_xlate_mode, 'YTD', 'EQUITY', NULL))
314: AND ghr.stop_rollforward_flag = 'N'
315: AND ghr.standard_re_rate_flag IS NULL
316: AND NOT EXISTS (
317: SELECT 1 FROM gcs_historical_rates ghr1
318: WHERE ghr1.entity_id = p_entity_id
319: AND ghr1.hierarchy_id = p_hierarchy_id
320: AND ghr1.cal_period_id = p_cal_period_id
321: AND ghr1.line_item_id = ghr.line_item_id AND ghr1.update_flag = 'N'

Line 445: ' GCS_HISTORICAL_RATES ghr' || g_nl ||

441: ' AND fb_in.entity_id = ' || p_entity_id || g_nl ||
442: ' GROUP BY ' || g_nl ||' fb_in.line_item_id) fb,' || g_nl ||
443: ' FEM_LN_ITEMS_ATTR li,' || g_nl ||
444: ' FEM_EXT_ACCT_TYPES_ATTR fxata,' || g_nl ||
445: ' GCS_HISTORICAL_RATES ghr' || g_nl ||
446: 'WHERE li.line_item_id = fb.line_item_id' || g_nl ||
447: 'AND li.attribute_id = ' || gcs_translation_pkg.g_li_acct_type_attr_id || g_nl ||
448: 'AND li.version_id = ' || gcs_translation_pkg.g_li_acct_type_v_id || g_nl ||
449: 'AND fxata.ext_account_type_code = li.dim_attribute_varchar_member' || g_nl ||

Line 528: GCS_HISTORICAL_RATES ghr

524: AND fb_in.entity_id = p_entity_id
525: GROUP BY fb_in.line_item_id) fb,
526: FEM_LN_ITEMS_ATTR li,
527: FEM_EXT_ACCT_TYPES_ATTR fxata,
528: GCS_HISTORICAL_RATES ghr
529: WHERE li.line_item_id = fb.line_item_id
530: AND li.attribute_id = gcs_translation_pkg.g_li_acct_type_attr_id
531: AND li.version_id = gcs_translation_pkg.g_li_acct_type_v_id
532: AND fxata.ext_account_type_code = li.dim_attribute_varchar_member

Line 543: FROM gcs_historical_rates ghr_retained

539: AND ghr.cal_period_id (+) = p_cal_period_id
540: AND ghr.line_item_id (+) = fb.line_item_id
541: AND ghr.update_flag (+) = 'N'
542: AND NOT EXISTS (SELECT 'X'
543: FROM gcs_historical_rates ghr_retained
544: WHERE ghr_retained.standard_re_rate_flag = 'Y'
545: AND ghr_retained.hierarchy_id = p_hierarchy_id
546: AND ghr_retained.entity_id = p_entity_id
547: AND ghr_retained.cal_period_id = p_cal_period_id

Line 618: ' GCS_HISTORICAL_RATES ghr' || g_nl ||

614: ' AND fb_in.ledger_id = ' || p_ledger_id || g_nl ||
615: ' AND fb_in.entity_id = ' || p_entity_id || ') fb,' || g_nl ||
616: ' FEM_LN_ITEMS_ATTR li,' || g_nl ||
617: ' FEM_EXT_ACCT_TYPES_ATTR fxata,' || g_nl ||
618: ' GCS_HISTORICAL_RATES ghr' || g_nl ||
619: 'WHERE li.line_item_id = fb.line_item_id' || g_nl ||
620: 'AND li.attribute_id = ' || gcs_translation_pkg.g_li_acct_type_attr_id || g_nl ||
621: 'AND li.version_id = ' || gcs_translation_pkg.g_li_acct_type_v_id || g_nl ||
622: 'AND fxata.ext_account_type_code = li.dim_attribute_varchar_member' || g_nl ||

Line 700: GCS_HISTORICAL_RATES ghr

696: AND fb_in.ledger_id = p_ledger_id
697: AND fb_in.entity_id = p_entity_id) fb,
698: FEM_LN_ITEMS_ATTR li,
699: FEM_EXT_ACCT_TYPES_ATTR fxata,
700: GCS_HISTORICAL_RATES ghr
701: WHERE li.line_item_id = fb.line_item_id
702: AND li.attribute_id = gcs_translation_pkg.g_li_acct_type_attr_id
703: AND li.version_id = gcs_translation_pkg.g_li_acct_type_v_id
704: AND fxata.ext_account_type_code = li.dim_attribute_varchar_member

Line 715: FROM gcs_historical_rates ghr_retained

711: AND ghr.cal_period_id (+) = p_cal_period_id
712: AND ghr.line_item_id (+) = fb.line_item_id
713: AND ghr.update_flag (+) = 'N'
714: AND NOT EXISTS (SELECT 'X'
715: FROM gcs_historical_rates ghr_retained
716: WHERE ghr_retained.standard_re_rate_flag = 'Y'
717: AND ghr_retained.hierarchy_id = p_hierarchy_id
718: AND ghr_retained.entity_id = p_entity_id
719: AND ghr_retained.cal_period_id = p_cal_period_id

Line 872: ' GCS_HISTORICAL_RATES ghr,' || g_nl ||

868: ' AND fb_in.ledger_id = ' || p_ledger_id || g_nl ||
869: ' AND fb_in.entity_id = ' || p_entity_id || g_nl ||
870: ' GROUP BY ' || g_nl ||' fb_in.line_item_id) fb,' || g_nl ||
871: ' FEM_BALANCES fbp,' || g_nl ||
872: ' GCS_HISTORICAL_RATES ghr,' || g_nl ||
873: ' FEM_LN_ITEMS_ATTR li,' || g_nl ||
874: ' FEM_EXT_ACCT_TYPES_ATTR fxata' || g_nl ||
875: 'WHERE fbp.created_by_object_id (+)= ' || fb_object_id || g_nl ||
876: 'AND li.line_item_id = fb.line_item_id' || g_nl ||

Line 968: GCS_HISTORICAL_RATES ghr,

964: AND fb_in.ledger_id = p_ledger_id
965: AND fb_in.entity_id = p_entity_id
966: GROUP BY fb_in.line_item_id) fb,
967: FEM_BALANCES fbp,
968: GCS_HISTORICAL_RATES ghr,
969: FEM_LN_ITEMS_ATTR li,
970: FEM_EXT_ACCT_TYPES_ATTR fxata
971: WHERE fbp.created_by_object_id (+)= fb_object_id
972: AND li.line_item_id = fb.line_item_id

Line 992: FROM gcs_historical_rates ghr_retained

988: AND ghr.cal_period_id (+)= p_cal_period_id
989: AND ghr.line_item_id (+)= fb.line_item_id
990: AND ghr.update_flag (+)= 'N'
991: AND NOT EXISTS (SELECT 'X'
992: FROM gcs_historical_rates ghr_retained
993: WHERE ghr_retained.standard_re_rate_flag = 'Y'
994: AND ghr_retained.hierarchy_id = p_hierarchy_id
995: AND ghr_retained.entity_id = p_entity_id
996: AND ghr_retained.cal_period_id = p_cal_period_id

Line 1073: ' GCS_HISTORICAL_RATES ghr,' || g_nl ||

1069: ' AND fb_in.currency_code = ''' || p_from_ccy || '''' || g_nl ||
1070: ' AND fb_in.ledger_id = ' || p_ledger_id || g_nl ||
1071: ' AND fb_in.entity_id = ' || p_entity_id || ') fb,' || g_nl ||
1072: ' FEM_BALANCES fbp,' || g_nl ||
1073: ' GCS_HISTORICAL_RATES ghr,' || g_nl ||
1074: ' FEM_LN_ITEMS_ATTR li,' || g_nl ||
1075: ' FEM_EXT_ACCT_TYPES_ATTR fxata' || g_nl ||
1076: 'WHERE fbp.created_by_object_id (+)= ' || fb_object_id || g_nl ||
1077: 'AND li.line_item_id = fb.line_item_id' || g_nl ||

Line 1168: GCS_HISTORICAL_RATES ghr,

1164: AND fb_in.currency_code = p_from_ccy
1165: AND fb_in.ledger_id = p_ledger_id
1166: AND fb_in.entity_id = p_entity_id) fb,
1167: FEM_BALANCES fbp,
1168: GCS_HISTORICAL_RATES ghr,
1169: FEM_LN_ITEMS_ATTR li,
1170: FEM_EXT_ACCT_TYPES_ATTR fxata
1171: WHERE fbp.created_by_object_id (+)= fb_object_id
1172: AND li.line_item_id = fb.line_item_id

Line 1192: FROM gcs_historical_rates ghr_retained

1188: AND ghr.cal_period_id (+)= p_cal_period_id
1189: AND ghr.line_item_id (+)= fb.line_item_id
1190: AND ghr.update_flag (+)= 'N'
1191: AND NOT EXISTS (SELECT 'X'
1192: FROM gcs_historical_rates ghr_retained
1193: WHERE ghr_retained.standard_re_rate_flag = 'Y'
1194: AND ghr_retained.hierarchy_id = p_hierarchy_id
1195: AND ghr_retained.entity_id = p_entity_id
1196: AND ghr_retained.cal_period_id = p_cal_period_id