[Home] [Help]
553: -- For automatic reversal batch creation if there is a rule evaluation pref
554: -- change.
555:
556: -- Earlier hxc_gen_retrieve_utils.chk_retrieve would have populated
557: -- HXC_BEE_PREF_ADJ_LINES with the details that were previously transferred
558: -- and had a preference change before transfer this time.
559: -- Check the count of those records which are for time store. Now we
560: -- are running OTM batches. Meaning, if there was an earlier batch, it would
561: -- have been from time store. There needs to be reverse batches for those.
568: -- the result is only 1 or 0.
569:
570: SELECT COUNT(*)
571: INTO l_dup_count
572: FROM hxc_bee_pref_adj_lines
573: WHERE batch_source = 'Time Store'
574: AND ROWNUM < 2 ;
575:
576:
1474: -- exists or not. We dont want the exact number, just wanna know if it exists or not.
1475:
1476: SELECT COUNT(*)
1477: INTO l_dup_count
1478: FROM hxc_bee_pref_adj_lines
1479: WHERE batch_source = 'OTM'
1480: AND ROWNUM < 2;
1481:
1482:
1647:
1648: -- Private procedure create_bld_blk_table
1649: -- populates the detail bld blks plsql table like gen. retrieval
1650: -- 1. Pull out the bb details from hxc_time_building_blocks table
1651: -- which has an entry in hxc_bee_pref_adj_lines table, with
1652: -- batch_source as Time Store.
1653: -- 2. Update hxc_bee_pref_adj_lines table with these values for
1654: -- the corresponding bb_ids and ovns.
1655: -- 3. Pull out these into a plsql table for the format prescribed in
1649: -- populates the detail bld blks plsql table like gen. retrieval
1650: -- 1. Pull out the bb details from hxc_time_building_blocks table
1651: -- which has an entry in hxc_bee_pref_adj_lines table, with
1652: -- batch_source as Time Store.
1653: -- 2. Update hxc_bee_pref_adj_lines table with these values for
1654: -- the corresponding bb_ids and ovns.
1655: -- 3. Pull out these into a plsql table for the format prescribed in
1656: -- hxc_generic_retrieval_pkg, so that it can use the batch creation API.
1657:
1677: FROM hxc_time_building_blocks
1678: WHERE (time_building_block_id,object_version_number)
1679: IN ( SELECT detail_bb_id,
1680: detail_bb_ovn
1681: FROM hxc_bee_pref_adj_lines
1682: WHERE batch_source = 'Time Store');
1683:
1684: CURSOR get_blocks
1685: IS
1698: changed,
1699: deleted,
1700: timecard_id,
1701: timecard_ovn
1702: FROM hxc_bee_pref_adj_lines
1703: WHERE batch_source = 'Time Store'
1704: order by detail_bb_id
1705: ;
1706:
1713: CLOSE get_bb_details;
1714:
1715: FOR i IN t_bb_details.FIRST..t_bb_details.LAST
1716: LOOP
1717: UPDATE hxc_bee_pref_adj_lines
1718: SET type = t_bb_details(i).type,
1719: scope = t_bb_details(i).scope,
1720: hours = t_bb_details(i).measure ,
1721: start_time = t_bb_details(i).start_time ,
1787: hxc_time_attributes hat
1788: WHERE hau.time_attribute_id = hat.time_attribute_id
1789: AND (hau.time_building_block_id,
1790: hau.time_building_block_ovn) IN ( SELECT detail_bb_id, detail_bb_ovn
1791: FROM hxc_bee_pref_adj_lines
1792: WHERE batch_source = 'Time Store')
1793: ORDER BY hau.time_building_block_id,
1794: hat.bld_blk_info_type_id;
1795:
2002: l_retro_adj_batch_id
2003: );
2004:
2005: -- you dont need the duplicate adjustment lines of this batch source, so delete them.
2006: DELETE FROM hxc_bee_pref_adj_lines
2007: WHERE batch_source = 'Time Store';
2008:
2009: EXCEPTION
2010: WHEN OTHERS THEN
2017:
2018:
2019: -- Bug 6121705
2020: -- This procedure is used to create reversal batches with Batch source as OTM
2021: -- for the details in hxc_bee_pref_adj_lines table with OTM as batch source.
2022: -- hxc_generic_retrieval_utils.chk_retrieve would have populated these
2023: -- records for which there is a history of a different preference for rules
2024: -- evaluation.
2025:
2045: WHERE ( date_worked,
2046: assignment_id )
2047: in ( SELECT date_earned,
2048: assignment_id
2049: FROM hxc_bee_pref_adj_lines,
2050: per_all_assignments_f paf,
2051: per_assignment_status_types pas
2052: WHERE resource_id = person_id
2053: AND batch_source = 'OTM'
2076: FROM hxt_batch_values_v
2077: WHERE (date_worked ,assignment_id) in
2078: ( SELECT date_earned,
2079: paf.assignment_id
2080: FROM hxc_bee_pref_adj_lines hoa,
2081: per_all_assignments_f paf
2082: WHERE hoa.resource_id = paf.person_id
2083: AND hoa.date_earned BETWEEN paf.effective_start_date
2084: AND paf.effective_end_date
2125: -- Check if there is anything left there. If no TC was transferred, no need of the
2126: -- adj dup batch.
2127: SELECT COUNT(*)
2128: INTO l_rec_count
2129: FROM hxc_bee_pref_adj_lines
2130: WHERE batch_source = 'OTM'
2131: AND rownum < 2;
2132:
2133: IF l_rec_count > 0
2149:
2150: create_batch_line(p_batch_id => l_new_batch);
2151:
2152:
2153: DELETE FROM hxc_bee_pref_adj_lines
2154: WHERE batch_source = 'OTM';
2155: END IF;
2156:
2157: