From 2708876f8ab4320f187dd7032ecc57fdfa068664 Mon Sep 17 00:00:00 2001 From: Julien Veyssier Date: Sun, 20 Oct 2024 23:46:57 +0200 Subject: [PATCH] refs #310 compute balances with past bills only Signed-off-by: Julien Veyssier --- lib/Service/LocalProjectService.php | 3 ++- src/Settlement.vue | 2 +- src/components/CospendNavigation.vue | 2 +- src/components/statistics/Statistics.vue | 8 +++++--- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/Service/LocalProjectService.php b/lib/Service/LocalProjectService.php index c7157fbea..31fe09361 100644 --- a/lib/Service/LocalProjectService.php +++ b/lib/Service/LocalProjectService.php @@ -339,7 +339,8 @@ public function getProjectInfo(string $projectId): array { $activeMembers[] = $member; } } - $balance = $this->getBalance($dbProjectId); + // compute balances for past bills only + $balance = $this->getBalance($dbProjectId, time()); $currencies = $this->getCurrencies($dbProjectId); $categories = $this->getCategoriesOrPaymentModes($dbProjectId); $paymentModes = $this->getCategoriesOrPaymentModes($dbProjectId, false); diff --git a/src/Settlement.vue b/src/Settlement.vue index 5d252e13b..45d368b6b 100644 --- a/src/Settlement.vue +++ b/src/Settlement.vue @@ -149,7 +149,7 @@

- {{ maxTs ? t('cospend', 'Balances on {date}', { date: formattedMaxDate }) : t('cospend', 'Balances') }} + {{ maxTs ? t('cospend', 'Balances on {date}', { date: formattedMaxDate }) : t('cospend', 'Global balances') }}

+ :name="t('cospend', 'My cumulated balance')"> diff --git a/src/components/statistics/Statistics.vue b/src/components/statistics/Statistics.vue index 351f37dac..96be7cb40 100644 --- a/src/components/statistics/Statistics.vue +++ b/src/components/statistics/Statistics.vue @@ -166,8 +166,9 @@ sort-key="filtered_balance"> {{ t('cospend', 'Filtered balance') }} - - {{ t('cospend', 'Balance') }} + + {{ t('cospend', 'Global Balance') }} @@ -198,7 +199,8 @@ {{ selectedCurrencyName }} + :style="'border: 2px solid #' + myGetMemberColor(value.member.id) +';'" + :title="t('cospend', 'This balance is computed from the complete bill list')"> {{ value.balance.toFixed(2) }} {{ selectedCurrencyName }}