diff --git a/installer/data/mysql/atomicupdate/bug_33664_CancelOrdersInClosedBaskets.pl b/installer/data/mysql/atomicupdate/bug_33664_CancelOrdersInClosedBaskets.pl new file mode 100755 index 0000000000..82b3e0c08c --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_33664_CancelOrdersInClosedBaskets.pl @@ -0,0 +1,22 @@ +use Modern::Perl; + +return { + bug_number => "33664", + description => "Allow cancelling of orders from closed baskets", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + # Do you stuffs here + $dbh->do( + q{ + INSERT IGNORE INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type` ) + VALUES + ('CancelOrdersInClosedBaskets', '0', NULL, 'Allow/Do not allow cancelling order lines in closed baskets.', 'YesNo') + } + ); + + # sysprefs + say $out "Added new system preference 'CancelOrdersInClosedBaskets'"; + }, +}; diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index 314efd51a8..50ab4e1521 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -130,6 +130,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('CanMarkHoldsToPullAsLost','do_not_allow','do_not_allow|allow|allow_and_notify','Add a button to the "Holds to pull" screen to mark an item as lost and notify the patron.','Choice'), ('canreservefromotherbranches','1','','With Independent branches on, can a user from one library place a hold on an item from another library','YesNo'), ('CardnumberLength', '', '', 'Set a length for card numbers with a maximum of 32 characters.', 'Free'), +('CancelOrdersInClosedBaskets', '0', NULL, 'Allow/Do not allow cancelling order lines in closed baskets.', 'YesNo'), ('casAuthentication','0','','Enable or disable CAS authentication','YesNo'), ('casLogout','0','','Does a logout from Koha should also log the user out of CAS?','YesNo'), ('casServerUrl','https://localhost:8443/cas','','URL of the cas server','Free'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt index 78e61ad302..1d5b546123 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt @@ -483,11 +483,11 @@ Supplier report [% END %] Place hold - [% IF ( active ) %] - [% UNLESS ( closedate ) %] + [% IF ( active && !closedate ) %] Modify - Cancel order - [% END %] + [% END %] + [% IF !closedate || Koha.Preference('CancelOrdersInClosedBaskets') %] + Cancel order [% END %] @@ -517,11 +517,11 @@   [% END %]   - [% IF ( active ) %] - [% UNLESS ( closedate ) %] -   -   - [% END %] + [% IF ( active && !closedate ) %] +   + [% END %] + [% IF !closedate || Koha.Preference('CancelOrdersInClosedBaskets') %] +   [% END %] [% END %] @@ -549,11 +549,11 @@   [% END %]   - [% IF ( active ) %] - [% UNLESS ( closedate ) %] -   -   - [% END %] + [% IF ( active && !closedate ) %] +   + [% END %] + [% IF !closedate || Koha.Preference('CancelOrdersInClosedBaskets') %] +   [% END %] @@ -686,42 +686,42 @@ [% END %] - [% IF ( active ) %] - [% UNLESS ( closedate ) %] - - [% UNLESS (books_loo.order_received) %] - Modify -
- Transfer + [% IF ( active && !closedate ) %] + + Modify + [% UNLESS (books_loo.order_received) %] +
+ Transfer + [% END %] + + [% END %] + [% IF ( !closedate || Koha.Preference('CancelOrdersInClosedBaskets') ) %] + + [% IF ( books_loo.orderstatus != "complete") %] + [% IF ( books_loo.left_holds_on_order ) %] + Can't cancel order
+ [% ELSE %] + Cancel order
[% END %] - - - [% IF ( books_loo.orderstatus != "complete") %] - [% IF ( books_loo.left_holds_on_order ) %] - Can't cancel order
- [% ELSE %] - Cancel order
- [% END %] - [% IF ( books_loo.can_del_bib ) %] - Cancel order and delete catalog record
- [% ELSE %] - Can't cancel order and delete catalog record
- [% END %] - [% IF ( books_loo.left_item ) %] - [% books_loo.items | html %] item(s) left
- [% END %] - [% IF ( books_loo.left_biblio ) %] - [% books_loo.biblios | html %] order(s) left
- [% END %] - [% IF ( books_loo.left_subscription ) %] - [% books_loo.subscriptions | html %] subscription(s) left
- [% END %] - [% IF ( books_loo.left_holds ) %] - [% books_loo.holds | html %] hold(s) left - [% END %] + [% IF ( books_loo.can_del_bib ) %] + Cancel order and delete catalog record
+ [% ELSE %] + Can't cancel order and delete catalog record
[% END %] - - [% END %] + [% IF ( books_loo.left_item ) %] + [% books_loo.items | html %] item(s) left
+ [% END %] + [% IF ( books_loo.left_biblio ) %] + [% books_loo.biblios | html %] order(s) left
+ [% END %] + [% IF ( books_loo.left_subscription ) %] + [% books_loo.subscriptions | html %] subscription(s) left
+ [% END %] + [% IF ( books_loo.left_holds ) %] + [% books_loo.holds | html %] hold(s) left + [% END %] + [% END %] + [% END %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref index b184d6dbe1..5e8897e2c2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref @@ -20,6 +20,12 @@ Acquisitions: choices: 1: always ask for confirmation. 2: do not ask for confirmation. + - + - pref: CancelOrdersInClosedBaskets + choices: + 1: Allow + 0: "Don't allow" + - cancelling order lines in closed baskets. - - Show baskets - pref: AcqViewBaskets