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 (-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