Bug 21849: Two useless Koha::Account::Offset->new calls need attention

Came across those calls in bug 20598 in _FixOverduesOnReturn

        Koha::Account::Offset->new(
            {
                debit_id => $accountline->id,
                type => 'Forgiven',
                amount => $amountoutstanding * -1,
            }
        );

This does nothing if you don't store data.

Test Plan:
1) Apply this patch
2) Set up 2 items with overdue fines
3) Return one with dropbox mode
4) Note the dropbox account offset is created
5) Return one with full fine forgiveness
6) Note the forgiven account offset is created

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit a2b5407ba5)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Kyle M Hall 2018-11-16 07:01:39 -05:00 committed by Martin Renvoize
parent aa565b8e99
commit ff3d3776a4
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 2 additions and 2 deletions

View File

@ -2339,7 +2339,7 @@ sub _FixOverduesOnReturn {
type => 'Forgiven',
amount => $amountoutstanding * -1,
}
);
)->store();
if (C4::Context->preference("FinesLog")) {
&logaction("FINES", 'MODIFY',$borrowernumber,"Overdue forgiven: item $item");
@ -2354,7 +2354,7 @@ sub _FixOverduesOnReturn {
type => 'Dropbox',
amount => $accountline->lastincrement * -1,
}
);
)->store();
if ( C4::Context->preference("FinesLog") ) {
&logaction( "FINES", 'MODIFY', $borrowernumber,