my $credit_total = $accountline->amountoutstanding + $total_to_refund;
if ( $credit_total > 0 ) {
+ my $branchcode = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef;
$credit = $account->add_credit(
{ amount => $credit_total,
description => 'Item Returned ' . $item_id,
- type => 'lost_item_return'
+ type => 'lost_item_return',
+ library_id => $branchcode
}
);
# Insert the account line
$line = Koha::Account::Line->new(
{ borrowernumber => $self->{patron_id},
+ accountno => $accountno,
date => \'NOW()',
amount => $amount,
description => $description,
payment_type => $payment_type,
note => $note,
manager_id => $user_id,
- itemnumber => $item_id
+ branchcode => $library_id,
+ itemnumber => $item_id,
+ lastincrement => undef,
}
)->store();
note => $note,
itemnumber => $item_id,
manager_id => $user_id,
+ branchcode => $library_id,
}
)
);