# Get and editor, check for a session, and check that we can void
# bills. (If we can void bills, we can unvoid them, too.)
- my $ed = new_editor (authtoken => $authtoken, xact => 1);
+ my $e = new_editor (authtoken => $authtoken, xact => 1);
return $e->die_event unless $e->checkauth;
return $e->die_event unless $e->allowed('VOID_BILLING');
- my $voids = $ed->search_money_void_payment(
+ my $voids = $e->search_money_void_payment(
{
billing => $bill->id()
}
if ($voids && @$voids) {
my $void_total = 0;
map {$void_total += $_->amount()} @$voids;
- my $result = $class->create_bill($ed, $void_total, $bill->btype(), $bill->billing_type(), $bill->xact(), $note);
+ my $result = $class->create_bill($e, $void_total, $bill->btype(), $bill->billing_type(), $bill->xact(), $note);
if ($result) {
- $ed->rollback();
+ $e->rollback();
return $result;
}
- $ed->commit;
+ $e->commit;
}
return undef;