Bugzilla – Attachment 83122 Details for
Bug 21727
Add Koha::Account::Line->adjust
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21727: Add handling for cases requireing patron refunds
Bug-21727-Add-handling-for-cases-requireing-patron.patch (text/plain), 1.81 KB, created by
Josef Moravec
on 2018-12-12 14:16:10 UTC
(
hide
)
Description:
Bug 21727: Add handling for cases requireing patron refunds
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2018-12-12 14:16:10 UTC
Size:
1.81 KB
patch
obsolete
>From 035c68ae9ea02df6d3e68124db891c3491eb5276 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 12 Dec 2018 12:09:46 +0000 >Subject: [PATCH] Bug 21727: Add handling for cases requireing patron refunds > >As it is possible to partially pay off a fine that is still incrementing >we can end up in a position (when dropbox mode is enabled) where the >patron may be owed money by the library should they have paid off the >fine between dropping the item off in dropbox mode and the increment >that reverts the increase on the dropbox day. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > Koha/Account/Line.pm | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > >diff --git a/Koha/Account/Line.pm b/Koha/Account/Line.pm >index 26c97e346b..502499a8a7 100644 >--- a/Koha/Account/Line.pm >+++ b/Koha/Account/Line.pm >@@ -256,6 +256,21 @@ sub adjust { > my $difference = $amount - $amount_before; > my $new_outstanding = $amount_outstanding_before + $difference; > >+ # Catch cases that require patron refunds >+ if ( $new_outstanding < 0 ) { >+ my $account = >+ Koha::Patrons->find( $self->borrowernumber )->account; >+ my $credit = $account->add_credit( >+ { >+ amount => $new_outstanding * -1, >+ description => 'Overpayment refund', >+ type => 'credit', >+ ( $update_type eq 'fine_increment' ? ( item_id => $self->itemnumber ) : ()), >+ } >+ ); >+ $new_outstanding = 0; >+ } >+ > # Update the account line > $self->set( > { >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 21727
:
81879
|
82777
|
82778
|
83054
|
83055
|
83056
|
83058
|
83088
|
83089
|
83090
|
83091
|
83095
|
83096
|
83097
|
83098
|
83101
|
83117
|
83118
|
83121
| 83122 |
83818