DBA Data[Home] [Help]

APPS.AP_WEB_POLICY_UTILS dependencies on AP_POL_HEADERS

Line 162: p_policy_id IN ap_pol_headers.policy_id%TYPE,

158: -- Delcare the private method upfront so that it can be used
159: -- before the definition.
160:
161: PROCEDURE permutatePolicyLines(p_user_id IN NUMBER,
162: p_policy_id IN ap_pol_headers.policy_id%TYPE,
163: p_rate_type IN ap_pol_schedule_options.rate_type_code%TYPE);
164:
165: PROCEDURE permutateAddonRates( p_user_id IN NUMBER,
166: p_policy_id IN ap_pol_headers.policy_id%TYPE,

Line 166: p_policy_id IN ap_pol_headers.policy_id%TYPE,

162: p_policy_id IN ap_pol_headers.policy_id%TYPE,
163: p_rate_type IN ap_pol_schedule_options.rate_type_code%TYPE);
164:
165: PROCEDURE permutateAddonRates( p_user_id IN NUMBER,
166: p_policy_id IN ap_pol_headers.policy_id%TYPE,
167: p_schedule_period_id IN ap_pol_lines.schedule_period_id%TYPE );
168:
169: PROCEDURE permutateNightRates( p_user_id IN NUMBER,
170: p_policy_id IN ap_pol_headers.policy_id%TYPE,

Line 170: p_policy_id IN ap_pol_headers.policy_id%TYPE,

166: p_policy_id IN ap_pol_headers.policy_id%TYPE,
167: p_schedule_period_id IN ap_pol_lines.schedule_period_id%TYPE );
168:
169: PROCEDURE permutateNightRates( p_user_id IN NUMBER,
170: p_policy_id IN ap_pol_headers.policy_id%TYPE,
171: p_schedule_period_id IN ap_pol_lines.schedule_period_id%TYPE );
172:
173: PROCEDURE permutateConusLines( p_user_id IN NUMBER,
174: p_policy_id IN ap_pol_headers.policy_id%TYPE);

Line 174: p_policy_id IN ap_pol_headers.policy_id%TYPE);

170: p_policy_id IN ap_pol_headers.policy_id%TYPE,
171: p_schedule_period_id IN ap_pol_lines.schedule_period_id%TYPE );
172:
173: PROCEDURE permutateConusLines( p_user_id IN NUMBER,
174: p_policy_id IN ap_pol_headers.policy_id%TYPE);
175:
176: FUNCTION get_hash_value(p_component1 IN VARCHAR2,
177: p_component2 IN VARCHAR2,
178: p_component3 IN VARCHAR2) RETURN NUMBER;

Line 204: l_sch_end_date ap_pol_headers.end_date%TYPE;

200: FUNCTION get_schedule_status(p_policy_id IN NUMBER) RETURN VARCHAR2 IS
201:
202: l_meaning fnd_lookups.meaning%TYPE := '';
203: l_lookup_code fnd_lookups.lookup_code%TYPE;
204: l_sch_end_date ap_pol_headers.end_date%TYPE;
205: l_no__saved_or_duplicated NUMBER;
206: l_no__active_or_inactive NUMBER;
207: l_no__need_activation NUMBER;
208:

Line 215: FROM ap_pol_headers

211: IF p_policy_id IS NOT NULL THEN
212:
213: SELECT end_date
214: INTO l_sch_end_date
215: FROM ap_pol_headers
216: WHERE policy_id = p_policy_id;
217:
218:
219: IF ( l_sch_end_date IS NOT NULL ) AND ( l_sch_end_date < sysdate ) THEN

Line 895: from ap_pol_headers ph,

891:
892: CURSOR policy_cur IS
893: select ph.role_code,
894: pl.role_id
895: from ap_pol_headers ph,
896: ap_pol_lines pl
897: where pl.policy_id = ph.policy_id
898: and pl.policy_line_id = p_policy_line_id;
899:

Line 942: from ap_pol_headers ph,

938:
939: CURSOR policy_cur IS
940: select ph.role_code,
941: pso.role_id
942: from ap_pol_headers ph,
943: ap_pol_schedule_options pso
944: where ph.policy_id = pso.policy_id
945: and pso.schedule_option_id = p_policy_schedule_option_id;
946:

Line 1269: FUNCTION getHighEndOfThreshold(p_policy_id IN ap_pol_headers.policy_id%TYPE,

1265: | Date Author Description of Changes
1266: | 16-May-2002 R Langi Created
1267: |
1268: *=======================================================================*/
1269: FUNCTION getHighEndOfThreshold(p_policy_id IN ap_pol_headers.policy_id%TYPE,
1270: p_threshold IN ap_pol_schedule_options.threshold%TYPE) RETURN ap_pol_schedule_options.threshold%TYPE IS
1271: BEGIN
1272:
1273: RETURN getHighEndOfThreshold(p_policy_id, p_threshold, 'STANDARD');

Line 1296: FUNCTION getHighEndOfThreshold(p_policy_id IN ap_pol_headers.policy_id%TYPE,

1292: | Date Author Description of Changes
1293: | 01-Nov-2005 krmenon Created
1294: |
1295: *=======================================================================*/
1296: FUNCTION getHighEndOfThreshold(p_policy_id IN ap_pol_headers.policy_id%TYPE,
1297: p_threshold IN ap_pol_schedule_options.threshold%TYPE,
1298: p_rate_type IN ap_pol_schedule_options.rate_type_code%TYPE) RETURN ap_pol_schedule_options.threshold%TYPE IS
1299:
1300: l_high_end_of_threshold ap_pol_schedule_options.threshold%TYPE;

Line 1356: FUNCTION getPolicyCategoryCode(p_policy_id IN ap_pol_headers.policy_id%TYPE) RETURN ap_pol_headers.category_code%TYPE IS

1352: | Date Author Description of Changes
1353: | 16-May-2002 R Langi Created
1354: |
1355: *=======================================================================*/
1356: FUNCTION getPolicyCategoryCode(p_policy_id IN ap_pol_headers.policy_id%TYPE) RETURN ap_pol_headers.category_code%TYPE IS
1357:
1358: l_category_code ap_pol_headers.category_code%TYPE;
1359:
1360: BEGIN

Line 1358: l_category_code ap_pol_headers.category_code%TYPE;

1354: |
1355: *=======================================================================*/
1356: FUNCTION getPolicyCategoryCode(p_policy_id IN ap_pol_headers.policy_id%TYPE) RETURN ap_pol_headers.category_code%TYPE IS
1357:
1358: l_category_code ap_pol_headers.category_code%TYPE;
1359:
1360: BEGIN
1361:
1362: select category_code

Line 1364: from ap_pol_headers

1360: BEGIN
1361:
1362: select category_code
1363: into l_category_code
1364: from ap_pol_headers
1365: where policy_id = p_policy_id;
1366:
1367: return l_category_code;
1368:

Line 1406: FUNCTION checkRuleOption(p_policy_id IN ap_pol_headers.policy_id%TYPE,

1402: | Date Author Description of Changes
1403: | 16-May-2002 R Langi Created
1404: |
1405: *=======================================================================*/
1406: FUNCTION checkRuleOption(p_policy_id IN ap_pol_headers.policy_id%TYPE,
1407: p_rule IN VARCHAR2) RETURN VARCHAR2 IS
1408:
1409:
1410: FUNCTION isLocationEnabled(p_policy_id IN ap_pol_headers.policy_id%TYPE) RETURN VARCHAR2 IS

Line 1410: FUNCTION isLocationEnabled(p_policy_id IN ap_pol_headers.policy_id%TYPE) RETURN VARCHAR2 IS

1406: FUNCTION checkRuleOption(p_policy_id IN ap_pol_headers.policy_id%TYPE,
1407: p_rule IN VARCHAR2) RETURN VARCHAR2 IS
1408:
1409:
1410: FUNCTION isLocationEnabled(p_policy_id IN ap_pol_headers.policy_id%TYPE) RETURN VARCHAR2 IS
1411:
1412: l_location_flag ap_pol_headers.location_flag%TYPE;
1413: l_location_count number := 0;
1414:

Line 1412: l_location_flag ap_pol_headers.location_flag%TYPE;

1408:
1409:
1410: FUNCTION isLocationEnabled(p_policy_id IN ap_pol_headers.policy_id%TYPE) RETURN VARCHAR2 IS
1411:
1412: l_location_flag ap_pol_headers.location_flag%TYPE;
1413: l_location_count number := 0;
1414:
1415: BEGIN
1416: select location_flag

Line 1418: from ap_pol_headers

1414:
1415: BEGIN
1416: select location_flag
1417: into l_location_flag
1418: from ap_pol_headers
1419: where policy_id = p_policy_id;
1420:
1421: select count(location_id)
1422: into l_location_count

Line 1442: FUNCTION isRoleEnabled(p_policy_id IN ap_pol_headers.policy_id%TYPE) RETURN VARCHAR2 IS

1438: WHEN OTHERS THEN
1439: raise;
1440: END isLocationEnabled;
1441:
1442: FUNCTION isRoleEnabled(p_policy_id IN ap_pol_headers.policy_id%TYPE) RETURN VARCHAR2 IS
1443:
1444: l_employee_role_flag ap_pol_headers.employee_role_flag%TYPE;
1445: l_role_count number := 0;
1446:

Line 1444: l_employee_role_flag ap_pol_headers.employee_role_flag%TYPE;

1440: END isLocationEnabled;
1441:
1442: FUNCTION isRoleEnabled(p_policy_id IN ap_pol_headers.policy_id%TYPE) RETURN VARCHAR2 IS
1443:
1444: l_employee_role_flag ap_pol_headers.employee_role_flag%TYPE;
1445: l_role_count number := 0;
1446:
1447: BEGIN
1448: select employee_role_flag

Line 1450: from ap_pol_headers

1446:
1447: BEGIN
1448: select employee_role_flag
1449: into l_employee_role_flag
1450: from ap_pol_headers
1451: where policy_id = p_policy_id;
1452:
1453: select count(role_id)
1454: into l_role_count

Line 1474: FUNCTION isCurrencyEnabled(p_policy_id IN ap_pol_headers.policy_id%TYPE) RETURN VARCHAR2 IS

1470: WHEN OTHERS THEN
1471: raise;
1472: END isRoleEnabled;
1473:
1474: FUNCTION isCurrencyEnabled(p_policy_id IN ap_pol_headers.policy_id%TYPE) RETURN VARCHAR2 IS
1475:
1476: l_currency_preference ap_pol_headers.currency_preference%TYPE;
1477: l_currency_count number := 0;
1478:

Line 1476: l_currency_preference ap_pol_headers.currency_preference%TYPE;

1472: END isRoleEnabled;
1473:
1474: FUNCTION isCurrencyEnabled(p_policy_id IN ap_pol_headers.policy_id%TYPE) RETURN VARCHAR2 IS
1475:
1476: l_currency_preference ap_pol_headers.currency_preference%TYPE;
1477: l_currency_count number := 0;
1478:
1479: BEGIN
1480: select currency_preference

Line 1482: from ap_pol_headers

1478:
1479: BEGIN
1480: select currency_preference
1481: into l_currency_preference
1482: from ap_pol_headers
1483: where policy_id = p_policy_id;
1484:
1485: select count(currency_code)
1486: into l_currency_count

Line 1506: FUNCTION isVehicleCategoryEnabled(p_policy_id IN ap_pol_headers.policy_id%TYPE) RETURN VARCHAR2 IS

1502: WHEN OTHERS THEN
1503: raise;
1504: END isCurrencyEnabled;
1505:
1506: FUNCTION isVehicleCategoryEnabled(p_policy_id IN ap_pol_headers.policy_id%TYPE) RETURN VARCHAR2 IS
1507:
1508: l_vehicle_category_flag ap_pol_headers.vehicle_category_flag%TYPE;
1509: l_vehicle_category_count number := 0;
1510:

Line 1508: l_vehicle_category_flag ap_pol_headers.vehicle_category_flag%TYPE;

1504: END isCurrencyEnabled;
1505:
1506: FUNCTION isVehicleCategoryEnabled(p_policy_id IN ap_pol_headers.policy_id%TYPE) RETURN VARCHAR2 IS
1507:
1508: l_vehicle_category_flag ap_pol_headers.vehicle_category_flag%TYPE;
1509: l_vehicle_category_count number := 0;
1510:
1511: BEGIN
1512: select vehicle_category_flag

Line 1514: from ap_pol_headers

1510:
1511: BEGIN
1512: select vehicle_category_flag
1513: into l_vehicle_category_flag
1514: from ap_pol_headers
1515: where policy_id = p_policy_id;
1516:
1517: select count(option_code)
1518: into l_vehicle_category_count

Line 1538: FUNCTION isVehicleTypeEnabled(p_policy_id IN ap_pol_headers.policy_id%TYPE) RETURN VARCHAR2 IS

1534: WHEN OTHERS THEN
1535: raise;
1536: END isVehicleCategoryEnabled;
1537:
1538: FUNCTION isVehicleTypeEnabled(p_policy_id IN ap_pol_headers.policy_id%TYPE) RETURN VARCHAR2 IS
1539:
1540: l_vehicle_type_flag ap_pol_headers.vehicle_type_flag%TYPE;
1541: l_vehicle_type_count number := 0;
1542:

Line 1540: l_vehicle_type_flag ap_pol_headers.vehicle_type_flag%TYPE;

1536: END isVehicleCategoryEnabled;
1537:
1538: FUNCTION isVehicleTypeEnabled(p_policy_id IN ap_pol_headers.policy_id%TYPE) RETURN VARCHAR2 IS
1539:
1540: l_vehicle_type_flag ap_pol_headers.vehicle_type_flag%TYPE;
1541: l_vehicle_type_count number := 0;
1542:
1543: BEGIN
1544: select vehicle_type_flag

Line 1546: from ap_pol_headers

1542:
1543: BEGIN
1544: select vehicle_type_flag
1545: into l_vehicle_type_flag
1546: from ap_pol_headers
1547: where policy_id = p_policy_id;
1548:
1549: select count(option_code)
1550: into l_vehicle_type_count

Line 1570: FUNCTION isFuelTypeEnabled(p_policy_id IN ap_pol_headers.policy_id%TYPE) RETURN VARCHAR2 IS

1566: WHEN OTHERS THEN
1567: raise;
1568: END isVehicleTypeEnabled;
1569:
1570: FUNCTION isFuelTypeEnabled(p_policy_id IN ap_pol_headers.policy_id%TYPE) RETURN VARCHAR2 IS
1571:
1572: l_fuel_type_flag ap_pol_headers.fuel_type_flag%TYPE;
1573: l_fuel_type_count number := 0;
1574:

Line 1572: l_fuel_type_flag ap_pol_headers.fuel_type_flag%TYPE;

1568: END isVehicleTypeEnabled;
1569:
1570: FUNCTION isFuelTypeEnabled(p_policy_id IN ap_pol_headers.policy_id%TYPE) RETURN VARCHAR2 IS
1571:
1572: l_fuel_type_flag ap_pol_headers.fuel_type_flag%TYPE;
1573: l_fuel_type_count number := 0;
1574:
1575: BEGIN
1576: select fuel_type_flag

Line 1578: from ap_pol_headers

1574:
1575: BEGIN
1576: select fuel_type_flag
1577: into l_fuel_type_flag
1578: from ap_pol_headers
1579: where policy_id = p_policy_id;
1580:
1581: select count(option_code)
1582: into l_fuel_type_count

Line 1602: FUNCTION isTimeThresholdsEnabled(p_policy_id IN ap_pol_headers.policy_id%TYPE) RETURN VARCHAR2 IS

1598: WHEN OTHERS THEN
1599: raise;
1600: END isFuelTypeEnabled;
1601:
1602: FUNCTION isTimeThresholdsEnabled(p_policy_id IN ap_pol_headers.policy_id%TYPE) RETURN VARCHAR2 IS
1603:
1604: l_time_based_entry_flag ap_pol_headers.time_based_entry_flag%TYPE;
1605: l_thresholds_count number := 0;
1606:

Line 1604: l_time_based_entry_flag ap_pol_headers.time_based_entry_flag%TYPE;

1600: END isFuelTypeEnabled;
1601:
1602: FUNCTION isTimeThresholdsEnabled(p_policy_id IN ap_pol_headers.policy_id%TYPE) RETURN VARCHAR2 IS
1603:
1604: l_time_based_entry_flag ap_pol_headers.time_based_entry_flag%TYPE;
1605: l_thresholds_count number := 0;
1606:
1607: BEGIN
1608: select nvl(time_based_entry_flag, 'N')

Line 1610: from ap_pol_headers

1606:
1607: BEGIN
1608: select nvl(time_based_entry_flag, 'N')
1609: into l_time_based_entry_flag
1610: from ap_pol_headers
1611: where policy_id = p_policy_id;
1612:
1613: select count(threshold)
1614: into l_thresholds_count

Line 1634: FUNCTION isDistanceThresholdsEnabled(p_policy_id IN ap_pol_headers.policy_id%TYPE) RETURN VARCHAR2 IS

1630: WHEN OTHERS THEN
1631: raise;
1632: END isTimeThresholdsEnabled;
1633:
1634: FUNCTION isDistanceThresholdsEnabled(p_policy_id IN ap_pol_headers.policy_id%TYPE) RETURN VARCHAR2 IS
1635:
1636: l_distance_thresholds_flag ap_pol_headers.distance_thresholds_flag%TYPE;
1637: l_thresholds_count number := 0;
1638:

Line 1636: l_distance_thresholds_flag ap_pol_headers.distance_thresholds_flag%TYPE;

1632: END isTimeThresholdsEnabled;
1633:
1634: FUNCTION isDistanceThresholdsEnabled(p_policy_id IN ap_pol_headers.policy_id%TYPE) RETURN VARCHAR2 IS
1635:
1636: l_distance_thresholds_flag ap_pol_headers.distance_thresholds_flag%TYPE;
1637: l_thresholds_count number := 0;
1638:
1639: BEGIN
1640: select nvl2(distance_thresholds_flag, 'Y', 'N')

Line 1642: from ap_pol_headers

1638:
1639: BEGIN
1640: select nvl2(distance_thresholds_flag, 'Y', 'N')
1641: into l_distance_thresholds_flag
1642: from ap_pol_headers
1643: where policy_id = p_policy_id;
1644:
1645: select count(threshold)
1646: into l_thresholds_count

Line 1666: FUNCTION isThresholdsEnabled(p_policy_id IN ap_pol_headers.policy_id%TYPE) RETURN VARCHAR2 IS

1662: WHEN OTHERS THEN
1663: raise;
1664: END isDistanceThresholdsEnabled;
1665:
1666: FUNCTION isThresholdsEnabled(p_policy_id IN ap_pol_headers.policy_id%TYPE) RETURN VARCHAR2 IS
1667:
1668: l_distance_thresholds_flag ap_pol_headers.distance_thresholds_flag%TYPE;
1669: l_time_thresholds_flag ap_pol_headers.time_based_entry_flag%TYPE;
1670:

Line 1668: l_distance_thresholds_flag ap_pol_headers.distance_thresholds_flag%TYPE;

1664: END isDistanceThresholdsEnabled;
1665:
1666: FUNCTION isThresholdsEnabled(p_policy_id IN ap_pol_headers.policy_id%TYPE) RETURN VARCHAR2 IS
1667:
1668: l_distance_thresholds_flag ap_pol_headers.distance_thresholds_flag%TYPE;
1669: l_time_thresholds_flag ap_pol_headers.time_based_entry_flag%TYPE;
1670:
1671: BEGIN
1672:

Line 1669: l_time_thresholds_flag ap_pol_headers.time_based_entry_flag%TYPE;

1665:
1666: FUNCTION isThresholdsEnabled(p_policy_id IN ap_pol_headers.policy_id%TYPE) RETURN VARCHAR2 IS
1667:
1668: l_distance_thresholds_flag ap_pol_headers.distance_thresholds_flag%TYPE;
1669: l_time_thresholds_flag ap_pol_headers.time_based_entry_flag%TYPE;
1670:
1671: BEGIN
1672:
1673: l_distance_thresholds_flag := isDistanceThresholdsEnabled(p_policy_id);

Line 1691: FUNCTION isAddonRatesEnabled(p_policy_id IN ap_pol_headers.policy_id%TYPE) RETURN VARCHAR2 IS

1687: WHEN OTHERS THEN
1688: raise;
1689: END isThresholdsEnabled;
1690:
1691: FUNCTION isAddonRatesEnabled(p_policy_id IN ap_pol_headers.policy_id%TYPE) RETURN VARCHAR2 IS
1692: l_addon_mileage_rates_flag ap_pol_headers.addon_mileage_rates_flag%TYPE;
1693: l_addon_rates_count number := 0;
1694: BEGIN
1695:

Line 1692: l_addon_mileage_rates_flag ap_pol_headers.addon_mileage_rates_flag%TYPE;

1688: raise;
1689: END isThresholdsEnabled;
1690:
1691: FUNCTION isAddonRatesEnabled(p_policy_id IN ap_pol_headers.policy_id%TYPE) RETURN VARCHAR2 IS
1692: l_addon_mileage_rates_flag ap_pol_headers.addon_mileage_rates_flag%TYPE;
1693: l_addon_rates_count number := 0;
1694: BEGIN
1695:
1696: select nvl(addon_mileage_rates_flag, 'N')

Line 1698: from ap_pol_headers

1694: BEGIN
1695:
1696: select nvl(addon_mileage_rates_flag, 'N')
1697: into l_addon_mileage_rates_flag
1698: from ap_pol_headers
1699: where policy_id = p_policy_id;
1700:
1701: select count(1)
1702: into l_addon_rates_count

Line 1762: FUNCTION getUnionStmtForRuleOption(p_policy_id IN ap_pol_headers.policy_id%TYPE,

1758: | Date Author Description of Changes
1759: | 16-May-2002 R Langi Created
1760: |
1761: *=======================================================================*/
1762: FUNCTION getUnionStmtForRuleOption(p_policy_id IN ap_pol_headers.policy_id%TYPE,
1763: p_rule IN VARCHAR2) RETURN VARCHAR2 IS
1764:
1765: l_currency_preference ap_pol_headers.currency_preference%TYPE;
1766:

Line 1765: l_currency_preference ap_pol_headers.currency_preference%TYPE;

1761: *=======================================================================*/
1762: FUNCTION getUnionStmtForRuleOption(p_policy_id IN ap_pol_headers.policy_id%TYPE,
1763: p_rule IN VARCHAR2) RETURN VARCHAR2 IS
1764:
1765: l_currency_preference ap_pol_headers.currency_preference%TYPE;
1766:
1767: l_src_stmt VARCHAR2(160) := 'union all select CURRENCY_CODE from ap_pol_headers where POLICY_ID = :p_policy_id';
1768:
1769: l_vc_stmt VARCHAR2(80) := 'union all select to_char(null), to_char(null), to_char(null) from sys.dual';

Line 1767: l_src_stmt VARCHAR2(160) := 'union all select CURRENCY_CODE from ap_pol_headers where POLICY_ID = :p_policy_id';

1763: p_rule IN VARCHAR2) RETURN VARCHAR2 IS
1764:
1765: l_currency_preference ap_pol_headers.currency_preference%TYPE;
1766:
1767: l_src_stmt VARCHAR2(160) := 'union all select CURRENCY_CODE from ap_pol_headers where POLICY_ID = :p_policy_id';
1768:
1769: l_vc_stmt VARCHAR2(80) := 'union all select to_char(null), to_char(null), to_char(null) from sys.dual';
1770: l_number_stmt VARCHAR2(80) := 'union all select to_number(null) from sys.dual';
1771: l_varchar2_stmt VARCHAR2(80) := 'union all select to_char(null) from sys.dual';

Line 1777: from ap_pol_headers

1773: BEGIN
1774:
1775: select currency_preference
1776: into l_currency_preference
1777: from ap_pol_headers
1778: where policy_id = p_policy_id;
1779:
1780: if (checkRuleOption(p_policy_id, p_rule) = 'Y')
1781: then

Line 1788: we must still permutate using ap_pol_headers.currency_code

1784: if (p_rule = c_CURRENCY) then
1785: if (l_currency_preference = c_SRC) then
1786: /*
1787: if Single Rate Currency there will be no records in ap_pol_schedule_options
1788: we must still permutate using ap_pol_headers.currency_code
1789: */
1790: return l_src_stmt;
1791: else
1792: /*

Line 1840: PROCEDURE checkAirfarePolicyLines(p_policy_id IN ap_pol_headers.policy_id%TYPE) IS

1836: | Date Author Description of Changes
1837: | 24-Dec-2002 R Langi Created
1838: |
1839: *=======================================================================*/
1840: PROCEDURE checkAirfarePolicyLines(p_policy_id IN ap_pol_headers.policy_id%TYPE) IS
1841:
1842: BEGIN
1843:
1844: if (getPolicyCategoryCode(p_policy_id) <> 'AIRFARE')

Line 1891: p_policy_id IN ap_pol_headers.policy_id%TYPE) IS

1887: | 16-May-2002 R Langi Created
1888: |
1889: *=======================================================================*/
1890: PROCEDURE permutatePolicyLines(p_user_id IN NUMBER,
1891: p_policy_id IN ap_pol_headers.policy_id%TYPE) IS
1892:
1893: l_schedule_period_id ap_pol_schedule_periods.schedule_period_id%TYPE;
1894: l_permutate_curref INTEGER;
1895: l_rows_permutated NUMBER := 0;

Line 1923: l_category_code ap_pol_headers.category_code%TYPE;

1919: l_night_rates_enabled VARCHAR2(1) := isNightRatesEnabled(p_policy_id);
1920:
1921: l_schedule_option_rec ap_pol_schedule_options%ROWTYPE;
1922: l_zero_threshold_count NUMBER;
1923: l_category_code ap_pol_headers.category_code%TYPE;
1924: l_rate_type_code ap_pol_schedule_options.rate_type_code%TYPE;
1925: l_schedule_type ap_pol_headers.schedule_type_code%TYPE;
1926: l_source ap_pol_headers.source%TYPE;
1927:

Line 1925: l_schedule_type ap_pol_headers.schedule_type_code%TYPE;

1921: l_schedule_option_rec ap_pol_schedule_options%ROWTYPE;
1922: l_zero_threshold_count NUMBER;
1923: l_category_code ap_pol_headers.category_code%TYPE;
1924: l_rate_type_code ap_pol_schedule_options.rate_type_code%TYPE;
1925: l_schedule_type ap_pol_headers.schedule_type_code%TYPE;
1926: l_source ap_pol_headers.source%TYPE;
1927:
1928: ---------------------------------------
1929: -- cursor for schedule periods

Line 1926: l_source ap_pol_headers.source%TYPE;

1922: l_zero_threshold_count NUMBER;
1923: l_category_code ap_pol_headers.category_code%TYPE;
1924: l_rate_type_code ap_pol_schedule_options.rate_type_code%TYPE;
1925: l_schedule_type ap_pol_headers.schedule_type_code%TYPE;
1926: l_source ap_pol_headers.source%TYPE;
1927:
1928: ---------------------------------------
1929: -- cursor for schedule periods
1930: ---------------------------------------

Line 2220: from ap_pol_headers

2216: BEGIN
2217:
2218: select category_code, schedule_type_code, source
2219: into l_category_code, l_schedule_type, l_source
2220: from ap_pol_headers
2221: where policy_id = p_policy_id;
2222:
2223: -- ---------------------------------------------------------------
2224: -- If this is a CONUS/OCONUS policy then call the appropriate

Line 2316: from ap_pol_headers

2312: -- for midnight to midnight schedules which have first and last rates
2313: -- or for allowance schedules with time rule of start and end times
2314: select count(1)
2315: into l_zero_threshold_count
2316: from ap_pol_headers
2317: where policy_id = p_policy_id
2318: and time_based_entry_flag = 'Y'
2319: and ( day_period_code <> 'MIDNIGHT' or
2320: (nvl(rate_period_type_code, 'STANDARD') = 'STANDARD' and schedule_type_code = 'PER_DIEM') or

Line 2605: PROCEDURE removeObsoletedPolicyLines(p_policy_id IN ap_pol_headers.policy_id%TYPE) IS

2601: | Date Author Description of Changes
2602: | 16-May-2002 R Langi Created
2603: |
2604: *=======================================================================*/
2605: PROCEDURE removeObsoletedPolicyLines(p_policy_id IN ap_pol_headers.policy_id%TYPE) IS
2606:
2607: l_obsolete_curref INTEGER;
2608: l_rows_obsoleted NUMBER := 0;
2609:

Line 2620: l_currency_preference ap_pol_headers.currency_preference%TYPE;

2616: l_ft_sql_stmt VARCHAR2(4000);
2617: l_dt_sql_stmt VARCHAR2(4000);
2618: l_amr_sql_stmt VARCHAR2(4000);
2619:
2620: l_currency_preference ap_pol_headers.currency_preference%TYPE;
2621: l_currency_code ap_pol_headers.currency_code%TYPE;
2622:
2623: cursor l_l_cursor is
2624: select

Line 2621: l_currency_code ap_pol_headers.currency_code%TYPE;

2617: l_dt_sql_stmt VARCHAR2(4000);
2618: l_amr_sql_stmt VARCHAR2(4000);
2619:
2620: l_currency_preference ap_pol_headers.currency_preference%TYPE;
2621: l_currency_code ap_pol_headers.currency_code%TYPE;
2622:
2623: cursor l_l_cursor is
2624: select
2625: '

Line 2696: from AP_POL_HEADERS ph

2692: )
2693: and
2694: not exists
2695: (select ph.CURRENCY_PREFERENCE
2696: from AP_POL_HEADERS ph
2697: where ph.POLICY_ID = pl.POLICY_ID
2698: and (ph.CURRENCY_PREFERENCE = :c_SRC
2699: or
2700: ph.CURRENCY_PREFERENCE = :c_LCR

Line 2710: from AP_POL_HEADERS ph

2706: (pl.CURRENCY_CODE is not null
2707: and
2708: exists
2709: (select ph.CURRENCY_PREFERENCE
2710: from AP_POL_HEADERS ph
2711: where ph.POLICY_ID = pl.POLICY_ID
2712: and ph.CURRENCY_PREFERENCE = :c_SRC
2713: )
2714: and

Line 2717: from AP_POL_HEADERS ph

2713: )
2714: and
2715: not exists
2716: (select ph.CURRENCY_CODE
2717: from AP_POL_HEADERS ph
2718: where ph.POLICY_ID = pl.POLICY_ID
2719: and ph.CURRENCY_CODE = pl.CURRENCY_CODE
2720: )
2721: )

Line 3016: PROCEDURE updateInactivePolicyLines(p_policy_id IN ap_pol_headers.policy_id%TYPE) IS

3012: | Date Author Description of Changes
3013: | 16-May-2002 R Langi Created
3014: |
3015: *=======================================================================*/
3016: PROCEDURE updateInactivePolicyLines(p_policy_id IN ap_pol_headers.policy_id%TYPE) IS
3017:
3018: l_inactive_curref INTEGER;
3019: l_rows_inactivated NUMBER := 0;
3020:

Line 3169: from AP_POL_HEADERS ph

3165: and nvl(pso.END_DATE, SYSDATE+1) > SYSDATE
3166: )
3167: or exists
3168: (select ph.CURRENCY_CODE
3169: from AP_POL_HEADERS ph
3170: where ph.POLICY_ID = pl.POLICY_ID
3171: and ((ph.CURRENCY_CODE is not null and ph.CURRENCY_CODE = pl.CURRENCY_CODE)
3172: or
3173: (ph.CURRENCY_CODE is null and ph.CURRENCY_PREFERENCE <> :c_SRC)))

Line 3357: p_from_policy_id IN ap_pol_headers.policy_id%TYPE,

3353: | 16-May-2002 R Langi Created
3354: |
3355: *=======================================================================*/
3356: PROCEDURE duplicatePolicyLines(p_user_id IN NUMBER,
3357: p_from_policy_id IN ap_pol_headers.policy_id%TYPE,
3358: p_from_schedule_period_id IN ap_pol_schedule_periods.schedule_period_id%TYPE,
3359: p_to_policy_id IN ap_pol_headers.policy_id%TYPE,
3360: p_to_schedule_period_id IN ap_pol_schedule_periods.schedule_period_id%TYPE) IS
3361:

Line 3359: p_to_policy_id IN ap_pol_headers.policy_id%TYPE,

3355: *=======================================================================*/
3356: PROCEDURE duplicatePolicyLines(p_user_id IN NUMBER,
3357: p_from_policy_id IN ap_pol_headers.policy_id%TYPE,
3358: p_from_schedule_period_id IN ap_pol_schedule_periods.schedule_period_id%TYPE,
3359: p_to_policy_id IN ap_pol_headers.policy_id%TYPE,
3360: p_to_schedule_period_id IN ap_pol_schedule_periods.schedule_period_id%TYPE) IS
3361:
3362: l_duplicate_curref INTEGER;
3363: l_rows_duplicated NUMBER := 0;

Line 3955: p_from_policy_id IN ap_pol_headers.policy_id%TYPE,

3951: | date when a schedule is duplicated.
3952: |
3953: *=======================================================================*/
3954: PROCEDURE duplicatePolicy(p_user_id IN NUMBER,
3955: p_from_policy_id IN ap_pol_headers.policy_id%TYPE,
3956: p_new_policy_id OUT NOCOPY ap_pol_headers.policy_id%TYPE) IS
3957:
3958: l_duplicate_header_sql_stmt VARCHAR2(4000);
3959: l_duplicate_options_sql_stmt VARCHAR2(4000);

Line 3956: p_new_policy_id OUT NOCOPY ap_pol_headers.policy_id%TYPE) IS

3952: |
3953: *=======================================================================*/
3954: PROCEDURE duplicatePolicy(p_user_id IN NUMBER,
3955: p_from_policy_id IN ap_pol_headers.policy_id%TYPE,
3956: p_new_policy_id OUT NOCOPY ap_pol_headers.policy_id%TYPE) IS
3957:
3958: l_duplicate_header_sql_stmt VARCHAR2(4000);
3959: l_duplicate_options_sql_stmt VARCHAR2(4000);
3960:

Line 3961: l_from_policy_id ap_pol_headers.policy_id%TYPE;

3957:
3958: l_duplicate_header_sql_stmt VARCHAR2(4000);
3959: l_duplicate_options_sql_stmt VARCHAR2(4000);
3960:
3961: l_from_policy_id ap_pol_headers.policy_id%TYPE;
3962: l_to_policy_id ap_pol_headers.policy_id%TYPE;
3963:
3964: l_from_schedule_period_id ap_pol_schedule_periods.schedule_period_id%TYPE;
3965: l_to_schedule_period_id ap_pol_schedule_periods.schedule_period_id%TYPE;

Line 3962: l_to_policy_id ap_pol_headers.policy_id%TYPE;

3958: l_duplicate_header_sql_stmt VARCHAR2(4000);
3959: l_duplicate_options_sql_stmt VARCHAR2(4000);
3960:
3961: l_from_policy_id ap_pol_headers.policy_id%TYPE;
3962: l_to_policy_id ap_pol_headers.policy_id%TYPE;
3963:
3964: l_from_schedule_period_id ap_pol_schedule_periods.schedule_period_id%TYPE;
3965: l_to_schedule_period_id ap_pol_schedule_periods.schedule_period_id%TYPE;
3966:

Line 4002: p_from_policy_id IN ap_pol_headers.policy_id%TYPE,

3998:
3999:
4000:
4001: PROCEDURE duplicatePolicyHeader(p_user_id IN NUMBER,
4002: p_from_policy_id IN ap_pol_headers.policy_id%TYPE,
4003: p_to_policy_id OUT NOCOPY ap_pol_headers.policy_id%TYPE) IS
4004:
4005: BEGIN
4006:

Line 4003: p_to_policy_id OUT NOCOPY ap_pol_headers.policy_id%TYPE) IS

3999:
4000:
4001: PROCEDURE duplicatePolicyHeader(p_user_id IN NUMBER,
4002: p_from_policy_id IN ap_pol_headers.policy_id%TYPE,
4003: p_to_policy_id OUT NOCOPY ap_pol_headers.policy_id%TYPE) IS
4004:
4005: BEGIN
4006:
4007: select AP_POL_HEADERS_S.NEXTVAL

Line 4007: select AP_POL_HEADERS_S.NEXTVAL

4003: p_to_policy_id OUT NOCOPY ap_pol_headers.policy_id%TYPE) IS
4004:
4005: BEGIN
4006:
4007: select AP_POL_HEADERS_S.NEXTVAL
4008: into p_to_policy_id
4009: from sys.dual;
4010:
4011:

Line 4012: insert into AP_POL_HEADERS

4008: into p_to_policy_id
4009: from sys.dual;
4010:
4011:
4012: insert into AP_POL_HEADERS
4013: (
4014: POLICY_ID,
4015: CATEGORY_CODE,
4016: POLICY_NAME,

Line 4133: AP_POL_HEADERS

4129: null AS LAST_UPDATE_LOGIN,
4130: sysdate AS LAST_UPDATE_DATE,
4131: p_user_id AS LAST_UPDATED_BY
4132: from
4133: AP_POL_HEADERS
4134: where POLICY_ID = p_from_policy_id;
4135:
4136: EXCEPTION
4137: WHEN OTHERS THEN

Line 4143: p_from_policy_id IN ap_pol_headers.policy_id%TYPE,

4139: END duplicatePolicyHeader;
4140:
4141:
4142: PROCEDURE duplicatePolicyScheduleOptions(p_user_id IN NUMBER,
4143: p_from_policy_id IN ap_pol_headers.policy_id%TYPE,
4144: p_to_policy_id IN ap_pol_headers.policy_id%TYPE) IS
4145:
4146: BEGIN
4147:

Line 4144: p_to_policy_id IN ap_pol_headers.policy_id%TYPE) IS

4140:
4141:
4142: PROCEDURE duplicatePolicyScheduleOptions(p_user_id IN NUMBER,
4143: p_from_policy_id IN ap_pol_headers.policy_id%TYPE,
4144: p_to_policy_id IN ap_pol_headers.policy_id%TYPE) IS
4145:
4146: BEGIN
4147:
4148: insert into AP_POL_SCHEDULE_OPTIONS

Line 4532: FUNCTION are_exp_type_enddates_capped(p_policy_id IN ap_pol_headers.policy_id%TYPE,

4528: | Date Author Description of Changes
4529: | 31-JUL-2002 Mohammad Shoaib Jamall Created
4530: |
4531: *=======================================================================*/
4532: FUNCTION are_exp_type_enddates_capped(p_policy_id IN ap_pol_headers.policy_id%TYPE,
4533: p_end_date IN ap_pol_headers.end_date%TYPE) RETURN VARCHAR2 IS
4534: l_count_rows NUMBER := 0;
4535: l_return_val VARCHAR2(1);
4536: BEGIN

Line 4533: p_end_date IN ap_pol_headers.end_date%TYPE) RETURN VARCHAR2 IS

4529: | 31-JUL-2002 Mohammad Shoaib Jamall Created
4530: |
4531: *=======================================================================*/
4532: FUNCTION are_exp_type_enddates_capped(p_policy_id IN ap_pol_headers.policy_id%TYPE,
4533: p_end_date IN ap_pol_headers.end_date%TYPE) RETURN VARCHAR2 IS
4534: l_count_rows NUMBER := 0;
4535: l_return_val VARCHAR2(1);
4536: BEGIN
4537:

Line 4586: PROCEDURE cap_expense_type_enddates(p_policy_id IN ap_pol_headers.policy_id%TYPE,

4582: | Date Author Description of Changes
4583: | 31-JUL-2002 Mohammad Shoaib Jamall Created
4584: |
4585: *=======================================================================*/
4586: PROCEDURE cap_expense_type_enddates(p_policy_id IN ap_pol_headers.policy_id%TYPE,
4587: p_end_date IN ap_pol_headers.end_date%TYPE) IS
4588: PRAGMA AUTONOMOUS_TRANSACTION;
4589:
4590: l_are_enddates_capped VARCHAR2(1);

Line 4587: p_end_date IN ap_pol_headers.end_date%TYPE) IS

4583: | 31-JUL-2002 Mohammad Shoaib Jamall Created
4584: |
4585: *=======================================================================*/
4586: PROCEDURE cap_expense_type_enddates(p_policy_id IN ap_pol_headers.policy_id%TYPE,
4587: p_end_date IN ap_pol_headers.end_date%TYPE) IS
4588: PRAGMA AUTONOMOUS_TRANSACTION;
4589:
4590: l_are_enddates_capped VARCHAR2(1);
4591: BEGIN

Line 4931: p_policy_id IN ap_pol_headers.policy_id%TYPE,

4927: | 16-May-2002 R Langi Created
4928: |
4929: *=======================================================================*/
4930: PROCEDURE permutatePolicyLines(p_user_id IN NUMBER,
4931: p_policy_id IN ap_pol_headers.policy_id%TYPE,
4932: p_rate_type IN ap_pol_schedule_options.rate_type_code%TYPE) IS
4933:
4934: l_schedule_period_id ap_pol_schedule_periods.schedule_period_id%TYPE;
4935: l_permutate_curref INTEGER;

Line 5297: p_policy_id IN ap_pol_headers.policy_id%TYPE,

5293: | 10-Nov-2005 krmenon Created
5294: |
5295: *=======================================================================*/
5296: PROCEDURE permutateAddonRates( p_user_id IN NUMBER,
5297: p_policy_id IN ap_pol_headers.policy_id%TYPE,
5298: p_schedule_period_id IN ap_pol_lines.schedule_period_id%TYPE ) IS
5299:
5300: l_policy_line_count NUMBER;
5301:

Line 5480: p_policy_id IN ap_pol_headers.policy_id%TYPE,

5476: | 10-Nov-2005 krmenon Created
5477: |
5478: *=======================================================================*/
5479: PROCEDURE permutateNightRates( p_user_id IN NUMBER,
5480: p_policy_id IN ap_pol_headers.policy_id%TYPE,
5481: p_schedule_period_id IN ap_pol_lines.schedule_period_id%TYPE ) IS
5482:
5483: -- -------------------------------------
5484: -- Cursor for inserting new permutation

Line 5547: l_night_rates_code ap_pol_headers.night_rates_code%TYPE;

5543: -- ------------------------------------
5544: -- Local variables
5545: -- ------------------------------------
5546: l_policy_line_count NUMBER;
5547: l_night_rates_code ap_pol_headers.night_rates_code%TYPE;
5548:
5549: BEGIN
5550:
5551: BEGIN

Line 5612: from ap_pol_headers

5608: -- ----------------------------------------------------------------
5609: BEGIN
5610: select night_rates_code
5611: into l_night_rates_code
5612: from ap_pol_headers
5613: where policy_id = p_policy_id;
5614: EXCEPTION WHEN OTHERS THEN
5615: raise;
5616: END;

Line 5708: FUNCTION isNightRatesEnabled(p_policy_id IN ap_pol_headers.policy_id%TYPE) RETURN VARCHAR2 IS

5704: | Date Author Description of Changes
5705: | 10-Nov-2005 krmenon Created
5706: |
5707: *=======================================================================*/
5708: FUNCTION isNightRatesEnabled(p_policy_id IN ap_pol_headers.policy_id%TYPE) RETURN VARCHAR2 IS
5709: l_night_rate_flag VARCHAR2(1) := 'N';
5710: BEGIN
5711:
5712: select nvl2(night_rates_code, 'Y', 'N' )

Line 5714: from ap_pol_headers

5710: BEGIN
5711:
5712: select nvl2(night_rates_code, 'Y', 'N' )
5713: into l_night_rate_flag
5714: from ap_pol_headers
5715: where policy_id = p_policy_id;
5716:
5717: return l_night_rate_flag;
5718:

Line 5748: FUNCTION isFirstPeriodRatesEnabled ( p_policy_id ap_pol_headers.policy_id%TYPE ) RETURN VARCHAR2 IS

5744: | Date Author Description of Changes
5745: | 10-Nov-2005 krmenon Created
5746: |
5747: *=======================================================================*/
5748: FUNCTION isFirstPeriodRatesEnabled ( p_policy_id ap_pol_headers.policy_id%TYPE ) RETURN VARCHAR2 IS
5749: l_rate_period_type_code ap_pol_headers.night_rates_code%TYPE;
5750: l_first_period_count number := 0;
5751: BEGIN
5752:

Line 5749: l_rate_period_type_code ap_pol_headers.night_rates_code%TYPE;

5745: | 10-Nov-2005 krmenon Created
5746: |
5747: *=======================================================================*/
5748: FUNCTION isFirstPeriodRatesEnabled ( p_policy_id ap_pol_headers.policy_id%TYPE ) RETURN VARCHAR2 IS
5749: l_rate_period_type_code ap_pol_headers.night_rates_code%TYPE;
5750: l_first_period_count number := 0;
5751: BEGIN
5752:
5753: select nvl(rate_period_type_code, 'STANDARD')

Line 5755: from ap_pol_headers

5751: BEGIN
5752:
5753: select nvl(rate_period_type_code, 'STANDARD')
5754: into l_rate_period_type_code
5755: from ap_pol_headers
5756: where policy_id = p_policy_id;
5757:
5758: select count(1)
5759: into l_first_period_count

Line 5799: FUNCTION isLastPeriodRatesEnabled ( p_policy_id ap_pol_headers.policy_id%TYPE ) RETURN VARCHAR2 IS

5795: | Date Author Description of Changes
5796: | 10-Nov-2005 krmenon Created
5797: |
5798: *=======================================================================*/
5799: FUNCTION isLastPeriodRatesEnabled ( p_policy_id ap_pol_headers.policy_id%TYPE ) RETURN VARCHAR2 IS
5800: l_rate_period_type_code ap_pol_headers.night_rates_code%TYPE;
5801: l_last_period_count number := 0;
5802: BEGIN
5803:

Line 5800: l_rate_period_type_code ap_pol_headers.night_rates_code%TYPE;

5796: | 10-Nov-2005 krmenon Created
5797: |
5798: *=======================================================================*/
5799: FUNCTION isLastPeriodRatesEnabled ( p_policy_id ap_pol_headers.policy_id%TYPE ) RETURN VARCHAR2 IS
5800: l_rate_period_type_code ap_pol_headers.night_rates_code%TYPE;
5801: l_last_period_count number := 0;
5802: BEGIN
5803:
5804: select nvl(rate_period_type_code, 'STANDARD')

Line 5806: from ap_pol_headers

5802: BEGIN
5803:
5804: select nvl(rate_period_type_code, 'STANDARD')
5805: into l_rate_period_type_code
5806: from ap_pol_headers
5807: where policy_id = p_policy_id;
5808:
5809: select count(1)
5810: into l_last_period_count

Line 5849: FUNCTION isSameDayRatesEnabled ( p_policy_id ap_pol_headers.policy_id%TYPE ) RETURN VARCHAR2 IS

5845: | Date Author Description of Changes
5846: | 10-Nov-2005 krmenon Created
5847: |
5848: *=======================================================================*/
5849: FUNCTION isSameDayRatesEnabled ( p_policy_id ap_pol_headers.policy_id%TYPE ) RETURN VARCHAR2 IS
5850: l_same_day_rate_code ap_pol_headers.night_rates_code%TYPE;
5851: l_same_day_count number := 0;
5852: BEGIN
5853:

Line 5850: l_same_day_rate_code ap_pol_headers.night_rates_code%TYPE;

5846: | 10-Nov-2005 krmenon Created
5847: |
5848: *=======================================================================*/
5849: FUNCTION isSameDayRatesEnabled ( p_policy_id ap_pol_headers.policy_id%TYPE ) RETURN VARCHAR2 IS
5850: l_same_day_rate_code ap_pol_headers.night_rates_code%TYPE;
5851: l_same_day_count number := 0;
5852: BEGIN
5853:
5854: select nvl(same_day_rate_code, 'NULL')

Line 5856: from ap_pol_headers

5852: BEGIN
5853:
5854: select nvl(same_day_rate_code, 'NULL')
5855: into l_same_day_rate_code
5856: from ap_pol_headers
5857: where policy_id = p_policy_id;
5858:
5859: select count(1)
5860: into l_same_day_count

Line 5902: p_policy_id IN ap_pol_headers.policy_id%TYPE) IS

5898: | Date Author Description of Changes
5899: | 07-Dec-2005 krmenon Created |
5900: *=======================================================================*/
5901: PROCEDURE permutateConusLines( p_user_id IN NUMBER,
5902: p_policy_id IN ap_pol_headers.policy_id%TYPE) IS
5903:
5904: l_role_enabled VARCHAR2(1);
5905: BEGIN
5906:

Line 6227: from AP_POL_HEADERS h, AP_POL_LINES l, AP_POL_SCHEDULE_PERIODS sp, AP_SYSTEM_PARAMETERS sys, AP_POL_EXRATE_OPTIONS rate_opts, ap_expense_report_params_all p

6223: l_location_id := getPolicyLocationId(p_expense_type_id, p_expense_date, p_location_id);
6224:
6225: select l.POLICY_LINE_ID
6226: INTO l_policy_line_id
6227: from AP_POL_HEADERS h, AP_POL_LINES l, AP_POL_SCHEDULE_PERIODS sp, AP_SYSTEM_PARAMETERS sys, AP_POL_EXRATE_OPTIONS rate_opts, ap_expense_report_params_all p
6228: where p.parameter_id = p_expense_type_id
6229: AND h.policy_id = p.company_policy_id
6230: AND h.category_code <> 'MILEAGE'
6231: AND h.category_code <> 'PER_DIEM'