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

(-)a/C4/Budgets.pm (-12 / +2 lines)
Lines 338-344 sub GetBudgetSpent { Link Here
338
            datecancellationprinted IS NULL
338
            datecancellationprinted IS NULL
339
    |);
339
    |);
340
	$sth->execute($budget_id);
340
	$sth->execute($budget_id);
341
	my $sum =  $sth->fetchrow_array;
341
	my $sum = 0 + $sth->fetchrow_array;
342
342
343
    $sth = $dbh->prepare(qq|
343
    $sth = $dbh->prepare(qq|
344
        SELECT SUM(shipmentcost) AS sum
344
        SELECT SUM(shipmentcost) AS sum
Lines 369-385 sub GetBudgetOrdered { Link Here
369
            datecancellationprinted IS NULL
369
            datecancellationprinted IS NULL
370
    |);
370
    |);
371
	$sth->execute($budget_id);
371
	$sth->execute($budget_id);
372
	my $sum =  $sth->fetchrow_array;
372
	my $sum =  0 + $sth->fetchrow_array;
373
374
    $sth = $dbh->prepare(qq|
375
        SELECT SUM(shipmentcost) AS sum
376
        FROM aqinvoices
377
        WHERE shipmentcost_budgetid = ?
378
          AND closedate IS NULL
379
    |);
380
    $sth->execute($budget_id);
381
    my ($shipmentcost_sum) = $sth->fetchrow_array;
382
    $sum += $shipmentcost_sum;
383
373
384
    my $adjustments = Koha::InvoiceAdjustments->search({budget_id => $budget_id, encumber_open => 1, closedate => undef},{ join => 'invoiceid' });
374
    my $adjustments = Koha::InvoiceAdjustments->search({budget_id => $budget_id, encumber_open => 1, closedate => undef},{ join => 'invoiceid' });
385
    while ( my $adj = $adjustments->next ){
375
    while ( my $adj = $adjustments->next ){
(-)a/t/db_dependent/Budgets.t (-2 / +1 lines)
Lines 472-478 ModReceiveOrder({ Link Here
472
} );
472
} );
473
473
474
is ( GetBudgetSpent( $fund ), 6, "total shipping cost is 6");
474
is ( GetBudgetSpent( $fund ), 6, "total shipping cost is 6");
475
is ( GetBudgetOrdered( $fund ), '26', "total ordered price is 20");
475
is ( GetBudgetOrdered( $fund ), '20', "total ordered price is 20");
476
476
477
477
478
# CloneBudgetPeriod
478
# CloneBudgetPeriod
479
- 

Return to bug 19166