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

(-)a/catalogue/detail.pl (-2 / +8 lines)
Lines 20-26 use Modern::Perl; Link Here
20
20
21
use CGI qw ( -utf8 );
21
use CGI qw ( -utf8 );
22
use HTML::Entities;
22
use HTML::Entities;
23
use C4::Acquisition qw( GetHistory );
24
use C4::Auth;
23
use C4::Auth;
25
use C4::Koha;
24
use C4::Koha;
26
use C4::Serials;    #uses getsubscriptionfrom biblionumber
25
use C4::Serials;    #uses getsubscriptionfrom biblionumber
Lines 180-186 foreach my $subscription (@subscriptions) { Link Here
180
179
181
# Get acquisition details
180
# Get acquisition details
182
if ( C4::Context->preference('AcquisitionDetails') ) {
181
if ( C4::Context->preference('AcquisitionDetails') ) {
183
    my $orders = C4::Acquisition::GetHistory( biblionumber => $biblionumber, get_canceled_order => 1 );
182
    my $orders = Koha::Acquisition::Orders->search(
183
        { biblionumber => $biblionumber },
184
        {
185
            join => 'basketno',
186
            order_by => 'basketno.booksellerid'
187
        }
188
    );    # GetHistory sorted by aqbooksellerid, but does it make sense?
189
184
    $template->param(
190
    $template->param(
185
        orders => $orders,
191
        orders => $orders,
186
    );
192
    );
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-13 / +25 lines)
Lines 693-735 Link Here
693
          <th class="title-string">Receive date</th>
693
          <th class="title-string">Receive date</th>
694
          <th>Status</th>
694
          <th>Status</th>
695
          <th>Quantity</th>
695
          <th>Quantity</th>
696
          <th>Subscription</th>
697
          <th>Subscription callnumber</th>
696
        </tr>
698
        </tr>
697
      </thead>
699
      </thead>
698
      <tbody>
700
      <tbody>
699
      [% FOR order IN orders %]
701
      [% FOR order IN orders %]
702
        [% SET basket = order.basket %]
703
        [% SET vendor = basket.bookseller %]
700
          <tr>
704
          <tr>
701
            <td>
705
            <td>
702
            [% IF (order.id) %]
706
                <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% vendor.id %]" title="Vendor detail page">[% vendor.name %]</a>
703
                <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% order.id %]" title="Vendor detail page">[% order.name %]</a>
704
            [% END %]
705
            </td>
707
            </td>
706
            <td>
708
            <td>
707
            [% IF (order.invoiceid) %]
709
            [% IF order.invoiceid %]
708
                [% IF CAN_user_acquisition %]
710
                [% IF CAN_user_acquisition %]
709
                    <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% order.invoiceid %]"
711
                    <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% order.invoiceid %]"
710
                       title="Invoice detail page">
712
                       title="Invoice detail page">
711
                       [% order.invoicenumber %]</a>
713
                       [% order.invoice.invoicenumber %]</a>
712
                [% ELSE %]
714
                [% ELSE %]
713
                    [% order.invoicenumber %]
715
                    [% order.invoice.invoicenumber %]
714
                [% END %]
716
                [% END %]
715
            [% END %]
717
            [% END %]
716
            </td>
718
            </td>
717
            <td>
719
            <td>
718
            [% IF (order.basketgroupid) %]
720
            [% IF basket.basketgroupid %]
721
                [% SET basket_group = basket.basket_group %]
719
                [% IF CAN_user_acquisition_group_manage %]
722
                [% IF CAN_user_acquisition_group_manage %]
720
                    <a href="/cgi-bin/koha/acqui/basketgroup.pl?op=add&booksellerid=[% order.id %]&basketgroupid=[% order.basketgroupid %]">[% order.groupname %] ([% order.basketgroupid %])</a>
723
                    <a href="/cgi-bin/koha/acqui/basketgroup.pl?op=add&booksellerid=[% vendor.id %]&basketgroupid=[% basket_group.id %]">[% basket_group.name %] ([% basket_group.id %])</a>
721
                [% ELSE %]
724
                [% ELSE %]
722
                    [% order.groupname %] ([% order.basketgroupid %])
725
                    [% basket_group.name %] ([% basket_group.id %])
723
                [% END %]
726
                [% END %]
724
            [% END %]
727
            [% END %]
725
            </td>
728
            </td>
726
            <td>[% IF CAN_user_acquisition_order_manage %]
729
            <td>[% IF CAN_user_acquisition_order_manage %]
727
                <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% order.basketno %]">[% order.basketname %] ([% order.basketno %])</a>
730
                <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno %]">[% basket.basketname %] ([% basket.basketno %])</a>
728
            [% ELSE %]
731
            [% ELSE %]
729
                [% order.basketname %] ([% order.basketno %])
732
                [% basket.basketname %] ([% basket.basketno %])
730
            [% END %]</td>
733
            [% END %]</td>
731
            <td>[% order.ordernumber %]</td>
734
            <td>[% order.ordernumber %]</td>
732
            <td><span title="[% order.creationdate %]">[% order.creationdate | $KohaDates%]</span></td>
735
            <td><span title="[% basket.creationdate %]">[% basket.creationdate | $KohaDates%]</span></td>
733
            <td><span title="[% order.datereceived %]">[% order.datereceived | $KohaDates%]</span></td>
736
            <td><span title="[% order.datereceived %]">[% order.datereceived | $KohaDates%]</span></td>
734
            <td>
737
            <td>
735
              [% SWITCH order.orderstatus %]
738
              [% SWITCH order.orderstatus %]
Lines 741-746 Link Here
741
              [% END %]
744
              [% END %]
742
            </td>
745
            </td>
743
            <td>[% order.quantity %]</td>
746
            <td>[% order.quantity %]</td>
747
            <td>
748
                [% IF order.subscriptionid %]
749
                    <a href="g/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% order.subscriptionid %]">[% order.subscriptionid %]</a>
750
                [% END %]
751
            </td>
752
            <td>
753
                [% IF order.subscriptionid %]
754
                    [% order.subscription.callnumber %]
755
                [% END %]
756
            </td>
744
          </tr>
757
          </tr>
745
      [% END %]
758
      [% END %]
746
      </tbody>
759
      </tbody>
747
- 

Return to bug 20366