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

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

Return to bug 13320