Lines 578-584
Returns in a arrayref of hashref all about booksellers baskets, plus:
Link Here
|
578 |
=cut |
578 |
=cut |
579 |
|
579 |
|
580 |
sub GetBasketsInfosByBookseller { |
580 |
sub GetBasketsInfosByBookseller { |
581 |
my ($supplierid) = @_; |
581 |
my ($supplierid, $allbaskets) = @_; |
582 |
|
582 |
|
583 |
return unless $supplierid; |
583 |
return unless $supplierid; |
584 |
|
584 |
|
Lines 595-604
sub GetBasketsInfosByBookseller {
Link Here
|
595 |
) AS expected_items |
595 |
) AS expected_items |
596 |
FROM aqbasket |
596 |
FROM aqbasket |
597 |
LEFT JOIN aqorders ON aqorders.basketno = aqbasket.basketno |
597 |
LEFT JOIN aqorders ON aqorders.basketno = aqbasket.basketno |
598 |
WHERE booksellerid = ? AND ( aqorders.quantity > aqorders.quantityreceived OR quantityreceived IS NULL) |
598 |
WHERE booksellerid = ?}; |
599 |
AND datecancellationprinted IS NULL |
599 |
if(!$allbaskets) { |
600 |
GROUP BY aqbasket.basketno |
600 |
$query.=" AND (closedate IS NULL OR (aqorders.quantity > aqorders.quantityreceived AND datecancellationprinted IS NULL))"; |
601 |
}; |
601 |
} |
|
|
602 |
$query.=" GROUP BY aqbasket.basketno"; |
603 |
|
602 |
my $sth = $dbh->prepare($query); |
604 |
my $sth = $dbh->prepare($query); |
603 |
$sth->execute($supplierid); |
605 |
$sth->execute($supplierid); |
604 |
return $sth->fetchall_arrayref({}); |
606 |
return $sth->fetchall_arrayref({}); |