diff --git a/Koha/Plugin/Acquire/Controllers/FundManagement/FundAllocations.pm b/Koha/Plugin/Acquire/Controllers/FundManagement/FundAllocations.pm
index cc2dea0..c3e034f 100644
--- a/Koha/Plugin/Acquire/Controllers/FundManagement/FundAllocations.pm
+++ b/Koha/Plugin/Acquire/Controllers/FundManagement/FundAllocations.pm
@@ -48,7 +48,17 @@ sub list {
my $filtered_fund_allocations =
Koha::Plugin::Acquire::Controllers::ControllerUtils->filter_data_by_group( { dataset => $fund_allocations } );
- return $c->render( status => 200, openapi => $fund_allocations );
+ my @sorted_allocations =
+ sort { $a->{fund_allocation_id} cmp $b->{fund_allocation_id} } @{$filtered_fund_allocations};
+ my $total = 0;
+ foreach my $allocation_index ( 1 .. scalar(@sorted_allocations) ) {
+ my $allocation = $sorted_allocations[ $allocation_index - 1 ];
+ $allocation->{allocation_index} = $allocation_index;
+ $total += $allocation->{allocation_amount};
+ $allocation->{new_fund_value} = $total;
+ }
+
+ return $c->render( status => 200, openapi => \@sorted_allocations );
} catch {
$c->unhandled_exception($_);
};
diff --git a/src/components/DisplayDataFields.vue b/src/components/DisplayDataFields.vue
index 2e3012b..b264f07 100644
--- a/src/components/DisplayDataFields.vue
+++ b/src/components/DisplayDataFields.vue
@@ -9,7 +9,7 @@
/>
-