17
17
class InvoiceV4Document (Prediction ):
18
18
"""Document data for Invoice, API version 4."""
19
19
20
+ billing_address : StringField
21
+ """The customer's address used for billing."""
20
22
customer_address : StringField
21
23
"""The address of the customer."""
22
24
customer_company_registrations : List [CompanyRegistrationField ]
@@ -37,6 +39,8 @@ class InvoiceV4Document(Prediction):
37
39
"""The locale detected on the document."""
38
40
reference_numbers : List [StringField ]
39
41
"""List of Reference numbers, including PO number."""
42
+ shipping_address : StringField
43
+ """Customer's delivery address."""
40
44
supplier_address : StringField
41
45
"""The address of the supplier or merchant."""
42
46
supplier_company_registrations : List [CompanyRegistrationField ]
@@ -66,6 +70,10 @@ def __init__(
66
70
:param page_id: Page number for multi pages pdf input
67
71
"""
68
72
super ().__init__ (raw_prediction , page_id )
73
+ self .billing_address = StringField (
74
+ raw_prediction ["billing_address" ],
75
+ page_id = page_id ,
76
+ )
69
77
self .customer_address = StringField (
70
78
raw_prediction ["customer_address" ],
71
79
page_id = page_id ,
@@ -106,6 +114,10 @@ def __init__(
106
114
StringField (prediction , page_id = page_id )
107
115
for prediction in raw_prediction ["reference_numbers" ]
108
116
]
117
+ self .shipping_address = StringField (
118
+ raw_prediction ["shipping_address" ],
119
+ page_id = page_id ,
120
+ )
109
121
self .supplier_address = StringField (
110
122
raw_prediction ["supplier_address" ],
111
123
page_id = page_id ,
@@ -202,6 +214,8 @@ def __str__(self) -> str:
202
214
f":Customer Company Registrations: { customer_company_registrations } \n "
203
215
)
204
216
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 "
205
219
out_str += f":Document Type: { self .document_type } \n "
206
220
out_str += f":Line Items: { self ._line_items_to_str ()} \n "
207
221
return clean_out_string (out_str )
0 commit comments