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

(-)a/C4/Acquisition.pm (-1 / +9 lines)
Lines 2063-2068 sub GetHistory { Link Here
2063
    my $basketgroupname = $params{basketgroupname};
2063
    my $basketgroupname = $params{basketgroupname};
2064
    my $budget = $params{budget};
2064
    my $budget = $params{budget};
2065
    my $orderstatus = $params{orderstatus};
2065
    my $orderstatus = $params{orderstatus};
2066
    my $biblionumber = $params{biblionumber};
2067
    my $get_canceled_order = $params{get_canceled_order} || 0;
2066
2068
2067
    my @order_loop;
2069
    my @order_loop;
2068
    my $total_qty         = 0;
2070
    my $total_qty         = 0;
Lines 2115-2124 sub GetHistory { Link Here
2115
2117
2116
    $query .= " WHERE 1 ";
2118
    $query .= " WHERE 1 ";
2117
2119
2118
    $query .= " AND (datecancellationprinted is NULL or datecancellationprinted='0000-00-00') " if $orderstatus ne 'cancelled';
2120
    $query .= " AND (datecancellationprinted is NULL or datecancellationprinted='0000-00-00') "
2121
        if not $get_canceled_order or ( defined $orderstatus and $orderstatus ne 'cancelled' );
2119
2122
2120
    my @query_params  = ();
2123
    my @query_params  = ();
2121
2124
2125
    if ( $biblionumber ) {
2126
        $query .= " AND biblio.biblionumber = ?";
2127
        push @query_params, $biblionumber;
2128
    }
2129
2122
    if ( $title ) {
2130
    if ( $title ) {
2123
        $query .= " AND biblio.title LIKE ? ";
2131
        $query .= " AND biblio.title LIKE ? ";
2124
        $title =~ s/\s+/%/g;
2132
        $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 (+13 lines)
Lines 7156-7161 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
7156
    SetVersion($DBversion);
7156
    SetVersion($DBversion);
7157
}
7157
}
7158
7158
7159
7160
7161
7162
7163
7164
$DBversion = "3.13.00.XXX";
7165
if ( CheckVersion($DBversion) ) {
7166
   $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('AcquisitionDetails', '1', '', 'Hide/Show acquisition details on the biblio detail page.', 'YesNo');");
7167
   print "Upgrade to $DBversion done (Bug 8230: Add AcquisitionDetails)\n";
7168
   SetVersion ($DBversion);
7169
}
7170
7171
7159
=head1 FUNCTIONS
7172
=head1 FUNCTIONS
7160
7173
7161
=head2 TableExists($table)
7174
=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 142-147 function verify_images() { Link Here
142
            table.before(link);
143
            table.before(link);
143
            deactivate_filters(id);
144
            deactivate_filters(id);
144
        }
145
        }
146
        [% IF AcquisitionDetails %]
147
            $("#orders").dataTable($.extend(true, {}, dataTablesDefaults, {
148
                'sDom': 't',
149
                'bPaginate': false,
150
                'bAutoWidth': false,
151
                "aaSorting": [[ 2, "desc" ]],
152
                "aoColumnDefs": [
153
                    { "aTargets": [ 2, 3 ], "sType": "title-string" }
154
                ]
155
            }));
156
157
        [% END %]
145
    });
158
    });
146
//]]>
159
//]]>
147
</script>
160
</script>
Lines 370-375 function verify_images() { Link Here
370
    [% END %]
383
    [% END %]
371
[% IF ( MARCNOTES || notes ) %]<li><a href="#description">Descriptions</a></li>[% END %]
384
[% IF ( MARCNOTES || notes ) %]<li><a href="#description">Descriptions</a></li>[% END %]
372
[% IF ( subscriptionsnumber ) %]<li><a href="#subscriptions">Subscriptions</a></li>[% END %]
385
[% IF ( subscriptionsnumber ) %]<li><a href="#subscriptions">Subscriptions</a></li>[% END %]
386
[% IF AcquisitionDetails %]<li><a href="#acq_details">Acquisition details</a></li>[% END %]
373
[% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]<li><a href="#editions">Editions</a></li>[% END %][% END %]
387
[% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]<li><a href="#editions">Editions</a></li>[% END %][% END %]
374
[% IF ( LocalCoverImages ) %][% IF ( localimages || CAN_user_tools_upload_local_cover_images ) %]<li><a href="#images">Images</a></li>[% END %][% END %]
388
[% IF ( LocalCoverImages ) %][% IF ( localimages || CAN_user_tools_upload_local_cover_images ) %]<li><a href="#images">Images</a></li>[% END %][% END %]
375
[% IF ( HTML5MediaEnabled ) %][% IF ( HTML5MediaSets ) %]<li><a href="#html5media">Play media</a></li>[% END %][% END %]
389
[% IF ( HTML5MediaEnabled ) %][% IF ( HTML5MediaSets ) %]<li><a href="#html5media">Play media</a></li>[% END %][% END %]
Lines 677-682 function verify_images() { Link Here
677
</div>
691
</div>
678
[% END %]
692
[% END %]
679
693
694
[% IF AcquisitionDetails %]
695
<div id="acq_details">
696
  [% IF orders %]
697
    <table id="orders">
698
      <thead>
699
        <tr>
700
          <th>Basket</th>
701
          <th>Ordernumber</th>
702
          <th>Creation date</th>
703
          <th>Receive date</th>
704
          <th>Status</th>
705
          <th>Quantity / items</th>
706
        </tr>
707
      </thead>
708
      <tbody>
709
      [% FOR order IN orders %]
710
          <tr>
711
            <td><a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% order.basketno %]">[% order.basketname %]</a></td>
712
            <td>[% order.ordernumber %]</td>
713
            <td><span title="[% order.creationdate %]">[% order.creationdate | $KohaDates%]</span></td>
714
            <td><span title="[% order.datereceived %]">[% order.datereceived | $KohaDates%]</span></td>
715
            <td>
716
              [% SWITCH order.orderstatus %]
717
                [% CASE '0' %]New
718
                [% CASE '1' %]Ordered
719
                [% CASE '2' %]Partial
720
                [% CASE '3' %]Complete
721
                [% CASE '4' %]Deleted
722
              [% END %]
723
            </td>
724
            <td>
725
              [% order.quantity %]
726
              [% IF order.itemnumbers.size > 0 && order.orderstatus != '4' %]
727
                (
728
                  [% FOR itemnumber IN order.itemnumbers %]
729
                    <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% biblionumber %]#item[% itemnumber %]">[% itemnumber %]</a>
730
                    [%- UNLESS loop.last %],[% END %]
731
                  [% END %]
732
                )
733
              [% END %]
734
            </th>
735
          </tr>
736
      [% END %]
737
      </tbody>
738
    </table>
739
  [% ELSE %]
740
    There is no order for this biblio.
741
  [% END %]
742
</div>
743
[% END %]
744
680
[% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]
745
[% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]
681
<div id="editions"><h4>Editions</h4>
746
<div id="editions"><h4>Editions</h4>
682
<table>
747
<table>
683
- 

Return to bug 8230