mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2026-01-14 13:21:25 +00:00
Fix calculation of budget balance
This commit is contained in:
6
.changes/unreleased/Fixed-20260112-103411.yaml
Normal file
6
.changes/unreleased/Fixed-20260112-103411.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
kind: Fixed
|
||||
body: Fix the calculation of budget balance to only take into account resources and charges that are still actual
|
||||
time: 2026-01-12T10:34:11.032115897+01:00
|
||||
custom:
|
||||
Issue: ""
|
||||
SchemaChange: No schema change
|
||||
@@ -72,14 +72,20 @@
|
||||
|
||||
{% macro table_results(actualCharges, actualResources, results) %}
|
||||
|
||||
{% set now = date() %}
|
||||
|
||||
{% set totalCharges = 0 %}
|
||||
{% for c in actualCharges %}
|
||||
{% set totalCharges = totalCharges + c.amount %}
|
||||
{% if c.startDate <= now and (c.endDate is null or c.endDate >= now) %}
|
||||
{% set totalCharges = totalCharges + c.amount %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% set totalResources = 0 %}
|
||||
{% for r in actualResources %}
|
||||
{% set totalResources = totalResources + r.amount %}
|
||||
{% if r.startDate <= now and (r.endDate is null or r.endDate >= now) %}
|
||||
{% set totalResources = totalResources + r.amount %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% set result = (totalResources - totalCharges) %}
|
||||
|
||||
Reference in New Issue
Block a user