Bugzilla – Attachment 27319 Details for
Bug 11243
Supplier list counts all items, even canceled ones
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
0002-PASSED-QA-Bug-11243-Display-count-of-items-and-bibli.patch
0002-PASSED-QA-Bug-11243-Display-count-of-items-and-bibli.patch (text/plain), 3.39 KB, created by
Katrin Fischer
on 2014-04-20 08:44:27 UTC
(
hide
)
Description:
0002-PASSED-QA-Bug-11243-Display-count-of-items-and-bibli.patch
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2014-04-20 08:44:27 UTC
Size:
3.39 KB
patch
obsolete
>From 3c1e57cb9518a345d910fdbc0a72584530e55453 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Wed, 20 Nov 2013 10:12:00 +0100 >Subject: [PATCH 2/3] [PASSED QA] Bug 11243: Display count of items and biblios > cancelled > >Same as previous patch but for the biblios count. > >Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> >Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> >--- > C4/Acquisition.pm | 22 +++++++++++++++++++--- > .../prog/en/modules/acqui/booksellers.tt | 7 ++++++- > 2 files changed, 25 insertions(+), 4 deletions(-) > >diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm >index dbc2714..4bb3c6e 100644 >--- a/C4/Acquisition.pm >+++ b/C4/Acquisition.pm >@@ -632,7 +632,7 @@ sub GetBasketsInfosByBookseller { > return unless $supplierid; > > my $dbh = C4::Context->dbh; >- my $query = qq{ >+ my $query = q{ > SELECT aqbasket.*, > SUM(aqorders.quantity) AS total_items, > SUM( >@@ -648,14 +648,30 @@ sub GetBasketsInfosByBookseller { > FROM aqbasket > LEFT JOIN aqorders ON aqorders.basketno = aqbasket.basketno > WHERE booksellerid = ?}; >- if(!$allbaskets) { >+ >+ unless ( $allbaskets ) { > $query.=" AND (closedate IS NULL OR (aqorders.quantity > aqorders.quantityreceived AND datecancellationprinted IS NULL))"; > } > $query.=" GROUP BY aqbasket.basketno"; > > my $sth = $dbh->prepare($query); > $sth->execute($supplierid); >- return $sth->fetchall_arrayref({}); >+ my $baskets = $sth->fetchall_arrayref({}); >+ >+ # Retrieve the number of biblios cancelled >+ my $cancelled_biblios = $dbh->selectall_hashref( q| >+ SELECT COUNT(DISTINCT(biblionumber)) AS total_biblios_cancelled, aqbasket.basketno >+ FROM aqbasket >+ LEFT JOIN aqorders ON aqorders.basketno = aqbasket.basketno >+ WHERE booksellerid = ? >+ AND aqorders.orderstatus = 'cancelled' >+ GROUP BY aqbasket.basketno >+ |, 'basketno', {}, $supplierid ); >+ map { >+ $_->{total_biblios_cancelled} = $cancelled_biblios->{$_->{basketno}}{total_biblios_cancelled} || 0 >+ } @$baskets; >+ >+ return $baskets; > } > > =head3 GetBasketUsers >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt >index 1e90ebf..e6527a5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt >@@ -122,7 +122,12 @@ $(document).ready(function() { > ([% basket.total_items_cancelled %] cancelled) > [% END %] > </td> >- <td>[% basket.total_biblios %]</td> >+ <td> >+ [% basket.total_biblios %] >+ [% IF basket.total_biblios_cancelled %] >+ ([% basket.total_biblios_cancelled %] cancelled) >+ [% END %] >+ </td> > <td>[% basket.expected_items %]</td> > <td> > [% basket.authorisedby_firstname %] >-- >1.8.3.2 >
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 11243
:
22906
|
22946
|
23050
|
23051
|
23844
|
23845
|
23846
|
27318
| 27319 |
27320