Skip to content

kyr0/easy-erechnung

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

25 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿงพ easy-e-rechnung

Java-App for creating and validating Factur-X / ZuGFeRD / X-Rechnung invoices conforming with EU-Norm EN 16931.


โœจ Key Features

Feature Description
๐Ÿ‡ช๐Ÿ‡บ EU Compliant Generates invoices conforming to EN 16931, accepted across all EU member states.
๐Ÿ”’ 100% Offline & Private All processing happens locally on your machine. Your invoice data never leaves your computer.
๐Ÿค– LocalAI-Powered OCR Uses local, open-weight AI models for automatic, high-quality text extraction from PDF invoices.
๐Ÿ“„ Multi-Page Support Processes multi-page PDF invoices โ€” each page is OCR'd separately, then semantically merged by the LLM into a single structured result.
๐Ÿง  Works with Ollama Integrates with Ollama for local LLM inference. Default models: glm-ocr:q8_0 (OCR) and qwen3:4b-q8_0 (JSON extraction).
๐Ÿ’ป Cross-Platform Runs on macOS, Linux, and Windows. (macOS and Linux are the primary tested platforms.)

๐Ÿš€ Setup

# Install tooling and dependencies
bash setup.sh

๐Ÿงพ Usage

Users usually interact with the app via the GUI:

# Start the App (Java)
./start.sh

๐Ÿง‘โ€๐Ÿ’ป Calling the OCR pipeline via Shell

You can also run the OCR pipeline directly via shell:

# Single-page PDF
bun run src/ocr.ts --input demo/verify.pdf --output /tmp/result.json \
  --seller-address "Friedrich-Damm-Str. 8, 80999 Mรผnchen" \
  --seller-tax-no "147/214/00001"

# Multi-page PDF with custom models
bun run src/ocr.ts --input demo/verify_multipage.pdf --output /tmp/result.json \
  --seller-address "Friedrich-Damm-Str. 8, 80999 Mรผnchen" \
  --seller-tax-no "147/214/00001" \
  --ocr-model glm-ocr:q8_0 --json-model qwen3:4b-q8_0

OCR Pipeline Architecture

  1. PDF โ†’ Images โ€” Each page is rendered as a high-resolution image.
  2. Image Preprocessing โ€” Contrast boost, normalization, and resize to max 3MP.
  3. OCR per Page โ€” Vision model (glm-ocr:q8_0) extracts text as markdown.
  4. Date Preprocessing โ€” Date ranges in the OCR text are annotated with day counts (e.g. DAYS: 31) to help the LLM correctly set quantities for time-based line items.
  5. JSON Extraction โ€” All page markdowns are combined and sent in a single LLM call (qwen3:4b-q8_0) to produce a structured ZUGFeRD-compatible JSON.

๐Ÿ“ธ How It Works

Step 1: Drag & Drop Your Invoice PDF

Simply drag and drop a PDF invoice into the app. Multi-page PDFs are displayed with tabs on the left side. The AI-powered OCR will automatically extract the text from each page.

OCR Detection


Step 2: AI Post-Processing

The local AI model analyzes the OCR output and intelligently extracts all relevant invoice data. Progress is shown in real-time with per-page OCR status tabs and a JSON extraction log.

AI OCR Post-Processing


Step 3: Review Invoice Positions

Review and edit the extracted line items. The app calculates totals automatically.

Invoice Positions


Step 4: Review Taxes & Totals

Verify the tax calculations and monetary summations.

Taxes and Totals


Step 5: Create the e-Invoice

Click to generate the ZuGFeRD/Factur-X compliant PDF with embedded XML.

Create e-Invoice


Step 6: Invoice Created Successfully

The app confirms successful creation and automatically opens the ELSTER e-Rechnung portal for official validation.

Success


Step 7: View the Final Output

Your new e-Invoice is ready.

Done


โœ… Validated by Official Tools

ELSTER (German Tax Authority)

Validated by ELSTER

Other Validators

Validated by Winball


๐Ÿ“ Demo Data

The demo/ folder contains sample invoice data for testing and demonstration purposes.


๐Ÿ“œ License

MIT, Open Source.


๐Ÿ›ก๏ธ Privacy Promise

  • No network requests. All AI inference runs locally.
  • No telemetry. Your data stays on your device.
  • Open Source. Audit the code yourself.

About

Java-App for creating and validating Factur-X / ZuGFeRD / X-Rechnung invoices conforming with EU-Norm EN 16931.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors