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

(-)a/acqui/parcel.pl (-11 / +24 lines)
Lines 69-74 use Koha::Acquisition::Baskets; Link Here
69
use Koha::Acquisition::Bookseller;
69
use Koha::Acquisition::Bookseller;
70
use Koha::Acquisition::Orders;
70
use Koha::Acquisition::Orders;
71
use Koha::Biblios;
71
use Koha::Biblios;
72
use Koha::Old::Biblios;
72
use Koha::DateUtils;
73
use Koha::DateUtils;
73
use Koha::Biblios;
74
use Koha::Biblios;
74
75
Lines 140-153 for my $order ( @orders ) { Link Here
140
141
141
    my %line = %{ $order };
142
    my %line = %{ $order };
142
    $line{invoice} = $invoice->{invoicenumber};
143
    $line{invoice} = $invoice->{invoicenumber};
143
    my @itemnumbers = $order_object->items->get_column('itemnumber');
144
144
    my $biblio = Koha::Biblios->find( $line{biblionumber} );
145
    my $biblio = Koha::Biblios->find( $line{biblionumber} );
145
    $line{total_holds} = $biblio ? $biblio->holds->count : 0;
146
    if ( $biblio ) {
146
    $line{item_holds} = $biblio ? $biblio->current_holds->search(
147
        my @itemnumbers = $order_object->items->get_column('itemnumber');
147
        {
148
        $line{total_holds} = $biblio->holds->count;
148
            itemnumber => { -in => \@itemnumbers },
149
        $line{item_holds} = $biblio->current_holds->search(
149
        }
150
            {
150
    )->count : 0;
151
                itemnumber => { -in => \@itemnumbers },
152
            }
153
        )->count;
154
    } else {
155
        $biblio = Koha::Old::Biblios->find( $line{biblionumber} );
156
        $line{total_holds} = 0;
157
        $line{item_holds} = 0;
158
    }
159
    $line{biblio} = $biblio;
151
    $line{budget} = GetBudgetByOrderNumber( $line{ordernumber} );
160
    $line{budget} = GetBudgetByOrderNumber( $line{ordernumber} );
152
161
153
    $line{tax_value} = $line{tax_value_on_receiving};
162
    $line{tax_value} = $line{tax_value_on_receiving};
Lines 244-254 unless( defined $invoice->{closedate} ) { Link Here
244
        my $countbiblio = CountBiblioInOrders($biblionumber);
253
        my $countbiblio = CountBiblioInOrders($biblionumber);
245
        my $ordernumber = $line{'ordernumber'};
254
        my $ordernumber = $line{'ordernumber'};
246
        my $order_object = Koha::Acquisition::Orders->find($ordernumber);
255
        my $order_object = Koha::Acquisition::Orders->find($ordernumber);
247
        my $cnt_subscriptions = $biblio ? $biblio->subscriptions->count: 0;
248
        my $itemcount   = $biblio ? $biblio->items->count : 0;
249
        my $holds_count = $biblio ? $biblio->holds->count : 0;
250
        my @itemnumbers = $order_object->items->get_column('itemnumber');
256
        my @itemnumbers = $order_object->items->get_column('itemnumber');
251
        my $itemholds = $biblio ? $biblio->holds->search({ itemnumber => { -in => \@itemnumbers } })->count : 0;
257
        my ( $cnt_subscriptions, $itemcount, $holds_count, $itemholds ) = (0) x 4;
258
        if ( $biblio ) {
259
            $cnt_subscriptions = $biblio->subscriptions->count;
260
            $itemcount   = $biblio->items->count;
261
            $holds_count = $biblio->holds->count;
262
            $itemholds = $biblio->holds->search({ itemnumber => { -in => \@itemnumbers } })->count;
263
        }
264
        $order->{biblio} = $biblio;
252
265
253
        my $suggestion   = GetSuggestionInfoFromBiblionumber($line{biblionumber});
266
        my $suggestion   = GetSuggestionInfoFromBiblionumber($line{biblionumber});
254
        $line{suggestionid}         = $suggestion->{suggestionid};
267
        $line{suggestionid}         = $suggestion->{suggestionid};
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt (-20 / +23 lines)
Lines 140-152 Link Here
140
                </td>
140
                </td>
141
                <td class="orderfilterclass"><a href="neworderempty.pl?ordernumber=[% loop_order.ordernumber | uri %]&amp;booksellerid=[% loop_order.booksellerid | uri %]">[% loop_order.ordernumber | html %]</a></td>
141
                <td class="orderfilterclass"><a href="neworderempty.pl?ordernumber=[% loop_order.ordernumber | uri %]&amp;booksellerid=[% loop_order.booksellerid | uri %]">[% loop_order.ordernumber | html %]</a></td>
142
                <td class="summaryfilterclass">
142
                <td class="summaryfilterclass">
143
                  <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loop_order.biblionumber | uri %]">[% loop_order.title | html %]</a>
143
                  <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loop_order.biblio.biblionumber | uri %]">[% loop_order.biblio.title | html %]</a>
144
                [% IF ( loop_order.author ) %] by [% loop_order.author | html %][% END %]
144
                [% IF ( loop_order.biblio.author ) %] by [% loop_order.biblio.author | html %][% END %]
145
                [% IF ( loop_order.isbn ) %] &ndash; [% loop_order.isbn | html %][% END %]
145
                [% IF ( loop_order.biblio.biblioitem ) %] &ndash; [% loop_order.biblio.biblioitem.isbn | html %][% END %]
146
                [% IF ( loop_order.publishercode ) %]
146
                [% IF ( loop_order.biblio.biblioitem.publishercode ) %]
147
                    <br />Publisher: [% loop_order.publishercode | html %]
147
                    <br />Publisher: [% loop_order.biblio.biblioitem.publishercode | html %]
148
                    [%- IF    ( loop_order.publicationyear > 0) -%], [% loop_order.publicationyear | html %]
148
                    [%- IF    ( loop_order.biblio.biblioitem.publicationyear > 0) -%], [% loop_order.biblio.biblioitem.publicationyear | html %]
149
                    [%- ELSIF ( loop_order.copyrightdate   > 0) -%] [% loop_order.copyrightdate | html %]
149
                    [%- ELSIF ( loop_order.biblio.copyrightdate   > 0) -%] [% loop_order.biblio.copyrightdate | html %]
150
                    [% END %]
150
                    [% END %]
151
                [% END %]
151
                [% END %]
152
                [% IF ( loop_order.suggestionid ) %]
152
                [% IF ( loop_order.suggestionid ) %]
Lines 167-174 Link Here
167
                </td>
167
                </td>
168
                <td>
168
                <td>
169
                  <a href="/cgi-bin/koha/acqui/showorder.pl?ordernumber=[% loop_order.ordernumber | uri %]" class="previewData">[% tp('noun', 'Order') | html %]</a><br>
169
                  <a href="/cgi-bin/koha/acqui/showorder.pl?ordernumber=[% loop_order.ordernumber | uri %]" class="previewData">[% tp('noun', 'Order') | html %]</a><br>
170
                  <a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% loop_order.biblionumber | uri %]" class="previewData">MARC</a><br>
170
                  [% IF loop_order.biblionumber %]
171
                  <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;id=[% loop_order.biblionumber | uri %]" class="previewData">Card</a>
171
                      <a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% loop_order.biblionumber | uri %]" class="previewData">MARC</a><br>
172
                      <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;id=[% loop_order.biblionumber | uri %]" class="previewData">Card</a>
173
                  [% END %]
172
                </td>
174
                </td>
173
                <td>[% loop_order.replacementprice | $Price %]</td>
175
                <td>[% loop_order.replacementprice | $Price %]</td>
174
                <td>[% loop_order.quantity | html %]</td>
176
                <td>[% loop_order.quantity | html %]</td>
Lines 303-315 Link Here
303
                    0
305
                    0
304
                  [% END %]
306
                  [% END %]
305
                </td>
307
                </td>
306
                <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% order.biblionumber | uri %]">[% order.title | html %]</a>
308
                <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% order.biblio.biblionumber | uri %]">[% order.biblio.title | html %]</a>
307
                [% IF ( order.author ) %] / [% order.author | html %][% END %]
309
                [% IF ( order.biblio.author ) %] / [% order.biblio.author | html %][% END %]
308
                [% IF ( order.isbn ) %] - [% order.isbn | html %][% END %]
310
                [% IF ( order.biblio.biblioitem.isbn ) %] - [% order.biblio.biblioitem.isbn | html %][% END %]
309
                [% IF ( order.publishercode ) %]
311
                [% IF ( order.biblio.biblioitem.publishercode ) %]
310
                    <br />Publisher: [% order.publishercode | html %]
312
                    <br />Publisher: [% order.biblio.biblioitem.publishercode | html %]
311
                    [%- IF    ( order.publicationyear > 0) -%], [% order.publicationyear | html %]
313
                    [%- IF    ( order.biblio.biblioitem.publicationyear > 0) -%], [% order.biblio.biblioitem.publicationyear | html %]
312
                    [%- ELSIF ( order.copyrightdate   > 0) -%] [% order.copyrightdate | html %]
314
                    [%- ELSIF ( order.biblio.copyrightdate   > 0) -%] [% order.biblio.copyrightdate | html %]
313
                    [% END %]
315
                    [% END %]
314
                [% END %]
316
                [% END %]
315
                [% IF ( order.suggestionid ) %]
317
                [% IF ( order.suggestionid ) %]
Lines 330-338 Link Here
330
                [% END %]
332
                [% END %]
331
                </td>
333
                </td>
332
                <td>
334
                <td>
333
                  <a href="/cgi-bin/koha/acqui/showorder.pl?ordernumber=[% order.ordernumber | uri %]" class="previewData">[% tp('noun', 'Order') | html %]</a><br>
335
                    <a href="/cgi-bin/koha/acqui/showorder.pl?ordernumber=[% order.ordernumber | uri %]" class="previewData">[% tp('noun', 'Order') | html %]</a><br>
334
                  <a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% order.biblionumber | uri %]" class="previewData">MARC</a><br>
336
                    [% IF order.biblionumber %]
335
                  <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;id=[% order.biblionumber | uri %]" class="previewData">Card</a>
337
                        <a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% order.biblionumber | uri %]" class="previewData">MARC</a><br>
338
                        <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;id=[% order.biblionumber | uri %]" class="previewData">Card</a>
339
                    [% END %]
336
                </td>
340
                </td>
337
                <td>[% order.replacementprice | $Price %]</td>
341
                <td>[% order.replacementprice | $Price %]</td>
338
                <td>[% order.quantityreceived | html %]</td>
342
                <td>[% order.quantityreceived | html %]</td>
339
- 

Return to bug 10758