Lines 681-687
sub GetBasketsInfosByBookseller {
Link Here
|
681 |
COUNT(DISTINCT aqorders.biblionumber) AS total_biblios, |
681 |
COUNT(DISTINCT aqorders.biblionumber) AS total_biblios, |
682 |
SUM( |
682 |
SUM( |
683 |
IF(aqorders.datereceived IS NULL |
683 |
IF(aqorders.datereceived IS NULL |
684 |
AND (aqorders.datecancellationprinted IS NULL OR aqorders.datecancellationprinted='0000-00-00') |
684 |
AND aqorders.datecancellationprinted IS NULL |
685 |
, aqorders.quantity |
685 |
, aqorders.quantity |
686 |
, 0) |
686 |
, 0) |
687 |
) AS expected_items, |
687 |
) AS expected_items, |
Lines 697-703
sub GetBasketsInfosByBookseller {
Link Here
|
697 |
$query.=" HAVING (closedate IS NULL OR ( |
697 |
$query.=" HAVING (closedate IS NULL OR ( |
698 |
SUM( |
698 |
SUM( |
699 |
IF(aqorders.datereceived IS NULL |
699 |
IF(aqorders.datereceived IS NULL |
700 |
AND (aqorders.datecancellationprinted IS NULL OR aqorders.datecancellationprinted='0000-00-00') |
700 |
AND aqorders.datecancellationprinted IS NULL |
701 |
, aqorders.quantity |
701 |
, aqorders.quantity |
702 |
, 0) |
702 |
, 0) |
703 |
) > 0))" |
703 |
) > 0))" |
Lines 1136-1150
sub GetOrders {
Link Here
|
1136 |
if ($cancelled) { |
1136 |
if ($cancelled) { |
1137 |
$orderby ||= q|biblioitems.publishercode, biblio.title|; |
1137 |
$orderby ||= q|biblioitems.publishercode, biblio.title|; |
1138 |
$query .= q| |
1138 |
$query .= q| |
1139 |
AND (datecancellationprinted IS NOT NULL |
1139 |
AND datecancellationprinted IS NOT NULL |
1140 |
AND datecancellationprinted <> '0000-00-00') |
|
|
1141 |
|; |
1140 |
|; |
1142 |
} |
1141 |
} |
1143 |
else { |
1142 |
else { |
1144 |
$orderby ||= |
1143 |
$orderby ||= |
1145 |
q|aqorders.datecancellationprinted desc, aqorders.timestamp desc|; |
1144 |
q|aqorders.datecancellationprinted desc, aqorders.timestamp desc|; |
1146 |
$query .= q| |
1145 |
$query .= q| |
1147 |
AND (datecancellationprinted IS NULL OR datecancellationprinted='0000-00-00') |
1146 |
AND datecancellationprinted IS NULL |
1148 |
|; |
1147 |
|; |
1149 |
} |
1148 |
} |
1150 |
|
1149 |
|
Lines 2188-2194
sub GetLateOrders {
Link Here
|
2188 |
OR aqorders.quantityreceived < aqorders.quantity |
2187 |
OR aqorders.quantityreceived < aqorders.quantity |
2189 |
) |
2188 |
) |
2190 |
AND aqbasket.closedate IS NOT NULL |
2189 |
AND aqbasket.closedate IS NOT NULL |
2191 |
AND (aqorders.datecancellationprinted IS NULL OR aqorders.datecancellationprinted='0000-00-00') |
2190 |
AND aqorders.datecancellationprinted IS NULL |
2192 |
"; |
2191 |
"; |
2193 |
if ($dbdriver eq "mysql") { |
2192 |
if ($dbdriver eq "mysql") { |
2194 |
$select .= " |
2193 |
$select .= " |
Lines 2396-2402
sub GetHistory {
Link Here
|
2396 |
$query .= " WHERE 1 "; |
2395 |
$query .= " WHERE 1 "; |
2397 |
|
2396 |
|
2398 |
unless ($get_canceled_order or (defined $orderstatus and $orderstatus eq 'cancelled')) { |
2397 |
unless ($get_canceled_order or (defined $orderstatus and $orderstatus eq 'cancelled')) { |
2399 |
$query .= " AND (datecancellationprinted is NULL or datecancellationprinted='0000-00-00') "; |
2398 |
$query .= " AND datecancellationprinted IS NULL "; |
2400 |
} |
2399 |
} |
2401 |
|
2400 |
|
2402 |
my @query_params = (); |
2401 |
my @query_params = (); |
Lines 3005-3011
sub GetBiblioCountByBasketno {
Link Here
|
3005 |
SELECT COUNT( DISTINCT( biblionumber ) ) |
3004 |
SELECT COUNT( DISTINCT( biblionumber ) ) |
3006 |
FROM aqorders |
3005 |
FROM aqorders |
3007 |
WHERE basketno = ? |
3006 |
WHERE basketno = ? |
3008 |
AND (datecancellationprinted IS NULL OR datecancellationprinted='0000-00-00') |
3007 |
AND datecancellationprinted IS NULL |
3009 |
"; |
3008 |
"; |
3010 |
|
3009 |
|
3011 |
my $sth = $dbh->prepare($query); |
3010 |
my $sth = $dbh->prepare($query); |
3012 |
- |
|
|