Skip to content

Commit e50b9b3

Browse files
authored
🐛 fix for tax base amount (#135)
1 parent 0ecd9f5 commit e50b9b3

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

mindee/fields/tax.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def __init__(
5959
self.code = None
6060

6161
try:
62-
self.basis = float(prediction["basis"])
62+
self.basis = float(prediction["base"])
6363
except (ValueError, TypeError, KeyError):
6464
self.basis = None
6565

tests/documents/test_receipt_v5.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def test_doc_constructor(receipt_v5_doc_object: ReceiptV5):
3636
assert receipt_v5_doc_object.orientation is None
3737
assert receipt_v5_doc_object.date.page_n == 0
3838
assert str(receipt_v5_doc_object) == doc_str
39+
assert receipt_v5_doc_object.taxes[0].basis == 8.5
3940

4041

4142
def test_page_constructor(receipt_v5_page_object: ReceiptV5):
@@ -46,6 +47,7 @@ def test_page_constructor(receipt_v5_page_object: ReceiptV5):
4647
assert receipt_v5_page_object.date.page_n == 0
4748
assert str(receipt_v5_page_object) == doc_str
4849
assert len(receipt_v5_page_object.cropper) == 0
50+
assert receipt_v5_page_object.taxes[0].basis == 8.5
4951

5052

5153
def test_all_na(receipt_v5_doc_object_empty: ReceiptV5):

0 commit comments

Comments
 (0)