Bugzilla – Attachment 90637 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: (QA follow-up) Catch LOST maninvoice cases
Bug-22563-QA-follow-up-Catch-LOST-maninvoice-cases.patch (text/plain), 3.10 KB, created by
Martin Renvoize (ashimema)
on 2019-06-15 06:19:56 UTC
(
hide
)
Description:
Bug 22563: (QA follow-up) Catch LOST maninvoice cases
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-06-15 06:19:56 UTC
Size:
3.10 KB
patch
obsolete
>From e65119bc1fcf7026e97d548d5171228bfdcfebca Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Sat, 15 Jun 2019 07:17:46 +0100 >Subject: [PATCH] Bug 22563: (QA follow-up) Catch LOST maninvoice cases > >One could add a manual invoice of type LOST but we would not associate >it with an issue_id. This patch tries to catch such cases and >extrapolate an issue_id to add to the accountline. >--- > C4/Accounts.pm | 19 ++++++++++++++++--- > .../prog/en/modules/members/maninvoice.tt | 2 +- > 2 files changed, 17 insertions(+), 4 deletions(-) > >diff --git a/C4/Accounts.pm b/C4/Accounts.pm >index 5601291d7a..304911628d 100644 >--- a/C4/Accounts.pm >+++ b/C4/Accounts.pm >@@ -87,9 +87,7 @@ sub chargelostitem { > my $issue_id = $checkout ? $checkout->issue_id : undef; > > my $account = Koha::Account->new({ patron_id => $borrowernumber }); >- # first make sure the borrower hasn't already been charged for this item >- # FIXME this should be more exact >- # there is no reason a user can't lose an item, find and return it, and lost it again >+ # first make sure the borrower hasn't already been charged for this item (for this issuance) > my $existing_charges = $account->lines->search( > { > itemnumber => $itemnumber, >@@ -156,6 +154,20 @@ sub manualinvoice { > > my $branchcode = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef; > >+ my $issue_id; >+ if ( $type eq 'LOST' && $itemnum ) { >+ my $checkouts = Koha::Checkouts->search( >+ { itemnumber => $itemnum, borrowernumber => $borrowernumber } ); >+ my $checkout = >+ $checkouts->count >+ ? $checkouts->next >+ : Koha::Old::Checkouts->search( >+ { itemnumber => $itemnum, borrowernumber => $borrowernumber }, >+ { order_by => { 'DESC' => 'returndate' }, rows => 1 } >+ )->next; >+ $issue_id = $checkout ? $checkout->issue_id : undef; >+ } >+ > my $accountline = Koha::Account::Line->new( > { > borrowernumber => $borrowernumber, >@@ -165,6 +177,7 @@ sub manualinvoice { > accounttype => $type, > amountoutstanding => $amountleft, > itemnumber => $itemnum || undef, >+ issue_id => $issue_id, > note => $note, > manager_id => $manager_id, > interface => C4::Context->interface, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt >index 7ce2a42997..4772da37d4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt >@@ -44,7 +44,7 @@ > <li> > <label for="type">Type: </label> > <select name="type" id="invoice_type"> >- <option value="L">Lost item</option> >+ <option value="LOST">Lost item</option> > <option value="F">Fine</option> > <option value="A">Account management fee</option> > <option value="N">New card</option> >-- >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