Bugzilla – Attachment 81807 Details for
Bug 21467
Allow several receipts for a given subscription
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21467: Display a summary line per parent_ordernumber
Bug-21467-Display-a-summary-line-per-parentordernu.patch (text/plain), 7.52 KB, created by
Katrin Fischer
on 2018-11-01 13:50:50 UTC
(
hide
)
Description:
Bug 21467: Display a summary line per parent_ordernumber
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2018-11-01 13:50:50 UTC
Size:
7.52 KB
patch
obsolete
>From aaf5ca9d365c3be4dcd5f633b0ed68ddaa295ef9 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 12 Oct 2018 15:19:28 -0300 >Subject: [PATCH] Bug 21467: Display a summary line per parent_ordernumber >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This will help to keep track of the different orders for a given >subscription. > >Sponsored-by: BULAC - http://www.bulac.fr/ > >Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > .../prog/en/modules/serials/subscription-detail.tt | 48 ++++++++++++++++------ > serials/subscription-detail.pl | 18 +++++++- > 2 files changed, 52 insertions(+), 14 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 4f4fe026e0..ad727b0b82 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 >@@ -346,7 +346,7 @@ > </div> > </div> > >- [% IF orders.count %] >+ [% IF orders_grouped.size %] > <div id="acquisition_details"> > <h2>Acquisition details</h2> > <table id="orders"> >@@ -373,12 +373,39 @@ > </tr> > </thead> > <tbody> >- [% FOR order IN orders %] >- [% IF order.parent_ordernumber != order.ordernumber %] >- <tr data-tt-id="[% order.ordernumber | html %]" data-tt-parent-id="[% order.parent_ordernumber | html %]"> >- [% ELSE %] >- <tr data-tt-id="[% order.parent_ordernumber | html %]"> >- [% END %] >+ [% FOR ordernumber IN orders_grouped.keys %] >+ [% SET parent_tree_id = loop.count %] >+ [% SET parent_order = orders_grouped.$ordernumber %] >+ <tr data-tt-id="[% parent_tree_id | html %]" class="highlighted-row"> >+ <td></td> [%# invoice %] >+ <td> >+ [% IF CAN_user_acquisition_order_manage %] >+ <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% order.basket.basketno | uri %]">[% parent_order.basket.basketname | html %] ([% parent_order.basket.basketno | html %])</a> >+ [% ELSE %] >+ [% parent_order.basket.basketname | html %] ([% parent_order.basket.basketno | html %]) >+ [% END %] >+ </td> >+ <td></td> [%# ordernumber %] >+ <td>[% parent_order.basket.creationdate | $KohaDates %]</td> >+ <td>[% parent_order.datereceived | $KohaDates %]</td> >+ <td> >+ [% SWITCH parent_order.orderstatus %] >+ [% CASE 'new' %]<span title="status_1">New</span> >+ [% CASE 'ordered' %]<span title="status_2">Ordered</span> >+ [% CASE 'partial' %]<span title="status_3">Partial</span> >+ [% CASE 'complete' %]<span title="status_4">Complete</span> >+ [% CASE 'cancelled' %]<span title="status_5">Cancelled</span> >+ [% END %] >+ </td> >+ <td></td> [%# internalnote %] >+ <td></td> [%# vendornote %] >+ <td></td> [%# fund %] >+ <td>[% parent_order.quantity | html %]</td> >+ <td>[% parent_order.ecost_tax_excluded | $Price %] / [% parent_order.ecost_tax_included | $Price %]</td> >+ <td>[% parent_order.unitprice_tax_excluded | $Price %] / [% parent_order.unitprice_tax_included | $Price %]</td> >+ </tr> >+ [% FOR order IN parent_order.orders %] >+ <tr data-tt-id="0" data-tt-parent-id="[% parent_tree_id | html %]"> > <td> > [% IF order.invoice %] > [% IF CAN_user_acquisition %] >@@ -389,11 +416,7 @@ > [% END %] > [% END %] > </td> >- <td>[% IF CAN_user_acquisition_order_manage %] >- <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% order.basketno | uri %]">[% order.basket.basketname | html %] ([% order.basketno | html %])</a> >- [% ELSE %] >- [% order.basket.basketname | html %] ([% order.basketno | html %]) >- [% END %]</td> >+ <td></td> [%# basket %] > <td>[% order.ordernumber | html %]</td> > <td><span title="[% order.basket.creationdate | uri %]">[% order.basket.creationdate | $KohaDates%]</span></td> > <td>[% IF order.datereceived %]<span title="[% order.datereceived | uri %]">[% order.datereceived | $KohaDates %]</span>[% END %]</td> >@@ -422,6 +445,7 @@ > [% END %] > </td> > </tr> >+ [% END %] > [% END %] > </tbody> > </table> >diff --git a/serials/subscription-detail.pl b/serials/subscription-detail.pl >index 701a46f406..4e5be77428 100755 >--- a/serials/subscription-detail.pl >+++ b/serials/subscription-detail.pl >@@ -129,7 +129,21 @@ 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 }, { order_by => { -desc => 'parent_ordernumber' } } ); >+my $orders = Koha::Acquisition::Orders->search( { subscriptionid => $subscriptionid }, { order_by => [ { -desc => 'timestamp' }, \[ "field(orderstatus, 'ordered', 'partial', 'complete')" ] ] } ); >+my $orders_grouped; >+while ( my $o = $orders->next ) { >+ if ( $o->ordernumber == $o->parent_ordernumber ) { >+ $orders_grouped->{$o->parent_ordernumber}->{datereceived} = $o->datereceived; >+ $orders_grouped->{$o->parent_ordernumber}->{orderstatus} = $o->orderstatus; >+ $orders_grouped->{$o->parent_ordernumber}->{basket} = $o->basket; >+ } >+ $orders_grouped->{$o->parent_ordernumber}->{quantity} += $o->quantity; >+ $orders_grouped->{$o->parent_ordernumber}->{ecost_tax_excluded} += sprintf('%.2f', $o->ecost_tax_excluded * $o->quantity); >+ $orders_grouped->{$o->parent_ordernumber}->{ecost_tax_included} += sprintf('%.2f', $o->ecost_tax_included * $o->quantity); >+ $orders_grouped->{$o->parent_ordernumber}->{unitprice_tax_excluded} += sprintf('%.2f', $o->unitprice_tax_excluded * $o->quantity); >+ $orders_grouped->{$o->parent_ordernumber}->{unitprice_tax_included} += sprintf('%.2f', $o->unitprice_tax_included * $o->quantity); >+ push @{$orders_grouped->{$o->parent_ordernumber}->{orders}}, $o; >+} > > $template->param( > subscriptionid => $subscriptionid, >@@ -147,7 +161,7 @@ $template->param( > intranetcolorstylesheet => C4::Context->preference('intranetcolorstylesheet'), > irregular_issues => scalar @irregular_issues, > default_bib_view => $default_bib_view, >- orders => $orders, >+ orders_grouped => $orders_grouped, > (uc(C4::Context->preference("marcflavour"))) => 1, > ); > >-- >2.11.0
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 21467
:
79801
|
79802
|
79834
|
79835
|
79836
|
79837
|
79838
|
80546
|
80706
|
80707
|
80717
|
80718
|
80719
|
80720
|
80721
|
80722
|
80723
|
80724
|
81394
|
81395
|
81396
|
81397
|
81398
|
81399
|
81400
|
81430
|
81797
|
81798
|
81799
|
81800
|
81801
|
81802
|
81803
|
81804
|
81805
|
81806
|
81807
|
81808
|
81809
|
81810
|
81811
|
82117
|
82122
|
82123
|
82124
|
82125
|
82126
|
82127
|
82128
|
82129
|
82130
|
82131
|
82132