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

(-)a/C4/Acquisition.pm (-1 / +9 lines)
Lines 2187-2192 sub GetHistory { Link Here
2187
    my $basketgroupname = $params{basketgroupname};
2187
    my $basketgroupname = $params{basketgroupname};
2188
    my $budget = $params{budget};
2188
    my $budget = $params{budget};
2189
    my $orderstatus = $params{orderstatus};
2189
    my $orderstatus = $params{orderstatus};
2190
    my $biblionumber = $params{biblionumber};
2191
    my $get_canceled_order = $params{get_canceled_order} || 0;
2190
2192
2191
    my @order_loop;
2193
    my @order_loop;
2192
    my $total_qty         = 0;
2194
    my $total_qty         = 0;
Lines 2239-2248 sub GetHistory { Link Here
2239
2241
2240
    $query .= " WHERE 1 ";
2242
    $query .= " WHERE 1 ";
2241
2243
2242
    $query .= " AND (datecancellationprinted is NULL or datecancellationprinted='0000-00-00') " if $orderstatus ne 'cancelled';
2244
    $query .= " AND (datecancellationprinted is NULL or datecancellationprinted='0000-00-00') "
2245
        if not $get_canceled_order or ( defined $orderstatus and $orderstatus ne 'cancelled' );
2243
2246
2244
    my @query_params  = ();
2247
    my @query_params  = ();
2245
2248
2249
    if ( $biblionumber ) {
2250
        $query .= " AND biblio.biblionumber = ?";
2251
        push @query_params, $biblionumber;
2252
    }
2253
2246
    if ( $title ) {
2254
    if ( $title ) {
2247
        $query .= " AND biblio.title LIKE ? ";
2255
        $query .= " AND biblio.title LIKE ? ";
2248
        $title =~ s/\s+/%/g;
2256
        $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 44-51 use C4::HTML5Media; Link Here
44
use C4::CourseReserves qw(GetItemCourseReservesInfo);
45
use C4::CourseReserves qw(GetItemCourseReservesInfo);
45
use C4::Acquisition qw(GetOrdersByBiblionumber);
46
use C4::Acquisition qw(GetOrdersByBiblionumber);
46
47
47
# use Smart::Comments;
48
49
my $query = CGI->new();
48
my $query = CGI->new();
50
49
51
my $analyze = $query->param('analyze');
50
my $analyze = $query->param('analyze');
Lines 166-171 foreach my $subscription (@subscriptions) { Link Here
166
    push @subs, \%cell;
165
    push @subs, \%cell;
167
}
166
}
168
167
168
169
# Get acquisition details
170
my ( $orders, $qty, $price, $received ) = C4::Acquisition::GetHistory( biblionumber => $biblionumber, get_canceled_order => 1 );
171
if ( C4::Context->preference('AcqCreateItem') eq 'ordering' ) {
172
    for my $order ( @$orders ) {
173
        $order->{itemnumbers} = [ C4::Acquisition::GetItemnumbersFromOrder( $order->{ordernumber} ) ];
174
    }
175
}
176
$template->param(
177
    orders => $orders,
178
    AcquisitionDetails => C4::Context->preference('AcquisitionDetails'),
179
);
180
169
if ( defined $dat->{'itemtype'} ) {
181
if ( defined $dat->{'itemtype'} ) {
170
    $dat->{imageurl} = getitemtypeimagelocation( 'intranet', $itemtypes->{ $dat->{itemtype} }{imageurl} );
182
    $dat->{imageurl} = getitemtypeimagelocation( 'intranet', $itemtypes->{ $dat->{itemtype} }{imageurl} );
171
}
183
}
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 1-6 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
('AcqItemSetSubfieldsWhenReceived','0','','This syspref set a status for item when items are created when receiving (e.g. 995\$o=5)','Free'),
3
('AcqItemSetSubfieldsWhenReceived','0','','This syspref set a status for item when items are created when receiving (e.g. 995\$o=5)','Free'),
4
('AcquisitionDetails', '1', '', 'Hide/Show acquisition details on the biblio detail page.', 'YesNo'),
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'),
5
('AcqViewBaskets','user','user|branch|all','Define which baskets a user is allowed to view: his own only, any within his branch or all','Choice'),
5
('AcqWarnOnDuplicateInvoice','0','','Warn librarians when they try to create a duplicate invoice','YesNo'),
6
('AcqWarnOnDuplicateInvoice','0','','Warn librarians when they try to create a duplicate invoice','YesNo'),
6
('AddPatronLists','categorycode','categorycode|category_type','Allow user to choose what list to pick up from when adding patrons','Choice'),
7
('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 7825-7830 if ( CheckVersion($DBversion) ) { Link Here
7825
}
7825
}
7826
7826
7827
7827
7828
7829
7830
7831
$DBversion = "3.13.00.XXX";
7832
if ( CheckVersion($DBversion) ) {
7833
   $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('AcquisitionDetails', '1', '', 'Hide/Show acquisition details on the biblio detail page.', 'YesNo');");
7834
   print "Upgrade to $DBversion done (Bug 8230: Add AcquisitionDetails)\n";
7835
   SetVersion ($DBversion);
7836
}
7837
7838
7828
=head1 FUNCTIONS
7839
=head1 FUNCTIONS
7829
7840
7830
=head2 TableExists($table)
7841
=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 254-259 function verify_images() { Link Here
254
            table.before(link);
255
            table.before(link);
255
            deactivate_filters(id);
256
            deactivate_filters(id);
256
        }
257
        }
258
        [% IF AcquisitionDetails %]
259
            $("#orders").dataTable($.extend(true, {}, dataTablesDefaults, {
260
                'sDom': 't',
261
                'bPaginate': false,
262
                'bAutoWidth': false,
263
                "aaSorting": [[ 2, "desc" ]],
264
                "aoColumnDefs": [
265
                    { "aTargets": [ 2, 3 ], "sType": "title-string" }
266
                ]
267
            }));
268
269
        [% END %]
257
    });
270
    });
258
//]]>
271
//]]>
259
</script>
272
</script>
Lines 482-487 function verify_images() { Link Here
482
    [% END %]
495
    [% END %]
483
[% IF ( MARCNOTES || notes ) %]<li><a href="#description">Descriptions</a></li>[% END %]
496
[% IF ( MARCNOTES || notes ) %]<li><a href="#description">Descriptions</a></li>[% END %]
484
[% IF ( subscriptionsnumber ) %]<li><a href="#subscriptions">Subscriptions</a></li>[% END %]
497
[% IF ( subscriptionsnumber ) %]<li><a href="#subscriptions">Subscriptions</a></li>[% END %]
498
[% IF AcquisitionDetails %]<li><a href="#acq_details">Acquisition details</a></li>[% END %]
485
[% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]<li><a href="#editions">Editions</a></li>[% END %][% END %]
499
[% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]<li><a href="#editions">Editions</a></li>[% END %][% END %]
486
[% IF ( LocalCoverImages ) %][% IF ( localimages || CAN_user_tools_upload_local_cover_images ) %]<li><a href="#images">Images</a></li>[% END %][% END %]
500
[% IF ( LocalCoverImages ) %][% IF ( localimages || CAN_user_tools_upload_local_cover_images ) %]<li><a href="#images">Images</a></li>[% END %][% END %]
487
[% IF ( HTML5MediaEnabled ) %][% IF ( HTML5MediaSets ) %]<li><a href="#html5media">Play media</a></li>[% END %][% END %]
501
[% IF ( HTML5MediaEnabled ) %][% IF ( HTML5MediaSets ) %]<li><a href="#html5media">Play media</a></li>[% END %][% END %]
Lines 810-815 function verify_images() { Link Here
810
</div>
824
</div>
811
[% END %]
825
[% END %]
812
826
827
[% IF AcquisitionDetails %]
828
<div id="acq_details">
829
  [% IF orders %]
830
    <table id="orders">
831
      <thead>
832
        <tr>
833
          <th>Basket</th>
834
          <th>Ordernumber</th>
835
          <th>Creation date</th>
836
          <th>Receive date</th>
837
          <th>Status</th>
838
          <th>Quantity / items</th>
839
        </tr>
840
      </thead>
841
      <tbody>
842
      [% FOR order IN orders %]
843
          <tr>
844
            <td><a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% order.basketno %]">[% order.basketname %]</a></td>
845
            <td>[% order.ordernumber %]</td>
846
            <td><span title="[% order.creationdate %]">[% order.creationdate | $KohaDates%]</span></td>
847
            <td><span title="[% order.datereceived %]">[% order.datereceived | $KohaDates%]</span></td>
848
            <td>
849
              [% SWITCH order.orderstatus %]
850
                [% CASE '0' %]New
851
                [% CASE '1' %]Ordered
852
                [% CASE '2' %]Partial
853
                [% CASE '3' %]Complete
854
                [% CASE '4' %]Deleted
855
              [% END %]
856
            </td>
857
            <td>
858
              [% order.quantity %]
859
              [% IF order.itemnumbers.size > 0 && order.orderstatus != '4' %]
860
                (
861
                  [% FOR itemnumber IN order.itemnumbers %]
862
                    <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% biblionumber %]#item[% itemnumber %]">[% itemnumber %]</a>
863
                    [%- UNLESS loop.last %],[% END %]
864
                  [% END %]
865
                )
866
              [% END %]
867
            </th>
868
          </tr>
869
      [% END %]
870
      </tbody>
871
    </table>
872
  [% ELSE %]
873
    There is no order for this biblio.
874
  [% END %]
875
</div>
876
[% END %]
877
813
[% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]
878
[% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]
814
<div id="editions"><h4>Editions</h4>
879
<div id="editions"><h4>Editions</h4>
815
<table>
880
<table>
816
- 

Return to bug 8230