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

(-)a/C4/Acquisition.pm (+37 lines)
Lines 54-59 BEGIN { Link Here
54
        &GetOrderNumber &GetLateOrders &GetOrderFromItemnumber
54
        &GetOrderNumber &GetLateOrders &GetOrderFromItemnumber
55
        &SearchOrder &GetHistory &GetRecentAcqui
55
        &SearchOrder &GetHistory &GetRecentAcqui
56
        &ModReceiveOrder &ModOrderBiblioitemNumber
56
        &ModReceiveOrder &ModOrderBiblioitemNumber
57
        &GetCancelledOrders
57
58
58
        &NewOrderItem &ModOrderItem
59
        &NewOrderItem &ModOrderItem
59
60
Lines 1044-1049 sub ModOrderBiblioitemNumber { Link Here
1044
    $sth->execute( $biblioitemnumber, $ordernumber, $biblionumber );
1045
    $sth->execute( $biblioitemnumber, $ordernumber, $biblionumber );
1045
}
1046
}
1046
1047
1048
=head3 GetCancelledOrders
1049
1050
  my @orders = GetCancelledOrders($basketno, $orderby);
1051
1052
Returns cancelled orders for a basket
1053
1054
=cut
1055
1056
sub GetCancelledOrders {
1057
    my ( $basketno, $orderby ) = @_;
1058
1059
    return () unless $basketno;
1060
1061
    my $dbh   = C4::Context->dbh;
1062
    my $query = "
1063
        SELECT biblio.*, biblioitems.*, aqorders.*, aqbudgets.*
1064
        FROM aqorders
1065
          LEFT JOIN aqbudgets   ON aqbudgets.budget_id = aqorders.budget_id
1066
          LEFT JOIN biblio      ON biblio.biblionumber = aqorders.biblionumber
1067
          LEFT JOIN biblioitems ON biblioitems.biblionumber = biblio.biblionumber
1068
        WHERE basketno = ?
1069
          AND (datecancellationprinted IS NOT NULL
1070
               AND datecancellationprinted <> '0000-00-00')
1071
    ";
1072
1073
    $orderby = "aqorders.datecancellationprinted desc, aqorders.timestamp desc"
1074
        unless $orderby;
1075
    $query .= " ORDER BY $orderby";
1076
    my $sth = $dbh->prepare($query);
1077
    $sth->execute($basketno);
1078
    my $results = $sth->fetchall_arrayref( {} );
1079
1080
    return @$results;
1081
}
1082
1083
1047
#------------------------------------------------------------#
1084
#------------------------------------------------------------#
1048
1085
1049
=head3 ModReceiveOrder
1086
=head3 ModReceiveOrder
(-)a/acqui/basket.pl (+6 lines)
Lines 343-348 my $total_est_gste; Link Here
343
        last;
343
        last;
344
    }
344
    }
345
345
346
    my @cancelledorders = GetCancelledOrders($basketno);
347
    foreach (@cancelledorders) {
348
        $_->{'line_total'} = sprintf("%.2f", $_->{'ecost'} * $_->{'quantity'});
349
    }
350
346
    $template->param(
351
    $template->param(
347
        basketno             => $basketno,
352
        basketno             => $basketno,
348
        basketname           => $basket->{'basketname'},
353
        basketname           => $basket->{'basketname'},
Lines 359-364 my $total_est_gste; Link Here
359
        name                 => $bookseller->{'name'},
364
        name                 => $bookseller->{'name'},
360
        entrydate            => C4::Dates->new($results[0]->{'entrydate'},'iso')->output,
365
        entrydate            => C4::Dates->new($results[0]->{'entrydate'},'iso')->output,
361
        books_loop           => \@books_loop,
366
        books_loop           => \@books_loop,
367
        cancelledorders_loop => \@cancelledorders,
362
        gist_rate            => sprintf( "%.2f", $gist * 100 ) . '%',
368
        gist_rate            => sprintf( "%.2f", $gist * 100 ) . '%',
363
        total_rrp_gste       => sprintf( "%.2f", $total_rrp_gste ),
369
        total_rrp_gste       => sprintf( "%.2f", $total_rrp_gste ),
364
        total_est_gste       => sprintf( "%.2f", $total_est_gste ),
370
        total_est_gste       => sprintf( "%.2f", $total_est_gste ),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt (-8 / +58 lines)
Lines 12-17 Link Here
12
                10: { sorter: false }
12
                10: { sorter: false }
13
            }
13
            }
14
        });
14
        });
15
        $("#cancelledorderst").tablesorter();
15
    });
16
    });
16
//]]>
17
//]]>
17
</script>
18
</script>
Lines 228-240 Link Here
228
                    <th>&nbsp;</th>
229
                    <th>&nbsp;</th>
229
                    <th>[% qty_total %]</th>
230
                    <th>[% qty_total %]</th>
230
                    <th>[% total_est_gste %]</th>
231
                    <th>[% total_est_gste %]</th>
231
                        [% IF ( active ) %]
232
                    [% IF ( active ) %]
232
                            [% IF ( closedate ) %]
233
                      [% IF ( closedate ) %]
233
                            <td colspan="1" rowspan="3">&nbsp;</td>
234
                        <th colspan="1" rowspan="3"></th>
234
                            [% ELSE %]
235
                      [% ELSE %]
235
                            <td colspan="3" rowspan="3">&nbsp;</td>
236
                        <th colspan="3" rowspan="3"></th>
236
                            [% END %]
237
                      [% END %]
237
                        [% END %]
238
                    [% END %]
238
                </tr>
239
                </tr>
239
                <tr>
240
                <tr>
240
                    <th>Tax ([% gist_rate %])</th>
241
                    <th>Tax ([% gist_rate %])</th>
Lines 257-262 Link Here
257
                    <th>&nbsp;</th>
258
                    <th>&nbsp;</th>
258
                    <th>[% qty_total %]</th>
259
                    <th>[% qty_total %]</th>
259
                    <th>[% total_est_gsti %]</th>
260
                    <th>[% total_est_gsti %]</th>
261
                    [% IF ( active ) %]
262
                      [% IF ( closedate ) %]
263
                        <th colspan="1"></th>
264
                      [% ELSE %]
265
                        <th colspan="3"></th>
266
                      [% END %]
267
                    [% END %]
260
                </tr>
268
                </tr>
261
                [% END %]
269
                [% END %]
262
                </tfoot>
270
                </tfoot>
Lines 321-326 Link Here
321
        [% IF ( listincgst ) %]<small class="highlight">** Vendor's listings already include tax.</small>
329
        [% IF ( listincgst ) %]<small class="highlight">** Vendor's listings already include tax.</small>
322
        [% END %]
330
        [% END %]
323
        </div>
331
        </div>
332
        [% IF (cancelledorders_loop) %]
333
          <div id="cancelledorders">
334
            <h2>Cancelled orders</h2>
335
            <table id="cancelledorderst">
336
              <thead>
337
                <tr>
338
                  <th>Order</th>
339
                  <th>RRP</th>
340
                  <th>Est.</th>
341
                  <th>Qty.</th>
342
                  <th>Total</th>
343
                  <th>Fund</th>
344
                </tr>
345
              </thead>
346
              <tbody>
347
                [% FOREACH order IN cancelledorders_loop %]
348
                  <tr style="color:grey">
349
                    <td>
350
                      <p>
351
                        [% IF ( order.order_received ) %] (rcvd)[% END %]
352
                        [% IF (order.title) %]
353
                          [% order.title |html %] by [% order.author %]<br />
354
                        [% ELSE %]
355
                          <em>Deleted bibliographic record, can't find title</em><br />
356
                        [% END %]
357
                        [% IF ( order.notes ) %] [% order.notes %][% END %]
358
                        [% IF ( order.isbn ) %] - [% order.isbn %][% END %]
359
                        [% IF ( order.issn ) %] - [% order.issn %][% END %]
360
                        [% IF ( order.publishercode ) %], [% order.publishercode %][% END %]
361
                        [% IF ( order.publicationyear ) %], [% order.publicationyear %][% END %]
362
                      </p>
363
                    </td>
364
                    <td><p>[% order.rrp %]</p></td>
365
                    <td><p>[% order.ecost %]</p></td>
366
                    <td><p>[% order.quantity %]</p></td>
367
                    <td><p>[% order.line_total %]</p></td>
368
                    <td><p>[% order.budget_name %]</p></td>
369
                  </tr>
370
                [% END %]
371
              </tbody>
372
            </table>
373
          </div>
374
        [% END %]
324
        <br />
375
        <br />
325
        [% UNLESS ( closedate ) %]
376
        [% UNLESS ( closedate ) %]
326
        [% INCLUDE 'acquisitions-add-to-basket.inc' %]
377
        [% INCLUDE 'acquisitions-add-to-basket.inc' %]
327
- 

Return to bug 5358