  UPDATE IReg SET ValueI = 0 WHERE Idkey ='dokumenty_dft_status_opng' AND (SELECT VALUE <> 'COMEX' FROM `_db_globals` WHERE `key`='Owner') AND ValueI = -10;
 UPDATE IReg SET ValueI = 0 WHERE Idkey ='dokumenty_dft_status_zmng' AND (SELECT VALUE <> 'COMEX' FROM `_db_globals` WHERE `key`='Owner') AND ValueI = -10;