Bug 33641: (follow-up) Change return_branch to checkin_library
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
51206a1f4a
commit
b2d02523b2
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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'" );
|
||||
}
|
||||
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue