AI Cost Calculation

Automating supplier quote processing — from PDF quotation to final selling price.

AI Quote Processor — supplier-quotation.pdf
PDFSupplier Quotation · Page 1/4
SupplierItemsQuantitiesPrices
XLSXCost Calculation Workbook
Pos.QtyDim.PriceTotal
1024120×8038,50924,00
206200×60112,00672,00
3015040×402,15322,50
401295×9554,80657,60
Selling Price2.576,10

Extracted values inserted automatically — formulas remain unchanged

Calculating selling prices begins with quotations from multiple suppliers. These documents can be surprisingly complex: they contain numerous items with different quantities, dimensions, weights, adjustments and additional costs. Some charges apply to individual items, while others must be distributed across several positions. For accounting and accurate cost allocation, every value needs to be identified and broken down correctly.

Previously, employees had to transcribe this information manually from PDFs into an Excel calculation tool. It was a recurring task that required both specialist knowledge and constant concentration. Although essential, it was also one of the most tedious parts of the workflow — and small transcription errors could affect the final selling price.

To automate this process, I developed an AI-powered PDF viewer as a desktop application — the supplier quotation displayed alongside the Excel workbook, with extracted values flowing directly into the right cells.

From PDF to selling price

Four automated steps replace the manual transcription:

  1. 1

    Supplier PDF. A quotation is opened in the desktop app — displayed side by side with the Excel calculation workbook.

  2. 2

    LLM-Based OCR. Pages are analysed via an OCR API hosted in Azure Foundry, extracting all relevant values into structured JSON.

  3. 3

    Validate & Map. The app validates and normalises the data, then maps it to the correct supplier-specific rows and columns.

  4. 4

    Excel Automation. PowerShell and the Excel COM interface insert values into the input cells — formulas and formatting stay untouched.

The model extracts everything the calculation needs: the supplier, line items, quantities, dimensions, weights, prices, adjustments and additional costs.

AI where it helps, determinism where it counts

The architecture separates flexible document understanding from predictable calculation logic. The LLM-based OCR handles the variable and unstructured content of supplier PDFs — different layouts, item structures and pricing formats — and returns everything in a structured JSON format.

The application then validates and normalises the extracted data and maps it to supplier-specific rows and columns. Excel performs the established cost calculations used to determine the final selling price. PowerShell and the Excel COM interface insert the recognised values into the intended input cells — existing formulas, formatting and calculation logic remain unchanged.

This separation is what makes the workflow both flexible and reliable: the AI absorbs the messiness of real-world documents, while the proven workbook stays responsible for the numbers.

Built for everyday operation

The Azure Foundry AI API proved inexpensive, effective and stable for this use case, and the limited number of requests keeps processing costs low. Structured responses, validation and automatic retries support reliable day-to-day operation without manual intervention.

The setup is also designed for GDPR-compliant use: controlled data processing, secure credential handling and the avoidance of unnecessary long-term document storage.

Technology Stack

Frontend
React, TypeScript, JavaScript, HTML
Automation
PowerShell, Excel COM, SQL
AI Platform
Azure Foundry (LLM OCR)
Development
Cursor, Codex, Git
Industry
Cost Calculation & Accounting