Browse Source
This patch will move the list item refund rules from a dedicated table to the circulation_rules table. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) Verify lost item refund rules remain unchanged Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Agustin Moyano <agustinmoyano@theke.io> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>remotes/origin/19.11.x
8 changed files with 235 additions and 222 deletions
@ -1,45 +0,0 @@ |
|||
package Koha::RefundLostItemFeeRule; |
|||
|
|||
# Copyright Theke Solutions 2016 |
|||
# |
|||
# This file is part of Koha. |
|||
# |
|||
# Koha is free software; you can redistribute it and/or modify it under the |
|||
# terms of the GNU General Public License as published by the Free Software |
|||
# Foundation; either version 3 of the License, or (at your option) any later |
|||
# version. |
|||
# |
|||
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY |
|||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
|||
# A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
|||
# |
|||
# You should have received a copy of the GNU General Public License along |
|||
# with Koha; if not, write to the Free Software Foundation, Inc., |
|||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
|||
|
|||
use Modern::Perl; |
|||
|
|||
use Koha::Database; |
|||
use Koha::Exceptions; |
|||
|
|||
use base qw(Koha::Object); |
|||
|
|||
=head1 NAME |
|||
|
|||
Koha::RefundLostItemFeeRule - Koha RefundLostItemFeeRule object class |
|||
|
|||
=head1 API |
|||
|
|||
=head2 Class Methods |
|||
|
|||
=cut |
|||
|
|||
=head3 type |
|||
|
|||
=cut |
|||
|
|||
sub _type { |
|||
return 'RefundLostItemFeeRule'; |
|||
} |
|||
|
|||
1; |
@ -1,66 +0,0 @@ |
|||
use utf8; |
|||
package Koha::Schema::Result::RefundLostItemFeeRule; |
|||
|
|||
# Created by DBIx::Class::Schema::Loader |
|||
# DO NOT MODIFY THE FIRST PART OF THIS FILE |
|||
|
|||
=head1 NAME |
|||
|
|||
Koha::Schema::Result::RefundLostItemFeeRule |
|||
|
|||
=cut |
|||
|
|||
use strict; |
|||
use warnings; |
|||
|
|||
use base 'DBIx::Class::Core'; |
|||
|
|||
=head1 TABLE: C<refund_lost_item_fee_rules> |
|||
|
|||
=cut |
|||
|
|||
__PACKAGE__->table("refund_lost_item_fee_rules"); |
|||
|
|||
=head1 ACCESSORS |
|||
|
|||
=head2 branchcode |
|||
|
|||
data_type: 'varchar' |
|||
default_value: (empty string) |
|||
is_nullable: 0 |
|||
size: 10 |
|||
|
|||
=head2 refund |
|||
|
|||
data_type: 'tinyint' |
|||
default_value: 0 |
|||
is_nullable: 0 |
|||
|
|||
=cut |
|||
|
|||
__PACKAGE__->add_columns( |
|||
"branchcode", |
|||
{ data_type => "varchar", default_value => "", is_nullable => 0, size => 10 }, |
|||
"refund", |
|||
{ data_type => "tinyint", default_value => 0, is_nullable => 0 }, |
|||
); |
|||
|
|||
=head1 PRIMARY KEY |
|||
|
|||
=over 4 |
|||
|
|||
=item * L</branchcode> |
|||
|
|||
=back |
|||
|
|||
=cut |
|||
|
|||
__PACKAGE__->set_primary_key("branchcode"); |
|||
|
|||
|
|||
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-05-31 02:45:35 |
|||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:K+2D3R+JxrovgvjdqA8xdw |
|||
|
|||
|
|||
# You can replace this text with custom code or comments, and it will be preserved on regeneration |
|||
1; |
@ -0,0 +1,14 @@ |
|||
$DBversion = 'XXX'; # will be replaced by the RM |
|||
if( CheckVersion( $DBversion ) ) { |
|||
if ( column_exists( 'refund_lost_item_fee_rules', 'refund' ) ) { |
|||
$dbh->do(" |
|||
INSERT INTO circulation_rules ( categorycode, branchcode, itemtype, rule_name, rule_value ) |
|||
SELECT NULL, branchcode, NULL, 'refund', refund |
|||
FROM refund_lost_item_fee_rules |
|||
"); |
|||
$dbh->do("DROP TABLE refund_lost_item_fee_rules"); |
|||
} |
|||
|
|||
SetVersion( $DBversion ); |
|||
print "Upgrade to $DBversion done (Bug 18930 - Move lost item refund rules to circulation_rules table)\n"; |
|||
} |
Loading…
Reference in new issue