Bug 24300: (QA follow-up) Update payout_amount to use internal methods
Tomas pointed out that we could, and probably should, use the internal 'add_debit' method within this function. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
1f32b62d1c
commit
c2026b6624
1 changed files with 5 additions and 7 deletions
|
@ -692,20 +692,18 @@ sub payout_amount {
|
|||
sub {
|
||||
|
||||
# A 'payout' is a 'debit'
|
||||
$payout = Koha::Account::Line->new(
|
||||
$payout = $self->add_debit(
|
||||
{
|
||||
date => \'NOW()',
|
||||
amount => $amount,
|
||||
debit_type_code => 'PAYOUT',
|
||||
amount => $params->{amount},
|
||||
type => 'PAYOUT',
|
||||
payment_type => $params->{payout_type},
|
||||
amountoutstanding => $amount,
|
||||
amountoutstanding => $params->{amount},
|
||||
manager_id => $params->{staff_id},
|
||||
borrowernumber => $self->{patron_id},
|
||||
interface => $params->{interface},
|
||||
branchcode => $params->{branch},
|
||||
register_id => $params->{cash_register}
|
||||
}
|
||||
)->store();
|
||||
);
|
||||
|
||||
# Offset against credits
|
||||
for my $credit ( @{$outstanding_credits} ) {
|
||||
|
|
Loading…
Reference in a new issue