@@ -, +, @@ having it in aqorders.notes, to avoid having untranslatable strings in database --- C4/Acquisition.pm | 9 ++------- acqui/cancelorder.pl | 5 ----- installer/data/mysql/kohastructure.sql | 1 + installer/data/mysql/updatedatabase.pl | 11 +++++++++++ koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt | 4 ++++ .../intranet-tmpl/prog/en/modules/acqui/cancelorder.tt | 10 +++++----- 6 files changed, 23 insertions(+), 17 deletions(-) --- a/C4/Acquisition.pm +++ a/C4/Acquisition.pm @@ -1768,19 +1768,14 @@ sub DelOrder { SET datecancellationprinted=now(), orderstatus='cancelled' "; if($reason) { - $query .= " - , notes = IF(notes IS NULL, - CONCAT('Cancellation reason: ', ?), - CONCAT(notes, ' - Cancellation reason: ', ?) - ) - "; + $query .= ", cancellationreason = ? "; } $query .= " WHERE biblionumber=? AND ordernumber=? "; my $sth = $dbh->prepare($query); if($reason) { - $sth->execute($reason, $reason, $bibnum, $ordernumber); + $sth->execute($reason, $bibnum, $ordernumber); } else { $sth->execute( $bibnum, $ordernumber ); } --- a/acqui/cancelorder.pl +++ a/acqui/cancelorder.pl @@ -33,11 +33,6 @@ use Modern::Perl; use CGI; use C4::Auth; use C4::Output; -# FIXME: C4::Search is needed by C4::Items::GetAnalyticsCount, which is called -# by C4::Acquisition::DelOrder. But C4::Search is not imported by C4::Items. -# Once this problem is resolved, the following line can be removed. -# See Bug 7847. -use C4::Search; use C4::Acquisition; my $input = new CGI; --- a/installer/data/mysql/kohastructure.sql +++ a/installer/data/mysql/kohastructure.sql @@ -2988,6 +2988,7 @@ CREATE TABLE `aqorders` ( -- information related to the basket line items `quantityreceived` smallint(6) NOT NULL default 0, -- the quantity that have been received so far `cancelledby` varchar(10) default NULL, -- not used? always NULL `datecancellationprinted` date default NULL, -- the date the line item was deleted + cancellationreason text default NULL, -- reason of cancellation `notes` mediumtext, -- notes related to this order line `supplierreference` mediumtext, -- not used? always NULL `purchaseordernumber` mediumtext, -- not used? always NULL --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -7743,6 +7743,17 @@ if(CheckVersion($DBversion)) { SetVersion($DBversion); } +$DBversion = "XXX"; +if ( CheckVersion($DBversion) ) { + $dbh->do(" + ALTER TABLE aqorders + ADD COLUMN cancellationreason TEXT DEFAULT NULL AFTER datecancellationprinted + "); + print "Upgrade to $DBversion done (Bug 7162: Add aqorders.cancellationreason)\n"; + SetVersion($DBversion); +} + + =head1 FUNCTIONS =head2 TableExists($table) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt @@ -528,6 +528,10 @@ [% IF ( order.publishercode ) %], [% order.publishercode %][% END %] [% IF ( order.publicationyear ) %], [% order.publicationyear %][% END %] [% IF ( books_loo.editionstatement ) %], [% books_loo.editionstatement %][% END %] + [% IF ( order.cancellationreason ) %] +
+ Cancellation reason: [% order.cancellationreason %] + [% END %]

[% IF order.transferred_to %] [% basket = order.transferred_to.basket %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/cancelorder.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/cancelorder.tt @@ -41,18 +41,18 @@ [% ELSE %] [% IF ( success_cancelorder ) %]
- The order has been successfully canceled + The order has been successfully cancelled [% ELSE %]
- An error has occured. + An error has occurred. [% IF ( error_delitem ) %] -

The order has been canceled, although one or more items could not have been deleted.

+

The order has been cancelled, although one or more items could not have been deleted.

[% END %] [% IF ( error_delbiblio ) %] -

The order has been canceled, although the record has not been deleted.

+

The order has been cancelled, although the record has not been deleted.

[% END %] [% END %] -

Click here to return to previous page

+

OK

[% END %] --