Bugzilla – Attachment 65164 Details for
Bug 18970
Yet another try at issue id's
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 1xxxx: Use autoincrement in AddIssue
Bug-1xxxx-Use-autoincrement-in-AddIssue.patch (text/plain), 1.72 KB, created by
Marcel de Rooy
on 2017-07-21 09:58:48 UTC
(
hide
)
Description:
Bug 1xxxx: Use autoincrement in AddIssue
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2017-07-21 09:58:48 UTC
Size:
1.72 KB
patch
obsolete
>From 1ad014fcb57533ef1366c3e2d1199cd099f3b2c7 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 21 Jul 2017 11:44:46 +0200 >Subject: [PATCH] Bug 1xxxx: Use autoincrement in AddIssue >Content-Type: text/plain; charset=utf-8 > >--- > C4/Circulation.pm | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index cb60da3..bde3458 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -1361,8 +1361,7 @@ sub AddIssue { > } > $datedue->truncate( to => 'minute' ); > >- $issue = Koha::Database->new()->schema()->resultset('Issue')->update_or_create( >- { >+ my $cols = { > borrowernumber => $borrower->{'borrowernumber'}, > itemnumber => $item->{'itemnumber'}, > issuedate => $issuedate->strftime('%Y-%m-%d %H:%M:%S'), >@@ -1370,8 +1369,12 @@ sub AddIssue { > branchcode => C4::Context->userenv->{'branch'}, > onsite_checkout => $onsite_checkout, > auto_renew => $auto_renew ? 1 : 0 >- } >- ); >+ }; >+ unless( Koha::Checkouts->search({ itemnumber => $item->{'itemnumber'}, borrowernumber => $borrower->{'borrowernumber'} }) ) { >+ my $id = Koha::Autoincrements->find('issues')->increment; >+ $cols->{issue_id} = $id; >+ } >+ $issue = Koha::Database->new->schema->resultset('Issue')->update_or_create( $cols ); > > if ( C4::Context->preference('ReturnToShelvingCart') ) { > # ReturnToShelvingCart is on, anything issued should be taken off the cart. >-- >2.1.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 18970
:
65162
|
65163
| 65164