@@ -38,6 +38,10 @@ def __init__(
3838 self .vat_number = None
3939 self .total_tax = None
4040 self .time = None
41+ self .supplier_address = None
42+ self .customer_name = None
43+ self .customer_company_registration = None
44+ self .customer_address = None
4145
4246 # need this for building from prediction
4347 self .input_file = input_file
@@ -70,6 +74,10 @@ def build_from_api_prediction(self, api_prediction, page_n=0):
7074 self .orientation = invoice .orientation
7175 self .total_tax = invoice .total_tax
7276 self .time = Field ({"value" : None , "confidence" : 0.0 })
77+ self .supplier_address = invoice .supplier_address
78+ self .customer_name = invoice .customer_name
79+ self .customer_company_registration = invoice .customer_company_registration
80+ self .customer_address = invoice .customer_address
7381 else :
7482 receipt = Receipt (api_prediction , self .input_file , page_n = page_n )
7583 self .orientation = receipt .orientation
@@ -85,6 +93,12 @@ def build_from_api_prediction(self, api_prediction, page_n=0):
8593 self .invoice_number = Field ({"value" : None , "confidence" : 0.0 })
8694 self .payment_details = []
8795 self .company_number = []
96+ self .supplier_address = Field ({"value" : None , "confidence" : 0.0 })
97+ self .customer_name = Field ({"value" : None , "confidence" : 0.0 })
98+ self .customer_company_registration = Field (
99+ {"value" : None , "confidence" : 0.0 }
100+ )
101+ self .customer_address = Field ({"value" : None , "confidence" : 0.0 })
88102
89103 def __str__ (self ) -> str :
90104 return (
@@ -96,6 +110,10 @@ def __str__(self) -> str:
96110 "Date: %s\n "
97111 "Invoice due date: %s\n "
98112 "Supplier name: %s\n "
113+ f"Supplier address: { self .supplier_address } \n "
114+ f"Customer name: { self .customer_name } \n "
115+ f"Customer company registration: { self .customer_company_registration } \n "
116+ f"Customer address: { self .customer_address } \n "
99117 "Taxes: %s\n "
100118 "Total taxes: %s\n "
101119 "----------------------"
0 commit comments