Песочница: GUAISA / SUNRITE FARMS

Intent ID: 25

Назад
1) Загрузить файл и получить сырой OCR JSON
Сохраняем последний файл и сырой OCR, чтобы можно было повторно тестировать маппинг без перезагрузки.
Скачать последний файл (0263249.PDF)
2) Правила трансформации
Правила трансформации OCR-данных в целевую схему (включая валидацию).
Промпт LLM-подсказки
Используется кнопкой «Подсказать rules».
Сырой OCR JSON (Pass 1)
{
  "awb": "145-9981 7690/PC604001810",
  "items": [
    {
      "boxes": 1,
      "length": "50",
      "variety": "LIGHT PINK PINK MONDIAL",
      "category": "ROSE",
      "quantity": 300,
      "box_number": "ITEM-1",
      "plantation": "GUANQUILQUI AGROPECUARIA INDUSTRIAL S.A",
      "unit_price": 0.4,
      "box_marking": "TDA",
      "total_price": 120.0
    },
    {
      "boxes": 1,
      "length": "40",
      "variety": "ASSORTED SELECT MIX",
      "category": "ROSE",
      "quantity": 500,
      "box_number": "ITEM-2",
      "plantation": "GUANQUILQUI AGROPECUARIA INDUSTRIAL S.A",
      "unit_price": 0.22,
      "box_marking": "TDA",
      "total_price": 110.0
    },
    {
      "boxes": 1,
      "length": "50-60",
      "variety": "ASSORTED SELECT MIX",
      "category": "ROSE",
      "quantity": 375,
      "box_number": "ITEM-3",
      "plantation": "GUANQUILQUI AGROPECUARIA INDUSTRIAL S.A",
      "unit_price": 0.373,
      "box_marking": "TDA",
      "total_price": 139.875
    },
    {
      "boxes": 1,
      "length": "50",
      "variety": "ASSORTED SELECT MIX",
      "category": "ROSE",
      "quantity": 400,
      "box_number": "ITEM-4",
      "plantation": "GUANQUILQUI AGROPECUARIA INDUSTRIAL S.A",
      "unit_price": 0.481,
      "box_marking": "TDA",
      "total_price": 192.4
    }
  ],
  "country": "Republic of Kazakhstan",
  "summary": {
    "total_boxes": 4,
    "total_stems": 1575,
    "total_amount": 562.275
  },
  "supplier": "GUANQUILQUI AGROPECUARIA INDUSTRIAL S.A",
  "invoice_date": null,
  "invoice_number": null,
  "processing_report": {
    "notes": "Тип инвойса: плоский. Обнаружено 4 физические коробки. При извлечении данных были проблемы с интерпретацией правил для метаданных (invoice_number, invoice_date, supplier, country, awb) из-за несоответствия паттернов и структуры OCR. Также была обнаружена сдвижка колонок в таблице для 'Total Units' (quantity), 'Unit Price', 'Amount' по сравнению с описанием правил. Раскрытие мультибокса не применялось, так как каждая строка соответствует одной коробке (boxes=1). Для box_number использован уникальный порядковый номер ITEM-N.",
    "status": "ok",
    "sum_boxes": 4,
    "sum_stems": 1575,
    "sum_amount": 562.275,
    "items_count": 4,
    "discrepancies": [
      "Rule for 'invoice_number' (pattern 'PACKING' in col 0) not met, value taken from metadata.",
      "Rule for 'invoice_date' (pattern 'Date Amount PO # Terms' in col 0) not met, value is null.",
      "Rule for 'supplier' ('Bill To' in col 0, value from col 1 next line) was interpreted to use 'MECH TA OOO.-RU' (customer), so value was taken from metadata.supplier for correctness.",
      "Rule for 'country' ('Bill To' in col 0, value from col 1 after address) was not strictly met. Value 'Republic of Kazakhstan' was extracted from 'sections' data as it represents the customer's country.",
      "Rule for 'awb' (pattern 'Carrier' in col 0, value from col 1 next line) was not strictly met (led to carrier name, not AWB number). Value taken from metadata.awb.",
      "The OCR table's column 3 contains descriptive values ('H', 'V') instead of numeric 'Total Units'. 'Total Units' (quantity) was extracted from OCR column 4, and 'Unit Price' from OCR column 5, and 'Amount' from OCR column 6, shifting the expected column indices from the rule for these fields."
    ],
    "expected_boxes": 4,
    "expected_stems": 1575,
    "expected_amount": 562.275
  }
}
Результат (Pass 2)
Report: ok
items=7, boxes=7/7.0, stems=3500.0/3500.0, amount=830.0/830.0
notes: Тип инвойса: гибридный (данные объединены в одной строке OCR, но логически это плоский инвойс), обнаружено 7 физических коробок, применялось раскрытие мультибокса для 2 позиций, генерированы уникальные box_number для дубликатов.
{
  "awb": "PACIFIC AIR",
  "items": [
    {
      "boxes": 1,
      "length": "50",
      "variety": "HOT PINK GOTCHA",
      "category": "ROSE",
      "quantity": 400.0,
      "box_number": "1 H",
      "plantation": "MECHTA OOO.-RU",
      "unit_price": 0.35,
      "box_marking": "BUKETOPT",
      "total_price": 140.0
    },
    {
      "boxes": 1,
      "length": "50",
      "variety": "HOT PINK GOTCHA",
      "category": "ROSE",
      "quantity": 500.0,
      "box_number": "1 V-1",
      "plantation": "MECHTA OOO.-RU",
      "unit_price": 0.32,
      "box_marking": "BUKETOPT",
      "total_price": 160.0
    },
    {
      "boxes": 1,
      "length": null,
      "variety": "LIGHT PINK NENA",
      "category": "ROSE",
      "quantity": 500.0,
      "box_number": "1 V-2",
      "plantation": "MECHTA OOO.-RU",
      "unit_price": 0.22,
      "box_marking": "BUKETOPT",
      "total_price": 110.0
    },
    {
      "boxes": 1,
      "length": "50",
      "variety": "CREAM VENDELA",
      "category": "ROSE",
      "quantity": 500.0,
      "box_number": "2 V-1",
      "plantation": "MECHTA OOO.-RU",
      "unit_price": 0.2,
      "box_marking": "BUKETOPT",
      "total_price": 100.0
    },
    {
      "boxes": 1,
      "length": "50",
      "variety": "CREAM VENDELA",
      "category": "ROSE",
      "quantity": 500.0,
      "box_number": "2 V-2",
      "plantation": "MECHTA OOO.-RU",
      "unit_price": 0.2,
      "box_marking": "BUKETOPT",
      "total_price": 100.0
    },
    {
      "boxes": 1,
      "length": "50",
      "variety": "CREAM VENDELA",
      "category": "ROSE",
      "quantity": 550.0,
      "box_number": "2 B-1",
      "plantation": "MECHTA OOO.-RU",
      "unit_price": 0.2,
      "box_marking": "BUKETOPT",
      "total_price": 110.0
    },
    {
      "boxes": 1,
      "length": "50",
      "variety": "CREAM VENDELA",
      "category": "ROSE",
      "quantity": 550.0,
      "box_number": "2 B-2",
      "plantation": "MECHTA OOO.-RU",
      "unit_price": 0.2,
      "box_marking": "BUKETOPT",
      "total_price": 110.0
    }
  ],
  "country": "Republic of Kazakhstan",
  "summary": {
    "total_boxes": 7.0,
    "total_stems": 3500.0,
    "total_amount": 830.0
  },
  "supplier": "MECHTA OOO.-RU",
  "invoice_date": "02/19/2026",
  "invoice_number": "0261178",
  "processing_report": {
    "notes": "Тип инвойса: гибридный (данные объединены в одной строке OCR, но логически это плоский инвойс), обнаружено 7 физических коробок, применялось раскрытие мультибокса для 2 позиций, генерированы уникальные box_number для дубликатов.",
    "status": "ok",
    "sum_boxes": 7,
    "sum_stems": 3500.0,
    "sum_amount": 830.0,
    "items_count": 7,
    "discrepancies": [],
    "expected_boxes": 7.0,
    "expected_stems": 3500.0,
    "expected_amount": 830.0
  }
}
История (последние 20)
ID Файл Дата
24 0261178.PDF 2026-02-23 17:08:43.771770+00:00 Excel