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

(-)a/installer/data/mysql/updatedatabase.pl (+35 lines)
Lines 9585-9590 if ( CheckVersion($DBversion) ) { Link Here
9585
    SetVersion ($DBversion);
9585
    SetVersion ($DBversion);
9586
}
9586
}
9587
9587
9588
$DBversion = "3.19.00.XXX";
9589
if(CheckVersion($DBversion)) {
9590
    $dbh->do(q{
9591
        INSERT INTO authorised_values (category, authorised_value, lib) VALUES
9592
         ('ORDER_CANCELLATION_REASON', 0, 'No reason'),
9593
         ('ORDER_CANCELLATION_REASON', 1, 'Sold out'),
9594
         ('ORDER_CANCELLATION_REASON', 2, 'Restocking')
9595
    });
9596
9597
    my $already_existing_reasons = $dbh->selectcol_arrayref(q{
9598
        SELECT DISTINCT( cancellationreason )
9599
        FROM aqorders;
9600
    }, { Slice => {} });
9601
9602
    my $update_orders_sth = $dbh->prepare(q{
9603
        UPDATE aqorders
9604
        SET cancellationreason = ?
9605
        WHERE cancellationreason = ?
9606
    });
9607
9608
    my $insert_av_sth = $dbh->prepare(q{
9609
        INSERT INTO authorised_values (category, authorised_value, lib) VALUES
9610
         ('ORDER_CANCELLATION_REASON', ?, ?)
9611
    });
9612
    my $i = 3;
9613
    for my $reason ( @$already_existing_reasons ) {
9614
        next unless $reason;
9615
        $insert_av_sth->execute( $i, $reason );
9616
        $update_orders_sth->execute( $i, $reason );
9617
        $i++;
9618
    }
9619
    print "Upgrade to $DBversion done (Bug XXXXX - Add the ORDER_CANCELLATION_REASON authorised value)\n";
9620
    SetVersion($DBversion);
9621
}
9622
9588
=head1 FUNCTIONS
9623
=head1 FUNCTIONS
9589
9624
9590
=head2 TableExists($table)
9625
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt (-1 / +2 lines)
Lines 1-4 Link Here
1
[% USE KohaDates %]
1
[% USE KohaDates %]
2
[% USE AuthorisedValues %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
[% INCLUDE 'doc-head-open.inc' %]
3
<title>Koha &rsaquo; Acquisitions &rsaquo; [% UNLESS ( basketno ) %]New [% END %][% IF ( delete_confirm ) %]Delete [% END %]Basket [% basketname|html %] ([% basketno %]) for [% name|html %]</title>
4
<title>Koha &rsaquo; Acquisitions &rsaquo; [% UNLESS ( basketno ) %]New [% END %][% IF ( delete_confirm ) %]Delete [% END %]Basket [% basketname|html %] ([% basketno %]) for [% name|html %]</title>
4
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
5
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
Lines 597-603 Link Here
597
                        [% IF ( books_loo.editionstatement ) %], [% books_loo.editionstatement %][% END %]
598
                        [% IF ( books_loo.editionstatement ) %], [% books_loo.editionstatement %][% END %]
598
                        [% IF ( order.cancellationreason ) %]
599
                        [% IF ( order.cancellationreason ) %]
599
                          <br />
600
                          <br />
600
                          Cancellation reason: [% order.cancellationreason %]
601
                          Cancellation reason: [% AuthorisedValues.GetByCode( 'ORDER_CANCELLATION_REASON', order.cancellationreason ) %]
601
                        [% END %]
602
                        [% END %]
602
                      </p>
603
                      </p>
603
                      [% IF order.transferred_to %]
604
                      [% IF order.transferred_to %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/cancelorder.tt (-2 / +1 lines)
Lines 25-31 Link Here
25
            [% END %]
25
            [% END %]
26
          </p>
26
          </p>
27
          <p>
27
          <p>
28
            <textarea name="reason" placeholder="Reason of cancellation"></textarea>
28
            [% PROCESS 'av-build-dropbox.inc' name="reason", category="ORDER_CANCELLATION_REASON" default="0" %]
29
          </p>
29
          </p>
30
          <input type="hidden" name="action" value="confirmcancel" />
30
          <input type="hidden" name="action" value="confirmcancel" />
31
          <input type="hidden" value="[% ordernumber %]" name="ordernumber" />
31
          <input type="hidden" value="[% ordernumber %]" name="ordernumber" />
32
- 

Return to bug 13380