+
+ # we might end up removing all cust_pay_batch above...
+ # probably the better way to handle this is to commit that removal,
+ # but no time to trace code & test that right now
+ #
+ # additionally, UI currently allows hand-deletion of all payments from a batch, meaning
+ # it's possible to try and process an empty batch...this is where we catch
+ # such an attempt, though it probably shouldn't be possible in the first place
+ return "Batch is empty" unless $self->cust_pay_batch;
+
+ #need to do this after unbatch_and_delete
+ my $error = $self->set_status('I');
+ return "error updating pay_batch status: $error\n" if $error;
+