/////////////////////////////////////////////////////////////////////////////
// list$wh.sqc
// This script lists all the employees buckets that must be recalculated
// manually by the user after the V5.00.1 fix is sent with spr fix 14595
// (this is part of spr 14616).  The user should take the output of
// this script and recalculate all boxes listed BUT they need to press
// the '~' when the 'do you want to continue' message comes up.
/////////////////////////////////////////////////////////////////////////////

// Can't do version checking because would need match
// 5.00.0 and up

output into updfed.log
select 'Update box Fed Wages for ', em_cardid from 
  emplwh, withhold, employee 
  where ew_whoid = wh_oid and
        ew_emoid = em_oid and
        ew_whoid in ( select wh_oid from withhold where wh_calc = '2')
        and wh_wxbox = 'Box 2';

output into upd171.log
select 'Update box 17-1 (State Wages, tips, etc) for ', em_cardid from 
  emplwh, withhold, employee 
  where ew_whoid = wh_oid and
        ew_emoid = em_oid and
        ew_whoid in ( select wh_oid from withhold where wh_calc = '2')
        and wh_wxbox = 'Box 18-1';
   
output into upd172.log
select 'Update box 17-2 (Other State Wages, tips, etc) for ', em_cardid from 
  emplwh, withhold, employee 
  where ew_whoid = wh_oid and
        ew_emoid = em_oid and
        ew_whoid in ( select wh_oid from withhold where wh_calc = '2')
        and wh_wxbox = 'Box 18-2';
   
output into upd201.log
select 'Update box 20-1 (Local Wages, tips, etc) for ', em_cardid from 
  emplwh, withhold, employee 
  where ew_whoid = wh_oid and
        ew_emoid = em_oid and
        ew_whoid in ( select wh_oid from withhold where wh_calc = '2')
        and wh_wxbox = 'Box 21-1';
   
output into upd202.log
select 'Update box 20-2 (Other Local Wages, tips, etc) for ', em_cardid from 
  emplwh, withhold, employee 
  where ew_whoid = wh_oid and
        ew_emoid = em_oid and
        ew_whoid in ( select wh_oid from withhold where wh_calc = '2')
        and wh_wxbox = 'Box 21-2';
   
COMMIT;