data-science-document-ai 1.61.2__py3-none-any.whl → 1.61.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: data-science-document-ai
3
- Version: 1.61.2
3
+ Version: 1.61.3
4
4
  Summary: "Document AI repo for data science"
5
5
  Author: Naomi Nguyen
6
6
  Author-email: naomi.nguyen@forto.com
@@ -10,7 +10,7 @@ src/pdf_processing.py,sha256=Fx-Glb9niEUU3WUCrBZ02ZYV-E2vWoUM0ifN7-0A1Q4,19961
10
10
  src/postprocessing/common.py,sha256=uFaJYpctS4vr-0Z3InRyfRZcEar0UWpcTxdB_TDCJ5E,26671
11
11
  src/postprocessing/postprocess_booking_confirmation.py,sha256=nK32eDiBNbauyQz0oCa9eraysku8aqzrcoRFoWVumDU,4827
12
12
  src/postprocessing/postprocess_commercial_invoice.py,sha256=3I8ijluTZcOs_sMnFZxfkAPle0UFQ239EMuvZfDZVPg,1028
13
- src/postprocessing/postprocess_partner_invoice.py,sha256=WuaTQK5D09dV_QNrh29ZoKX9IvQn2Ub-WnAMyRjCsvI,14240
13
+ src/postprocessing/postprocess_partner_invoice.py,sha256=ijBh8LRN23HWdotqMw6uf0ro1IaiL_obBiiikMwXYXk,14768
14
14
  src/prompts/library/arrivalNotice/other/placeholders.json,sha256=1vzly1amgyKt3jr2JJQbb24kNZsnI289iduvoUo5dJU,3061
15
15
  src/prompts/library/arrivalNotice/other/prompt.txt,sha256=QNuU-BvMA8VbdupVNapad4O3WmCotH5cKNxImRMbKDk,2906
16
16
  src/prompts/library/bookingConfirmation/evergreen/placeholders.json,sha256=49mmxxjExniMqLkT37zd5q8ILCLPGsfugKOMkR926kk,5854
@@ -55,6 +55,6 @@ src/prompts/prompt_library.py,sha256=VJWHeXN-s501C2GiidIIvQQuZdU6T1R27hE2dKBiI40
55
55
  src/setup.py,sha256=prJNY3N2qu14ttfCYnvRtpCqdHQeSW34zXwmuAGWX_M,7472
56
56
  src/tms.py,sha256=UXbIo1QE--hIX6NZi5Qyp2R_CP338syrY9pCTPrfgnE,1741
57
57
  src/utils.py,sha256=Ow5_Jals88o8mbZ1BoHfZpHZoCfig_UQb5aalH-mpWE,17278
58
- data_science_document_ai-1.61.2.dist-info/METADATA,sha256=eEkafeJHhdHNOAKuEAmx-3dmS33GHvACepPhKgL0XH4,2058
59
- data_science_document_ai-1.61.2.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
60
- data_science_document_ai-1.61.2.dist-info/RECORD,,
58
+ data_science_document_ai-1.61.3.dist-info/METADATA,sha256=Lq6ZHTHHCJJg5zOaI7awo2Uf4Mx1ZC0FgG7XmXKaETk,2058
59
+ data_science_document_ai-1.61.3.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
60
+ data_science_document_ai-1.61.3.dist-info/RECORD,,
@@ -119,16 +119,22 @@ def post_process_bundeskasse(aggregated_data):
119
119
  if is_forto_recipient(line_item):
120
120
  is_recipient_forto = True
121
121
 
122
- update_recipient_and_vendor(aggregated_data, is_recipient_forto)
122
+ update_aggregated_data_fields(aggregated_data, is_recipient_forto)
123
123
 
124
124
 
125
- def update_recipient_and_vendor(aggregated_data, is_recipient_forto):
126
- """Update the recipient and vendor information in the aggregated data."""
125
+ def update_aggregated_data_fields(aggregated_data, is_recipient_forto):
126
+ """Update the recipient, vendor and deferredDutyPayer information in the aggregated data."""
127
127
  # Check if the "recipientName" and "recipientAddress" keys exist
128
128
  keys_to_init = ["recipientName", "recipientAddress", "vendorName", "vendorAddress"]
129
129
  for key in keys_to_init:
130
130
  aggregated_data.setdefault(key, {"formattedValue": "", "documentValue": ""})
131
131
 
132
+ # Update the vendor details always to Bundeskasse Trier
133
+ aggregated_data["vendorName"]["formattedValue"] = "Bundeskasse Trier"
134
+ aggregated_data["vendorAddress"][
135
+ "formattedValue"
136
+ ] = "Dasbachstraße 15, 54292 Trier, Germany"
137
+
132
138
  if is_recipient_forto:
133
139
  # Update the aggregated data with the recipient information
134
140
  aggregated_data["recipientName"][
@@ -138,11 +144,17 @@ def update_recipient_and_vendor(aggregated_data, is_recipient_forto):
138
144
  "formattedValue"
139
145
  ] = "Schönhauser Allee 9, 10119 Berlin, Germany"
140
146
 
141
- # Update the vendor details always to Bundeskasse Trier
142
- aggregated_data["vendorName"]["formattedValue"] = "Bundeskasse Trier"
143
- aggregated_data["vendorAddress"][
144
- "formattedValue"
145
- ] = "Dasbachstraße 15, 54292 Trier, Germany"
147
+ # Update the defferDutyPayer to Forto Logistics SE & Co KG 'DE789147263644738 - Fort'
148
+ lineitems = aggregated_data.get("lineItem", [])
149
+
150
+ for lineitem in lineitems:
151
+ if "deferredDutyPayer" in lineitem:
152
+ lineitem["deferredDutyPayer"] = {
153
+ "documentValue": lineitem.get("deferredDutyPayer", {}).get(
154
+ "documentValue"
155
+ ),
156
+ "formattedValue": "DE789147263644738",
157
+ }
146
158
 
147
159
 
148
160
  def select_unique_bank_account(bank_account):