summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2024-10-01 14:17:17 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2024-10-01 14:17:17 +0200
commitb0372619f003b5ca8f007b93c9839a62f23ab4fb (patch)
treeb5f6e305255bb8997feaae05ab740a3162d7a63d
parentc51b4c089c5af2c2bb037b0bdf4451b9a837e0bc (diff)
downloadIshtar-b0372619f003b5ca8f007b93c9839a62f23ab4fb.tar.bz2
Ishtar-b0372619f003b5ca8f007b93c9839a62f23ab4fb.zip
🩹 Archaeological files templates: fix preventive fields calculation
-rw-r--r--archaeological_files/models.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/archaeological_files/models.py b/archaeological_files/models.py
index 3f9623414..fb0665a28 100644
--- a/archaeological_files/models.py
+++ b/archaeological_files/models.py
@@ -1111,9 +1111,9 @@ class File(
"""
France specific value used by templates
"""
- if not self.operation_type_for_royalties or not self.total_developed_surface:
+ if not self.operation_type_for_royalties or not self.total_surface:
return
- return (self.total_developed_surface or 0) * (
+ return (self.total_surface or 0) * (
self.operation_type_for_royalties.increased_final_value or 0)
@property
@@ -1245,7 +1245,7 @@ class File(
def get_values(self, prefix="", no_values=False, filtr=None, **kwargs):
if "redevance" in filtr:
- filtr.append("total_developed_surface")
+ filtr.append("total_surface")
if "equipments_cost_planned_tva" in filtr:
filtr.append("equipments_cost_planned")
values = super().get_values(
@@ -1253,7 +1253,7 @@ class File(
q = GlobalVar.objects.filter(slug="taux_rap")
if q.count():
try:
- values["redevance"] = float(q.all()[0].value) * float(values.get("total_developed_surface", 0))
+ values["redevance"] = float(q.all()[0].value) * self.total_surface
except ValueError:
pass
q = GlobalVar.objects.filter(slug="taux_tva")