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

(-)a/acqui/parcel.pl (-4 / +9 lines)
Lines 122-127 my %foot; Link Here
122
my $total_gste = 0;
122
my $total_gste = 0;
123
my $total_gsti = 0;
123
my $total_gsti = 0;
124
124
125
my $subtotal_for_funds;
125
for my $order ( @orders ) {
126
for my $order ( @orders ) {
126
    $order = C4::Acquisition::populate_order_with_prices({ order => $order, booksellerid => $bookseller->{id}, receiving => 1, ordering => 1 });
127
    $order = C4::Acquisition::populate_order_with_prices({ order => $order, booksellerid => $bookseller->{id}, receiving => 1, ordering => 1 });
127
    $order->{'unitprice'} += 0;
128
    $order->{'unitprice'} += 0;
Lines 164-171 for my $order ( @orders ) { Link Here
164
        }
165
        }
165
    }
166
    }
166
167
167
    my $budget = GetBudget( $line{budget_id} );
168
    my $budget_name = GetBudgetName( $line{budget_id} );
168
    $line{budget_name} = $budget->{'budget_name'};
169
    $line{budget_name} = $budget_name;
170
171
    $subtotal_for_funds->{ $line{budget_name} }{ecost} += $order->{ecost} * $order->{quantity};
172
    $subtotal_for_funds->{ $line{budget_name} }{unitprice} += $order->{total};
169
173
170
    push @loop_received, \%line;
174
    push @loop_received, \%line;
171
}
175
}
Lines 263-270 unless( defined $invoice->{closedate} ) { Link Here
263
        $line{holds}                = $holds;
267
        $line{holds}                = $holds;
264
        $line{holds_on_order}       = $itemholds?$itemholds:$holds if $line{left_holds_on_order};
268
        $line{holds_on_order}       = $itemholds?$itemholds:$holds if $line{left_holds_on_order};
265
269
266
        my $budget = GetBudget( $line{budget_id} );
270
        my $budget_name = GetBudgetName( $line{budget_id} );
267
        $line{budget_name} = $budget->{'budget_name'};
271
        $line{budget_name} = $budget_name;
268
272
269
        push @loop_orders, \%line;
273
        push @loop_orders, \%line;
270
    }
274
    }
Lines 289-294 $template->param( Link Here
289
    (uc(C4::Context->preference("marcflavour"))) => 1,
293
    (uc(C4::Context->preference("marcflavour"))) => 1,
290
    total_gste           => $total_gste,
294
    total_gste           => $total_gste,
291
    total_gsti           => $total_gsti,
295
    total_gsti           => $total_gsti,
296
    subtotal_for_funds    => $subtotal_for_funds,
292
    sticky_filters       => $sticky_filters,
297
    sticky_filters       => $sticky_filters,
293
);
298
);
294
output_html_with_http_headers $input, $cookie, $template->output;
299
output_html_with_http_headers $input, $cookie, $template->output;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt (-23 / +3 lines)
Lines 324-349 Link Here
324
<div id="acqui_receive_receivelist">
324
<div id="acqui_receive_receivelist">
325
    <h3>Already received</h3>
325
    <h3>Already received</h3>
326
326
327
328
   [% IF ( loop_received ) %]
327
   [% IF ( loop_received ) %]
329
       [% SET funds = {} %]
330
       [% SET estimated_total = 0 %]
331
332
       [% FOREACH loop_receive IN loop_received %]
333
           [% SET index = loop.count %]
334
           [% SET funds.${ index }.budget_name = loop_receive.budget.budget_name %]
335
           [% IF (funds.${ index }.estimated == '') %]
336
              [% SET funds.${ index }.estimated = 0 %]
337
           [% END %]
338
           [% IF (funds.${ index }.actual == '') %]
339
              [% SET funds.${ index }.actual = 0 %]
340
           [% END %]
341
           [% SET estimated_total = estimated_total + ( loop_receive.ecost * loop_receive.quantityreceived ) %]
342
           [% SET funds.${ index }.estimated = funds.${ index }.estimated + ( loop_receive.ecost * loop_receive.quantityreceived )%]
343
344
           [% SET funds.${ index }.actual = funds.${ loop_receive.budget.budget_name }.actual + loop_receive.total %]
345
       [% END %]
346
347
   <form action="/cgi-bin/koha/acqui/parcel.pl" method="get" name="orderform">
328
   <form action="/cgi-bin/koha/acqui/parcel.pl" method="get" name="orderform">
348
    <table id="receivedt">
329
    <table id="receivedt">
349
      <thead>
330
      <thead>
Lines 363-374 Link Here
363
        </tr>
344
        </tr>
364
      </thead>
345
      </thead>
365
    <tfoot>
346
    <tfoot>
366
        [% FOREACH key IN funds.keys.sort %]
347
        [% FOREACH key IN subtotal_for_funds.keys.sort %]
367
            <tr>
348
            <tr>
368
                <td colspan="6" class="total">(Tax exc.)</td>
349
                <td colspan="6" class="total">(Tax exc.)</td>
369
                <td colspan="2"><i>Subtotal for</i> [% funds.$key.budget_name %]</td>
350
                <td colspan="2"><i>Subtotal for</i> [% funds.$key.budget_name %]</td>
370
                <td>[% funds.$key.estimated | $Price %]</td>
351
                <td>[% subtotal_for_funds.$key.ecost | $Price %]</td>
371
                <td>[% funds.$key.actual | $Price  %]</td>
352
                <td>[% subtotal_for_funds.$key.unitprice | $Price  %]</td>
372
                <td>&nbsp;</td>
353
                <td>&nbsp;</td>
373
                <td>&nbsp;</td>
354
                <td>&nbsp;</td>
374
            </tr>
355
            </tr>
375
- 

Return to bug 13320