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 709-751 Link Here
709
          <th class="title-string">Receive date</th>
709
          <th class="title-string">Receive date</th>
710
          <th>Status</th>
710
          <th>Status</th>
711
          <th>Quantity</th>
711
          <th>Quantity</th>
712
          <th>Subscription</th>
713
          <th>Subscription callnumber</th>
712
        </tr>
714
        </tr>
713
      </thead>
715
      </thead>
714
      <tbody>
716
      <tbody>
715
      [% FOR order IN orders %]
717
      [% FOR order IN orders %]
718
        [% SET basket = order.basket %]
719
        [% SET vendor = basket.bookseller %]
716
          <tr>
720
          <tr>
717
            <td>
721
            <td>
718
            [% IF (order.id) %]
722
                <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% vendor.id %]" title="Vendor detail page">[% vendor.name %]</a>
719
                <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% order.id %]" title="Vendor detail page">[% order.name %]</a>
720
            [% END %]
721
            </td>
723
            </td>
722
            <td>
724
            <td>
723
            [% IF (order.invoiceid) %]
725
            [% IF order.invoiceid %]
724
                [% IF CAN_user_acquisition %]
726
                [% IF CAN_user_acquisition %]
725
                    <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% order.invoiceid %]"
727
                    <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% order.invoiceid %]"
726
                       title="Invoice detail page">
728
                       title="Invoice detail page">
727
                       [% order.invoicenumber %]</a>
729
                       [% order.invoice.invoicenumber %]</a>
728
                [% ELSE %]
730
                [% ELSE %]
729
                    [% order.invoicenumber %]
731
                    [% order.invoice.invoicenumber %]
730
                [% END %]
732
                [% END %]
731
            [% END %]
733
            [% END %]
732
            </td>
734
            </td>
733
            <td>
735
            <td>
734
            [% IF (order.basketgroupid) %]
736
            [% IF basket.basketgroupid %]
737
                [% SET basket_group = basket.basket_group %]
735
                [% IF CAN_user_acquisition_group_manage %]
738
                [% IF CAN_user_acquisition_group_manage %]
736
                    <a href="/cgi-bin/koha/acqui/basketgroup.pl?op=add&booksellerid=[% order.id %]&basketgroupid=[% order.basketgroupid %]">[% order.groupname %] ([% order.basketgroupid %])</a>
739
                    <a href="/cgi-bin/koha/acqui/basketgroup.pl?op=add&booksellerid=[% vendor.id %]&basketgroupid=[% basket_group.id %]">[% basket_group.name %] ([% basket_group.id %])</a>
737
                [% ELSE %]
740
                [% ELSE %]
738
                    [% order.groupname %] ([% order.basketgroupid %])
741
                    [% basket_group.name %] ([% basket_group.id %])
739
                [% END %]
742
                [% END %]
740
            [% END %]
743
            [% END %]
741
            </td>
744
            </td>
742
            <td>[% IF CAN_user_acquisition_order_manage %]
745
            <td>[% IF CAN_user_acquisition_order_manage %]
743
                <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% order.basketno %]">[% order.basketname %] ([% order.basketno %])</a>
746
                <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno %]">[% basket.basketname %] ([% basket.basketno %])</a>
744
            [% ELSE %]
747
            [% ELSE %]
745
                [% order.basketname %] ([% order.basketno %])
748
                [% basket.basketname %] ([% basket.basketno %])
746
            [% END %]</td>
749
            [% END %]</td>
747
            <td>[% order.ordernumber %]</td>
750
            <td>[% order.ordernumber %]</td>
748
            <td><span title="[% order.creationdate %]">[% order.creationdate | $KohaDates%]</span></td>
751
            <td><span title="[% basket.creationdate %]">[% basket.creationdate | $KohaDates%]</span></td>
749
            <td><span title="[% order.datereceived %]">[% order.datereceived | $KohaDates%]</span></td>
752
            <td><span title="[% order.datereceived %]">[% order.datereceived | $KohaDates%]</span></td>
750
            <td>
753
            <td>
751
              [% SWITCH order.orderstatus %]
754
              [% SWITCH order.orderstatus %]
Lines 757-762 Link Here
757
              [% END %]
760
              [% END %]
758
            </td>
761
            </td>
759
            <td>[% order.quantity %]</td>
762
            <td>[% order.quantity %]</td>
763
            <td>
764
                [% IF order.subscriptionid %]
765
                    <a href="g/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% order.subscriptionid %]">[% order.subscriptionid %]</a>
766
                [% END %]
767
            </td>
768
            <td>
769
                [% IF order.subscriptionid %]
770
                    [% order.subscription.callnumber %]
771
                [% END %]
772
            </td>
760
          </tr>
773
          </tr>
761
      [% END %]
774
      [% END %]
762
      </tbody>
775
      </tbody>
763
- 

Return to bug 20366