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

(-)a/C4/Serials.pm (-1 / +3 lines)
Lines 772-779 sub GetLatestSerials { Link Here
772
    my $dbh = C4::Context->dbh;
772
    my $dbh = C4::Context->dbh;
773
773
774
    my $statuses = join( ',', ( ARRIVED, MISSING_STATUSES ) );
774
    my $statuses = join( ',', ( ARRIVED, MISSING_STATUSES ) );
775
    my $strsth = "SELECT   serialid,serialseq, status, planneddate, publisheddate, notes
775
    my $strsth = "SELECT   serial.serialid,serialseq, status, planneddate, publisheddate, notes, price
776
                        FROM     serial
776
                        FROM     serial
777
                        INNER JOIN serialitems ON (serial.serialid=serialitems.serialid)
778
                        INNER JOIN items ON (serialitems.itemnumber=items.itemnumber)
777
                        WHERE    subscriptionid = ?
779
                        WHERE    subscriptionid = ?
778
                        AND      status IN ($statuses)
780
                        AND      status IN ($statuses)
779
                        ORDER BY publisheddate DESC LIMIT 0,$limit
781
                        ORDER BY publisheddate DESC LIMIT 0,$limit
(-)a/catalogue/detail.pl (+20 lines)
Lines 37-42 use C4::Search; # enabled_staff_search_views Link Here
37
use C4::Tags qw(get_tags);
37
use C4::Tags qw(get_tags);
38
use C4::XSLT;
38
use C4::XSLT;
39
use C4::Images;
39
use C4::Images;
40
use C4::Acquisition;
40
use Koha::DateUtils;
41
use Koha::DateUtils;
41
use C4::HTML5Media;
42
use C4::HTML5Media;
42
use C4::CourseReserves qw(GetItemCourseReservesInfo);
43
use C4::CourseReserves qw(GetItemCourseReservesInfo);
Lines 210-215 my @subscriptions = SearchSubscriptions({ biblionumber => $biblionumber, o Link Here
210
my @subs;
211
my @subs;
211
212
212
foreach my $subscription (@subscriptions) {
213
foreach my $subscription (@subscriptions) {
214
215
    #Get the order associated with this subscription to calculate and display subscription cost
216
    my $lastOrder;
217
    if ( subscriptionCurrentlyOnOrder $subscription->{subscriptionid}  ) {
218
        $lastOrder = GetLastOrderNotReceivedFromSubscriptionid( $subscription->{subscriptionid} );
219
    } else {
220
        $lastOrder = GetLastOrderReceivedFromSubscriptionid( $subscription->{subscriptionid} );
221
    }
222
    my $subscriptioncost = sprintf( "%.2f", ($lastOrder->{ecost} || 0) * ($lastOrder->{quantity} || 0) );
223
213
    my %cell;
224
    my %cell;
214
    my $serials_to_display;
225
    my $serials_to_display;
215
    $cell{subscriptionid}    = $subscription->{subscriptionid};
226
    $cell{subscriptionid}    = $subscription->{subscriptionid};
Lines 221-232 foreach my $subscription (@subscriptions) { Link Here
221
    $cell{callnumber}        = $subscription->{callnumber};
232
    $cell{callnumber}        = $subscription->{callnumber};
222
    $cell{location}          = $subscription->{location};
233
    $cell{location}          = $subscription->{location};
223
    $cell{closed}            = $subscription->{closed};
234
    $cell{closed}            = $subscription->{closed};
235
    $cell{subscriptioncost}  = $subscriptioncost;
224
    #get the three latest serials.
236
    #get the three latest serials.
225
    $serials_to_display = $subscription->{staffdisplaycount};
237
    $serials_to_display = $subscription->{staffdisplaycount};
226
    $serials_to_display = C4::Context->preference('StaffSerialIssueDisplayCount') unless $serials_to_display;
238
    $serials_to_display = C4::Context->preference('StaffSerialIssueDisplayCount') unless $serials_to_display;
227
    $cell{staffdisplaycount} = $serials_to_display;
239
    $cell{staffdisplaycount} = $serials_to_display;
228
    $cell{latestserials} =
240
    $cell{latestserials} =
229
      GetLatestSerials( $subscription->{subscriptionid}, $serials_to_display );
241
      GetLatestSerials( $subscription->{subscriptionid}, $serials_to_display );
242
243
    #Add the subscription cost to each of the latest serials for display
244
    my $i = 0;
245
    while ( $cell{latestserials}[$i] ) {
246
        $cell{latestserials}[$i]{total} = $subscriptioncost;
247
        $i++;
248
    }
249
230
    push @subs, \%cell;
250
    push @subs, \%cell;
231
}
251
}
232
252
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-1 / +6 lines)
Lines 6-11 Link Here
6
[% USE Branches %]
6
[% USE Branches %]
7
[% USE Biblio %]
7
[% USE Biblio %]
8
[% USE ColumnsSettings %]
8
[% USE ColumnsSettings %]
9
[% USE Price %]
9
[% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %]
10
[% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %]
10
[% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %]
11
[% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %]
11
12
Lines 567-572 Note that permanent location is a code, and location may be an authval. Link Here
567
            [% IF ( subscription.subscriptionnotes ) %]<p>[% subscription.subscriptionnotes | html | html_line_break %] </p>[% END %]
568
            [% IF ( subscription.subscriptionnotes ) %]<p>[% subscription.subscriptionnotes | html | html_line_break %] </p>[% END %]
568
            [% IF ( subscription.missinglist ) %]<p>Missing issues: [% subscription.missinglist | html %] </p>[% END %]
569
            [% IF ( subscription.missinglist ) %]<p>Missing issues: [% subscription.missinglist | html %] </p>[% END %]
569
            [% IF ( subscription.librariannote ) %]<p>([% subscription.librariannote | html %])</p>[% END %]
570
            [% IF ( subscription.librariannote ) %]<p>([% subscription.librariannote | html %])</p>[% END %]
571
            [% IF ( subscription.subscriptioncost ) %]<p>Total cost of the subscription is: [% subscription.subscriptioncost | $Price %]</p>[% END %]
570
            [% IF ( subscription.latestserials ) %]
572
            [% IF ( subscription.latestserials ) %]
571
            <p> The [% subscription.staffdisplaycount | html %] latest issues related to this subscription:</p>
573
            <p> The [% subscription.staffdisplaycount | html %] latest issues related to this subscription:</p>
572
            <table>
574
            <table>
Lines 575-580 Note that permanent location is a code, and location may be an authval. Link Here
575
                    <th>Date arrived</th>
577
                    <th>Date arrived</th>
576
                    <th>Date published</th>
578
                    <th>Date published</th>
577
                    <th>Status</th>
579
                    <th>Status</th>
580
                    <th>Issue price</th>
581
                    <th>Subscription cost</th>
578
                    <th>Note</th>
582
                    <th>Note</th>
579
                </tr>
583
                </tr>
580
            [% FOREACH latestserial IN subscription.latestserials %]
584
            [% FOREACH latestserial IN subscription.latestserials %]
Lines 596-601 Note that permanent location is a code, and location may be an authval. Link Here
596
                      [% IF ( latestserial.status7 ) %]Claimed[% END %]
600
                      [% IF ( latestserial.status7 ) %]Claimed[% END %]
597
                      [% IF ( latestserial.status8 ) %]Stopped[% END %]
601
                      [% IF ( latestserial.status8 ) %]Stopped[% END %]
598
                    </td>
602
                    </td>
603
                    <td>[% latestserial.price | $Price %]</td>
604
                    <td>[% latestserial.total | $Price %]</th>
599
                    <td>[% latestserial.notes | html %]</td>
605
                    <td>[% latestserial.notes | html %]</td>
600
                </tr>
606
                </tr>
601
            [% END %]
607
            [% END %]
602
- 

Return to bug 23450