Bugzilla – Attachment 148113 Details for
Bug 23450
Display issue and subscription price for each issue in subscription tab of /catalogue/detail.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23450: Display serial and subscription price in biblio detail page
Bug-23450-Display-serial-and-subscription-price-in.patch (text/plain), 4.54 KB, created by
Alex Buckley
on 2023-03-12 22:00:29 UTC
(
hide
)
Description:
Bug 23450: Display serial and subscription price in biblio detail page
Filename:
MIME Type:
Creator:
Alex Buckley
Created:
2023-03-12 22:00:29 UTC
Size:
4.54 KB
patch
obsolete
>From 262ca68784c41e948813bf24ca5f0725a023bef5 Mon Sep 17 00:00:00 2001 >From: Alex Buckley <alexbuckley@catalyst.net.nz> >Date: Sun, 12 Mar 2023 20:42:13 +0000 >Subject: [PATCH] Bug 23450: Display serial and subscription price in biblio > detail page > >The 'Subscription' tab should display: >- Total subscription price (based on what's set in the linked order) >- Serial price based on what's set in the 952$g (items.price) > >Test plan: >1. Create a subscription >- Tick the 'Create an item record when receiving this serial' >radiobutton >2. Create an order, linking it to a subscription, set: >- Quantity: 2 >- Vendor price: 3 >3. Receive the serial >4. Set the 952$g (normal purchase price) as 5 >5. Visit the biblio detail page >6. View the 'Subscription' tab and confirm that: >- 'Total subscription cost is: 6.00' >- 'Issue price' in the table is 5.00 > >Sponsored-By: Brimbank Library, Australia >--- > C4/Serials.pm | 4 +++- > catalogue/detail.pl | 11 +++++++++++ > .../intranet-tmpl/prog/en/modules/catalogue/detail.tt | 3 +++ > 3 files changed, 17 insertions(+), 1 deletion(-) > >diff --git a/C4/Serials.pm b/C4/Serials.pm >index 75c9d7f19fd..818f383d2de 100644 >--- a/C4/Serials.pm >+++ b/C4/Serials.pm >@@ -746,8 +746,10 @@ sub GetLatestSerials { > my $dbh = C4::Context->dbh; > > my $statuses = join( ',', ( ARRIVED, MISSING_STATUSES ) ); >- my $strsth = "SELECT serialid,serialseq, status, planneddate, publisheddate, notes >+ my $strsth = "SELECT serial.serialid,serialseq, status, planneddate, publisheddate, notes, price > FROM serial >+ INNER JOIN serialitems ON (serial.serialid=serialitems.serialid) >+ INNER JOIN items ON (serialitems.itemnumber=items.itemnumber) > WHERE subscriptionid = ? > AND status IN ($statuses) > ORDER BY publisheddate DESC LIMIT 0,$limit >diff --git a/catalogue/detail.pl b/catalogue/detail.pl >index 905120ec9d4..1a367f28609 100755 >--- a/catalogue/detail.pl >+++ b/catalogue/detail.pl >@@ -239,6 +239,17 @@ foreach my $subscription (@subscriptions) { > $cell{staffdisplaycount} = $serials_to_display; > $cell{latestserials} = > GetLatestSerials( $subscription->{subscriptionid}, $serials_to_display ); >+ # Get subscription price >+ my $order = Koha::Acquisition::Orders->search( >+ { >+ subscriptionid => $subscription->{subscriptionid}, >+ } >+ )->next; >+ if ( $order->unitprice_tax_included > 0 ) { >+ $cell{price} = $order->quantity * $order->unitprice_tax_included; >+ } else { >+ $cell{price} = $order->quantity * $order->ecost_tax_included; >+ } > push @subs, \%cell; > } > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >index 707a5d7cf3f..c2fb054a661 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -791,6 +791,7 @@ Note that permanent location is a code, and location may be an authval. > [% IF ( subscription.subscriptionnotes ) %]<p>[% subscription.subscriptionnotes | html | html_line_break %] </p>[% END %] > [% IF ( subscription.missinglist ) %]<p>Missing issues: [% subscription.missinglist | html %] </p>[% END %] > [% IF ( subscription.librariannote ) %]<p>([% subscription.librariannote | html %])</p>[% END %] >+ [% IF ( subscription.price ) %]<p>Total cost of the subscription is: [% subscription.price | $Price %] </p>[% END %] > [% IF ( subscription.latestserials ) %] > <p> The [% subscription.staffdisplaycount | html %] latest issues related to this subscription:</p> > <table> >@@ -800,6 +801,7 @@ Note that permanent location is a code, and location may be an authval. > <th>Date published</th> > <th>Status</th> > <th>Note</th> >+ <th>Issue Price</th> > </tr> > [% FOREACH latestserial IN subscription.latestserials %] > <tr> >@@ -821,6 +823,7 @@ Note that permanent location is a code, and location may be an authval. > [% IF ( latestserial.status8 ) %]<span>Stopped</span>[% END %] > </td> > <td>[% latestserial.notes | html %]</td> >+ <td>[% latestserial.price | $Price %]</td> > </tr> > [% END %] > </table> >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 23450
:
92147
|
92148
|
101930
|
129128
|
129520
| 148113