DBA Data[Home] [Help]

APPS.GCS_TRANS_RE_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: Only Roll Forward Rates Where Standard RE Rate Flag is Y
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 132: ' FROM GCS_HISTORICAL_RATES ghr2, ' || g_nl ||

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

Line 133: ' GCS_HISTORICAL_RATES ghr3' || g_nl ||

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

Line 164: UPDATE gcs_historical_rates ghr

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

Line 169: FROM gcs_historical_rates ghr1

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

Line 179: FROM GCS_HISTORICAL_RATES ghr2,

175: AND ghr1.standard_re_rate_flag = 'Y'
176: AND ghr1.line_item_id = p_hier_li_id AND ghr1.cal_period_id = p_prev_period_id)
177: WHERE ghr.rowid IN (
178: SELECT ghr3.rowid
179: FROM GCS_HISTORICAL_RATES ghr2,
180: GCS_HISTORICAL_RATES ghr3
181: WHERE ghr2.entity_id = p_entity_id
182: AND ghr2.hierarchy_id = p_hierarchy_id
183: AND ghr2.from_currency = p_from_ccy

Line 180: GCS_HISTORICAL_RATES ghr3

176: AND ghr1.line_item_id = p_hier_li_id AND ghr1.cal_period_id = p_prev_period_id)
177: WHERE ghr.rowid IN (
178: SELECT ghr3.rowid
179: FROM GCS_HISTORICAL_RATES ghr2,
180: GCS_HISTORICAL_RATES ghr3
181: WHERE ghr2.entity_id = p_entity_id
182: AND ghr2.hierarchy_id = p_hierarchy_id
183: AND ghr2.from_currency = p_from_ccy
184: AND ghr2.to_currency = p_to_ccy

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

201: nvl(to_char(ghr3.translated_amount), 'X')));
202:
203: --Bugfix 6111815: Only Roll Forward Rates Where Standard RE Rate Flag is Y
204: write_to_log(module, FND_LOG.LEVEL_STATEMENT,
205: 'DELETE FROM gcs_historical_rates ghr' || g_nl ||
206: 'WHERE (rowid, ''E'') IN (' || g_nl ||
207: ' SELECT ghr3.rowid, nvl(ghr2.rate_type_code, ''E'')' || g_nl ||
208: ' FROM GCS_HISTORICAL_RATES ghr3, ' || g_nl ||
209: ' GCS_HISTORICAL_RATES ghr2' || g_nl ||

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

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

Line 209: ' GCS_HISTORICAL_RATES ghr2' || g_nl ||

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

Line 233: DELETE FROM gcs_historical_rates ghr

229: -- type is Prior.
230: -- 2. There is no historical rate in the previous period or a historical
231: -- rate exists in the previous period with the rate type Period.
232: --Bugfix 6111815: Only Roll Forward Rates Where Standard RE Rate Flag is Y
233: DELETE FROM gcs_historical_rates ghr
234: WHERE (rowid, 'E') IN (
235: SELECT ghr3.rowid, nvl(ghr2.rate_type_code, 'E')
236: FROM GCS_HISTORICAL_RATES ghr3,
237: GCS_HISTORICAL_RATES ghr2

Line 236: FROM GCS_HISTORICAL_RATES ghr3,

232: --Bugfix 6111815: Only Roll Forward Rates Where Standard RE Rate Flag is Y
233: DELETE FROM gcs_historical_rates ghr
234: WHERE (rowid, 'E') IN (
235: SELECT ghr3.rowid, nvl(ghr2.rate_type_code, 'E')
236: FROM GCS_HISTORICAL_RATES ghr3,
237: GCS_HISTORICAL_RATES ghr2
238: WHERE ghr3.entity_id = p_entity_id
239: AND ghr3.hierarchy_id = p_hierarchy_id
240: AND ghr3.rate_type_code = 'P'

Line 237: GCS_HISTORICAL_RATES ghr2

233: DELETE FROM gcs_historical_rates ghr
234: WHERE (rowid, 'E') IN (
235: SELECT ghr3.rowid, nvl(ghr2.rate_type_code, 'E')
236: FROM GCS_HISTORICAL_RATES ghr3,
237: GCS_HISTORICAL_RATES ghr2
238: WHERE ghr3.entity_id = p_entity_id
239: AND ghr3.hierarchy_id = p_hierarchy_id
240: AND ghr3.rate_type_code = 'P'
241: AND ghr3.account_type_code IN ('ASSET','LIABILITY',decode(p_eq_xlate_mode, 'YTD', 'EQUITY', NULL))

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

252: AND ghr3.standard_re_rate_flag = 'Y'
253: AND ghr3.line_item_id = p_hier_li_id );
254:
255: write_to_log(module, FND_LOG.LEVEL_STATEMENT,
256: 'INSERT /*+ parallel (gcs_historical_rates) */ INTO gcs_historical_rates(standard_re_rate_flag, entity_id, hierarchy_id, ' ||
257: 'cal_period_id, from_currency, to_currency, line_item_id, ' ||
258: 'company_cost_center_org_id, intercompany_id, financial_elem_id, ' ||
259: 'product_id, natural_account_id, channel_id, project_id, customer_id, task_id, ' ||
260: 'user_dim1_id, user_dim2_id, user_dim3_id, user_dim4_id, user_dim5_id, ' ||

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

267: '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'', ' ||
268: 'ghr.account_type_code, ''N'', sysdate, ' ||
269: gcs_translation_pkg.g_fnd_user_id || ', ' || gcs_translation_pkg.g_fnd_login_id ||
270: ', sysdate, ' || gcs_translation_pkg.g_fnd_user_id || g_nl ||
271: 'FROM gcs_historical_rates ghr' || g_nl ||
272: 'WHERE ghr.entity_id = ' || p_entity_id || g_nl ||
273: 'AND ghr.hierarchy_id = ' || p_hierarchy_id || g_nl ||
274: 'AND ghr.to_currency = ''' || p_to_ccy || '''' || g_nl ||
275: 'AND ghr.from_currency = ''' || p_from_ccy || '''' || g_nl ||

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

279: 'AND ghr.stop_rollforward_flag = ''N''' || g_nl ||
280: 'AND ghr.line_item_id = ' || p_hier_li_id || g_nl ||
281: 'AND ghr.standard_re_rate_flag = ''Y'' ' || g_nl ||
282: ' AND NOT EXISTS (' || g_nl ||
283: ' SELECT 1 FROM gcs_historical_rates ghr1' || g_nl ||
284: ' WHERE ghr1.entity_id = p_entity_id' || g_nl ||
285: ' AND ghr1.hierarchy_id = p_hierarchy_id' || g_nl ||
286: ' AND ghr1.cal_period_id = p_cal_period_id' || g_nl ||
287: ' AND ghr1.line_item_id = ghr.line_item_id' || g_nl ||' AND ghr1.update_flag = ''N''' || g_nl ||

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

292: -- 1. No historical rate exists for the current period.
293: -- 2. A historical rate is defined for the previous period with Prior or
294: -- Historical rate type and the stop roll forward flag is not checked.
295: -- Bugfix 6111815: Adeded Standard RE Rate Flag as part of insert
296: INSERT /*+ parallel (gcs_historical_rates) */ INTO gcs_historical_rates(
297: standard_re_rate_flag, entity_id, hierarchy_id, cal_period_id, from_currency,
298: to_currency, line_item_id, company_cost_center_org_id, intercompany_id,
299: financial_elem_id, product_id, natural_account_id,
300: channel_id, project_id, customer_id, task_id, user_dim1_id, user_dim2_id,

Line 313: FROM gcs_historical_rates ghr

309: 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',
310: ghr.account_type_code, 'N', sysdate, gcs_translation_pkg.g_fnd_user_id,
311: gcs_translation_pkg.g_fnd_login_id, sysdate,
312: gcs_translation_pkg.g_fnd_user_id
313: FROM gcs_historical_rates ghr
314: WHERE ghr.entity_id = p_entity_id
315: AND ghr.hierarchy_id = p_hierarchy_id
316: AND ghr.to_currency = p_to_ccy
317: AND ghr.from_currency = p_from_ccy

Line 325: SELECT 1 FROM gcs_historical_rates ghr1

321: AND ghr.stop_rollforward_flag = 'N'
322: AND ghr.line_item_id = p_hier_li_id
323: AND ghr.standard_re_rate_flag = 'Y'
324: AND NOT EXISTS (
325: SELECT 1 FROM gcs_historical_rates ghr1
326: WHERE ghr1.entity_id = p_entity_id
327: AND ghr1.hierarchy_id = p_hierarchy_id
328: AND ghr1.cal_period_id = p_cal_period_id
329: AND ghr1.line_item_id = ghr.line_item_id AND ghr1.update_flag = 'N'

Line 453: ' GCS_HISTORICAL_RATES ghr' || g_nl ||

449: ' AND fb_in.entity_id = ' || p_entity_id || g_nl ||
450: ' GROUP BY ' || g_nl ||' fb_in.line_item_id) fb,' || g_nl ||
451: ' FEM_LN_ITEMS_ATTR li,' || g_nl ||
452: ' FEM_EXT_ACCT_TYPES_ATTR fxata,' || g_nl ||
453: ' GCS_HISTORICAL_RATES ghr' || g_nl ||
454: 'WHERE li.line_item_id = fb.line_item_id' || g_nl ||
455: 'AND li.attribute_id = ' || gcs_translation_pkg.g_li_acct_type_attr_id || g_nl ||
456: 'AND li.version_id = ' || gcs_translation_pkg.g_li_acct_type_v_id || g_nl ||
457: 'AND fxata.ext_account_type_code = li.dim_attribute_varchar_member' || g_nl ||

Line 538: GCS_HISTORICAL_RATES ghr

534: AND fb_in.entity_id = p_entity_id
535: GROUP BY fb_in.line_item_id) fb,
536: FEM_LN_ITEMS_ATTR li,
537: FEM_EXT_ACCT_TYPES_ATTR fxata,
538: GCS_HISTORICAL_RATES ghr
539: WHERE li.line_item_id = fb.line_item_id
540: AND li.attribute_id = gcs_translation_pkg.g_li_acct_type_attr_id
541: AND li.version_id = gcs_translation_pkg.g_li_acct_type_v_id
542: AND fxata.ext_account_type_code = li.dim_attribute_varchar_member

Line 623: ' GCS_HISTORICAL_RATES ghr' || g_nl ||

619: ' AND fb_in.ledger_id = ' || p_ledger_id || g_nl ||
620: ' AND fb_in.entity_id = ' || p_entity_id || ') fb,' || g_nl ||
621: ' FEM_LN_ITEMS_ATTR li,' || g_nl ||
622: ' FEM_EXT_ACCT_TYPES_ATTR fxata,' || g_nl ||
623: ' GCS_HISTORICAL_RATES ghr' || g_nl ||
624: 'WHERE li.line_item_id = fb.line_item_id' || g_nl ||
625: 'AND li.attribute_id = ' || gcs_translation_pkg.g_li_acct_type_attr_id || g_nl ||
626: 'AND li.version_id = ' || gcs_translation_pkg.g_li_acct_type_v_id || g_nl ||
627: 'AND fxata.ext_account_type_code = li.dim_attribute_varchar_member' || g_nl ||

Line 707: GCS_HISTORICAL_RATES ghr

703: AND fb_in.ledger_id = p_ledger_id
704: AND fb_in.entity_id = p_entity_id) fb,
705: FEM_LN_ITEMS_ATTR li,
706: FEM_EXT_ACCT_TYPES_ATTR fxata,
707: GCS_HISTORICAL_RATES ghr
708: WHERE li.line_item_id = fb.line_item_id
709: AND li.attribute_id = gcs_translation_pkg.g_li_acct_type_attr_id
710: AND li.version_id = gcs_translation_pkg.g_li_acct_type_v_id
711: AND fxata.ext_account_type_code = li.dim_attribute_varchar_member

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

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

Line 973: GCS_HISTORICAL_RATES ghr,

969: AND fb_in.ledger_id = p_ledger_id
970: AND fb_in.entity_id = p_entity_id
971: GROUP BY fb_in.line_item_id) fb,
972: FEM_BALANCES fbp,
973: GCS_HISTORICAL_RATES ghr,
974: FEM_LN_ITEMS_ATTR li,
975: FEM_EXT_ACCT_TYPES_ATTR fxata
976: WHERE fbp.created_by_object_id (+)= fb_object_id
977: AND li.line_item_id = fb.line_item_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 1170: GCS_HISTORICAL_RATES ghr,

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