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

(-)a/C4/Acquisition.pm (-1 / +9 lines)
Lines 2014-2019 sub GetHistory { Link Here
2014
    my $basketgroupname = $params{basketgroupname};
2014
    my $basketgroupname = $params{basketgroupname};
2015
    my $budget = $params{budget};
2015
    my $budget = $params{budget};
2016
    my $orderstatus = $params{orderstatus};
2016
    my $orderstatus = $params{orderstatus};
2017
    my $biblionumber = $params{biblionumber};
2018
    my $get_canceled_order = $params{get_canceled_order} || 0;
2017
2019
2018
    my @order_loop;
2020
    my @order_loop;
2019
    my $total_qty         = 0;
2021
    my $total_qty         = 0;
Lines 2066-2075 sub GetHistory { Link Here
2066
2068
2067
    $query .= " WHERE 1 ";
2069
    $query .= " WHERE 1 ";
2068
2070
2069
    $query .= " AND (datecancellationprinted is NULL or datecancellationprinted='0000-00-00') " if $orderstatus ne 'cancelled';
2071
    $query .= " AND (datecancellationprinted is NULL or datecancellationprinted='0000-00-00') "
2072
        if not $get_canceled_order or ( defined $orderstatus and $orderstatus ne 'cancelled' );
2070
2073
2071
    my @query_params  = ();
2074
    my @query_params  = ();
2072
2075
2076
    if ( $biblionumber ) {
2077
        $query .= " AND biblio.biblionumber = ?";
2078
        push @query_params, $biblionumber;
2079
    }
2080
2073
    if ( $title ) {
2081
    if ( $title ) {
2074
        $query .= " AND biblio.title LIKE ? ";
2082
        $query .= " AND biblio.title LIKE ? ";
2075
        $title =~ s/\s+/%/g;
2083
        $title =~ s/\s+/%/g;
(-)a/catalogue/detail.pl (-2 / +14 lines)
Lines 20-25 use strict; Link Here
20
use warnings;
20
use warnings;
21
21
22
use CGI;
22
use CGI;
23
use C4::Acquisition qw( GetHistory GetItemnumbersFromOrder );
23
use C4::Auth;
24
use C4::Auth;
24
use C4::Dates qw/format_date/;
25
use C4::Dates qw/format_date/;
25
use C4::Koha;
26
use C4::Koha;
Lines 43-50 use Koha::DateUtils; Link Here
43
use C4::HTML5Media;
44
use C4::HTML5Media;
44
use C4::CourseReserves qw(GetItemCourseReservesInfo);
45
use C4::CourseReserves qw(GetItemCourseReservesInfo);
45
46
46
# use Smart::Comments;
47
48
my $query = CGI->new();
47
my $query = CGI->new();
49
48
50
my $analyze = $query->param('analyze');
49
my $analyze = $query->param('analyze');
Lines 165-170 foreach my $subscription (@subscriptions) { Link Here
165
    push @subs, \%cell;
164
    push @subs, \%cell;
166
}
165
}
167
166
167
168
# Get acquisition details
169
my ( $orders, $qty, $price, $received ) = C4::Acquisition::GetHistory( biblionumber => $biblionumber, get_canceled_order => 1 );
170
if ( C4::Context->preference('AcqCreateItem') eq 'ordering' ) {
171
    for my $order ( @$orders ) {
172
        $order->{itemnumbers} = [ C4::Acquisition::GetItemnumbersFromOrder( $order->{ordernumber} ) ];
173
    }
174
}
175
$template->param(
176
    orders => $orders,
177
    AcquisitionDetails => C4::Context->preference('AcquisitionDetails'),
178
);
179
168
if ( defined $dat->{'itemtype'} ) {
180
if ( defined $dat->{'itemtype'} ) {
169
    $dat->{imageurl} = getitemtypeimagelocation( 'intranet', $itemtypes->{ $dat->{itemtype} }{imageurl} );
181
    $dat->{imageurl} = getitemtypeimagelocation( 'intranet', $itemtypes->{ $dat->{itemtype} }{imageurl} );
170
}
182
}
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 1-5 Link Here
1
INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
1
INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
2
('AcqCreateItem','ordering','ordering|receiving|cataloguing','Define when the item is created : when ordering, when receiving, or in cataloguing module','Choice'),
2
('AcqCreateItem','ordering','ordering|receiving|cataloguing','Define when the item is created : when ordering, when receiving, or in cataloguing module','Choice'),
3
('AcquisitionDetails', '1', '', 'Hide/Show acquisition details on the biblio detail page.', 'YesNo'),
3
('AcqViewBaskets','user','user|branch|all','Define which baskets a user is allowed to view: his own only, any within his branch or all','Choice'),
4
('AcqViewBaskets','user','user|branch|all','Define which baskets a user is allowed to view: his own only, any within his branch or all','Choice'),
4
('AcqWarnOnDuplicateInvoice','0','','Warn librarians when they try to create a duplicate invoice','YesNo'),
5
('AcqWarnOnDuplicateInvoice','0','','Warn librarians when they try to create a duplicate invoice','YesNo'),
5
('AddPatronLists','categorycode','categorycode|category_type','Allow user to choose what list to pick up from when adding patrons','Choice'),
6
('AddPatronLists','categorycode','categorycode|category_type','Allow user to choose what list to pick up from when adding patrons','Choice'),
(-)a/installer/data/mysql/updatedatabase.pl (+11 lines)
Lines 7596-7601 if ( CheckVersion($DBversion) ) { Link Here
7596
}
7596
}
7597
7597
7598
7598
7599
7600
7601
7602
$DBversion = "3.13.00.XXX";
7603
if ( CheckVersion($DBversion) ) {
7604
   $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('AcquisitionDetails', '1', '', 'Hide/Show acquisition details on the biblio detail page.', 'YesNo');");
7605
   print "Upgrade to $DBversion done (Bug 8230: Add AcquisitionDetails)\n";
7606
   SetVersion ($DBversion);
7607
}
7608
7609
7599
=head1 FUNCTIONS
7610
=head1 FUNCTIONS
7600
7611
7601
=head2 TableExists($table)
7612
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref (+6 lines)
Lines 176-178 Cataloging: Link Here
176
            - pref: NotesBlacklist
176
            - pref: NotesBlacklist
177
              class: multi
177
              class: multi
178
            - note fields in title notes separator (OPAC record details) and in the description separator (Staff client record details). The fields should appear separated with commas and according with the Koha MARC format (eg 3.. for UNIMARC, 5.. for MARC21)
178
            - note fields in title notes separator (OPAC record details) and in the description separator (Staff client record details). The fields should appear separated with commas and according with the Koha MARC format (eg 3.. for UNIMARC, 5.. for MARC21)
179
        -
180
            - pref: AcquisitionDetails
181
              choices:
182
                  yes: Display
183
                  no: "Don't display"
184
            - acquisition details on the biblio detail page.
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-1 / +65 lines)
Lines 1-3 Link Here
1
[% USE KohaDates %]
1
[% USE AuthorisedValues %]
2
[% USE AuthorisedValues %]
2
3
3
[% ShowCourseReserves = 0 %]
4
[% ShowCourseReserves = 0 %]
Lines 168-173 function verify_images() { Link Here
168
            table.before(link);
169
            table.before(link);
169
            deactivate_filters(id);
170
            deactivate_filters(id);
170
        }
171
        }
172
        [% IF AcquisitionDetails %]
173
            $("#orders").dataTable($.extend(true, {}, dataTablesDefaults, {
174
                'sDom': 't',
175
                'bPaginate': false,
176
                'bAutoWidth': false,
177
                "aaSorting": [[ 2, "desc" ]],
178
                "aoColumnDefs": [
179
                    { "aTargets": [ 2, 3 ], "sType": "title-string" }
180
                ]
181
            }));
182
183
        [% END %]
171
    });
184
    });
172
//]]>
185
//]]>
173
</script>
186
</script>
Lines 396-401 function verify_images() { Link Here
396
    [% END %]
409
    [% END %]
397
[% IF ( MARCNOTES || notes ) %]<li><a href="#description">Descriptions</a></li>[% END %]
410
[% IF ( MARCNOTES || notes ) %]<li><a href="#description">Descriptions</a></li>[% END %]
398
[% IF ( subscriptionsnumber ) %]<li><a href="#subscriptions">Subscriptions</a></li>[% END %]
411
[% IF ( subscriptionsnumber ) %]<li><a href="#subscriptions">Subscriptions</a></li>[% END %]
412
[% IF AcquisitionDetails %]<li><a href="#acq_details">Acquisition details</a></li>[% END %]
399
[% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]<li><a href="#editions">Editions</a></li>[% END %][% END %]
413
[% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]<li><a href="#editions">Editions</a></li>[% END %][% END %]
400
[% IF ( LocalCoverImages ) %][% IF ( localimages || CAN_user_tools_upload_local_cover_images ) %]<li><a href="#images">Images</a></li>[% END %][% END %]
414
[% IF ( LocalCoverImages ) %][% IF ( localimages || CAN_user_tools_upload_local_cover_images ) %]<li><a href="#images">Images</a></li>[% END %][% END %]
401
[% IF ( HTML5MediaEnabled ) %][% IF ( HTML5MediaSets ) %]<li><a href="#html5media">Play media</a></li>[% END %][% END %]
415
[% IF ( HTML5MediaEnabled ) %][% IF ( HTML5MediaSets ) %]<li><a href="#html5media">Play media</a></li>[% END %][% END %]
Lines 703-708 function verify_images() { Link Here
703
</div>
717
</div>
704
[% END %]
718
[% END %]
705
719
720
[% IF AcquisitionDetails %]
721
<div id="acq_details">
722
  [% IF orders %]
723
    <table id="orders">
724
      <thead>
725
        <tr>
726
          <th>Basket</th>
727
          <th>Ordernumber</th>
728
          <th>Creation date</th>
729
          <th>Receive date</th>
730
          <th>Status</th>
731
          <th>Quantity / items</th>
732
        </tr>
733
      </thead>
734
      <tbody>
735
      [% FOR order IN orders %]
736
          <tr>
737
            <td><a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% order.basketno %]">[% order.basketname %]</a></td>
738
            <td>[% order.ordernumber %]</td>
739
            <td><span title="[% order.creationdate %]">[% order.creationdate | $KohaDates%]</span></td>
740
            <td><span title="[% order.datereceived %]">[% order.datereceived | $KohaDates%]</span></td>
741
            <td>
742
              [% SWITCH order.orderstatus %]
743
                [% CASE '0' %]New
744
                [% CASE '1' %]Ordered
745
                [% CASE '2' %]Partial
746
                [% CASE '3' %]Complete
747
                [% CASE '4' %]Deleted
748
              [% END %]
749
            </td>
750
            <td>
751
              [% order.quantity %]
752
              [% IF order.itemnumbers.size > 0 && order.orderstatus != '4' %]
753
                (
754
                  [% FOR itemnumber IN order.itemnumbers %]
755
                    <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% biblionumber %]#item[% itemnumber %]">[% itemnumber %]</a>
756
                    [%- UNLESS loop.last %],[% END %]
757
                  [% END %]
758
                )
759
              [% END %]
760
            </th>
761
          </tr>
762
      [% END %]
763
      </tbody>
764
    </table>
765
  [% ELSE %]
766
    There is no order for this biblio.
767
  [% END %]
768
</div>
769
[% END %]
770
706
[% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]
771
[% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]
707
<div id="editions"><h4>Editions</h4>
772
<div id="editions"><h4>Editions</h4>
708
<table>
773
<table>
709
- 

Return to bug 8230