From a2165d95b3db932f58c1280ec252e3bc2f23ec87 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Mon, 7 Jul 2014 09:27:58 +0200 Subject: [PATCH] [PASSED QA] Bug 7162: Factorize code for order cancellation (QA fixes) Signed-off-by: Katrin Fischer Passes tests and QA script. Checked cancelling the orders from the basket and from the receive page. Both worked nicely. Cancellation reason is shown on the cancelled order line in the basket. Signed-off-by: Katrin Fischer --- acqui/addorder.pl | 8 ++++---- acqui/cancelorder.pl | 23 +++++++++++----------- .../prog/en/modules/acqui/cancelorder.tt | 4 ++-- t/db_dependent/Acquisition.t | 6 +++--- 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/acqui/addorder.pl b/acqui/addorder.pl index 3377c16..ccdc960 100755 --- a/acqui/addorder.pl +++ b/acqui/addorder.pl @@ -122,10 +122,10 @@ if it is an order from an existing suggestion : the id of this suggestion. use strict; use warnings; use CGI; -use C4::Auth; # get_template_and_user -use C4::Acquisition; # NewOrder ModOrder -use C4::Suggestions; # ModStatus -use C4::Biblio; # AddBiblio TransformKohaToMarc +use C4::Auth; # get_template_and_user +use C4::Acquisition; # NewOrder ModOrder +use C4::Suggestions; # ModStatus +use C4::Biblio; # AddBiblio TransformKohaToMarc use C4::Budgets; use C4::Items; use C4::Output; diff --git a/acqui/cancelorder.pl b/acqui/cancelorder.pl index c45b8da..a0b7597 100755 --- a/acqui/cancelorder.pl +++ b/acqui/cancelorder.pl @@ -1,20 +1,21 @@ #!/usr/bin/perl -# Copyright 2011 BibLibre SARL +# Copyright 2014 BibLibre +# # 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 2 of the License, or (at your option) any later -# version. +# 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. +# 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. +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . =head1 NAME diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/cancelorder.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/cancelorder.tt index 8df5f2c..7f36cd1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/cancelorder.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/cancelorder.tt @@ -34,8 +34,8 @@ [% IF (del_biblio) %] [% END %] - - + + [% ELSE %] diff --git a/t/db_dependent/Acquisition.t b/t/db_dependent/Acquisition.t index 8abb0e0..2f7539e 100755 --- a/t/db_dependent/Acquisition.t +++ b/t/db_dependent/Acquisition.t @@ -934,8 +934,8 @@ ok((defined $order1->{datecancellationprinted}), "order is cancelled"); ok((not defined $order1->{cancellationreason}), "order has no cancellation reason"); ok((defined GetBiblio($order1->{biblionumber})), "biblio still exists"); -my $order2 = GetOrder($ordernumbers[1]); -my $error = DelOrder($order2->{biblionumber}, $order2->{ordernumber}, 1); +$order2 = GetOrder($ordernumbers[1]); +$error = DelOrder($order2->{biblionumber}, $order2->{ordernumber}, 1); ok((not defined $error), "DelOrder does not fail"); $order2 = GetOrder($order2->{ordernumber}); ok((defined $order2->{datecancellationprinted}), "order is cancelled"); @@ -943,7 +943,7 @@ ok((not defined $order2->{cancellationreason}), "order has no cancellation reaso ok((not defined GetBiblio($order2->{biblionumber})), "biblio does not exist anymore"); my $order4 = GetOrder($ordernumbers[3]); -my $error = DelOrder($order4->{biblionumber}, $order4->{ordernumber}, 1, "foobar"); +$error = DelOrder($order4->{biblionumber}, $order4->{ordernumber}, 1, "foobar"); ok((not defined $error), "DelOrder does not fail"); $order4 = GetOrder($order4->{ordernumber}); ok((defined $order4->{datecancellationprinted}), "order is cancelled"); -- 1.9.1