Bugzilla – Attachment 83244 Details for
Bug 21999
C4::Circulation::AddIssue uses DBIx::Class directly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21999: Use Koha::Checkout in C4::Circulation::AddIssue
Bug-21999-Use-KohaCheckout-in-C4CirculationAddIssu.patch (text/plain), 2.75 KB, created by
Pierre-Marc Thibault
on 2018-12-14 19:43:11 UTC
(
hide
)
Description:
Bug 21999: Use Koha::Checkout in C4::Circulation::AddIssue
Filename:
MIME Type:
Creator:
Pierre-Marc Thibault
Created:
2018-12-14 19:43:11 UTC
Size:
2.75 KB
patch
obsolete
>From 842365e840cc6cb9c4e00bcb28476468d5fca026 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 14 Dec 2018 12:27:01 +0000 >Subject: [PATCH] Bug 21999: Use Koha::Checkout in C4::Circulation::AddIssue > >Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com> >--- > C4/Circulation.pm | 38 +++++++++++++++++++++++++++----------- > 1 file changed, 27 insertions(+), 11 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index fc1379d..dc285f0 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -1355,17 +1355,33 @@ sub AddIssue { > } > $datedue->truncate( to => 'minute' ); > >- $issue = Koha::Database->new()->schema()->resultset('Issue')->update_or_create( >- { >- borrowernumber => $borrower->{'borrowernumber'}, >- itemnumber => $item->{'itemnumber'}, >- issuedate => $issuedate->strftime('%Y-%m-%d %H:%M:%S'), >- date_due => $datedue->strftime('%Y-%m-%d %H:%M:%S'), >- branchcode => C4::Context->userenv->{'branch'}, >- onsite_checkout => $onsite_checkout, >- auto_renew => $auto_renew ? 1 : 0 >- } >- ); >+ $issue = >+ Koha::Checkouts->find( { itemnumber => $item->{'itemnumber'} } ); >+ if ($issue) { >+ $issue->set( >+ { >+ borrowernumber => $borrower->{'borrowernumber'}, >+ issuedate => $issuedate->strftime('%Y-%m-%d %H:%M:%S'), >+ date_due => $datedue->strftime('%Y-%m-%d %H:%M:%S'), >+ branchcode => C4::Context->userenv->{'branch'}, >+ onsite_checkout => $onsite_checkout, >+ auto_renew => $auto_renew ? 1 : 0 >+ } >+ )->store; >+ } >+ else { >+ $issue = Koha::Checkout->new( >+ { >+ borrowernumber => $borrower->{'borrowernumber'}, >+ itemnumber => $item->{'itemnumber'}, >+ issuedate => $issuedate->strftime('%Y-%m-%d %H:%M:%S'), >+ date_due => $datedue->strftime('%Y-%m-%d %H:%M:%S'), >+ branchcode => C4::Context->userenv->{'branch'}, >+ onsite_checkout => $onsite_checkout, >+ auto_renew => $auto_renew ? 1 : 0 >+ } >+ )->store; >+ } > > if ( C4::Context->preference('ReturnToShelvingCart') ) { > # ReturnToShelvingCart is on, anything issued should be taken off the cart. >-- >2.7.4
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 21999
:
83215
|
83216
|
83244
|
83245
|
83327
|
83328
|
83329
|
83330