From d6006b0b99b64f1e0859adcafeb375e0e1049031 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 15 Mar 2018 16:21:42 +0000 Subject: [PATCH] Bug 19166: (follow-up) Shipment cost is always added to 'spent' MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Two koha professionals agreed, also it is current behvaiour so this patch removes a change Signed-off-by: Séverine QUEUNE Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize Signed-off-by: Nick Clemens --- C4/Budgets.pm | 14 ++------------ t/db_dependent/Budgets.t | 2 +- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/C4/Budgets.pm b/C4/Budgets.pm index a2a1a92a0f..3ce512dcd7 100644 --- a/C4/Budgets.pm +++ b/C4/Budgets.pm @@ -338,7 +338,7 @@ sub GetBudgetSpent { datecancellationprinted IS NULL |); $sth->execute($budget_id); - my $sum = $sth->fetchrow_array; + my $sum = 0 + $sth->fetchrow_array; $sth = $dbh->prepare(qq| SELECT SUM(shipmentcost) AS sum @@ -369,17 +369,7 @@ sub GetBudgetOrdered { datecancellationprinted IS NULL |); $sth->execute($budget_id); - my $sum = $sth->fetchrow_array; - - $sth = $dbh->prepare(qq| - SELECT SUM(shipmentcost) AS sum - FROM aqinvoices - WHERE shipmentcost_budgetid = ? - AND closedate IS NULL - |); - $sth->execute($budget_id); - my ($shipmentcost_sum) = $sth->fetchrow_array; - $sum += $shipmentcost_sum; + my $sum = 0 + $sth->fetchrow_array; my $adjustments = Koha::InvoiceAdjustments->search({budget_id => $budget_id, encumber_open => 1, closedate => undef},{ join => 'invoiceid' }); while ( my $adj = $adjustments->next ){ diff --git a/t/db_dependent/Budgets.t b/t/db_dependent/Budgets.t index afeb910daf..9c748952b4 100755 --- a/t/db_dependent/Budgets.t +++ b/t/db_dependent/Budgets.t @@ -472,7 +472,7 @@ ModReceiveOrder({ } ); is ( GetBudgetSpent( $fund ), 6, "total shipping cost is 6"); -is ( GetBudgetOrdered( $fund ), '26', "total ordered price is 20"); +is ( GetBudgetOrdered( $fund ), '20', "total ordered price is 20"); # CloneBudgetPeriod -- 2.39.5