--related to order 502462 from HVL

update wearerinventory wi
   set wi.issuedquit = wi.circinventory
 where wi.issuedquit = 0
   and wi.weareremployment_id in
       (select we.weareremployment_id
          from weareremployment we
         where we.wearer_id in
               (select w.wearer_id
                  from wearer w
                 where w.dateinactive <> to_date('31-12-2099', 'dd-mm-yyyy')));