[Home] [Help]
1225: gl_message.func_ent('Cross Rates Calculation');
1226:
1227: -- select all the lines who can be calculate cross rate from the gl_daily_rates table
1228: IF DEBUG_MODE THEN
1229: fnd_file.put_line(fnd_file.LOG, 'Clean gl_cross_rate_temp.');
1230: END IF;
1231:
1232: DELETE FROM gl_cross_rate_temp;
1233:
1228: IF DEBUG_MODE THEN
1229: fnd_file.put_line(fnd_file.LOG, 'Clean gl_cross_rate_temp.');
1230: END IF;
1231:
1232: DELETE FROM gl_cross_rate_temp;
1233:
1234: IF DEBUG_MODE THEN
1235: fnd_file.put_line
1236: (fnd_file.LOG,
1233:
1234: IF DEBUG_MODE THEN
1235: fnd_file.put_line
1236: (fnd_file.LOG,
1237: 'Copy rows from interface table to gl_cross_rate_temp.');
1238: END IF;
1239:
1240: INSERT INTO gl_cross_rate_temp
1241: (conversion_type, pivot_currency, from_currency,
1236: (fnd_file.LOG,
1237: 'Copy rows from interface table to gl_cross_rate_temp.');
1238: END IF;
1239:
1240: INSERT INTO gl_cross_rate_temp
1241: (conversion_type, pivot_currency, from_currency,
1242: to_currency, from_conversion_date,
1243: to_conversion_date, conversion_rate,
1244: inverse_conversion_rate, mode_flag,
1297: IF DEBUG_MODE THEN
1298: fnd_file.put_line(fnd_file.LOG, 'Update the used for ab translation');
1299: END IF;
1300:
1301: UPDATE gl_cross_rate_temp ri
1302: SET used_for_ab_translation =
1303: ( SELECT nvl(max('Y'), 'N')
1304: FROM gl_daily_conversion_types ct,
1305: gl_ledgers led,
1323: BEGIN
1324:
1325: SELECT 'Y'
1326: INTO l_launch_rate_change
1327: FROM gl_cross_rate_temp
1328: WHERE used_for_ab_translation = 'Y'
1329: AND ROWNUM < 2;
1330:
1331: EXCEPTION
1359: usr_daily_rate_cannot_delete.r_rate,
1360: usr_daily_rate_cannot_delete.r_rate_source_code
1361: FROM gl_daily_rates gldr,
1362: gl_daily_conversion_types gldct,
1363: gl_cross_rate_temp glcrt,
1364: gl_row_multipliers glrm
1365: WHERE gldr.conversion_type = gldct.conversion_type
1366: AND ( (gldr.rate_source_code IS NULL)
1367: OR ( (gldr.rate_source_code IS NOT NULL)
1432: usr_daily_rate_cannot_override.r_rate,
1433: usr_daily_rate_cannot_override.r_rate_source_code
1434: FROM gl_daily_rates gldr,
1435: gl_daily_conversion_types gldct,
1436: gl_cross_rate_temp glcrt,
1437: gl_row_multipliers glrm
1438: WHERE gldr.conversion_type = gldct.conversion_type
1439: AND ( (gldr.rate_source_code IS NULL)
1440: OR ( (gldr.rate_source_code IS NOT NULL)
1519: glcrt.conversion_type,
1520: TRUNC(glcrt.from_conversion_date)
1521: + glrm.multiplier - 1
1522: FROM gl_row_multipliers glrm,
1523: gl_cross_rate_temp glcrt,
1524: gl_daily_rates gldr
1525: WHERE glcrt.mode_flag = 'D'
1526: AND glcrt.used_for_ab_translation = 'Y'
1527: AND gldr.from_currency = glcrt.from_currency
1541: glcrt.conversion_type,
1542: TRUNC(glcrt.from_conversion_date)
1543: + glrm.multiplier - 1
1544: FROM gl_row_multipliers glrm,
1545: gl_cross_rate_temp glcrt,
1546: gl_daily_rates gldr
1547: WHERE glcrt.mode_flag = 'D'
1548: AND glcrt.used_for_ab_translation = 'Y'
1549: AND gldr.to_currency = glcrt.from_currency
1581: glcrt.conversion_type,
1582: TRUNC(glcrt.from_conversion_date)
1583: + glrm.multiplier - 1
1584: FROM gl_row_multipliers glrm,
1585: gl_cross_rate_temp glcrt,
1586: gl_daily_rates gldr
1587: WHERE ( glcrt.mode_flag in ('I', 'T')
1588: OR ( glcrt.mode_flag = 'D'
1589: AND glcrt.used_for_ab_translation <>
1606: glcrt.conversion_type,
1607: TRUNC(glcrt.from_conversion_date)
1608: + glrm.multiplier - 1
1609: FROM gl_row_multipliers glrm,
1610: gl_cross_rate_temp glcrt,
1611: gl_daily_rates gldr
1612: WHERE ( glcrt.mode_flag in ('I', 'T')
1613: OR ( glcrt.mode_flag = 'D'
1614: AND glcrt.used_for_ab_translation <>
1632: fnd_file.put_line(fnd_file.LOG,
1633: SQL%ROWCOUNT || ' rows deleted.');
1634: END IF;
1635:
1636: UPDATE gl_cross_rate_temp rt
1637: SET mode_flag = 'F'
1638: WHERE mode_flag = 'N'
1639: AND (EXISTS (SELECT 1 FROM gl_daily_rates dr
1640: WHERE dr.from_currency = rt.from_currency
1668: glcrt.inverse_conversion_rate * gldr.conversion_rate,
1669: DECODE(glcrt.used_for_ab_translation, 'Y', 'O', 'C'),
1670: SYSDATE, 1, SYSDATE, 1, 1, 'SYSTEM'
1671: FROM gl_row_multipliers glrm,
1672: gl_cross_rate_temp glcrt,
1673: gl_daily_rates gldr
1674: WHERE glcrt.mode_flag in ('I', 'T', 'N')
1675: AND gldr.from_currency = glcrt.pivot_currency
1676: AND gldr.to_currency = glcrt.to_currency
1712: glcrt.conversion_rate * gldr.conversion_rate,
1713: DECODE(glcrt.used_for_ab_translation, 'Y', 'O', 'C'),
1714: SYSDATE, 1, SYSDATE, 1, 1, 'SYSTEM'
1715: FROM gl_row_multipliers glrm,
1716: gl_cross_rate_temp glcrt,
1717: gl_daily_rates gldr
1718: WHERE glcrt.mode_flag in ('I', 'T', 'N')
1719: AND gldr.to_currency = glcrt.pivot_currency
1720: AND gldr.from_currency = glcrt.to_currency