Error when invoice download from payment posting

I am using version 7.0.2. This error " Fatal error : Uncaught TypeError: fwrite(): Argument #1 ($stream) must be of type resource, bool given in public_html/interface/billing/sl_eob_search.php:567 Stack trace: #0 public_html/interface/billing/sl_eob_search.php(567): fwrite() #1 {main} thrown in public_html/interface/billing/sl_eob_search.php on line 567" when trying to download statement from posting payment