Vladt-Tempest commited on
Commit
63cd59d
·
1 Parent(s): c60dd86

Corregido problema en columna "Extendend_price" que no leía valores mayores de US $999

Browse files
__pycache__/commercial_invoice.cpython-310.pyc CHANGED
Binary files a/__pycache__/commercial_invoice.cpython-310.pyc and b/__pycache__/commercial_invoice.cpython-310.pyc differ
 
commercial_invoice.py CHANGED
@@ -173,14 +173,14 @@ def process_product_line(text, invoice_number):
173
 
174
  # Unit price
175
  if current_idx < len(parts):
176
- unit_price = parts[current_idx]
177
  if unit_price.replace('.', '').isdigit():
178
  product_data["Unit_price"] = unit_price
179
  current_idx += 1
180
 
181
  # Extended price
182
  if current_idx < len(parts):
183
- ext_price = parts[current_idx]
184
  if ext_price.replace('.', '').isdigit():
185
  product_data["Extended_price"] = ext_price
186
 
@@ -272,7 +272,7 @@ def process_invoice_batch(image_paths, coordinates_json):
272
 
273
  # Inicializar DataFrames vacíos al inicio del proceso por lotes
274
  products_df = pd.DataFrame(columns=[
275
- "invoice_number", "Boxes", "Pieces", "Product_desc",
276
  "Tariff_number", "Stems", "Unit_price", "Extended_price"
277
  ])
278
  facturas_df = pd.DataFrame()
 
173
 
174
  # Unit price
175
  if current_idx < len(parts):
176
+ unit_price = parts[current_idx].replace(',', '')
177
  if unit_price.replace('.', '').isdigit():
178
  product_data["Unit_price"] = unit_price
179
  current_idx += 1
180
 
181
  # Extended price
182
  if current_idx < len(parts):
183
+ ext_price = parts[current_idx].replace(',', '')
184
  if ext_price.replace('.', '').isdigit():
185
  product_data["Extended_price"] = ext_price
186
 
 
272
 
273
  # Inicializar DataFrames vacíos al inicio del proceso por lotes
274
  products_df = pd.DataFrame(columns=[
275
+ "invoice_number", "Boxes", "Pieces", "Product_code", "Product_desc",
276
  "Tariff_number", "Stems", "Unit_price", "Extended_price"
277
  ])
278
  facturas_df = pd.DataFrame()
coordinates_CI.json CHANGED
@@ -158,7 +158,7 @@
158
  {
159
  "id": "I",
160
  "label": "Product_line_2",
161
- "x": "827.50",
162
  "y": "1091.83",
163
  "width": "3100.00",
164
  "height": "27.00",
 
158
  {
159
  "id": "I",
160
  "label": "Product_line_2",
161
+ "x": "827.00",
162
  "y": "1091.83",
163
  "width": "3100.00",
164
  "height": "27.00",