Песочница: UTOPIA FARMS UTF S.A.S

Intent ID: 41

Назад
1) Загрузить файл и получить сырой OCR JSON
Сохраняем последний файл и сырой OCR, чтобы можно было повторно тестировать маппинг без перезагрузки.
Скачать последний файл (invoice_163295.pdf)
2) Правила трансформации
Правила трансформации OCR-данных в целевую схему (включая валидацию).
Промпт LLM-подсказки
Используется кнопкой «Подсказать rules».
Сырой OCR JSON (Pass 1)
{
  "awb": null,
  "items": [
    {
      "boxes": 0.25,
      "length": "80CM",
      "variety": "SUNFL.",
      "category": "SUNFL.",
      "quantity": 120,
      "box_number": "BQT1",
      "plantation": "BQT Mora4",
      "unit_price": 0.38,
      "box_marking": "TDA",
      "total_price": 45.6
    },
    {
      "boxes": 1.0,
      "length": "80CM",
      "variety": "SUNFLOWER",
      "category": "SUNFLOWER",
      "quantity": 120,
      "box_number": "BQT2",
      "plantation": "BQT Mora4",
      "unit_price": 0.38,
      "box_marking": "TDA",
      "total_price": 45.6
    },
    {
      "boxes": 0.5,
      "length": "60CM",
      "variety": "SP.",
      "category": "SPRAY ROSES",
      "quantity": 200,
      "box_number": "ELC1",
      "plantation": "El Chivan",
      "unit_price": 0.7,
      "box_marking": "TDA",
      "total_price": 140.0
    },
    {
      "boxes": 1.0,
      "length": "60CM",
      "variety": "SPRAY",
      "category": "SPRAY ROSES",
      "quantity": 50,
      "box_number": "ELC2",
      "plantation": "El Chivan",
      "unit_price": 0.7,
      "box_marking": "TDA",
      "total_price": 35.0
    },
    {
      "boxes": 1.0,
      "length": "60CM",
      "variety": "SPRAY",
      "category": "SPRAY ROSES",
      "quantity": 40,
      "box_number": "ELC3",
      "plantation": "El Chivan",
      "unit_price": 0.7,
      "box_marking": "TDA",
      "total_price": 28.0
    },
    {
      "boxes": 1.0,
      "length": "60CM",
      "variety": "SPRAY",
      "category": "SPRAY ROSES",
      "quantity": 50,
      "box_number": "ELC4",
      "plantation": "El Chivan",
      "unit_price": 0.7,
      "box_marking": "TDA",
      "total_price": 35.0
    },
    {
      "boxes": 1.0,
      "length": "60CM",
      "variety": "SPRAY",
      "category": "SPRAY ROSES",
      "quantity": 60,
      "box_number": "ELC5",
      "plantation": "El Chivan",
      "unit_price": 0.7,
      "box_marking": "TDA",
      "total_price": 42.0
    },
    {
      "boxes": 1.0,
      "length": "50CM",
      "variety": "ROSE",
      "category": "ROSES",
      "quantity": 700,
      "box_number": "FLY1",
      "plantation": "Flor y Campo",
      "unit_price": 0.28,
      "box_marking": null,
      "total_price": 196.0
    },
    {
      "boxes": 1.0,
      "length": "50CM",
      "variety": "ROSE",
      "category": "ROSES",
      "quantity": 50,
      "box_number": "FLY2",
      "plantation": "Flor y Campo",
      "unit_price": 0.28,
      "box_marking": null,
      "total_price": 14.0
    },
    {
      "boxes": 1.0,
      "length": "50CM",
      "variety": "ROSE",
      "category": "ROSES",
      "quantity": 50,
      "box_number": "FLY3",
      "plantation": "Flor y Campo",
      "unit_price": 0.28,
      "box_marking": null,
      "total_price": 14.0
    },
    {
      "boxes": 1.0,
      "length": "50CM",
      "variety": "ROSE",
      "category": "ROSES",
      "quantity": 50,
      "box_number": "FLY4",
      "plantation": "Flor y Campo",
      "unit_price": 0.28,
      "box_marking": null,
      "total_price": 14.0
    },
    {
      "boxes": 1.0,
      "length": "50CM",
      "variety": "ROSE",
      "category": "ROSES",
      "quantity": 100,
      "box_number": "FLY5",
      "plantation": "Flor y Campo",
      "unit_price": 0.28,
      "box_marking": null,
      "total_price": 28.0
    },
    {
      "boxes": 1.0,
      "length": "50CM",
      "variety": "ROSE",
      "category": "ROSES",
      "quantity": 50,
      "box_number": "FLY6",
      "plantation": "Flor y Campo",
      "unit_price": 0.28,
      "box_marking": null,
      "total_price": 14.0
    },
    {
      "boxes": 1.0,
      "length": "50CM",
      "variety": "ROSE",
      "category": "ROSES",
      "quantity": 100,
      "box_number": "FLY7",
      "plantation": "Flor y Campo",
      "unit_price": 0.28,
      "box_marking": null,
      "total_price": 28.0
    },
    {
      "boxes": 1.0,
      "length": "50CM",
      "variety": "ROSE",
      "category": "ROSES",
      "quantity": 50,
      "box_number": "FLY8",
      "plantation": "Flor y Campo",
      "unit_price": 0.28,
      "box_marking": null,
      "total_price": 14.0
    },
    {
      "boxes": 1.0,
      "length": "50CM",
      "variety": "ROSE",
      "category": "ROSES",
      "quantity": 50,
      "box_number": "FLY9",
      "plantation": "Flor y Campo",
      "unit_price": 0.28,
      "box_marking": null,
      "total_price": 14.0
    },
    {
      "boxes": 1.0,
      "length": "50CM",
      "variety": "ROSE",
      "category": "ROSES",
      "quantity": 50,
      "box_number": "FL10",
      "plantation": "Flor y Campo",
      "unit_price": 0.28,
      "box_marking": null,
      "total_price": 14.0
    },
    {
      "boxes": 1.0,
      "length": "50CM",
      "variety": "ROSE",
      "category": "ROSES",
      "quantity": 50,
      "box_number": "FL11",
      "plantation": "Flor y Campo",
      "unit_price": 0.28,
      "box_marking": null,
      "total_price": 14.0
    },
    {
      "boxes": 1.0,
      "length": "50CM",
      "variety": "ROSE",
      "category": "ROSES",
      "quantity": 50,
      "box_number": "FL12",
      "plantation": "Flor y Campo",
      "unit_price": 0.28,
      "box_marking": null,
      "total_price": 14.0
    },
    {
      "boxes": 1.0,
      "length": null,
      "variety": "ROSE(G)",
      "category": "ROSES",
      "quantity": 50,
      "box_number": "FL13",
      "plantation": "Flor y Campo",
      "unit_price": 0.28,
      "box_marking": null,
      "total_price": 14.0
    },
    {
      "boxes": 1.0,
      "length": "50CM",
      "variety": "ROSE",
      "category": "ROSES",
      "quantity": 700,
      "box_number": "FL14",
      "plantation": "Flor y Campo",
      "unit_price": 0.28,
      "box_marking": null,
      "total_price": 196.0
    },
    {
      "boxes": 1.0,
      "length": "50CM",
      "variety": "ROSE",
      "category": "ROSES",
      "quantity": 50,
      "box_number": "FL15",
      "plantation": "Flor y Campo",
      "unit_price": 0.28,
      "box_marking": null,
      "total_price": 14.0
    },
    {
      "boxes": 1.0,
      "length": "50CM",
      "variety": "ROSE",
      "category": "ROSES",
      "quantity": 50,
      "box_number": "FL16",
      "plantation": "Flor y Campo",
      "unit_price": 0.28,
      "box_marking": null,
      "total_price": 14.0
    },
    {
      "boxes": 1.0,
      "length": "50CM",
      "variety": "ROSE",
      "category": "ROSES",
      "quantity": 50,
      "box_number": "FL17",
      "plantation": "Flor y Campo",
      "unit_price": 0.28,
      "box_marking": null,
      "total_price": 14.0
    },
    {
      "boxes": 1.0,
      "length": "50CM",
      "variety": "ROSE",
      "category": "ROSES",
      "quantity": 100,
      "box_number": "FL18",
      "plantation": "Flor y Campo",
      "unit_price": 0.28,
      "box_marking": null,
      "total_price": 28.0
    },
    {
      "boxes": 1.0,
      "length": "50CM",
      "variety": "ROSE",
      "category": "ROSES",
      "quantity": 50,
      "box_number": "FL19",
      "plantation": "Flor y Campo",
      "unit_price": 0.28,
      "box_marking": null,
      "total_price": 14.0
    },
    {
      "boxes": 1.0,
      "length": "50CM",
      "variety": "ROSE",
      "category": "ROSES",
      "quantity": 100,
      "box_number": "FL20",
      "plantation": "Flor y Campo",
      "unit_price": 0.28,
      "box_marking": null,
      "total_price": 28.0
    },
    {
      "boxes": 1.0,
      "length": "50CM",
      "variety": "ROSE",
      "category": "ROSES",
      "quantity": 50,
      "box_number": "FL21",
      "plantation": "Flor y Campo",
      "unit_price": 0.28,
      "box_marking": null,
      "total_price": 14.0
    },
    {
      "boxes": 1.0,
      "length": "50CM",
      "variety": "ROSE",
      "category": "ROSES",
      "quantity": 50,
      "box_number": "FL22",
      "plantation": "Flor y Campo",
      "unit_price": 0.28,
      "box_marking": null,
      "total_price": 14.0
    },
    {
      "boxes": 1.0,
      "length": "50CM",
      "variety": "ROSE",
      "category": "ROSES",
      "quantity": 50,
      "box_number": "FL23",
      "plantation": "Flor y Campo",
      "unit_price": 0.28,
      "box_marking": null,
      "total_price": 14.0
    },
    {
      "boxes": 1.0,
      "length": "50CM",
      "variety": "ROSE",
      "category": "ROSES",
      "quantity": 50,
      "box_number": "FL24",
      "plantation": "Flor y Campo",
      "unit_price": 0.28,
      "box_marking": null,
      "total_price": 14.0
    }
  ],
  "country": "Ecuador",
  "summary": {
    "total_boxes": 24.75,
    "total_stems": 3580,
    "total_amount": 1022.2
  },
  "supplier": "UTOPIA FARMS UTF S.A.S",
  "invoice_date": "3/13/2026",
  "invoice_number": "163295",
  "processing_report": {
    "notes": "Invoice type: grouped by HAWB. Discrepancy in extracted sums vs document totals. The document seems to list two full sets of items under 'Flor y Campo', but then states 'TOTALS FULL: 0 HALF: 14 QUARTER: 4 EIGHTH: 3 Pieces=21 F.B.E= 8.375 Total Stems: 6,470 USD: 2,062.60'. This suggests the item lines within the Flor y Campo section might represent two distinct boxes (as indicated by the '2 H 1 700 ST' for the main 'ROSE ASSORTED' lines), but the individual variety lines are then listed as separate items with their own stems. For this output, each detail line was treated as a distinct item as per rules, leading to the discrepancy. No multi-box unfolding applied. Number of physical boxes based on items is 24.75, but document reports 8.375 F.B.E.",
    "status": "warning",
    "sum_boxes": 24.75,
    "sum_stems": 3580,
    "sum_amount": 1022.2,
    "items_count": 24,
    "discrepancies": [
      "Total stems mismatch: Calculated 3580, Expected 6470",
      "Total amount mismatch: Calculated 1022.2, Expected 2062.6",
      "Total boxes mismatch: Calculated 24.75, Expected 8.375"
    ],
    "expected_boxes": 8.375,
    "expected_stems": 6470,
    "expected_amount": 2062.6
  }
}
Результат (Pass 2)

  
История (последние 20)
ID Файл Дата