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

(-)a/C4/Acquisition.pm (-7 / +2 lines)
Lines 1770-1788 sub DelOrder { Link Here
1770
        SET    datecancellationprinted=now(), orderstatus='cancelled'
1770
        SET    datecancellationprinted=now(), orderstatus='cancelled'
1771
    ";
1771
    ";
1772
    if($reason) {
1772
    if($reason) {
1773
        $query .= "
1773
        $query .= ", cancellationreason = ? ";
1774
            , notes = IF(notes IS NULL,
1775
                CONCAT('Cancellation reason: ', ?),
1776
                CONCAT(notes, ' - Cancellation reason: ', ?)
1777
            )
1778
        ";
1779
    }
1774
    }
1780
    $query .= "
1775
    $query .= "
1781
        WHERE biblionumber=? AND ordernumber=?
1776
        WHERE biblionumber=? AND ordernumber=?
1782
    ";
1777
    ";
1783
    my $sth = $dbh->prepare($query);
1778
    my $sth = $dbh->prepare($query);
1784
    if($reason) {
1779
    if($reason) {
1785
        $sth->execute($reason, $reason, $bibnum, $ordernumber);
1780
        $sth->execute($reason, $bibnum, $ordernumber);
1786
    } else {
1781
    } else {
1787
        $sth->execute( $bibnum, $ordernumber );
1782
        $sth->execute( $bibnum, $ordernumber );
1788
    }
1783
    }
(-)a/acqui/cancelorder.pl (-5 lines)
Lines 33-43 use Modern::Perl; Link Here
33
use CGI;
33
use CGI;
34
use C4::Auth;
34
use C4::Auth;
35
use C4::Output;
35
use C4::Output;
36
# FIXME: C4::Search is needed by C4::Items::GetAnalyticsCount, which is called
37
# by C4::Acquisition::DelOrder. But C4::Search is not imported by C4::Items.
38
# Once this problem is resolved, the following line can be removed.
39
# See Bug 7847.
40
use C4::Search;
41
use C4::Acquisition;
36
use C4::Acquisition;
42
37
43
my $input = new CGI;
38
my $input = new CGI;
(-)a/installer/data/mysql/kohastructure.sql (+1 lines)
Lines 2994-2999 CREATE TABLE `aqorders` ( -- information related to the basket line items Link Here
2994
  `quantityreceived` smallint(6) NOT NULL default 0, -- the quantity that have been received so far
2994
  `quantityreceived` smallint(6) NOT NULL default 0, -- the quantity that have been received so far
2995
  `cancelledby` varchar(10) default NULL, -- not used? always NULL
2995
  `cancelledby` varchar(10) default NULL, -- not used? always NULL
2996
  `datecancellationprinted` date default NULL, -- the date the line item was deleted
2996
  `datecancellationprinted` date default NULL, -- the date the line item was deleted
2997
  cancellationreason text default NULL, -- reason of cancellation
2997
  `notes` mediumtext, -- notes related to this order line
2998
  `notes` mediumtext, -- notes related to this order line
2998
  `supplierreference` mediumtext, -- not used? always NULL
2999
  `supplierreference` mediumtext, -- not used? always NULL
2999
  `purchaseordernumber` mediumtext, -- not used? always NULL
3000
  `purchaseordernumber` mediumtext, -- not used? always NULL
(-)a/installer/data/mysql/updatedatabase.pl (+11 lines)
Lines 7912-7917 if ( CheckVersion($DBversion) ) { Link Here
7912
    SetVersion($DBversion);
7912
    SetVersion($DBversion);
7913
}
7913
}
7914
7914
7915
$DBversion = "XXX";
7916
if ( CheckVersion($DBversion) ) {
7917
    $dbh->do("
7918
        ALTER TABLE aqorders
7919
        ADD COLUMN cancellationreason TEXT DEFAULT NULL AFTER datecancellationprinted
7920
    ");
7921
    print "Upgrade to $DBversion done (Bug 7162: Add aqorders.cancellationreason)\n";
7922
    SetVersion($DBversion);
7923
}
7924
7925
7915
=head1 FUNCTIONS
7926
=head1 FUNCTIONS
7916
7927
7917
=head2 TableExists($table)
7928
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt (+4 lines)
Lines 571-576 Link Here
571
                        [% IF ( order.publishercode ) %], [% order.publishercode %][% END %]
571
                        [% IF ( order.publishercode ) %], [% order.publishercode %][% END %]
572
                        [% IF ( order.publicationyear ) %], [% order.publicationyear %][% END %]
572
                        [% IF ( order.publicationyear ) %], [% order.publicationyear %][% END %]
573
                        [% IF ( books_loo.editionstatement ) %], [% books_loo.editionstatement %][% END %]
573
                        [% IF ( books_loo.editionstatement ) %], [% books_loo.editionstatement %][% END %]
574
                        [% IF ( order.cancellationreason ) %]
575
                          <br />
576
                          Cancellation reason: [% order.cancellationreason %]
577
                        [% END %]
574
                      </p>
578
                      </p>
575
                      [% IF order.transferred_to %]
579
                      [% IF order.transferred_to %]
576
                        [% basket = order.transferred_to.basket %]
580
                        [% basket = order.transferred_to.basket %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/cancelorder.tt (-6 / +5 lines)
Lines 41-58 Link Here
41
      [% ELSE %]
41
      [% ELSE %]
42
        [% IF ( success_cancelorder ) %]
42
        [% IF ( success_cancelorder ) %]
43
            <div class="dialog message">
43
            <div class="dialog message">
44
                The order has been successfully canceled
44
                The order has been successfully cancelled
45
        [% ELSE %]
45
        [% ELSE %]
46
            <div class="dialog alert">
46
            <div class="dialog alert">
47
                An error has occured.
47
                An error has occurred.
48
                [% IF ( error_delitem ) %]
48
                [% IF ( error_delitem ) %]
49
                    <p>The order has been canceled, although one or more items could not have been deleted.</p>
49
                    <p>The order has been cancelled, although one or more items could not have been deleted.</p>
50
                [% END %]
50
                [% END %]
51
                [% IF ( error_delbiblio ) %]
51
                [% IF ( error_delbiblio ) %]
52
                <p>The order has been canceled, although the record has not been deleted.</p>
52
                <p>The order has been cancelled, although the record has not been deleted.</p>
53
                [% END %]
53
                [% END %]
54
        [% END %]
54
        [% END %]
55
                <p>Click <a href="[% referrer %]">here</a> to return to previous page</p>
55
                <p><a href="[% referrer %]">OK</a></p>
56
            </div>
56
            </div>
57
      [% END %]
57
      [% END %]
58
58
59
- 

Return to bug 7162