Closed Mandagsteve closed 1 year ago
Can you share your parsed invoice (you can skip personal data)? In whatever readable form. Python's dict or JSON or XML.
{'issuer': 'SC ICORE OUTSOURCING SRL', 'Address': 'Victor Babes 36, office 1.10 Brasov RO', 'issued_to': 'Makro-Mikro Consulting GmbH', 'amount': 1729.46, 'date': datetime.datetime(2023, 1, 15, 0, 0), 'date_payement_due': datetime.datetime(2023, 1, 30, 0, 0), 'invoice_number': '002', 'currency': 'EUR, LEI', 'lines': [{'name': '1 (Providing Services as per Contract no.13 from', 'desc': 'buc / pc.', 'qty': 1.0, 'price_unit': '350.00', 'Total': '350.00'}], 'desc': 'Invoice from SC ICORE OUTSOURCING SRL'}
i tried it with other invoices as well and got the same error
tried into a JSON format got the same error
I tried to reproduce this few times using invoice2data
command line tool and failed. The loop code looks basically as this:
for line in data:
for k, v in line.items():
...
Variable data
always contains a list of invoices (a list of dict
s).
My only explanation is that you use invoice2data
from a custom Python script and you pass wrong argument to it. Please note that data
has to be an array of invoices. Not a single invoice.
Please verify your script if I'm right with my guess.
for k, v in line.items(): AttributeError: 'str' object has no attribute 'items'