#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 cbb137a902
commit 7d0c405f58
6 changed files with 129 additions and 86 deletions

View File

@@ -21,8 +21,21 @@ class InterventionQualityChecker(AbstractQualityChecker):
self._check_legal_data()
self._check_compensations()
self._check_geometry()
self._check_payment_documents()
self.valid = len(self.messages) == 0
def _check_payment_documents(self):
""" Checks existence of documents in case of payments
There should be at least one legal document which defines the payment's total amount.
Returns:
"""
has_payment_without_document = self.obj.payments.exists() and not self.obj.get_documents()[1].exists()
if has_payment_without_document:
self._add_missing_attr_name(_("Documents"))
def _check_responsible_data(self):
""" Checks data quality of related Responsibility