Skip to content

Commit 49b3b2b

Browse files
chg: ⚡ financialDoc has same type for each attribute from receipt or invoice
1 parent 320d0ae commit 49b3b2b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mindee/documents/financial_document.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ def build_from_api_prediction(self, api_prediction, input_file, page_n=0):
134134
self.time = receipt.time
135135
self.total_tax = receipt.total_tax
136136
self.invoice_number = Field({"value": None, "probability": 0.})
137-
self.payment_details = Field({"value": None, "probability": 0.})
138-
self.company_number = Field({"value": None, "probability": 0.})
137+
self.payment_details = []
138+
self.company_number = []
139139

140140
def __str__(self):
141141
return "-----Financial document-----\n" \
@@ -218,7 +218,7 @@ def __taxes_match_total_incl(self):
218218
total_vat = 0
219219
reconstructed_total = 0
220220
for tax in self.taxes:
221-
if tax.rate is not None and tax.rate != 0:
221+
if tax.rate is not None and tax.rate != 0 and tax.value is not None:
222222
total_vat += tax.value
223223
reconstructed_total += tax.value + 100 * tax.value / tax.rate
224224

0 commit comments

Comments
 (0)