fix: int cast statement count saving invoice (#7281)