Bugzilla – Attachment 174513 Details for
Bug 33641
We should record return library in old checkouts (oldissues)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33641: (follow-up) Change return_branch to checkin_library
Bug-33641-follow-up-Change-returnbranch-to-checkin.patch (text/plain), 6.12 KB, created by
Nick Clemens (kidclamp)
on 2024-11-14 12:44:34 UTC
(
hide
)
Description:
Bug 33641: (follow-up) Change return_branch to checkin_library
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2024-11-14 12:44:34 UTC
Size:
6.12 KB
patch
obsolete
>From 089d43eb1f901e192200a8e67d9b86c4a023c710 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 14 Nov 2024 12:39:49 +0000 >Subject: [PATCH] Bug 33641: (follow-up) Change return_branch to > checkin_library > >--- > C4/Circulation.pm | 2 +- > installer/data/mysql/atomicupdate/bug_33641.pl | 14 +++++++------- > installer/data/mysql/kohastructure.sql | 4 ++-- > t/db_dependent/Circulation/MarkIssueReturned.t | 4 ++-- > 4 files changed, 12 insertions(+), 12 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 54d2feafa13..b9b66974bec 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -2646,7 +2646,7 @@ sub MarkIssueReturned { > $issue->returndate( \'NOW()' )->store->discard_changes; # update and refetch > } > >- $issue->return_branch(C4::Context->userenv->{'branch'}); >+ $issue->checkin_library(C4::Context->userenv->{'branch'}); > # Create the old_issues entry > my $old_checkout = Koha::Old::Checkout->new($issue->unblessed)->store; > >diff --git a/installer/data/mysql/atomicupdate/bug_33641.pl b/installer/data/mysql/atomicupdate/bug_33641.pl >index e738d50a0a0..fd51c2c1dfc 100755 >--- a/installer/data/mysql/atomicupdate/bug_33641.pl >+++ b/installer/data/mysql/atomicupdate/bug_33641.pl >@@ -3,32 +3,32 @@ use Koha::Installer::Output qw(say_warning say_failure say_success say_info); > > return { > bug_number => "33641", >- description => "Added issues.return_branch and old_issues.return_branch", >+ description => "Added issues.checkin_library and old_issues.checkin_library", > up => sub { > my ($args) = @_; > my ( $dbh, $out ) = @$args{qw(dbh out)}; > >- if ( !column_exists( 'issues', 'return_branch' ) ) { >+ if ( !column_exists( 'issues', 'checkin_library' ) ) { > $dbh->do( > q{ > ALTER TABLE issues >- ADD COLUMN return_branch varchar(10) DEFAULT NULL >+ ADD COLUMN checkin_library varchar(10) DEFAULT NULL > COMMENT 'foreign key, linking to the branches table for the location the item was returned' > AFTER returndate > } > ); >- say_success( $out, "Added column 'issues.return_branch'" ); >+ say_success( $out, "Added column 'issues.checkin_library'" ); > } >- if ( !column_exists( 'old_issues', 'return_branch' ) ) { >+ if ( !column_exists( 'old_issues', 'checkin_library' ) ) { > $dbh->do( > q{ > ALTER TABLE old_issues >- ADD COLUMN return_branch varchar(10) DEFAULT NULL >+ ADD COLUMN checkin_library varchar(10) DEFAULT NULL > COMMENT 'foreign key, linking to the branches table for the location the item was returned' > AFTER returndate > } > ); >- say_success( $out, "Added column 'old_issues.return_branch'" ); >+ say_success( $out, "Added column 'old_issues.checkin_library'" ); > } > > }, >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index fd383530d29..14f15502d27 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -3896,7 +3896,7 @@ CREATE TABLE `issues` ( > `date_due` datetime DEFAULT NULL COMMENT 'datetime the item is due (yyyy-mm-dd hh:mm::ss)', > `branchcode` varchar(10) DEFAULT NULL COMMENT 'foreign key, linking to the branches table for the location the item was checked out', > `returndate` datetime DEFAULT NULL COMMENT 'date the item was returned, will be NULL until moved to old_issues', >- `return_branch` varchar(10) DEFAULT NULL COMMENT 'foreign key, linking to the branches table for the location the item was returned', >+ `checkin_library` varchar(10) DEFAULT NULL COMMENT 'foreign key, linking to the branches table for the location the item was returned', > `lastreneweddate` datetime DEFAULT NULL COMMENT 'date the item was last renewed', > `renewals_count` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'lists the number of times the item was renewed', > `unseen_renewals` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'lists the number of consecutive times the item was renewed without being seen', >@@ -4986,7 +4986,7 @@ CREATE TABLE `old_issues` ( > `date_due` datetime DEFAULT NULL COMMENT 'date the item is due (yyyy-mm-dd)', > `branchcode` varchar(10) DEFAULT NULL COMMENT 'foreign key, linking to the branches table for the location the item was checked out', > `returndate` datetime DEFAULT NULL COMMENT 'date the item was returned', >- `return_branch` varchar(10) DEFAULT NULL COMMENT 'foreign key, linking to the branches table for the location the item was returned', >+ `checkin_library` varchar(10) DEFAULT NULL COMMENT 'foreign key, linking to the branches table for the location the item was returned', > `lastreneweddate` datetime DEFAULT NULL COMMENT 'date the item was last renewed', > `renewals_count` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'lists the number of times the item was renewed', > `unseen_renewals` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'lists the number of consecutive times the item was renewed without being seen', >diff --git a/t/db_dependent/Circulation/MarkIssueReturned.t b/t/db_dependent/Circulation/MarkIssueReturned.t >index a744e1a5d5a..7f76a40a616 100755 >--- a/t/db_dependent/Circulation/MarkIssueReturned.t >+++ b/t/db_dependent/Circulation/MarkIssueReturned.t >@@ -305,7 +305,7 @@ subtest 'AutoRemoveOverduesRestrictions' => sub { > $schema->storage->txn_rollback; > }; > >-subtest 'Pass return_branch to old_issues' => sub { >+subtest 'Pass checkin_library to old_issues' => sub { > plan tests => 2; > > $schema->storage->txn_begin; >@@ -330,7 +330,7 @@ subtest 'Pass return_branch to old_issues' => sub { > > is( $issue_id, $issue->issue_id, 'Item has been returned' ); > my $old_issue = Koha::Old::Checkouts->find( $issue_id ); >- is( $old_issue->return_branch, $library->branchcode, 'Return branch is passed correctly' ); >+ is( $old_issue->checkin_library, $library->branchcode, 'Return branch is passed correctly' ); > > $schema->storage->txn_rollback > }; >-- >2.39.5
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 33641
:
170105
|
170106
|
170107
|
170108
|
170109
|
170110
|
170111
|
170138
|
170139
|
170140
|
170141
|
173562
|
173563
|
173564
|
173565
|
174510
|
174511
|
174512
| 174513 |
174514
|
174536
|
174538
|
174569
|
174570
|
174571
|
174572
|
174573
|
174574
|
174584
|
174585