Bugzilla – Attachment 90310 Details for
Bug 22563
Convert lost handling to use 'status' instead of multiple accounttypes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22563: (follow-up) Items LOST should not be RETURNED
Bug-22563-follow-up-Items-LOST-should-not-be-RETUR.patch (text/plain), 5.24 KB, created by
Martin Renvoize (ashimema)
on 2019-06-04 10:21:11 UTC
(
hide
)
Description:
Bug 22563: (follow-up) Items LOST should not be RETURNED
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-06-04 10:21:11 UTC
Size:
5.24 KB
patch
obsolete
>From f3b4bd1c681ce221672c398bf74efe33588f2d75 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 18 Apr 2019 08:45:54 +0100 >Subject: [PATCH] Bug 22563: (follow-up) Items LOST should not be RETURNED > >Up until now we marked lost items as returned in the accountlines, now >we have the oportunity to mark these distinctly with an appropriate >status we should. > >Test Plan >1) Find an overdue with fines >2) Ensure you are not forgiving fines when an item is marked as lost >3) Mark the item as lost >4) Confirm the Fine is given a status of 'Lost' > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > C4/Circulation.pm | 18 ++++++++++++------ > .../prog/en/includes/accounts.inc | 1 + > .../bootstrap/en/includes/account-table.inc | 1 + > 3 files changed, 14 insertions(+), 6 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 92c9b59030..70c3b9cca8 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -2031,7 +2031,7 @@ sub AddReturn { > > # fix up the overdues in accounts... > if ($borrowernumber) { >- my $fix = _FixOverduesOnReturn( $borrowernumber, $item->itemnumber, $exemptfine ); >+ my $fix = _FixOverduesOnReturn( $borrowernumber, $item->itemnumber, $exemptfine, 'RETURNED' ); > defined($fix) or warn "_FixOverduesOnReturn($borrowernumber, $item->itemnumber...) failed!"; # zero is OK, check defined > > if ( $issue and $issue->is_overdue ) { >@@ -2315,7 +2315,7 @@ sub _debar_user_on_return { > > =head2 _FixOverduesOnReturn > >- &_FixOverduesOnReturn($borrowernumber, $itemnumber, $exemptfine); >+ &_FixOverduesOnReturn($borrowernumber, $itemnumber, $exemptfine, $status); > > C<$borrowernumber> borrowernumber > >@@ -2323,12 +2323,14 @@ C<$itemnumber> itemnumber > > C<$exemptfine> BOOL -- remove overdue charge associated with this issue. > >+C<$status> ENUM -- reason for fix [ RETURNED, RENEWED, LOST, FORGIVEN ] >+ > Internal function > > =cut > > sub _FixOverduesOnReturn { >- my ( $borrowernumber, $item, $exemptfine ) = @_; >+ my ( $borrowernumber, $item, $exemptfine, $status ) = @_; > unless( $borrowernumber ) { > warn "_FixOverduesOnReturn() not supplied valid borrowernumber"; > return; >@@ -2337,6 +2339,10 @@ sub _FixOverduesOnReturn { > warn "_FixOverduesOnReturn() not supplied valid itemnumber"; > return; > } >+ unless( $status ) { >+ warn "_FixOverduesOnReturn() not supplied valid status"; >+ return; >+ } > > my $schema = Koha::Database->schema; > >@@ -2377,7 +2383,7 @@ sub _FixOverduesOnReturn { > &logaction("FINES", 'MODIFY',$borrowernumber,"Overdue forgiven: item $item"); > } > } else { >- $accountline->status('RETURNED'); >+ $accountline->status($status); > } > > return $accountline->store(); >@@ -2863,7 +2869,7 @@ sub AddRenewal { > if ( C4::Context->preference('CalculateFinesOnReturn') && $issue->is_overdue ) { > _CalculateAndUpdateFine( { issue => $issue, item => $item_unblessed, borrower => $patron_unblessed } ); > } >- _FixOverduesOnReturn( $borrowernumber, $itemnumber ); >+ _FixOverduesOnReturn( $borrowernumber, $itemnumber, undef, 'RENEWED' ); > > # If the due date wasn't specified, calculate it by adding the > # book's loan length to today's date or the current due date >@@ -3708,7 +3714,7 @@ sub LostItem{ > if ( my $borrowernumber = $issues->{borrowernumber} ){ > my $patron = Koha::Patrons->find( $borrowernumber ); > >- my $fix = _FixOverduesOnReturn($borrowernumber, $itemnumber, C4::Context->preference('WhenLostForgiveFine'), 0); # 1, 0 = exemptfine, no-dropbox >+ my $fix = _FixOverduesOnReturn($borrowernumber, $itemnumber, C4::Context->preference('WhenLostForgiveFine'), 'LOST'); > defined($fix) or warn "_FixOverduesOnReturn($borrowernumber, $itemnumber...) failed!"; # zero is OK, check defined > > if (C4::Context->preference('WhenLostChargeReplacementFee')){ >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc >index dfce02b6fe..e221af6525 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc >@@ -44,6 +44,7 @@ > [%- CASE 'REPLACED' -%]<span> (Replaced)</span> > [%- CASE 'FORGIVEN' -%]<span> (Forgiven)</span> > [%- CASE 'VOID' -%]<span> (Voided)</span> >+ [%- CASE 'LOST' -%]<span> (Lost)</span> > [%- CASE -%] > [%- END -%] > [%- END -%] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc >index 8235962d20..b0624b09f5 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc >@@ -122,6 +122,7 @@ > [%- CASE 'REPLACED' -%]<span> (Replaced)</span> > [%- CASE 'FORGIVEN' -%]<span> (Forgiven)</span> > [%- CASE 'VOID' -%]<span> (Voided)</span> >+ [%- CASE 'LOST' -%]<span> (Lost)</span> > [%- CASE -%] > [%- END -%] > [%- END -%] >-- >2.20.1
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 22563
:
86913
|
86914
|
87092
|
87093
|
87094
|
87637
|
87638
|
87639
|
87640
|
87641
|
87642
|
87801
|
87802
|
87803
|
87804
|
87805
|
87806
|
88279
|
88280
|
88281
|
88282
|
88283
|
88284
|
88285
|
88323
|
88324
|
88325
|
88326
|
88327
|
88328
|
88720
|
88721
|
88722
|
88723
|
88724
|
88725
|
89462
|
89463
|
89464
|
89465
|
89466
|
89467
|
90221
|
90222
|
90223
|
90224
|
90225
|
90226
|
90227
|
90307
|
90308
|
90309
|
90310
|
90311
|
90312
|
90330
|
90331
|
90332
|
90333
|
90334
|
90335
|
90632
|
90637
|
90667
|
91338
|
91339
|
91340
|
91341
|
91342
|
91343
|
91344
|
91345
|
91346
|
91347
|
91348