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 ){ |