Bugzilla – Attachment 75710 Details for
Bug 20726
Display acquisition details on the subscription detail page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20726: Add acquisition history on the subscription detail page
Bug-20726-Add-acquisition-history-on-the-subscript.patch (text/plain), 9.92 KB, created by
Séverine Queune
on 2018-05-31 16:02:06 UTC
(
hide
)
Description:
Bug 20726: Add acquisition history on the subscription detail page
Filename:
MIME Type:
Creator:
Séverine Queune
Created:
2018-05-31 16:02:06 UTC
Size:
9.92 KB
patch
obsolete
>From 9c370b81a3926908c84ec3bc7c3b79bdb648e2d4 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 7 May 2018 20:00:25 -0300 >Subject: [PATCH] Bug 20726: Add acquisition history on the subscription detail > page >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Since bug 20365 is going to add the ability to create several pending orders on >the same subscription we should display the history of the acquisitions on the >subscription detail page. > >Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> >--- > .../prog/en/modules/serials/subscription-detail.tt | 73 +++++++++++++++------- > serials/subscription-detail.pl | 66 ++----------------- > 2 files changed, 56 insertions(+), 83 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt >index ac4b8f8..a376dba 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt >@@ -1,7 +1,9 @@ > [% USE Asset %] > [% USE Koha %] >+[% USE KohaDates %] > [% USE Branches %] > [% USE AuthorisedValues %] >+[% USE Price %] > [% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Serials › Details for subscription #[% subscriptionid %]</title> >@@ -327,42 +329,71 @@ > </div> > </div> > >- [% IF ( show_acquisition_details ) %] >+ [% IF orders %] > <div id="acquisition_details"> > <h2>Acquisition details</h2> >- <table> >+ <table id="orders"> > <thead> >- <tr><th></th><th>Price exc. taxes</th><th>Price inc. taxes</th><th>Fund</th><th></th></tr> >+ <tr> >+ <th>Invoice</th> >+ <th>Basket</th> >+ <th>Order number</th> >+ <th class="title-string">Creation date</th> >+ <th class="title-string">Receive date</th> >+ <th>Status</th> >+ <th>Fund</th> >+ <th>Ordered</th> >+ <th>Spent</th> >+ </tr> > </thead> > <tbody> >+ [% FOR order IN orders %] > <tr> >- <td>Ordered amount</td> >- <td>[% value_tax_excluded_ordered %]</td> >- <td>[% value_tax_included_ordered %]</td> >- <td>[% budget_name_ordered %]</td> > <td> >- [% IF ( ordered_exists ) %] >- <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]">See basket information</a> >+ [% IF order.invoice %] >+ [% IF CAN_user_acquisition %] >+ <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% order.invoiceid %]" title="Invoice detail page"> >+ [% order.invoice.invoicenumber %]</a> >+ [% ELSE %] >+ [% order.invoice.invoicenumber %] > [% END %] >+ [% END %] > </td> >- </tr> >- <tr> >- <td>Spent amount</td> >- <td>[% value_tax_excluded_spent %]</td> >- <td>[% value_tax_included_spent %]</td> >- <td>[% budget_name_spent %]</td> >+ <td>[% IF CAN_user_acquisition_order_manage %] >+ <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% order.basketno %]">[% order.basket.basketname %] ([% order.basketno %])</a> >+ [% ELSE %] >+ [% order.basket.basketname %] ([% order.basketno %]) >+ [% END %]</td> >+ <td>[% order.ordernumber %]</td> >+ <td><span title="[% order.basket.creationdate %]">[% order.basket.creationdate | $KohaDates%]</span></td> >+ <td><span title="[% order.datereceived %]">[% order.datereceived | $KohaDates%]</span></td> > <td> >- [% IF ( spent_exists ) %] >- <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoiceid %]">See invoice information</a> >+ [% SWITCH order.orderstatus %] >+ [% CASE 'new' %]New >+ [% CASE 'ordered' %]Ordered >+ [% CASE 'partial' %]Partial >+ [% CASE 'complete' %]Complete >+ [% CASE 'cancelled' %]Cancelled >+ [% END %] >+ </td> >+ <td>[% order.fund.budget_name %]</td> >+ <td> >+ [% UNLESS order.datereceived %] >+ [% order.ecost_tax_excluded | $Price %] / [% order.ecost_tax_included | $Price %] >+ [% END %] >+ </td> >+ <td> >+ [% IF order.datereceived %] >+ [%# FIXME What if unitprice has not been filled? %] >+ [% order.unitprice_tax_excluded | $Price %] / [% order.unitprice_tax_included | $Price %] > [% END %] > </td> > </tr> >+ [% END %] > </tbody> > </table> >- </div> >- [% END %] >- >- >+ </div> >+ [% END %] > > </div> > </div> >diff --git a/serials/subscription-detail.pl b/serials/subscription-detail.pl >index b7e7c05..cc7a5d2 100755 >--- a/serials/subscription-detail.pl >+++ b/serials/subscription-detail.pl >@@ -116,32 +116,6 @@ my $numberpattern = C4::Serials::Numberpattern::GetSubscriptionNumberpattern($su > > my $default_bib_view = get_default_view(); > >-my ( $order, $bookseller, $tmpl_infos ); >-if ( defined $subscriptionid ) { >- my $lastOrderNotReceived = GetLastOrderNotReceivedFromSubscriptionid $subscriptionid; >- my $lastOrderReceived = GetLastOrderReceivedFromSubscriptionid $subscriptionid; >- if ( defined $lastOrderNotReceived ) { >- my $basket = GetBasket $lastOrderNotReceived->{basketno}; >- my $bookseller = Koha::Acquisition::Booksellers->find( $basket->{booksellerid} ); >- ( $tmpl_infos->{value_tax_included_ordered}, $tmpl_infos->{value_tax_excluded_ordered} ) = get_value_with_gst_params ( $lastOrderNotReceived->{ecost}, $lastOrderNotReceived->{tax_rate}, $bookseller ); >- $tmpl_infos->{value_tax_included_ordered} = sprintf( "%.2f", $tmpl_infos->{value_tax_included_ordered} ); >- $tmpl_infos->{value_tax_excluded_ordered} = sprintf( "%.2f", $tmpl_infos->{value_tax_excluded_ordered} ); >- $tmpl_infos->{budget_name_ordered} = GetBudgetName $lastOrderNotReceived->{budget_id}; >- $tmpl_infos->{basketno} = $lastOrderNotReceived->{basketno}; >- $tmpl_infos->{ordered_exists} = 1; >- } >- if ( defined $lastOrderReceived ) { >- my $basket = GetBasket $lastOrderReceived->{basketno}; >- my $bookseller = Koha::Acquisition::Booksellers->find( $basket->{booksellerid} ); >- ( $tmpl_infos->{value_tax_included_spent}, $tmpl_infos->{value_tax_excluded_spent} ) = get_value_with_gst_params ( $lastOrderReceived->{unitprice}, $lastOrderReceived->{tax_rate}, $bookseller ); >- $tmpl_infos->{value_tax_included_spent} = sprintf( "%.2f", $tmpl_infos->{value_tax_included_spent} ); >- $tmpl_infos->{value_tax_excluded_spent} = sprintf( "%.2f", $tmpl_infos->{value_tax_excluded_spent} ); >- $tmpl_infos->{budget_name_spent} = GetBudgetName $lastOrderReceived->{budget_id}; >- $tmpl_infos->{invoiceid} = $lastOrderReceived->{invoiceid}; >- $tmpl_infos->{spent_exists} = 1; >- } >-} >- > my $additional_fields = Koha::AdditionalField->all( { tablename => 'subscription' } ); > for my $field ( @$additional_fields ) { > if ( $field->{authorised_value_category} ) { >@@ -150,6 +124,9 @@ for my $field ( @$additional_fields ) { > } > $template->param( additional_fields_for_subscription => $additional_fields ); > >+# FIXME Do we want to hide canceled orders? >+my $orders = Koha::Acquisition::Orders->search( { subscriptionid => $subscriptionid } ); >+ > $template->param( > subscriptionid => $subscriptionid, > serialslist => \@serialslist, >@@ -166,10 +143,8 @@ $template->param( > intranetcolorstylesheet => C4::Context->preference('intranetcolorstylesheet'), > irregular_issues => scalar @irregular_issues, > default_bib_view => $default_bib_view, >+ orders => $orders, > (uc(C4::Context->preference("marcflavour"))) => 1, >- show_acquisition_details => defined $tmpl_infos->{ordered_exists} || defined $tmpl_infos->{spent_exists} ? 1 : 0, >- basketno => $order->{basketno}, >- %$tmpl_infos, > ); > > output_html_with_http_headers $query, $cookie, $template->output; >@@ -188,36 +163,3 @@ sub get_default_view { > } > return 'detail'; > } >- >-sub get_value_with_gst_params { >- my $value = shift; >- my $tax_rate = shift; >- my $bookseller = shift; >- if ( $bookseller->listincgst ) { >- return ( $value, $value / ( 1 + $tax_rate ) ); >- } else { >- return ( $value * ( 1 + $tax_rate ), $value ); >- } >-} >- >-sub get_tax_excluded { >- my $value = shift; >- my $tax_rate = shift; >- my $bookseller = shift; >- if ( $bookseller->invoiceincgst ) { >- return $value / ( 1 + $tax_rate ); >- } else { >- return $value; >- } >-} >- >-sub get_gst { >- my $value = shift; >- my $tax_rate = shift; >- my $bookseller = shift; >- if ( $bookseller->invoiceincgst ) { >- return $value / ( 1 + $tax_rate ) * $tax_rate; >- } else { >- return $value * ( 1 + $tax_rate ) - $value; >- } >-} >-- >2.1.4
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 20726
:
75146
|
75147
|
75148
|
75149
|
75150
|
75650
|
75651
|
75666
|
75708
|
75709
|
75710
|
75711
|
75712
|
75713
|
75794
|
77428
|
77429
|
77430
|
77431
|
77432
|
77433
|
77434
|
77500
|
77501
|
77502
|
77503
|
77504
|
77505
|
77506
|
78062
|
78063
|
78064
|
78065
|
78066
|
78067
|
78068