Bugzilla – Attachment 154045 Details for
Bug 33664
Add ability to cancel order lines in closed baskets
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33664: Add ability to cancel order lines in closed baskets
Bug-33664-Add-ability-to-cancel-order-lines-in-clo.patch (text/plain), 18.07 KB, created by
Katrin Fischer
on 2023-07-28 16:16:33 UTC
(
hide
)
Description:
Bug 33664: Add ability to cancel order lines in closed baskets
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2023-07-28 16:16:33 UTC
Size:
18.07 KB
patch
obsolete
>From b315bc676b16cf95a67be1151060d1fe05fab722 Mon Sep 17 00:00:00 2001 >From: Katrin Fischer <katrin.fischer@bsz-bw.de> >Date: Fri, 28 Jul 2023 15:39:38 +0000 >Subject: [PATCH] Bug 33664: Add ability to cancel order lines in closed > baskets > >At the moment it's only possible to cancel order lines while the >basket is still open or from the pending orders page during processing >a shipment. The latter requires you to add a shipment and fake an >invoice. To make things easier we want to optionally allow cancelling >order lines in closed baskets from the basket summary page. > >Before applying the patch: > >1) Set up data >* Create a new basket >* Create a few order lines, at least 3 >* Close the basket >* Receive shipment and receive one order line > >2) Verify current behaviour >* On basket summary page: you cannot cancel while the basket is closed >* On the pending orders page you can cancel > >Apply patch, run database update, restart_all > >3) Verify new behaviour >* Verify that nothing has changed on pending orders and basket summary >* Switch new system preference CancelOrdersInClosedBaskets to "Allow" >* Verify that pending orders hasn't changed a bit >* Verify that you now can cancel your order lines in the closed basket > Exception: the received order line should not be cancellable > >Test anything else that you think might make sense ;) >--- > .../bug_33664_CancelOrdersInClosedBaskets.pl | 22 +++++ > installer/data/mysql/mandatory/sysprefs.sql | 1 + > .../prog/en/modules/acqui/basket.tt | 94 +++++++++---------- > .../admin/preferences/acquisitions.pref | 6 ++ > 4 files changed, 76 insertions(+), 47 deletions(-) > create mode 100755 installer/data/mysql/atomicupdate/bug_33664_CancelOrdersInClosedBaskets.pl > >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 30197591a8..82de5eadb2 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -127,6 +127,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 604d1a2f36..868e22762e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >@@ -475,11 +475,11 @@ > [% IF Koha.Preference('EDIFACT') && ediaccount %] > <th>Supplier report</th> > [% END %] >- [% IF ( active ) %] >- [% UNLESS ( closedate ) %] >- <th class="NoSort">Modify</th> >- <th class="NoSort">Cancel order</th> >- [% END %] >+ [% IF ( active && !closedate ) %] >+ <th> </th> >+ [% END %] >+ [% IF !closedate || Koha.Preference('CancelOrdersInClosedBaskets') %] >+ <th> </th> > [% END %] > </tr> > </thead> >@@ -505,11 +505,11 @@ > [% IF Koha.Preference('EDIFACT') && ediaccount %] > <th> </th> > [% END %] >- [% IF ( active ) %] >- [% UNLESS ( closedate ) %] >+ [% IF ( active && !closedate ) %] > <th> </th> >- <th> </th> >- [% END %] >+ [% END %] >+ [% IF !closedate || Koha.Preference('CancelOrdersInClosedBaskets') %] >+ <th> </th> > [% END %] > </tr> > [% END %] >@@ -533,11 +533,11 @@ > [% IF Koha.Preference('EDIFACT') && ediaccount %] > <th> </th> > [% END %] >- [% IF ( active ) %] >- [% UNLESS ( closedate ) %] >+ [% IF ( active && !closedate ) %] > <th> </th> >- <th> </th> >- [% END %] >+ [% END %] >+ [% IF !closedate || Koha.Preference('CancelOrdersInClosedBaskets') %] >+ <th> </th> > [% END %] > </tr> > </tfoot> >@@ -653,42 +653,42 @@ > [% IF Koha.Preference('EDIFACT') && ediaccount %] > <td>[% books_loo.suppliers_report | html %]</td> > [% END %] >- [% IF ( active ) %] >- [% UNLESS ( closedate ) %] >- <td> >- <a href="neworderempty.pl?ordernumber=[% books_loo.ordernumber | uri %]&booksellerid=[% booksellerid | uri %]&basketno=[% basketno | uri %]">Modify</a> >- [% UNLESS (books_loo.order_received) %] >- <br /> >- <a href="#" class="transfer_order" data-ordernumber="[% books_loo.ordernumber | html %]">Transfer</a> >+ [% IF ( active && !closedate ) %] >+ <td> >+ <a href="neworderempty.pl?ordernumber=[% books_loo.ordernumber | uri %]&booksellerid=[% booksellerid | uri %]&basketno=[% basketno | uri %]">Modify</a> >+ [% UNLESS (books_loo.order_received) %] >+ <br /> >+ <a href="#" class="transfer_order" data-ordernumber="[% books_loo.ordernumber | html %]">Transfer</a> >+ [% END %] >+ </td> >+ [% END %] >+ [% IF ( !closedate || Koha.Preference('CancelOrdersInClosedBaskets') ) %] >+ <td> >+ [% IF ( books_loo.orderstatus != "complete") %] >+ [% IF ( books_loo.left_holds_on_order ) %] >+ <span class="button" title="Can't cancel order, ([% books_loo.holds_on_order | html %]) holds are linked with this order. Cancel holds first">Can't cancel order</span><br> >+ [% ELSE %] >+ <a href="/cgi-bin/koha/acqui/cancelorder.pl?ordernumber=[% books_loo.ordernumber | uri %]&biblionumber=[% books_loo.biblionumber | uri %]&basketno=[% basketno | uri %]&referrer=/cgi-bin/koha/acqui/basket.pl%3Fbasketno=[% basketno | uri %]" class="button">Cancel order</a><br> > [% END %] >- </td> >- <td> >- [% IF ( books_loo.orderstatus != "complete") %] >- [% IF ( books_loo.left_holds_on_order ) %] >- <span class="button" title="Can't cancel order, ([% books_loo.holds_on_order | html %]) holds are linked with this order. Cancel holds first">Can't cancel order</span><br> >- [% ELSE %] >- <a href="/cgi-bin/koha/acqui/cancelorder.pl?ordernumber=[% books_loo.ordernumber | uri %]&biblionumber=[% books_loo.biblionumber | uri %]&basketno=[% basketno | uri %]&referrer=/cgi-bin/koha/acqui/basket.pl%3Fbasketno=[% basketno | uri %]" class="button">Cancel order</a><br> >- [% END %] >- [% IF ( books_loo.can_del_bib ) %] >- <a href="/cgi-bin/koha/acqui/cancelorder.pl?ordernumber=[% books_loo.ordernumber | uri %]&biblionumber=[% books_loo.biblionumber | uri %]&basketno=[% basketno | uri %]&del_biblio=1&referrer=/cgi-bin/koha/acqui/basket.pl%3Fbasketno=[% basketno | uri %]" class="button">Cancel order and delete catalog record</a><br> >- [% ELSE %] >- <span class="button" title="Can't delete catalog record, see constraints below">Can't cancel order and delete catalog record</span><br> >- [% END %] >- [% IF ( books_loo.left_item ) %] >- <strong title="Can't delete catalog record, because of [% books_loo.items | html %] existing hold(s)" >[% books_loo.items | html %] item(s) left</strong><br> >- [% END %] >- [% IF ( books_loo.left_biblio ) %] >- <strong title="Can't delete catalog record, delete other orders linked to it first">[% books_loo.biblios | html %] order(s) left</strong><br> >- [% END %] >- [% IF ( books_loo.left_subscription ) %] >- <strong title="Can't delete catalog record, delete subscriptions first">[% books_loo.subscriptions | html %] subscription(s) left</strong><br> >- [% END %] >- [% IF ( books_loo.left_holds ) %] >- <strong title="Can't delete catalog record or order, cancel holds first">[% books_loo.holds | html %] hold(s) left</strong> >- [% END %] >+ [% IF ( books_loo.can_del_bib ) %] >+ <a href="/cgi-bin/koha/acqui/cancelorder.pl?ordernumber=[% books_loo.ordernumber | uri %]&biblionumber=[% books_loo.biblionumber | uri %]&basketno=[% basketno | uri %]&del_biblio=1&referrer=/cgi-bin/koha/acqui/basket.pl%3Fbasketno=[% basketno | uri %]" class="button">Cancel order and delete catalog record</a><br> >+ [% ELSE %] >+ <span class="button" title="Can't delete catalog record, see constraints below">Can't cancel order and delete catalog record</span><br> > [% END %] >- </td> >- [% END %] >+ [% IF ( books_loo.left_item ) %] >+ <strong title="Can't delete catalog record, because of [% books_loo.items | html %] existing hold(s)" >[% books_loo.items | html %] item(s) left</strong><br> >+ [% END %] >+ [% IF ( books_loo.left_biblio ) %] >+ <strong title="Can't delete catalog record, delete other orders linked to it first">[% books_loo.biblios | html %] order(s) left</strong><br> >+ [% END %] >+ [% IF ( books_loo.left_subscription ) %] >+ <strong title="Can't delete catalog record, delete subscriptions first">[% books_loo.subscriptions | html %] subscription(s) left</strong><br> >+ [% END %] >+ [% IF ( books_loo.left_holds ) %] >+ <strong title="Can't delete catalog record or order, cancel holds first">[% books_loo.holds | html %] hold(s) left</strong> >+ [% END %] >+ [% END %] >+ </td> > [% END %] > </tr> > [% 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 4e2c18512e..70f6b9dbc5 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 >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 33664
:
154045
|
154053
|
157979
|
158075
|
158076
|
158077
|
158078