Merge branch 'bug_9824' into 3.14-master
This commit is contained in:
commit
fe54d7ca24
|
|
@ -578,7 +578,7 @@ Returns in a arrayref of hashref all about booksellers baskets, plus:
|
|||
=cut
|
||||
|
||||
sub GetBasketsInfosByBookseller {
|
||||
my ($supplierid) = @_;
|
||||
my ($supplierid, $allbaskets) = @_;
|
||||
|
||||
return unless $supplierid;
|
||||
|
||||
|
|
@ -595,10 +595,12 @@ sub GetBasketsInfosByBookseller {
|
|||
) AS expected_items
|
||||
FROM aqbasket
|
||||
LEFT JOIN aqorders ON aqorders.basketno = aqbasket.basketno
|
||||
WHERE booksellerid = ? AND ( aqorders.quantity > aqorders.quantityreceived OR quantityreceived IS NULL)
|
||||
AND datecancellationprinted IS NULL
|
||||
GROUP BY aqbasket.basketno
|
||||
};
|
||||
WHERE booksellerid = ?};
|
||||
if(!$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({});
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
|
|||
#parameters
|
||||
my $supplier = $query->param('supplier');
|
||||
my $booksellerid = $query->param('booksellerid');
|
||||
my $allbaskets= $query->param('allbaskets')||0;
|
||||
my @suppliers;
|
||||
|
||||
if ($booksellerid) {
|
||||
|
|
@ -106,7 +107,7 @@ my $userbranch = $userenv->{branch};
|
|||
my $loop_suppliers = [];
|
||||
|
||||
for my $vendor (@suppliers) {
|
||||
my $baskets = GetBasketsInfosByBookseller( $vendor->{id} );
|
||||
my $baskets = GetBasketsInfosByBookseller( $vendor->{id}, $allbaskets );
|
||||
|
||||
my $loop_basket = [];
|
||||
|
||||
|
|
@ -150,5 +151,6 @@ $template->param(
|
|||
supplier => ( $booksellerid || $supplier ),
|
||||
count => $supplier_count,
|
||||
);
|
||||
$template->{VARS}->{'allbaskets'} = $allbaskets;
|
||||
|
||||
output_html_with_http_headers $query, $cookie, $template->output;
|
||||
|
|
|
|||
|
|
@ -56,12 +56,19 @@ $(document).ready(function() {
|
|||
[% UNLESS (count == 1) %]
|
||||
<p>Choose a vendor in the list to jump directly to the right place.
|
||||
<select id="supplierlist">
|
||||
[% FOREACH supplier IN loop_suppliers %]
|
||||
<option value="[% supplier.booksellerid %]">[% supplier.name %]</option>
|
||||
[% FOREACH supplier1 IN loop_suppliers %]
|
||||
<option value="[% supplier1.booksellerid %]">[% supplier1.name %]</option>
|
||||
[% END %]
|
||||
</select>
|
||||
</p>
|
||||
[% END %]
|
||||
<p>
|
||||
[% IF ( allbaskets ) %]
|
||||
<a href="/cgi-bin/koha/acqui/booksellers.pl?supplier=[% supplier %]&booksellerid=[% booksellerid %]">Apply filter</a>
|
||||
[% ELSE %]
|
||||
<a href="/cgi-bin/koha/acqui/booksellers.pl?supplier=[% supplier %]&booksellerid=[% booksellerid %]&allbaskets=1">Cancel filter</a>
|
||||
[% END %]
|
||||
</p>
|
||||
<div id="acqui_order_supplierlist">
|
||||
[% FOREACH supplier IN loop_suppliers %]
|
||||
<div class="supplier">
|
||||
|
|
|
|||
Loading…
Reference in New Issue