Bug 19166: (follow-up) Shipment cost is always added to 'spent'
authorNick Clemens <nick@bywatersolutions.com>
Thu, 15 Mar 2018 16:21:42 +0000 (16:21 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Thu, 19 Jul 2018 17:28:37 +0000 (17:28 +0000)
Two koha professionals agreed, also it is current behvaiour so this
patch removes a change

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
C4/Budgets.pm
t/db_dependent/Budgets.t

index a2a1a92..3ce512d 100644 (file)
@@ -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 ){
index afeb910..9c74895 100755 (executable)
@@ -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