Hello respected Community members ,

 I want to know is this code right for removing invoices that are settled but still showing in Open Transaction . I tried but it doesnt seem to work , kindly let me know if its correct . Actually what the issue is the settled invoices are still showing in open transaction, this is customization so would this code be right ?