fix invoice deletion vs. cust_pay_batch records, #37837