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

(-)a/C4/Acquisition.pm (-5 / +3 lines)
Lines 2448-2454 sub GetInvoiceDetails { Link Here
2448
    }
2448
    }
2449
2449
2450
    my $dbh = C4::Context->dbh;
2450
    my $dbh = C4::Context->dbh;
2451
    my $query = qq{
2451
    my $query = q{
2452
        SELECT aqinvoices.*, aqbooksellers.name AS suppliername
2452
        SELECT aqinvoices.*, aqbooksellers.name AS suppliername
2453
        FROM aqinvoices
2453
        FROM aqinvoices
2454
          LEFT JOIN aqbooksellers ON aqinvoices.booksellerid = aqbooksellers.id
2454
          LEFT JOIN aqbooksellers ON aqinvoices.booksellerid = aqbooksellers.id
Lines 2459-2471 sub GetInvoiceDetails { Link Here
2459
2459
2460
    my $invoice = $sth->fetchrow_hashref;
2460
    my $invoice = $sth->fetchrow_hashref;
2461
2461
2462
    $query = qq{
2462
    $query = q{
2463
        SELECT aqorders.*, biblio.*, aqorders_items.itemnumber,
2463
        SELECT aqorders.*, biblio.*, aqbasket.basketname
2464
        aqbasket.basketname
2465
        FROM aqorders
2464
        FROM aqorders
2466
          LEFT JOIN aqbasket ON aqorders.basketno = aqbasket.basketno
2465
          LEFT JOIN aqbasket ON aqorders.basketno = aqbasket.basketno
2467
          LEFT JOIN biblio ON aqorders.biblionumber = biblio.biblionumber
2466
          LEFT JOIN biblio ON aqorders.biblionumber = biblio.biblionumber
2468
          LEFT JOIN aqorders_items ON aqorders.ordernumber = aqorders_items.ordernumber
2469
        WHERE invoiceid = ?
2467
        WHERE invoiceid = ?
2470
    };
2468
    };
2471
    $sth = $dbh->prepare($query);
2469
    $sth = $dbh->prepare($query);
(-)a/acqui/parcel.pl (-13 / +17 lines)
Lines 149-156 my $gst = $bookseller->{gstrate} // C4::Context->preference("gist") // 0; Link Here
149
my $datereceived = C4::Dates->new();
149
my $datereceived = C4::Dates->new();
150
150
151
my $cfstr         = "%.2f";                                                           # currency format string -- could get this from currency table.
151
my $cfstr         = "%.2f";                                                           # currency format string -- could get this from currency table.
152
my @parcelitems   = @{ $invoice->{orders} };
152
my @orders        = @{ $invoice->{orders} };
153
my $countlines    = scalar @parcelitems;
153
my $countlines    = scalar @orders;
154
my $totalprice    = 0;
154
my $totalprice    = 0;
155
my $totalquantity = 0;
155
my $totalquantity = 0;
156
my $total;
156
my $total;
Lines 161-181 my $total_quantity = 0; Link Here
161
my $total_gste = 0;
161
my $total_gste = 0;
162
my $total_gsti = 0;
162
my $total_gsti = 0;
163
163
164
for my $item ( @parcelitems ) {
164
for my $order ( @orders ) {
165
    $item->{unitprice} = get_value_with_gst_params( $item->{unitprice}, $item->{gstrate}, $bookseller );
165
    $order->{unitprice} = get_value_with_gst_params( $order->{unitprice}, $order->{gstrate}, $bookseller );
166
    $total = ( $item->{'unitprice'} ) * $item->{'quantityreceived'};
166
    $total = ( $order->{unitprice} ) * $order->{quantityreceived};
167
    $item->{'unitprice'} += 0;
167
    $order->{'unitprice'} += 0;
168
    my %line = %{ $item };
168
    my %line = %{ $order };
169
    my $ecost = get_value_with_gst_params( $line{ecost}, $line{gstrate}, $bookseller );
169
    my $ecost = get_value_with_gst_params( $line{ecost}, $line{gstrate}, $bookseller );
170
    $line{ecost} = sprintf( "%.2f", $ecost );
170
    $line{ecost} = sprintf( "%.2f", $ecost );
171
    $line{invoice} = $invoice->{invoicenumber};
171
    $line{invoice} = $invoice->{invoicenumber};
172
    $line{total} = sprintf($cfstr, $total);
172
    $line{total} = sprintf($cfstr, $total);
173
    $line{booksellerid} = $invoice->{booksellerid};
173
    $line{booksellerid} = $invoice->{booksellerid};
174
    my ($count) = &GetReservesFromBiblionumber($line{biblionumber},undef,$item->{itemnumber});
174
    $line{holds} = 0;
175
    $line{holds} = $count;
175
    my @itemnumbers = GetItemnumbersFromOrder( $order->{ordernumber} );
176
    for my $itemnumber ( @itemnumbers ) {
177
        my ( $count ) = &GetReservesFromBiblionumber($line{biblionumber}, undef, $itemnumber);
178
        $line{holds} += $count;
179
    }
176
    $line{budget} = GetBudgetByOrderNumber( $line{ordernumber} );
180
    $line{budget} = GetBudgetByOrderNumber( $line{ordernumber} );
177
    $totalprice += $item->{'unitprice'};
181
    $totalprice += $order->{unitprice};
178
    $line{unitprice} = sprintf( $cfstr, $item->{'unitprice'} );
182
    $line{unitprice} = sprintf( $cfstr, $order->{unitprice} );
179
    my $gste = get_gste( $line{total}, $line{gstrate}, $bookseller );
183
    my $gste = get_gste( $line{total}, $line{gstrate}, $bookseller );
180
    my $gst = get_gst( $line{total}, $line{gstrate}, $bookseller );
184
    my $gst = get_gst( $line{total}, $line{gstrate}, $bookseller );
181
    $foot{$line{gstrate}}{gstrate} = $line{gstrate};
185
    $foot{$line{gstrate}}{gstrate} = $line{gstrate};
Lines 191-197 for my $item ( @parcelitems ) { Link Here
191
195
192
    if ( $line{parent_ordernumber} != $line{ordernumber} ) {
196
    if ( $line{parent_ordernumber} != $line{ordernumber} ) {
193
        if ( grep { $_->{ordernumber} == $line{parent_ordernumber} }
197
        if ( grep { $_->{ordernumber} == $line{parent_ordernumber} }
194
            @parcelitems
198
            @orders
195
            )
199
            )
196
        {
200
        {
197
            $line{cannot_cancel} = 1;
201
            $line{cannot_cancel} = 1;
Lines 202-208 for my $item ( @parcelitems ) { Link Here
202
    $line{budget_name} = $budget->{'budget_name'};
206
    $line{budget_name} = $budget->{'budget_name'};
203
207
204
    push @loop_received, \%line;
208
    push @loop_received, \%line;
205
    $totalquantity += $item->{'quantityreceived'};
209
    $totalquantity += $order->{quantityreceived};
206
210
207
}
211
}
208
push @book_foot_loop, map { $_ } values %foot;
212
push @book_foot_loop, map { $_ } values %foot;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt (-2 / +7 lines)
Lines 361-367 Link Here
361
            <tr>
361
            <tr>
362
                <td>[% loop_receive.basketname %] (<a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% loop_receive.basketno %]">[% loop_receive.basketno %]</a>)</td>
362
                <td>[% loop_receive.basketname %] (<a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% loop_receive.basketno %]">[% loop_receive.basketno %]</a>)</td>
363
                <td><a href="neworderempty.pl?ordernumber=[% loop_receive.ordernumber %]&amp;booksellerid=[% booksellerid %]">[% loop_receive.ordernumber %]</a></td>
363
                <td><a href="neworderempty.pl?ordernumber=[% loop_receive.ordernumber %]&amp;booksellerid=[% booksellerid %]">[% loop_receive.ordernumber %]</a></td>
364
                <td>[% IF loop_receive.holds %]<span class="error"><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% loop_receive.biblionumber %]">[% loop_receive.holds %]</a></span>[% END %]</td>
364
                <td>
365
                  [% IF loop_receive.holds > 0 %]
366
                    <span class="error"><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% loop_receive.biblionumber %]">[% loop_receive.holds %]</a></span>
367
                  [% ELSE %]
368
                    0
369
                  [% END %]
370
                </td>
365
                <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loop_receive.biblionumber %]">[% loop_receive.title |html %]</a>
371
                <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loop_receive.biblionumber %]">[% loop_receive.title |html %]</a>
366
                [% IF ( loop_receive.author ) %] / [% loop_receive.author %][% END %]
372
                [% IF ( loop_receive.author ) %] / [% loop_receive.author %][% END %]
367
                [% IF ( loop_receive.isbn ) %] - [% loop_receive.isbn %][% END %]
373
                [% IF ( loop_receive.isbn ) %] - [% loop_receive.isbn %][% END %]
368
- 

Return to bug 8037