Bugzilla – Attachment 112484 Details for
Bug 26583
Unnecessary code in AddIssue
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26583: Remove unneccessary code in AddIssue
Bug-26583-Remove-unneccessary-code-in-AddIssue.patch (text/plain), 2.47 KB, created by
Chris Cormack
on 2020-10-25 20:57:05 UTC
(
hide
)
Description:
Bug 26583: Remove unneccessary code in AddIssue
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2020-10-25 20:57:05 UTC
Size:
2.47 KB
patch
obsolete
>From 21391e8b700be11b7c4b086de5e48a34dadcc0cb Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 1 Oct 2020 10:50:17 +0000 >Subject: [PATCH] Bug 26583: Remove unneccessary code in AddIssue > >The lines to calc due date are doubled > >ModDateLastSeen is not needed as we set the item not lost and we can set >the date as we do for date last borrowed and save a DB store > >Largely this is reading the code and confirming the changes make sense > >To test: >1 - Apply patch >2 - Check out items, confirm it works as before >3 - prove -v t/db_dependent/Circulation.t > >Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> >--- > C4/Circulation.pm | 12 +++--------- > 1 file changed, 3 insertions(+), 9 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 18c4dacda5..7db5810655 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -1496,14 +1496,6 @@ sub AddIssue { > $auto_renew = $rule->rule_value if $rule; > } > >- # Record in the database the fact that the book was issued. >- unless ($datedue) { >- my $itype = $item_object->effective_itemtype; >- $datedue = CalcDateDue( $issuedate, $itype, $branchcode, $borrower ); >- >- } >- $datedue->truncate( to => 'minute' ); >- > my $issue_attributes = { > borrowernumber => $borrower->{'borrowernumber'}, > issuedate => $issuedate->strftime('%Y-%m-%d %H:%M:%S'), >@@ -1513,6 +1505,8 @@ sub AddIssue { > auto_renew => $auto_renew ? 1 : 0, > }; > >+ # In the case that the borrower has an on-site checkout >+ # and SwitchOnSiteCheckouts is enabled this converts it to a regular checkout > $issue = Koha::Checkouts->find( { itemnumber => $item_object->itemnumber } ); > if ($issue) { > $issue->set($issue_attributes)->store; >@@ -1540,8 +1534,8 @@ sub AddIssue { > $item_object->itemlost(0); > $item_object->onloan($datedue->ymd()); > $item_object->datelastborrowed( dt_from_string()->ymd() ); >+ $item_object->datelastseen( dt_from_string()->ymd() ); > $item_object->store({log_action => 0}); >- ModDateLastSeen( $item_object->itemnumber ); > > # If it costs to borrow this book, charge it to the patron's account. > my ( $charge, $itemtype ) = GetIssuingCharges( $item_object->itemnumber, $borrower->{'borrowernumber'} ); >-- >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 26583
:
111008
|
111030
|
112484
|
112793