Bugzilla – Attachment 23050 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]
Bug 11243: Display count of items and biblios cancelled
Bug-11243-Display-count-of-items-and-biblios-cance.patch (text/plain), 3.26 KB, created by
Jonathan Druart
on 2013-11-20 09:14:01 UTC
(
hide
)
Description:
Bug 11243: Display count of items and biblios cancelled
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2013-11-20 09:14:01 UTC
Size:
3.26 KB
patch
obsolete
>From e7fb65b88b358e9172561a0a50cefb7132a73898 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] Bug 11243: Display count of items and biblios cancelled > >Same as previous patch but for the biblios count. >--- > 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 a9af527..c6f3fbf 100644 >--- a/C4/Acquisition.pm >+++ b/C4/Acquisition.pm >@@ -635,7 +635,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( >@@ -651,14 +651,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 f5f044c..d85e96a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt >@@ -121,7 +121,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.7.10.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 11243
:
22906
|
22946
|
23050
|
23051
|
23844
|
23845
|
23846
|
27318
|
27319
|
27320