Lines 861-878
Results are ordered from most to least recent.
Link Here
|
861 |
sub GetPendingOrders { |
861 |
sub GetPendingOrders { |
862 |
my ($supplierid,$grouped,$owner,$basketno,$ordernumber,$search,$ean) = @_; |
862 |
my ($supplierid,$grouped,$owner,$basketno,$ordernumber,$search,$ean) = @_; |
863 |
my $dbh = C4::Context->dbh; |
863 |
my $dbh = C4::Context->dbh; |
864 |
my $strsth = " |
864 |
my $strsth = q{SELECT }; |
865 |
SELECT ".($grouped?"count(*),":"")."aqbasket.basketno, |
865 |
$strsth .= q{COUNT(*),} if $grouped; |
866 |
surname,firstname,biblio.*,biblioitems.isbn, |
866 |
$strsth .= q{ |
867 |
aqbasket.closedate, aqbasket.creationdate, aqbasket.basketname, |
867 |
aqbasket.basketno, |
868 |
aqorders.* |
868 |
borrowers.surname, |
|
|
869 |
borrowers.firstname, |
870 |
biblio.title, |
871 |
biblio.author, |
872 |
biblioitems.isbn, |
873 |
biblioitems.publishercode, |
874 |
biblioitems.publicationyear, |
875 |
aqbasket.closedate, |
876 |
aqbasket.creationdate, |
877 |
aqbasket.basketname, |
878 |
aqorders.* |
869 |
FROM aqorders |
879 |
FROM aqorders |
870 |
LEFT JOIN aqbasket ON aqbasket.basketno=aqorders.basketno |
880 |
LEFT JOIN aqbasket ON aqbasket.basketno=aqorders.basketno |
871 |
LEFT JOIN borrowers ON aqbasket.authorisedby=borrowers.borrowernumber |
881 |
LEFT JOIN borrowers ON aqbasket.authorisedby=borrowers.borrowernumber |
872 |
LEFT JOIN biblio ON biblio.biblionumber=aqorders.biblionumber |
882 |
LEFT JOIN biblio ON biblio.biblionumber=aqorders.biblionumber |
873 |
LEFT JOIN biblioitems ON biblioitems.biblionumber=biblio.biblionumber |
883 |
LEFT JOIN biblioitems ON biblioitems.biblionumber=biblio.biblionumber |
874 |
WHERE (quantity > quantityreceived OR quantityreceived is NULL) |
884 |
WHERE |
875 |
AND datecancellationprinted IS NULL"; |
885 |
(quantity > quantityreceived OR quantityreceived IS NULL) |
|
|
886 |
AND datecancellationprinted IS NULL |
887 |
}; |
876 |
my @query_params; |
888 |
my @query_params; |
877 |
my $userenv = C4::Context->userenv; |
889 |
my $userenv = C4::Context->userenv; |
878 |
if ( C4::Context->preference("IndependentBranches") ) { |
890 |
if ( C4::Context->preference("IndependentBranches") ) { |
Lines 2433-2442
sub GetInvoiceDetails {
Link Here
|
2433 |
|
2445 |
|
2434 |
my $invoice = $sth->fetchrow_hashref; |
2446 |
my $invoice = $sth->fetchrow_hashref; |
2435 |
|
2447 |
|
2436 |
$query = qq{ |
2448 |
$query = q{ |
2437 |
SELECT aqorders.*, biblio.* |
2449 |
SELECT |
|
|
2450 |
aqorders.*, |
2451 |
biblio.title, |
2452 |
biblio.author, |
2453 |
biblio.seriestitle, |
2454 |
biblioitems.isbn, |
2455 |
biblioitems.publishercode, |
2456 |
biblioitems.publicationyear, |
2457 |
biblioitems.volume |
2438 |
FROM aqorders |
2458 |
FROM aqorders |
2439 |
LEFT JOIN biblio ON aqorders.biblionumber = biblio.biblionumber |
2459 |
LEFT JOIN biblio ON aqorders.biblionumber = biblio.biblionumber |
|
|
2460 |
LEFT JOIN biblioitems ON biblioitems.biblionumber=biblio.biblionumber |
2440 |
WHERE invoiceid = ? |
2461 |
WHERE invoiceid = ? |
2441 |
}; |
2462 |
}; |
2442 |
$sth = $dbh->prepare($query); |
2463 |
$sth = $dbh->prepare($query); |