On the vendor result list, the "Item count" columns contain the sum of
all items ordered for a basket. But if an order is canceled, the item
count is not really meaningful.
This patch just adds, in parenthesis, the number of items canceled.
Test plan:
- create a basket and 3 orders with different number of items
- cancel 1 order
- verify on the supplier list that the number of items is correct and
the number of canceled items is correct too.
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Note: In case the biblio was deleted when the order was cancelled,
the number of biblios will be off.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
my $query = qq{
SELECT aqbasket.*,
SUM(aqorders.quantity) AS total_items,
my $query = qq{
SELECT aqbasket.*,
SUM(aqorders.quantity) AS total_items,
+ SUM(
+ IF ( aqorders.orderstatus = 'cancelled', aqorders.quantity, 0 )
+ ) AS total_items_cancelled,
COUNT(DISTINCT aqorders.biblionumber) AS total_biblios,
SUM(
IF(aqorders.datereceived IS NULL
COUNT(DISTINCT aqorders.biblionumber) AS total_biblios,
SUM(
IF(aqorders.datereceived IS NULL
[% END %]
<td>[% basket.basketno %]</td>
<td>[% basket.basketname %]</td>
[% END %]
<td>[% basket.basketno %]</td>
<td>[% basket.basketname %]</td>
- <td>[% basket.total_items %]</td>
+ <td>
+ [% basket.total_items %]
+ [% IF basket.total_items_cancelled %]
+ ([% basket.total_items_cancelled %] cancelled)
+ [% END %]
+ </td>
<td>[% basket.total_biblios %]</td>
<td>[% basket.expected_items %]</td>
<td>
<td>[% basket.total_biblios %]</td>
<td>[% basket.expected_items %]</td>
<td>