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

(-)a/C4/Acquisition.pm (-1 / +2 lines)
Lines 684-690 sub GetBasketsInfosByBookseller { Link Here
684
              AND (aqorders.datecancellationprinted IS NULL OR aqorders.datecancellationprinted='0000-00-00')
684
              AND (aqorders.datecancellationprinted IS NULL OR aqorders.datecancellationprinted='0000-00-00')
685
            , aqorders.quantity
685
            , aqorders.quantity
686
            , 0)
686
            , 0)
687
          ) AS expected_items
687
          ) AS expected_items,
688
	  SUM( aqorders.uncertainprice ) AS uncertainprices
688
        FROM aqbasket
689
        FROM aqbasket
689
          LEFT JOIN aqorders ON aqorders.basketno = aqbasket.basketno
690
          LEFT JOIN aqorders ON aqorders.basketno = aqbasket.basketno
690
        WHERE booksellerid = ?};
691
        WHERE booksellerid = ?};
(-)a/acqui/addorderiso2709.pl (+1 lines)
Lines 242-247 if ($op eq ""){ Link Here
242
            for (my $i = 0; $i < $count; $i++) {
242
            for (my $i = 0; $i < $count; $i++) {
243
                $budget_hash->{$budget_codes[$i]}->{quantity} += 1;
243
                $budget_hash->{$budget_codes[$i]}->{quantity} += 1;
244
                $budget_hash->{$budget_codes[$i]}->{price} = $itemprices[$i];
244
                $budget_hash->{$budget_codes[$i]}->{price} = $itemprices[$i];
245
                $budget_hash->{$budget_codes[$i]}->{replacementprice} = $replacementprices[$i];
245
                $budget_hash->{$budget_codes[$i]}->{itemnumbers} //= [];
246
                $budget_hash->{$budget_codes[$i]}->{itemnumbers} //= [];
246
                push @{ $budget_hash->{$budget_codes[$i]}->{itemnumbers} }, $itemnumbers[$i];
247
                push @{ $budget_hash->{$budget_codes[$i]}->{itemnumbers} }, $itemnumbers[$i];
247
            }
248
            }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt (-2 / +5 lines)
Lines 150-158 Link Here
150
                                                    <a class="btn btn-default btn-xs" role="button" href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno | html %]"><i class="fa fa-eye"></i> View</a><a class="btn btn-default btn-xs dropdown-toggle" id="basketactions[% basket.basknetno | html %]" role="button" data-toggle="dropdown" href="#"><b class="caret"></b></a>
150
                                                    <a class="btn btn-default btn-xs" role="button" href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno | html %]"><i class="fa fa-eye"></i> View</a><a class="btn btn-default btn-xs dropdown-toggle" id="basketactions[% basket.basknetno | html %]" role="button" data-toggle="dropdown" href="#"><b class="caret"></b></a>
151
                                                    <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="basketactions[% basketn.basketno | html %]">
151
                                                    <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="basketactions[% basketn.basketno | html %]">
152
                                                        <li><a id="addtoBasketLabel[% basket.basketno | html %]" href="#addtoBasket[% basket.basketno | html %]" role="button" data-toggle="modal"><i class="fa fa-plus"></i> Add to basket</a></li>
152
                                                        <li><a id="addtoBasketLabel[% basket.basketno | html %]" href="#addtoBasket[% basket.basketno | html %]" role="button" data-toggle="modal"><i class="fa fa-plus"></i> Add to basket</a></li>
153
                                                        [% IF basket.total_items %]
153
                                                        [% IF basket.uncertainprices %]
154
                                                        <li><a href="/cgi-bin/koha/acqui/basket.pl?op=close&basketno=[% basket.basketno | html %]&booksellerid=[% supplier.id | html %]"><i class="fa fa-times-circle"></i> Close this basket</a></li>
154
                                                        <li><a href="/cgi-bin/koha/acqui/uncertainprice.pl?booksellerid=[% basket.booksellerid | html %]&owner=1"><i class="fa fa-usd"></i> Uncertain prices</a></li>
155
                                                        [% ELSIF basket.total_items && !basket.is_standing %]
156
                                                        <li><a href="/cgi-bin/koha/acqui/basket.pl?op=close&basketno=[% basket.basketno | html %]&booksellerid=[% basket.booksellerid | html %]"><i class="fa fa-times-circle"></i> Close this basket</a></li>
155
                                                        [% END %]
157
                                                        [% END %]
158
156
                                                    </ul>
159
                                                    </ul>
157
                                                    <!-- Modal -->
160
                                                    <!-- Modal -->
158
                                                    <div id="addtoBasket[% basket.basketno | html %]" class="modal" tabindex="-1" role="dialog" aria-labelledby="addtoBasketLabel[% basket.basketno | html %]" aria-hidden="true" data-basketno="[% basket.basketname | html %]">
161
                                                    <div id="addtoBasket[% basket.basketno | html %]" class="modal" tabindex="-1" role="dialog" aria-labelledby="addtoBasketLabel[% basket.basketno | html %]" aria-hidden="true" data-basketno="[% basket.basketname | html %]">
(-)a/t/db_dependent/Acquisition/GetBasketsInfosByBookseller.t (-2 / +15 lines)
Lines 1-7 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
2
3
use Modern::Perl;
3
use Modern::Perl;
4
use Test::More tests => 40;
4
use Test::More tests => 43;
5
use Data::Dumper;
5
use Data::Dumper;
6
6
7
use C4::Acquisition qw( NewBasket GetBasketsInfosByBookseller );
7
use C4::Acquisition qw( NewBasket GetBasketsInfosByBookseller );
Lines 72-77 is( $basket->{total_items_cancelled}, 0, 'Start with 0 item cancelled' ); Link Here
72
is( $basket->{expected_items}, 6, 'Start with 6 items expected' );
72
is( $basket->{expected_items}, 6, 'Start with 6 items expected' );
73
is( $basket->{total_biblios_cancelled}, 0, 'Start with 0 biblio cancelled' );
73
is( $basket->{total_biblios_cancelled}, 0, 'Start with 0 biblio cancelled' );
74
74
75
$order1->uncertainprice(1)->store;
76
$baskets = C4::Acquisition::GetBasketsInfosByBookseller( $supplierid );
77
$basket = $baskets->[0];
78
is( $basket->{uncertainprices}, 1, "Uncertain prcies returns number of uncertain items");
79
$order2->uncertainprice(1)->store;
80
$baskets = C4::Acquisition::GetBasketsInfosByBookseller( $supplierid );
81
$basket = $baskets->[0];
82
is( $basket->{uncertainprices}, 2, "Uncertain prcies returns number of uncertain items");
83
$order1->uncertainprice(0)->store;
84
$order2->uncertainprice(0)->store;
85
$baskets = C4::Acquisition::GetBasketsInfosByBookseller( $supplierid );
86
$basket = $baskets->[0];
87
is( $basket->{uncertainprices}, 0, "Uncertain prcies returns number of uncertain items");
88
75
C4::Acquisition::DelOrder( $biblionumber2, $ordernumber2 );
89
C4::Acquisition::DelOrder( $biblionumber2, $ordernumber2 );
76
$baskets = C4::Acquisition::GetBasketsInfosByBookseller( $supplierid );
90
$baskets = C4::Acquisition::GetBasketsInfosByBookseller( $supplierid );
77
is( scalar(@$baskets), 1, 'Order2 deleted, still 1 basket' );
91
is( scalar(@$baskets), 1, 'Order2 deleted, still 1 basket' );
78
- 

Return to bug 21364