# restore those overdue charges voided when item was set to lost
# ------------------------------------------------------------------
+ # first, look for a forgive payment with a special note
+ my $forgives = $self->editor->search_money_forgive_payment(
+ {
+ xact => $self->circ->id,
+ note => 'System: OVERDUES FORGIVEN ON LOST'
+ }
+ );
+
+ if ($forgives) {
+ $logger->info("Found forgive payment(s) on circ ", $self->circ->id);
+ # re-bill the forgiven overdue(s)
+ for my $payment (@$forgives) {
+ my $bill = Fieldmapper::money::billing->new;
+ my $amount = $payment->amount;
+ my $billing_type = OILS_BILLING_TYPE_OVERDUE_MATERIALS;
+ my $btype = 1;
+ $bill->xact($self->circ->id);
+ $bill->amount($amount);
+ $bill->note('System: re-billed previously forgiven overdues on lost checkin');
+ $bill->billing_type($billing_type);
+ $bill->btype($btype);
+ $self->editor->create_money_billing($bill) or $self->bail_on_events($self->editor->event);
+ $logger->info("Re-billed previously forgiven overdues of $amount on circ ", $self->circ->id);
+ }
+ return;
+ }
+
my $ods = $self->editor->search_money_billing(
{
xact => $self->circ->id,