Песочница: OSCAR VALENCIA

Intent ID: 22

Назад
1) Загрузить файл и получить сырой OCR JSON
Сохраняем последний файл и сырой OCR, чтобы можно было повторно тестировать маппинг без перезагрузки.
Скачать последний файл (FACT EXPORTACION TDA00042862 H 14_52_30.pdf)
2) Правила трансформации
Правила трансформации OCR-данных в целевую схему (включая валидацию).
Промпт LLM-подсказки
Используется кнопкой «Подсказать rules».
Сырой OCR JSON (Pass 1)
{
  "awb": "",
  "items": [
    {
      "boxes": 1.0,
      "length": "60",
      "variety": "CANDLELIGHT",
      "category": ".00",
      "quantity": 350.0,
      "box_number": "1",
      "plantation": "",
      "unit_price": 0.5,
      "box_marking": "HB",
      "total_price": 175.0
    },
    {
      "boxes": 1.0,
      "length": "60",
      "variety": "MAGIC TIMES",
      "category": ".00",
      "quantity": 50.0,
      "box_number": "1",
      "plantation": "",
      "unit_price": 0.35,
      "box_marking": "HB",
      "total_price": 17.5
    },
    {
      "boxes": 2.0,
      "length": "50",
      "variety": "MAGIC TIMES",
      "category": ".00",
      "quantity": 50.0,
      "box_number": "2",
      "plantation": "",
      "unit_price": 0.3,
      "box_marking": "QB",
      "total_price": 15.0
    },
    {
      "boxes": 2.0,
      "length": "60",
      "variety": "PINK FLOYD",
      "category": ".00",
      "quantity": 50.0,
      "box_number": "2",
      "plantation": "",
      "unit_price": 0.35,
      "box_marking": "QB",
      "total_price": 17.5
    }
  ],
  "country": "Ecuador",
  "summary": {
    "total_boxes": 0.75,
    "total_stems": 500.0,
    "total_amount": 225.0
  },
  "supplier": "VALENCIA PUJOTA JAIME",
  "invoice_date": "06/03/2026",
  "invoice_number": "276",
  "processing_report": {
    "notes": "Invoice type: flat. 6 boxes detected from items data. No multi-box unfolding applied. 'OTR.' column values '.00' treated as category placeholder. Invoice date extracted from header text as table rule yielded no valid date. AWB value not found.",
    "status": "warning",
    "sum_boxes": 6.0,
    "sum_stems": 500.0,
    "sum_amount": 225.0,
    "items_count": 4,
    "discrepancies": [
      "Sum of item boxes (6.0) does not match total_boxes in summary (0.75)."
    ],
    "expected_boxes": 0.75,
    "expected_stems": 500.0,
    "expected_amount": 225.0
  }
}
Результат (Pass 2)
Report: warning
items=8, boxes=8.0/14.0, stems=350.0/350.0, amount=135.0/135.0
discrepancies: Calculated total boxes (8.0) does not match expected total boxes (14.0).
notes: Плоский тип инвойса. Обнаружено 8 физических коробок. Расхождение в количестве коробок между суммой позиций и итоговым значением. Раскрытие мультибокса не применялось.
{
  "awb": null,
  "items": [
    {
      "boxes": 1.0,
      "length": "60",
      "variety": "EXPLORER",
      "category": ".00",
      "quantity": 100.0,
      "box_number": "1",
      "plantation": "",
      "unit_price": 0.35,
      "box_marking": "HB",
      "total_price": 35.0
    },
    {
      "boxes": 1.0,
      "length": "70",
      "variety": "SALMA",
      "category": ".00",
      "quantity": 75.0,
      "box_number": "1",
      "plantation": "",
      "unit_price": 0.35,
      "box_marking": "HB",
      "total_price": 26.25
    },
    {
      "boxes": 1.0,
      "length": "60",
      "variety": "FRUTETO",
      "category": ".00",
      "quantity": 25.0,
      "box_number": "1",
      "plantation": "",
      "unit_price": 0.35,
      "box_marking": "HB",
      "total_price": 8.75
    },
    {
      "boxes": 1.0,
      "length": "60",
      "variety": "KAHALA",
      "category": ".00",
      "quantity": 50.0,
      "box_number": "1",
      "plantation": "",
      "unit_price": 0.35,
      "box_marking": "HB",
      "total_price": 17.5
    },
    {
      "boxes": 1.0,
      "length": "60",
      "variety": "HERMOSA",
      "category": ".00",
      "quantity": 25.0,
      "box_number": "1",
      "plantation": "",
      "unit_price": 0.35,
      "box_marking": "HB",
      "total_price": 8.75
    },
    {
      "boxes": 1.0,
      "length": "60",
      "variety": "PINK XPRESSION",
      "category": ".00",
      "quantity": 25.0,
      "box_number": "1",
      "plantation": "",
      "unit_price": 0.45,
      "box_marking": "HB",
      "total_price": 11.25
    },
    {
      "boxes": 1.0,
      "length": "60",
      "variety": "PRINCESS CROWN",
      "category": ".00",
      "quantity": 25.0,
      "box_number": "1",
      "plantation": "",
      "unit_price": 0.5,
      "box_marking": "HB",
      "total_price": 12.5
    },
    {
      "boxes": 1.0,
      "length": "60",
      "variety": "CANDLELIGHT",
      "category": ".00",
      "quantity": 25.0,
      "box_number": "1",
      "plantation": "",
      "unit_price": 0.6,
      "box_marking": "HB",
      "total_price": 15.0
    }
  ],
  "country": "Ecuador",
  "summary": {
    "total_boxes": 14.0,
    "total_stems": 350.0,
    "total_amount": 135.0
  },
  "supplier": "VALENCIA PUJOTA JAIME",
  "invoice_date": null,
  "invoice_number": "276",
  "processing_report": {
    "notes": "Плоский тип инвойса. Обнаружено 8 физических коробок. Расхождение в количестве коробок между суммой позиций и итоговым значением. Раскрытие мультибокса не применялось.",
    "status": "warning",
    "sum_boxes": 8.0,
    "sum_stems": 350.0,
    "sum_amount": 135.0,
    "items_count": 8,
    "discrepancies": [
      "Calculated total boxes (8.0) does not match expected total boxes (14.0)."
    ],
    "expected_boxes": 14.0,
    "expected_stems": 350.0,
    "expected_amount": 135.0
  }
}
История (последние 20)
ID Файл Дата
29 FACT EXPORTACION TDA00042222 H 19_28_58.pdf 2026-02-23 17:17:33.211191+00:00 Excel