View | Details | Raw Unified | Return to bug 33664
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/bug_33664_CancelOrdersInClosedBaskets.pl (+22 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "33664",
5
    description => "Allow cancelling of orders from closed baskets",
6
    up          => sub {
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
10
        # Do you stuffs here
11
        $dbh->do(
12
            q{
13
            INSERT IGNORE INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type` )
14
            VALUES
15
            ('CancelOrdersInClosedBaskets', '0', NULL, 'Allow/Do not allow cancelling order lines in closed baskets.', 'YesNo')
16
        }
17
        );
18
19
        # sysprefs
20
        say $out "Added new system preference 'CancelOrdersInClosedBaskets'";
21
    },
22
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 127-132 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
127
('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'),
127
('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'),
128
('canreservefromotherbranches','1','','With Independent branches on, can a user from one library place a hold on an item from another library','YesNo'),
128
('canreservefromotherbranches','1','','With Independent branches on, can a user from one library place a hold on an item from another library','YesNo'),
129
('CardnumberLength', '', '', 'Set a length for card numbers with a maximum of 32 characters.', 'Free'),
129
('CardnumberLength', '', '', 'Set a length for card numbers with a maximum of 32 characters.', 'Free'),
130
('CancelOrdersInClosedBaskets', '0', NULL, 'Allow/Do not allow cancelling order lines in closed baskets.', 'YesNo'),
130
('casAuthentication','0','','Enable or disable CAS authentication','YesNo'),
131
('casAuthentication','0','','Enable or disable CAS authentication','YesNo'),
131
('casLogout','0','','Does a logout from Koha should also log the user out of CAS?','YesNo'),
132
('casLogout','0','','Does a logout from Koha should also log the user out of CAS?','YesNo'),
132
('casServerUrl','https://localhost:8443/cas','','URL of the cas server','Free'),
133
('casServerUrl','https://localhost:8443/cas','','URL of the cas server','Free'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt (-47 / +47 lines)
Lines 475-485 Link Here
475
                                                    [% IF Koha.Preference('EDIFACT') && ediaccount %]
475
                                                    [% IF Koha.Preference('EDIFACT') && ediaccount %]
476
                                                        <th>Supplier report</th>
476
                                                        <th>Supplier report</th>
477
                                                    [% END %]
477
                                                    [% END %]
478
                                                    [% IF ( active ) %]
478
                                                    [% IF ( active && !closedate ) %]
479
                                                        [% UNLESS ( closedate ) %]
479
                                                            <th>&nbsp;</th>
480
                                                            <th class="NoSort">Modify</th>
480
                                                    [% END %]
481
                                                            <th class="NoSort">Cancel order</th>
481
                                                    [% IF !closedate || Koha.Preference('CancelOrdersInClosedBaskets') %]
482
                                                        [% END %]
482
                                                        <th>&nbsp;</th>
483
                                                    [% END %]
483
                                                    [% END %]
484
                                                </tr>
484
                                                </tr>
485
                                            </thead>
485
                                            </thead>
Lines 505-515 Link Here
505
                                                        [% IF Koha.Preference('EDIFACT') && ediaccount %]
505
                                                        [% IF Koha.Preference('EDIFACT') && ediaccount %]
506
                                                            <th>&nbsp;</th>
506
                                                            <th>&nbsp;</th>
507
                                                        [% END %]
507
                                                        [% END %]
508
                                                        [% IF ( active ) %]
508
                                                        [% IF ( active && !closedate ) %]
509
                                                            [% UNLESS ( closedate ) %]
510
                                                                <th>&nbsp;</th>
509
                                                                <th>&nbsp;</th>
511
                                                                <th>&nbsp;</th>
510
                                                        [% END %]
512
                                                            [% END %]
511
                                                        [% IF !closedate || Koha.Preference('CancelOrdersInClosedBaskets') %]
512
                                                            <th>&nbsp;</th>
513
                                                        [% END %]
513
                                                        [% END %]
514
                                                    </tr>
514
                                                    </tr>
515
                                                [% END %]
515
                                                [% END %]
Lines 533-543 Link Here
533
                                                    [% IF Koha.Preference('EDIFACT') && ediaccount %]
533
                                                    [% IF Koha.Preference('EDIFACT') && ediaccount %]
534
                                                        <th>&nbsp;</th>
534
                                                        <th>&nbsp;</th>
535
                                                    [% END %]
535
                                                    [% END %]
536
                                                    [% IF ( active ) %]
536
                                                    [% IF ( active && !closedate ) %]
537
                                                        [% UNLESS ( closedate ) %]
538
                                                            <th>&nbsp;</th>
537
                                                            <th>&nbsp;</th>
539
                                                            <th>&nbsp;</th>
538
                                                    [% END %]
540
                                                        [% END %]
539
                                                    [% IF !closedate || Koha.Preference('CancelOrdersInClosedBaskets') %]
540
                                                        <th>&nbsp;</th>
541
                                                    [% END %]
541
                                                    [% END %]
542
                                                </tr>
542
                                                </tr>
543
                                            </tfoot>
543
                                            </tfoot>
Lines 653-694 Link Here
653
                                                        [% IF Koha.Preference('EDIFACT') && ediaccount %]
653
                                                        [% IF Koha.Preference('EDIFACT') && ediaccount %]
654
                                                            <td>[% books_loo.suppliers_report | html %]</td>
654
                                                            <td>[% books_loo.suppliers_report | html %]</td>
655
                                                        [% END %]
655
                                                        [% END %]
656
                                                        [% IF ( active ) %]
656
                                                        [% IF ( active && !closedate ) %]
657
                                                            [% UNLESS ( closedate ) %]
657
                                                            <td>
658
                                                                <td>
658
                                                                <a href="neworderempty.pl?ordernumber=[% books_loo.ordernumber | uri %]&amp;booksellerid=[% booksellerid | uri %]&amp;basketno=[% basketno | uri %]">Modify</a>
659
                                                                    <a href="neworderempty.pl?ordernumber=[% books_loo.ordernumber | uri %]&amp;booksellerid=[% booksellerid | uri %]&amp;basketno=[% basketno | uri %]">Modify</a>
659
                                                                [% UNLESS (books_loo.order_received) %]
660
                                                                    [% UNLESS (books_loo.order_received) %]
660
                                                                    <br />
661
                                                                        <br />
661
                                                                    <a href="#" class="transfer_order" data-ordernumber="[% books_loo.ordernumber | html %]">Transfer</a>
662
                                                                        <a href="#" class="transfer_order" data-ordernumber="[% books_loo.ordernumber | html %]">Transfer</a>
662
                                                                [% END %]
663
                                                            </td>
664
                                                        [% END %]
665
                                                        [% IF ( !closedate || Koha.Preference('CancelOrdersInClosedBaskets') ) %]
666
                                                            <td>
667
                                                                [% IF ( books_loo.orderstatus != "complete") %]
668
                                                                    [% IF ( books_loo.left_holds_on_order ) %]
669
                                                                        <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>
670
                                                                    [% ELSE %]
671
                                                                        <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>
663
                                                                    [% END %]
672
                                                                    [% END %]
664
                                                                </td>
673
                                                                    [% IF ( books_loo.can_del_bib ) %]
665
                                                                <td>
674
                                                                        <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>
666
                                                                    [% IF ( books_loo.orderstatus != "complete") %]
675
                                                                    [% ELSE %]
667
                                                                        [% IF ( books_loo.left_holds_on_order ) %]
676
                                                                        <span class="button" title="Can't delete catalog record, see constraints below">Can't cancel order and delete catalog record</span><br>
668
                                                                            <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>
669
                                                                        [% ELSE %]
670
                                                                            <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>
671
                                                                        [% END %]
672
                                                                        [% IF ( books_loo.can_del_bib ) %]
673
                                                                            <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>
674
                                                                        [% ELSE %]
675
                                                                            <span class="button" title="Can't delete catalog record, see constraints below">Can't cancel order and delete catalog record</span><br>
676
                                                                        [% END %]
677
                                                                        [% IF ( books_loo.left_item ) %]
678
                                                                            <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>
679
                                                                        [% END %]
680
                                                                        [% IF ( books_loo.left_biblio ) %]
681
                                                                            <strong title="Can't delete catalog record, delete other orders linked to it first">[% books_loo.biblios | html %] order(s) left</strong><br>
682
                                                                        [% END %]
683
                                                                        [% IF ( books_loo.left_subscription ) %]
684
                                                                            <strong title="Can't delete catalog record, delete subscriptions first">[% books_loo.subscriptions | html %] subscription(s) left</strong><br>
685
                                                                        [% END %]
686
                                                                        [% IF ( books_loo.left_holds ) %]
687
                                                                            <strong title="Can't delete catalog record or order, cancel holds first">[% books_loo.holds | html %] hold(s) left</strong>
688
                                                                        [% END %]
689
                                                                    [% END %]
677
                                                                    [% END %]
690
                                                                </td>
678
                                                                    [% IF ( books_loo.left_item ) %]
691
                                                            [% END %]
679
                                                                        <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>
680
                                                                    [% END %]
681
                                                                    [% IF ( books_loo.left_biblio ) %]
682
                                                                        <strong title="Can't delete catalog record, delete other orders linked to it first">[% books_loo.biblios | html %] order(s) left</strong><br>
683
                                                                    [% END %]
684
                                                                    [% IF ( books_loo.left_subscription ) %]
685
                                                                        <strong title="Can't delete catalog record, delete subscriptions first">[% books_loo.subscriptions | html %] subscription(s) left</strong><br>
686
                                                                    [% END %]
687
                                                                    [% IF ( books_loo.left_holds ) %]
688
                                                                        <strong title="Can't delete catalog record or order, cancel holds first">[% books_loo.holds | html %] hold(s) left</strong>
689
                                                                    [% END %]
690
                                                                [% END %]
691
                                                            </td>
692
                                                        [% END %]
692
                                                        [% END %]
693
                                                    </tr>
693
                                                    </tr>
694
                                                [% END %]
694
                                                [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref (-1 / +6 lines)
Lines 20-25 Acquisitions: Link Here
20
              choices:
20
              choices:
21
                  1: always ask for confirmation.
21
                  1: always ask for confirmation.
22
                  2: do not ask for confirmation.
22
                  2: do not ask for confirmation.
23
        -
24
            - pref: CancelOrdersInClosedBaskets
25
              choices:
26
                  1: Allow
27
                  0: "Don't allow"
28
            - cancelling order lines in closed baskets.
23
        -
29
        -
24
            - Show baskets
30
            - Show baskets
25
            - pref: AcqViewBaskets
31
            - pref: AcqViewBaskets
26
- 

Return to bug 33664