Se eu entendi a [regra](https://github.com/BielSystems/boletophp/issues/62#issuecomment-35005078), seria algo tipo:
```php
if($fator > 9999){
    $fator = $fator - 9999 + 1000;
}
```
não?