#232 Payment document linkage

* adds error message on intervention view if a payment has been added but no document has been uploaded yet
* adds same check to quality checker, meaning no intervention can be recorded which has a payment but no document
* adds trigger for sending data to egon on uploading a document in case of an already existing payment
* adds translations
This commit is contained in:
2022-11-16 16:11:42 +01:00
parent 4e0ee7dc91
commit d7b2e933ec
6 changed files with 129 additions and 86 deletions

View File

@@ -157,6 +157,8 @@ def detail_view(request: HttpRequest, id: str):
if last_checked:
last_checked_tooltip = DATA_CHECKED_PREVIOUSLY_TEMPLATE.format(last_checked.get_timestamp_str_formatted(), last_checked.user)
has_payment_without_document = intervention.payments.exists() and not intervention.get_documents()[1].exists()
context = {
"obj": intervention,
"last_checked": last_checked,
@@ -168,6 +170,7 @@ def detail_view(request: HttpRequest, id: str):
"is_zb_member": in_group(_user, ZB_GROUP),
"is_ets_member": in_group(_user, ETS_GROUP),
"LANIS_LINK": intervention.get_LANIS_link(),
"has_payment_without_document": has_payment_without_document,
TAB_TITLE_IDENTIFIER: f"{intervention.identifier} - {intervention.title}",
}