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 130-135 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
130
('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'),
130
('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'),
131
('canreservefromotherbranches','1','','With Independent branches on, can a user from one library place a hold on an item from another library','YesNo'),
131
('canreservefromotherbranches','1','','With Independent branches on, can a user from one library place a hold on an item from another library','YesNo'),
132
('CardnumberLength', '', '', 'Set a length for card numbers with a maximum of 32 characters.', 'Free'),
132
('CardnumberLength', '', '', 'Set a length for card numbers with a maximum of 32 characters.', 'Free'),
133
('CancelOrdersInClosedBaskets', '0', NULL, 'Allow/Do not allow cancelling order lines in closed baskets.', 'YesNo'),
133
('casAuthentication','0','','Enable or disable CAS authentication','YesNo'),
134
('casAuthentication','0','','Enable or disable CAS authentication','YesNo'),
134
('casLogout','0','','Does a logout from Koha should also log the user out of CAS?','YesNo'),
135
('casLogout','0','','Does a logout from Koha should also log the user out of CAS?','YesNo'),
135
('casServerUrl','https://localhost:8443/cas','','URL of the cas server','Free'),
136
('casServerUrl','https://localhost:8443/cas','','URL of the cas server','Free'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt (-48 / +48 lines)
Lines 483-493 Link Here
483
                                                        <th>Supplier report</th>
483
                                                        <th>Supplier report</th>
484
                                                    [% END %]
484
                                                    [% END %]
485
                                                    <th class="NoSort">Place hold</th>
485
                                                    <th class="NoSort">Place hold</th>
486
                                                    [% IF ( active ) %]
486
                                                    [% IF ( active && !closedate ) %]
487
                                                        [% UNLESS ( closedate ) %]
488
                                                            <th class="NoSort">Modify</th>
487
                                                            <th class="NoSort">Modify</th>
489
                                                            <th class="NoSort">Cancel order</th>
488
                                                    [% END %]
490
                                                        [% END %]
489
                                                    [% IF !closedate || Koha.Preference('CancelOrdersInClosedBaskets') %]
490
                                                        <th class="NoSort">Cancel order</th>
491
                                                    [% END %]
491
                                                    [% END %]
492
                                                </tr>
492
                                                </tr>
493
                                            </thead>
493
                                            </thead>
Lines 517-527 Link Here
517
                                                            <th>&nbsp;</th>
517
                                                            <th>&nbsp;</th>
518
                                                        [% END %]
518
                                                        [% END %]
519
                                                        <th>&nbsp;</th>
519
                                                        <th>&nbsp;</th>
520
                                                        [% IF ( active ) %]
520
                                                        [% IF ( active && !closedate ) %]
521
                                                            [% UNLESS ( closedate ) %]
521
                                                            <th>&nbsp;</th>
522
                                                                <th>&nbsp;</th>
522
                                                        [% END %]
523
                                                                <th>&nbsp;</th>
523
                                                        [% IF !closedate || Koha.Preference('CancelOrdersInClosedBaskets') %]
524
                                                            [% END %]
524
                                                            <th>&nbsp;</th>
525
                                                        [% END %]
525
                                                        [% END %]
526
                                                    </tr>
526
                                                    </tr>
527
                                                [% END %]
527
                                                [% END %]
Lines 549-559 Link Here
549
                                                        <th>&nbsp;</th>
549
                                                        <th>&nbsp;</th>
550
                                                    [% END %]
550
                                                    [% END %]
551
                                                    <th>&nbsp;</th>
551
                                                    <th>&nbsp;</th>
552
                                                    [% IF ( active ) %]
552
                                                    [% IF ( active && !closedate ) %]
553
                                                        [% UNLESS ( closedate ) %]
553
                                                        <th>&nbsp;</th>
554
                                                            <th>&nbsp;</th>
554
                                                    [% END %]
555
                                                            <th>&nbsp;</th>
555
                                                    [% IF !closedate || Koha.Preference('CancelOrdersInClosedBaskets') %]
556
                                                        [% END %]
556
                                                        <th>&nbsp;</th>
557
                                                    [% END %]
557
                                                    [% END %]
558
                                                </tr>
558
                                                </tr>
559
                                            </tfoot>
559
                                            </tfoot>
Lines 686-727 Link Here
686
                                                                </a>
686
                                                                </a>
687
                                                            [% END %]
687
                                                            [% END %]
688
                                                        </td>
688
                                                        </td>
689
                                                        [% IF ( active ) %]
689
                                                        [% IF ( active && !closedate ) %]
690
                                                            [% UNLESS ( closedate ) %]
690
                                                            <td>
691
                                                                <td>
691
                                                                <a href="neworderempty.pl?ordernumber=[% books_loo.ordernumber | uri %]&amp;booksellerid=[% booksellerid | uri %]&amp;basketno=[% basketno | uri %]">Modify</a>
692
                                                                    [% UNLESS (books_loo.order_received) %]
692
                                                                [% UNLESS (books_loo.order_received) %]
693
                                                                        <a href="neworderempty.pl?ordernumber=[% books_loo.ordernumber | uri %]&amp;booksellerid=[% booksellerid | uri %]&amp;basketno=[% basketno | uri %]">Modify</a>
693
                                                                    <br />
694
                                                                        <br />
694
                                                                    <a href="#" class="transfer_order" data-ordernumber="[% books_loo.ordernumber | html %]">Transfer</a>
695
                                                                        <a href="#" class="transfer_order" data-ordernumber="[% books_loo.ordernumber | html %]">Transfer</a>
695
                                                                [% END %]
696
                                                            </td>
697
                                                        [% END %]
698
                                                        [% IF ( !closedate || Koha.Preference('CancelOrdersInClosedBaskets') ) %]
699
                                                            <td>
700
                                                                [% IF ( books_loo.orderstatus != "complete") %]
701
                                                                    [% IF ( books_loo.left_holds_on_order ) %]
702
                                                                        <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>
703
                                                                    [% ELSE %]
704
                                                                        <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>
696
                                                                    [% END %]
705
                                                                    [% END %]
697
                                                                </td>
706
                                                                    [% IF ( books_loo.can_del_bib ) %]
698
                                                                <td>
707
                                                                        <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>
699
                                                                    [% IF ( books_loo.orderstatus != "complete") %]
708
                                                                    [% ELSE %]
700
                                                                        [% IF ( books_loo.left_holds_on_order ) %]
709
                                                                        <span class="button" title="Can't delete catalog record, see constraints below">Can't cancel order and delete catalog record</span><br>
701
                                                                            <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>
702
                                                                        [% ELSE %]
703
                                                                            <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>
704
                                                                        [% END %]
705
                                                                        [% IF ( books_loo.can_del_bib ) %]
706
                                                                            <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>
707
                                                                        [% ELSE %]
708
                                                                            <span class="button" title="Can't delete catalog record, see constraints below">Can't cancel order and delete catalog record</span><br>
709
                                                                        [% END %]
710
                                                                        [% IF ( books_loo.left_item ) %]
711
                                                                            <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>
712
                                                                        [% END %]
713
                                                                        [% IF ( books_loo.left_biblio ) %]
714
                                                                            <strong title="Can't delete catalog record, delete other orders linked to it first">[% books_loo.biblios | html %] order(s) left</strong><br>
715
                                                                        [% END %]
716
                                                                        [% IF ( books_loo.left_subscription ) %]
717
                                                                            <strong title="Can't delete catalog record, delete subscriptions first">[% books_loo.subscriptions | html %] subscription(s) left</strong><br>
718
                                                                        [% END %]
719
                                                                        [% IF ( books_loo.left_holds ) %]
720
                                                                            <strong title="Can't delete catalog record or order, cancel holds first">[% books_loo.holds | html %] hold(s) left</strong>
721
                                                                        [% END %]
722
                                                                    [% END %]
710
                                                                    [% END %]
723
                                                                </td>
711
                                                                    [% IF ( books_loo.left_item ) %]
724
                                                            [% END %]
712
                                                                        <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>
713
                                                                    [% END %]
714
                                                                    [% IF ( books_loo.left_biblio ) %]
715
                                                                        <strong title="Can't delete catalog record, delete other orders linked to it first">[% books_loo.biblios | html %] order(s) left</strong><br>
716
                                                                    [% END %]
717
                                                                    [% IF ( books_loo.left_subscription ) %]
718
                                                                        <strong title="Can't delete catalog record, delete subscriptions first">[% books_loo.subscriptions | html %] subscription(s) left</strong><br>
719
                                                                    [% END %]
720
                                                                    [% IF ( books_loo.left_holds ) %]
721
                                                                        <strong title="Can't delete catalog record or order, cancel holds first">[% books_loo.holds | html %] hold(s) left</strong>
722
                                                                    [% END %]
723
                                                                [% END %]
724
                                                            </td>
725
                                                        [% END %]
725
                                                        [% END %]
726
                                                    </tr>
726
                                                    </tr>
727
                                                [% END %]
727
                                                [% 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