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

(-)a/C4/Acquisition.pm (-7 / +2 lines)
Lines 1841-1859 sub DelOrder { Link Here
1841
        SET    datecancellationprinted=now(), orderstatus='cancelled'
1841
        SET    datecancellationprinted=now(), orderstatus='cancelled'
1842
    ";
1842
    ";
1843
    if($reason) {
1843
    if($reason) {
1844
        $query .= "
1844
        $query .= ", cancellationreason = ? ";
1845
            , notes = IF(notes IS NULL,
1846
                CONCAT('Cancellation reason: ', ?),
1847
                CONCAT(notes, ' - Cancellation reason: ', ?)
1848
            )
1849
        ";
1850
    }
1845
    }
1851
    $query .= "
1846
    $query .= "
1852
        WHERE biblionumber=? AND ordernumber=?
1847
        WHERE biblionumber=? AND ordernumber=?
1853
    ";
1848
    ";
1854
    my $sth = $dbh->prepare($query);
1849
    my $sth = $dbh->prepare($query);
1855
    if($reason) {
1850
    if($reason) {
1856
        $sth->execute($reason, $reason, $bibnum, $ordernumber);
1851
        $sth->execute($reason, $bibnum, $ordernumber);
1857
    } else {
1852
    } else {
1858
        $sth->execute( $bibnum, $ordernumber );
1853
        $sth->execute( $bibnum, $ordernumber );
1859
    }
1854
    }
(-)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 3004-3009 CREATE TABLE `aqorders` ( -- information related to the basket line items Link Here
3004
  `quantityreceived` smallint(6) NOT NULL default 0, -- the quantity that have been received so far
3004
  `quantityreceived` smallint(6) NOT NULL default 0, -- the quantity that have been received so far
3005
  `cancelledby` varchar(10) default NULL, -- not used? always NULL
3005
  `cancelledby` varchar(10) default NULL, -- not used? always NULL
3006
  `datecancellationprinted` date default NULL, -- the date the line item was deleted
3006
  `datecancellationprinted` date default NULL, -- the date the line item was deleted
3007
  `cancellationreason` text default NULL, -- reason of cancellation
3007
  `order_internalnote` mediumtext, -- notes related to this order line, made for staff
3008
  `order_internalnote` mediumtext, -- notes related to this order line, made for staff
3008
  `order_vendornote` mediumtext, -- notes related to this order line, made for vendor
3009
  `order_vendornote` mediumtext, -- notes related to this order line, made for vendor
3009
  `supplierreference` mediumtext, -- not used? always NULL
3010
  `supplierreference` mediumtext, -- not used? always NULL
(-)a/installer/data/mysql/updatedatabase.pl (+11 lines)
Lines 8551-8556 if (CheckVersion($DBversion)) { Link Here
8551
    SetVersion($DBversion);
8551
    SetVersion($DBversion);
8552
}
8552
}
8553
8553
8554
$DBversion = "XXX";
8555
if ( CheckVersion($DBversion) ) {
8556
    $dbh->do("
8557
        ALTER TABLE aqorders
8558
        ADD COLUMN cancellationreason TEXT DEFAULT NULL AFTER datecancellationprinted
8559
    ");
8560
    print "Upgrade to $DBversion done (Bug 7162: Add aqorders.cancellationreason)\n";
8561
    SetVersion($DBversion);
8562
}
8563
8564
8554
=head1 FUNCTIONS
8565
=head1 FUNCTIONS
8555
8566
8556
=head2 TableExists($table)
8567
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt (+4 lines)
Lines 595-600 Link Here
595
                        [% IF ( order.publishercode ) %], [% order.publishercode %][% END %]
595
                        [% IF ( order.publishercode ) %], [% order.publishercode %][% END %]
596
                        [% IF ( order.publicationyear ) %], [% order.publicationyear %][% END %]
596
                        [% IF ( order.publicationyear ) %], [% order.publicationyear %][% END %]
597
                        [% IF ( books_loo.editionstatement ) %], [% books_loo.editionstatement %][% END %]
597
                        [% IF ( books_loo.editionstatement ) %], [% books_loo.editionstatement %][% END %]
598
                        [% IF ( order.cancellationreason ) %]
599
                          <br />
600
                          Cancellation reason: [% order.cancellationreason %]
601
                        [% END %]
598
                      </p>
602
                      </p>
599
                      [% IF order.transferred_to %]
603
                      [% IF order.transferred_to %]
600
                        [% basket = order.transferred_to.basket %]
604
                        [% 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