1717class InvoiceV4Document (Prediction ):
1818 """Document data for Invoice, API version 4."""
1919
20+ billing_address : StringField
21+ """The customer's address used for billing."""
2022 customer_address : StringField
2123 """The address of the customer."""
2224 customer_company_registrations : List [CompanyRegistrationField ]
@@ -37,6 +39,8 @@ class InvoiceV4Document(Prediction):
3739 """The locale detected on the document."""
3840 reference_numbers : List [StringField ]
3941 """List of Reference numbers, including PO number."""
42+ shipping_address : StringField
43+ """Customer's delivery address."""
4044 supplier_address : StringField
4145 """The address of the supplier or merchant."""
4246 supplier_company_registrations : List [CompanyRegistrationField ]
@@ -66,6 +70,10 @@ def __init__(
6670 :param page_id: Page number for multi pages pdf input
6771 """
6872 super ().__init__ (raw_prediction , page_id )
73+ self .billing_address = StringField (
74+ raw_prediction ["billing_address" ],
75+ page_id = page_id ,
76+ )
6977 self .customer_address = StringField (
7078 raw_prediction ["customer_address" ],
7179 page_id = page_id ,
@@ -106,6 +114,10 @@ def __init__(
106114 StringField (prediction , page_id = page_id )
107115 for prediction in raw_prediction ["reference_numbers" ]
108116 ]
117+ self .shipping_address = StringField (
118+ raw_prediction ["shipping_address" ],
119+ page_id = page_id ,
120+ )
109121 self .supplier_address = StringField (
110122 raw_prediction ["supplier_address" ],
111123 page_id = page_id ,
@@ -202,6 +214,8 @@ def __str__(self) -> str:
202214 f":Customer Company Registrations: { customer_company_registrations } \n "
203215 )
204216 out_str += f":Customer Address: { self .customer_address } \n "
217+ out_str += f":Shipping Address: { self .shipping_address } \n "
218+ out_str += f":Billing Address: { self .billing_address } \n "
205219 out_str += f":Document Type: { self .document_type } \n "
206220 out_str += f":Line Items: { self ._line_items_to_str ()} \n "
207221 return clean_out_string (out_str )
0 commit comments