View | Details | Raw Unified | Return to bug 9824
Collapse All | Expand All

(-)a/C4/Acquisition.pm (-5 / +7 lines)
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({});
(-)a/acqui/booksellers.pl (-1 / +2 lines)
Lines 75-80 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
75
#parameters
75
#parameters
76
my $supplier = $query->param('supplier');
76
my $supplier = $query->param('supplier');
77
my $booksellerid = $query->param('booksellerid');
77
my $booksellerid = $query->param('booksellerid');
78
my $allbaskets= $query->param('allbaskets')||0;
78
my @suppliers;
79
my @suppliers;
79
80
80
if ($booksellerid) {
81
if ($booksellerid) {
Lines 106-112 my $userbranch = $userenv->{branch}; Link Here
106
my $loop_suppliers = [];
107
my $loop_suppliers = [];
107
108
108
for my $vendor (@suppliers) {
109
for my $vendor (@suppliers) {
109
    my $baskets = GetBasketsInfosByBookseller( $vendor->{id} );
110
    my $baskets = GetBasketsInfosByBookseller( $vendor->{id}, $allbaskets );
110
111
111
    my $loop_basket = [];
112
    my $loop_basket = [];
112
113
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt (-3 / +3 lines)
Lines 56-67 $(document).ready(function() { Link Here
56
    [% UNLESS (count == 1) %]
56
    [% UNLESS (count == 1) %]
57
        <p>Choose a vendor in the list to jump directly to the right place.
57
        <p>Choose a vendor in the list to jump directly to the right place.
58
        <select id="supplierlist">
58
        <select id="supplierlist">
59
            [% FOREACH supplier IN loop_suppliers %]
59
            [% FOREACH supplier1 IN loop_suppliers %]
60
                <option value="[% supplier.booksellerid %]">[% supplier.name %]</option>
60
                <option value="[% supplier1.booksellerid %]">[% supplier1.name %]</option>
61
            [% END %]
61
            [% END %]
62
        </select>
62
        </select>
63
        </p>
63
        </p>
64
    [% END %]
64
    [% END %]
65
    <p><a href="/cgi-bin/koha/acqui/booksellers.pl?supplier=[% supplier %]&allbaskets=1">Cancel filter</a></p>
65
    <div id="acqui_order_supplierlist">
66
    <div id="acqui_order_supplierlist">
66
        [% FOREACH supplier IN loop_suppliers %]
67
        [% FOREACH supplier IN loop_suppliers %]
67
            <div class="supplier">
68
            <div class="supplier">
68
- 

Return to bug 9824