# Mehrwertsteuer-Rechner - Comprehensive Documentation

**Last Updated:** 2026-01-07

## Tool Overview

### Basic Information

- **Tool Name:** Mehrwertsteuer-Rechner
- **Slug:** `mehrwertsteuer-rechner`
- **URL:** `https://www.ordio.com/tools/mehrwertsteuer-rechner`
- **Status:** Available
- **Last Updated:** 2026-01-21

### Purpose

Calculate VAT (Mehrwertsteuer/Umsatzsteuer) for Germany, Austria, and Switzerland. Supports three calculation modes: Quick (single calculation), Multi-Item (multiple items with different VAT rates), and Invoice Generator (full invoice creation with company/customer data). Includes export functionality (PDF, Excel, CSV).

### Use Cases

- **Businesses:** Calculate VAT for invoices and pricing
- **Accountants:** Calculate VAT for multiple items
- **Restaurants:** Calculate VAT for food and beverages
- **E-commerce:** Calculate VAT for product pricing
- **Service Providers:** Generate invoices with VAT

### Real-World Scenarios

**Scenario 1: Restaurant Owner Calculating Menu Prices**

- **User:** Restaurant owner setting menu prices
- **Situation:** Want to sell dish for €20 net, need to calculate final price with VAT
- **Goal:** Calculate gross price including 7% reduced VAT rate for food
- **Steps:**
  1. Select Quick Mode
  2. Enter amount: €20
  3. Select input type: Netto
  4. Select country: Germany
  5. Select VAT rate: 7% (reduced rate for food)
  6. Review calculated gross price
- **Result:** Sees €21.40 gross price (€20 + €1.40 VAT)
- **Related Tools:** [Prozentrechner](prozentrechner-documentation.md) (for percentage calculations), [Brutto-Netto-Rechner](brutto-netto-rechner-documentation.md) (for salary calculations)

**Scenario 2: E-commerce Seller Pricing Products**

- **User:** Online seller pricing products for German market
- **Situation:** Need to price product at €50 including VAT, want to know net price
- **Goal:** Calculate net price from gross price for accounting
- **Steps:**
  1. Select Quick Mode
  2. Enter amount: €50
  3. Select input type: Brutto
  4. Select country: Germany
  5. Select VAT rate: 19% (standard rate)
  6. Review calculated net price
- **Result:** Sees €42.02 net price (€50 - €7.98 VAT)
- **Related Tools:** [PayPal Gebührenrechner](paypal-gebuehrenrechner-documentation.md) (for payment fees), [Prozentrechner](prozentrechner-documentation.md) (for markup calculations)

**Scenario 3: Accountant Processing Multi-Item Invoice**

- **User:** Accountant processing invoice with multiple items
- **Situation:** Invoice has 5 items with different VAT rates (19%, 7%, 0%)
- **Goal:** Calculate total VAT and gross amount
- **Steps:**
  1. Select Multi-Item Mode
  2. Add items with different VAT rates
  3. Enter net amounts for each item
  4. Review calculated totals
  5. Export to Excel for accounting
- **Result:** Sees total net, total VAT, total gross, breakdown by VAT rate
- **Related Tools:** [Prozentrechner](prozentrechner-documentation.md) (for percentage breakdowns), [Einkommensteuer-Rechner](einkommensteuer-rechner-documentation.md) (for tax planning)

**Scenario 4: Service Provider Generating Invoice**

- **User:** Freelancer generating invoice for client
- **Situation:** Need to create professional invoice with VAT for €1,000 service
- **Goal:** Generate complete invoice with company/customer data
- **Steps:**
  1. Select Invoice Generator Mode
  2. Enter company details
  3. Enter customer details
  4. Add service item: €1,000
  5. Select VAT rate: 19%
  6. Generate PDF invoice
- **Result:** Sees complete invoice with €1,000 net, €190 VAT, €1,190 gross, can export PDF
- **Related Tools:** [Brutto-Netto-Rechner](brutto-netto-rechner-documentation.md) (for net income), [Einkommensteuer-Rechner](einkommensteuer-rechner-documentation.md) (for tax calculation)

### Target Audience

- Business owners
- Accountants
- Restaurant owners
- E-commerce businesses
- Service providers

### Visual Description

**Hero Section:**

- Layout: Centered hero section with badge, headline, and description
- Badge: "Mehrwertsteuer" badge
- Headline: Large bold headline "Mehrwertsteuer Rechner 2026: Brutto Netto MwSt" with blue accent
- Description: Paragraph explaining VAT calculation for DACH countries
- Background: Gradient blur effect

**Visual Examples (To Be Added):**

**Hero Section Screenshot:**

- Location: `docs/guides/tools-pages/screenshots/mehrwertsteuer-rechner-hero.png`
- Description: Full hero section showing badge, headline, description
- Dimensions: 1920x1080 (desktop), 375x667 (mobile)
- Shows: Complete above-fold content with visual styling

**Quick Mode Form Screenshot:**

- Location: `docs/guides/tools-pages/screenshots/mehrwertsteuer-rechner-quick.png`
- Description: Quick mode form showing amount input, country/VAT selection
- Dimensions: 1920x1080 (desktop)
- Shows: Input fields, country dropdown, VAT rate selection, calculate button

**Multi-Item Mode Screenshot:**

- Location: `docs/guides/tools-pages/screenshots/mehrwertsteuer-rechner-multi.png`
- Description: Multi-item mode showing multiple items with different VAT rates
- Dimensions: 1920x1080 (desktop)
- Shows: Item list, VAT rate selection per item, totals breakdown

**Invoice Generator Screenshot:**

- Location: `docs/guides/tools-pages/screenshots/mehrwertsteuer-rechner-invoice.png`
- Description: Invoice generator showing company/customer data and invoice preview
- Dimensions: 1920x1080 (desktop)
- Shows: Company details, customer details, invoice items, PDF export button

**VAT Calculation Flow Diagram:**

- Location: `docs/guides/tools-pages/diagrams/mehrwertsteuer-rechner-flow.svg`
- Description: Flow diagram showing VAT calculation process for different modes
- Format: SVG (vector) for scalability
- Shows: Input → Calculation → Output flow for Quick/Multi-Item/Invoice modes

**Calculator Form:**

- Layout: Large white card with rounded corners, shadow, max-width container
- Mode Tabs: Three tabs (Quick / Multi-Item / Rechnung) with icons
- Form Sections: Mode-specific sections:
  - Quick Mode: Amount input, input type toggle (Netto/Brutto), country selection, VAT rate selection
  - Multi-Item Mode: Item list with add/remove/duplicate, global VAT rate, quantity support
  - Invoice Mode: Company data, customer data, invoice details, item list, discounts/charges
- Input Fields: Number inputs, selects, radio buttons, toggles, text inputs
- Calculate Button: Auto-calculation on input change (debounced)
- Styling: Blue accent color (#4D8EF3), gray borders, rounded corners

**Result Display:**

- Layout: Results section below form (updates in real-time)
- Quick Mode Results: Three cards showing Netto, MwSt, Brutto
- Multi-Item Results: Summary cards (Subtotal, Total VAT, Grand Total) + VAT breakdown by rate
- Invoice Results: Full invoice preview with company/customer data, items table, totals
- Export Options: PDF, Excel, CSV export buttons (email gating)

### UI/UX Flow

**Initial Load:**

- Page loads with hero section visible
- Calculator form shows default values:
  - Mode: Quick
  - Input Type: Netto
  - Country: Deutschland (DE)
  - VAT Rate: 19% (standard)
  - Amount: Empty
- No results displayed initially

**User Interaction Flow (Quick Mode):**

1. User enters amount
2. User selects input type (Netto or Brutto)
3. User selects country (DE/AT/CH)
4. VAT rates update automatically based on country
5. User selects VAT rate (standard/reduced/custom)
6. Calculation runs automatically (debounced)
7. Results displayed in real-time

**User Interaction Flow (Multi-Item Mode):**

1. User switches to "Multi-Item" tab
2. User adds items (description, amount, quantity, VAT rate)
3. User can set global VAT rate for all items
4. User can set individual VAT rates per item
5. Calculations run automatically for each item
6. Summary totals displayed with VAT breakdown

**User Interaction Flow (Invoice Mode):**

1. User switches to "Rechnung" tab
2. User enters company data (name, address, VAT ID, etc.)
3. User enters customer data (name, address, VAT ID)
4. User enters invoice details (number, date, due date, terms)
5. User adds invoice items (description, quantity, price, VAT rate)
6. User can add discounts and additional charges
7. Invoice preview updates in real-time
8. User can export PDF/Excel

**Error Handling Flow:**

- Input validation: Amount validation, email validation
- Auto-correction: Number formatting, VAT rate validation
- Warnings: Invalid amounts, missing required fields
- Results only shown after successful calculation

## Technical Documentation

### File Structure

- **PHP File:** `v2/pages/tools_mehrwertsteuer_rechner.php` (4,565 lines)
- **JavaScript:** Inline Alpine.js component (embedded in PHP file, line 1032+)
- **CSS:** Uses shared `v2/css/tools-pages.css` + extensive inline styles
- **External Libraries:** jsPDF (lazy loaded), html2canvas (lazy loaded), ExcelJS (lazy loaded)

### Code Organization

**Alpine.js Component Structure:**

- Main component: `mehrwertsteuerCalculator()` function (line 1032)
- All logic embedded in PHP file
- Complex state management for three modes

**State Management:**

- Alpine.js reactive state for all UI state
- localStorage for email collection status
- No URL parameter sharing

**Code Patterns:**

- Alpine.js reactive data properties
- Debounced calculation functions
- Real-time calculation updates
- Export functions (PDF, Excel, CSV)

### Calculation Modes

**Mode 1: Quick (Single Calculation)**

- **Visual Description:** Simple form with single amount input
- **Purpose:** Quick VAT calculation for single amounts
- **Input Fields:**

  - `amount` (number): Amount to calculate
    - Required: Yes
    - Default: Empty
    - Validation: min=0, max=10,000,000
  - `inputType` (radio): Input type
    - Options: Netto, Brutto
    - Default: Netto
    - Required: Yes
  - `selectedCountry` (select): Country
    - Options: Deutschland (DE), Österreich (AT), Schweiz (CH)
    - Default: Deutschland (DE)
    - Required: Yes
  - `selectedVatRate` (radio): VAT rate
    - Options: Standard, Reduced, Custom
    - Default: Standard (19% for DE)
    - Required: Yes
  - `customVatRate` (number): Custom VAT rate (if custom selected)
    - Default: Empty
    - Required: Yes (if custom selected)

- **Output Fields:**

  - `netto` (number): Net amount
  - `mwst` (number): VAT amount
  - `brutto` (number): Gross amount

- **Formula:**

  ```
  If inputType === 'netto':
    netto = amount
    mwst = Math.round(netto * vatRate / 100 * 100) / 100
    brutto = netto + mwst
  Else if inputType === 'brutto':
    brutto = amount
    netto = Math.round(brutto / (1 + vatRate / 100) * 100) / 100
    mwst = brutto - netto
  ```

- **Calculation Steps:**

  1. Validate amount input
  2. Parse VAT rate (standard/reduced/custom)
  3. Calculate based on input type (netto or brutto)
  4. Round to 2 decimal places
  5. Display results

- **Example:**

  - Input:
    - Amount: 100.00
    - Input Type: Netto
    - Country: Deutschland
    - VAT Rate: 19% (standard)
  - Calculation:
    - Netto: 100.00 €
    - MwSt: 100.00 × 0.19 = 19.00 €
    - Brutto: 100.00 + 19.00 = 119.00 €
  - Output:
    - Netto: 100,00 €
    - MwSt: 19,00 €
    - Brutto: 119,00 €

**Mode 2: Multi-Item (Multiple Items)**

- **Visual Description:** Item list with add/remove/duplicate functionality
- **Purpose:** Calculate VAT for multiple items with different VAT rates
- **Input Fields:**

  - `multiItems[]` (array): Array of items
    - Each item has:
      - `description` (string): Item description
      - `amount` (number): Item amount (netto)
      - `quantity` (number): Quantity
      - `vatRate` (number): VAT rate for item
      - `customVatRate` (number): Custom VAT rate (if custom)
    - Default: One empty item
  - `globalVatRate` (radio): Global VAT rate for all items
    - Options: Standard, Reduced, Custom
    - Default: Standard
  - `customGlobalVatRate` (number): Custom global VAT rate
    - Default: Empty

- **Output Fields:**

  - `subtotal` (number): Sum of all netto amounts
  - `totalVat` (number): Sum of all VAT amounts
  - `grandTotal` (number): Sum of all brutto amounts
  - `vatBreakdown` (object): VAT breakdown by rate
    - Each rate has: netto, mwst, brutto

- **Formula:**

  ```
  For each item:
    totalAmount = amount * quantity
    netto = totalAmount
    mwst = Math.round((netto * vatRate) / 100 * 100) / 100
    brutto = netto + mwst

  subtotal = sum of all netto
  totalVat = sum of all mwst
  grandTotal = sum of all brutto

  vatBreakdown[rate] = {
    netto: sum of netto for this rate,
    mwst: sum of mwst for this rate,
    brutto: sum of brutto for this rate
  }
  ```

- **Calculation Steps:**

  1. Validate all items
  2. Calculate each item (netto, mwst, brutto)
  3. Sum totals (subtotal, totalVat, grandTotal)
  4. Group by VAT rate for breakdown
  5. Display results with breakdown

- **Example:**

  - Input:
    - Item 1: Description "Product A", Amount 100.00, Quantity 2, VAT 19%
    - Item 2: Description "Product B", Amount 50.00, Quantity 1, VAT 7%
  - Calculation:
    - Item 1: Netto 200.00, MwSt 38.00, Brutto 238.00
    - Item 2: Netto 50.00, MwSt 3.50, Brutto 53.50
    - Subtotal: 250.00 €
    - Total VAT: 41.50 €
    - Grand Total: 291.50 €
  - Output:
    - Subtotal: 250,00 €
    - Total VAT: 41,50 €
    - Grand Total: 291,50 €
    - VAT Breakdown:
      - 19%: Netto 200,00 €, MwSt 38,00 €, Brutto 238,00 €
      - 7%: Netto 50,00 €, MwSt 3,50 €, Brutto 53,50 €

**Mode 3: Invoice Generator (Rechnung)**

- **Visual Description:** Full invoice form with company/customer data and item table
- **Purpose:** Generate complete invoices with VAT calculation
- **Input Fields:**

  - `invoiceData.company` (object): Company information
    - `name` (string): Company name
    - `address` (string): Company address
    - `vatId` (string): VAT ID
    - `email` (string): Email
    - `phone` (string): Phone
  - `invoiceData.customer` (object): Customer information
    - `name` (string): Customer name
    - `address` (string): Customer address
    - `vatId` (string): VAT ID
  - `invoiceData.invoice` (object): Invoice details
    - `number` (string): Invoice number
    - `date` (date): Invoice date
    - `dueDate` (date): Due date
    - `terms` (string): Payment terms
  - `invoiceData.items[]` (array): Invoice items
    - Each item has:
      - `description` (string): Item description
      - `quantity` (number): Quantity
      - `price` (number): Price per unit
      - `vatRate` (number): VAT rate
  - `invoiceData.discounts[]` (array): Discounts (optional)
  - `invoiceData.additionalCharges[]` (array): Additional charges (optional)
  - `globalInvoiceVatRate` (radio): Global VAT rate for all items
  - `customInvoiceVatRate` (number): Custom global VAT rate

- **Output Fields:**

  - `subtotal` (number): Sum of all item subtotals
  - `totalVat` (number): Sum of all VAT amounts
  - `grandTotal` (number): Final total including discounts/charges

- **Formula:**

  ```
  For each item:
    itemSubtotal = quantity * price
    itemVat = itemSubtotal * (vatRate / 100)

  subtotal = sum of all itemSubtotal
  totalVat = sum of all itemVat
  grandTotal = Math.round((subtotal + totalVat) * 100) / 100
  ```

- **Calculation Steps:**

  1. Validate invoice data
  2. Calculate each item (subtotal, VAT)
  3. Sum totals (subtotal, totalVat)
  4. Apply discounts and additional charges (if any)
  5. Calculate grand total
  6. Display invoice preview

- **Example:**

  - Input:
    - Company: "Ordio GmbH", Address "Berlin", VAT ID "DE123456789"
    - Customer: "Customer Name", Address "Munich"
    - Invoice: Number "INV-2026-001", Date "2026-01-07"
    - Item 1: Description "Service A", Quantity 2, Price 100.00, VAT 19%
    - Item 2: Description "Service B", Quantity 1, Price 50.00, VAT 19%
  - Calculation:
    - Item 1: Subtotal 200.00, VAT 38.00
    - Item 2: Subtotal 50.00, VAT 9.50
    - Subtotal: 250.00 €
    - Total VAT: 47.50 €
    - Grand Total: 297.50 €
  - Output:
    - Full invoice preview with company/customer data, items table, totals

### Constants and Thresholds

**2026 Values:**

- **VAT Rates by Country:**
  - **Deutschland (DE):**
    - Standard: 19%
    - Reduced: 7%
    - Kleinunternehmer thresholds: 25,000 € net (Vorjahr) / 100,000 € net (laufendes Jahr)
  - **Österreich (AT):**
    - Standard: 20%
    - Reduced: 10%
    - Kleinunternehmer threshold: 35,000 €
  - **Schweiz (CH):**
    - Standard: 8.1%
    - Reduced: 2.6%
    - MwSt-Befreiung threshold: 100,000 CHF
- **Amount Limits:**
  - Min: 0.01
  - Max: 10,000,000
- **Rounding:** 2 decimal places (cents)

**Previous Values (for reference):**

- VAT rates stable (no changes expected in 2026)
- Kleinunternehmerregelung 2025: Single threshold of 25,000€ (gross amounts)
- Kleinunternehmerregelung 2026: Dual thresholds - 25,000€ net (previous year) and 100,000€ net (current year)

### Validation Rules

- Amount: min=0.01, max=10,000,000, required
- Quantity: min=1, integer, required
- VAT Rate: min=0, max=100, required
- Email: Valid email format (for export)
- Invoice Number: Required (for invoice mode)
- Company Name: Required (for invoice mode)
- Customer Name: Required (for invoice mode)

### Edge Cases Handled

- Different countries with different VAT rates
- Custom VAT rates
- Multiple items with different VAT rates
- Zero amounts (validation)
- Very large amounts (validation)
- Empty items (filtered out)
- Invalid VAT rates (validation)
- Missing required fields (validation)

### Dependencies

- **External Libraries:**
  - jsPDF: PDF generation (lazy loaded)
  - html2canvas: HTML to canvas conversion for PDF (lazy loaded)
  - ExcelJS: Excel generation (lazy loaded)
- **APIs:** None
- **Alpine.js:** Used for reactive UI (version from base includes)
- **Inline JavaScript:** All logic embedded in PHP file

## Functions & Methods

### Main Component Function

**Function:** `mehrwertsteuerCalculator()`

- **Location:** `v2/pages/tools_mehrwertsteuer_rechner.php:1032`
- **Purpose:** Main Alpine.js component for VAT calculator
- **Returns:** Alpine.js component object
- **Dependencies:** Alpine.js framework
- **Side Effects:** Manages DOM state, triggers calculations

### Calculation Functions

**Function:** `calculateQuick()`

- **Location:** `v2/pages/tools_mehrwertsteuer_rechner.php:1324`
- **Purpose:** Calculate VAT for quick mode
- **Parameters:** None (uses component state)
- **Returns:** void (sets component state)
- **Dependencies:** `validateAmount()`, `parseAmount()`
- **Side Effects:** Updates `results` object, sets `hasResults` to true

**Function:** `calculateMulti()`

- **Location:** `v2/pages/tools_mehrwertsteuer_rechner.php:1397`
- **Purpose:** Calculate VAT for multi-item mode
- **Parameters:** None (uses component state)
- **Returns:** void (sets component state)
- **Dependencies:** `validateAmount()`, `parseAmount()`
- **Side Effects:** Updates `multiResults` object, sets `multiHasResults` to true

**Function:** `calculateInvoice()`

- **Location:** `v2/pages/tools_mehrwertsteuer_rechner.php:1591`
- **Purpose:** Calculate VAT for invoice mode
- **Parameters:** None (uses component state)
- **Returns:** void (sets component state)
- **Dependencies:** `parseAmount()`
- **Side Effects:** Updates `invoiceData.totals` object, sets `invoiceHasResults` to true

**Function:** `calculateItemTotal(item)`

- **Location:** `v2/pages/tools_mehrwertsteuer_rechner.php:1621`
- **Purpose:** Calculate total for single invoice item
- **Parameters:**
  - `item` (object): Invoice item
- **Returns:** Number (item total)
- **Dependencies:** `parseAmount()`
- **Side Effects:** None

### Utility Functions

**Function:** `formatCurrency(amount)`

- **Location:** `v2/pages/tools_mehrwertsteuer_rechner.php:1367`
- **Purpose:** Format number as currency
- **Parameters:**
  - `amount` (number): Amount to format
- **Returns:** String (formatted currency)
- **Dependencies:** Intl.NumberFormat
- **Side Effects:** None

**Function:** `parseAmount(amountString)`

- **Location:** `v2/pages/tools_mehrwertsteuer_rechner.php:1384`
- **Purpose:** Parse amount string to number
- **Parameters:**
  - `amountString` (string): Amount string
- **Returns:** Number (parsed amount)
- **Dependencies:** None (pure parsing)
- **Side Effects:** None

**Function:** `validateAmount(amount)`

- **Location:** `v2/pages/tools_mehrwertsteuer_rechner.php:1301`
- **Purpose:** Validate amount input
- **Parameters:**
  - `amount` (string): Amount string
- **Returns:** String (error message) or empty string
- **Dependencies:** None (pure validation)
- **Side Effects:** None

**Function:** `updateVatRateForCountry()`

- **Location:** `v2/pages/tools_mehrwertsteuer_rechner.php:1216`
- **Purpose:** Update VAT rates when country changes
- **Parameters:** None (uses component state)
- **Returns:** void (updates component state)
- **Dependencies:** None (pure state update)
- **Side Effects:** Updates VAT rate properties, triggers recalculation

### Export Functions

**Function:** `exportToCSV()` (Quick mode)

- **Location:** `v2/pages/tools_mehrwertsteuer_rechner.php:1570`
- **Purpose:** Export quick calculation to CSV
- **Parameters:** None (uses component state)
- **Returns:** void (triggers download)
- **Dependencies:** None (pure CSV generation)
- **Side Effects:** Downloads CSV file

**Function:** `performExport(format, email, mode)` (External)

- **Location:** `v2/pages/tools_mehrwertsteuer_rechner.php:1791+`
- **Purpose:** Perform export (PDF/Excel/CSV) with email gating
- **Parameters:**
  - `format` (string): Export format ('pdf', 'excel', 'csv')
  - `email` (string): User email
  - `mode` (string): Calculation mode ('quick', 'multi', 'invoice')
- **Returns:** void (triggers download)
- **Dependencies:** jsPDF, html2canvas, ExcelJS
- **Side Effects:** Downloads file, sends email to HubSpot

## Formulas & Calculations

### Primary Formulas

**Quick Mode (Netto to Brutto):**

```
netto = amount
mwst = Math.round(netto * vatRate / 100 * 100) / 100
brutto = netto + mwst
```

**Quick Mode (Brutto to Netto):**

```
brutto = amount
netto = Math.round(brutto / (1 + vatRate / 100) * 100) / 100
mwst = brutto - netto
```

**Multi-Item Mode:**

```
For each item:
  totalAmount = amount * quantity
  netto = totalAmount
  mwst = Math.round((netto * vatRate) / 100 * 100) / 100
  brutto = netto + mwst

subtotal = sum of all netto
totalVat = sum of all mwst
grandTotal = sum of all brutto
```

**Invoice Mode:**

```
For each item:
  itemSubtotal = quantity * price
  itemVat = itemSubtotal * (vatRate / 100)

subtotal = sum of all itemSubtotal
totalVat = sum of all itemVat
grandTotal = Math.round((subtotal + totalVat) * 100) / 100
```

### Legal Basis

- **Umsatzsteuergesetz (UStG):** German VAT law
- **VAT Rates:** Standard and reduced rates by country
- **Kleinunternehmer:** VAT exemption thresholds
- **Rounding Rules:** Standard accounting rounding (2 decimal places)

### Step-by-Step Calculation Example

**Input (Quick Mode - Netto to Brutto):**

- Amount: 100.00
- Input Type: Netto
- Country: Deutschland
- VAT Rate: 19% (standard)

**Calculation:**

1. Parse amount: 100.00
2. Parse VAT rate: 19%
3. Calculate VAT: 100.00 × 0.19 = 19.00
4. Round VAT: 19.00 (already rounded)
5. Calculate Brutto: 100.00 + 19.00 = 119.00

**Output:**

- Netto: 100,00 €
- MwSt: 19,00 €
- Brutto: 119,00 €

## Export Functionality

**Export Types:**

- **PDF Export:** Full calculation report or invoice
- **Excel Export:** Calculation data in Excel format
- **CSV Export:** Calculation data in CSV format

**Email Gating:**

- **Basic Features:** No email required
- **Advanced Features:** Email required for PDF/Excel/CSV export
- **Email Collection:** HubSpot integration via `/v2/api/collect-lead.php`
- **Email Storage:** localStorage (`mwst_export_email`, `mwst_export_form_submitted`)

**Export Content:**

- **PDF (Quick):** Includes calculation inputs and results
- **PDF (Multi-Item):** Includes all items, totals, VAT breakdown
- **PDF (Invoice):** Full invoice with company/customer data, items, totals
- **Excel:** Calculation data in spreadsheet format
- **CSV:** Calculation data in CSV format

**Sharing:** Not implemented (no URL parameter sharing)

## Results & Insights

### Result Display

**Quick Mode Results:**

- Netto: Large number display
- MwSt: Large number display
- Brutto: Large number display
- Copy button: Copy results to clipboard

**Multi-Item Results:**

- Subtotal: Summary card
- Total VAT: Summary card
- Grand Total: Summary card
- VAT Breakdown: Table showing breakdown by VAT rate

**Invoice Results:**

- Full invoice preview with:
  - Company information
  - Customer information
  - Invoice details
  - Items table
  - Totals section

**Result Formatting:**

- Currency: Formatted with German locale (€)
- Numbers: 2 decimal places
- Dates: Formatted as German dates (DD.MM.YYYY)

## Browser Testing Results

### Desktop Browsers

**Chrome (Latest):**

- Status: ✅ Fully functional
- Issues: None
- Notes: All features working correctly

**Firefox (Latest):**

- Status: ✅ Fully functional
- Issues: None
- Notes: All features working correctly

**Safari (Latest):**

- Status: ✅ Fully functional
- Issues: None
- Notes: All features working correctly

**Edge (Latest):**

- Status: ✅ Fully functional
- Issues: None
- Notes: All features working correctly

### Mobile Testing

**iOS Safari:**

- Status: ✅ Functional
- Device: iPhone (tested)
- Issues: Minor UI adjustments on small screens
- Notes: Responsive design works well, tabs work on mobile

**Android Chrome:**

- Status: ✅ Functional
- Device: Android (tested)
- Issues: None
- Notes: Touch interactions work correctly

**Mobile UI Differences:**

- Tabs stack vertically on mobile
- Form sections stack vertically on small screens
- Result cards stack vertically on small screens
- Invoice preview scrollable on mobile

### Responsive Design

**Desktop (>1024px):**

- Layout: Multi-column form grid
- Results: Multi-column summary cards

**Tablet (768px-1024px):**

- Layout: Two-column form grid
- Results: Two-column summary cards

**Mobile (<768px):**

- Layout: Single-column form
- Results: Single-column cards

## Code Analysis

### Key Functions Location

- Main component: `v2/pages/tools_mehrwertsteuer_rechner.php:1032`
- Quick calculation: `v2/pages/tools_mehrwertsteuer_rechner.php:1324`
- Multi-item calculation: `v2/pages/tools_mehrwertsteuer_rechner.php:1397`
- Invoice calculation: `v2/pages/tools_mehrwertsteuer_rechner.php:1591`
- Export functions: `v2/pages/tools_mehrwertsteuer_rechner.php:1791+`

### Constants Location

- VAT rates: `v2/pages/tools_mehrwertsteuer_rechner.php:1042+`
- Default values: Embedded in component data (line 1035+)

## Content Documentation

### Hero Section

- **H1:** "Mehrwertsteuer Rechner 2026: Brutto Netto MwSt" (✅ Already "2026")
- **Description:** "Mehrwertsteuer berechnen: Brutto, Netto & MwSt für Deutschland, Österreich & Schweiz. Kostenloser Rechner mit Excel-Export & PDF-Report."

### Educational Content Sections

1. **VAT Basics**

   - Standard and reduced rates explained
   - Country differences explained
   - Kleinunternehmerregelung explained (dual thresholds, Fallbeileffekt)

2. **Calculation Methods**

   - Netto to Brutto explained
   - Brutto to Netto explained
   - Multi-item calculation explained

### FAQ Section

- **Total FAQs:** ~10 FAQs
- **FAQ Topics:**
  - Basic Calculation: 3 FAQs
  - Multi-Item: 3 FAQs
  - Invoice: 2 FAQs
  - Export: 2 FAQs

### Meta Tags

- **Title:** "Mehrwertsteuer Rechner 2026: Brutto Netto MwSt - Ordio" (✅ Already "2026")
- **Description:** "Mehrwertsteuer berechnen: Brutto, Netto & MwSt für Deutschland, Österreich & Schweiz. Kostenloser Rechner mit Excel-Export & PDF-Report."
- **Keywords:** mehrwertsteuerrechner, mwst rechner, umsatzsteuerrechner, brutto netto mwst

### Schema Markup

- **WebApplication schema:** Yes
- **FAQPage schema:** Yes
- **HowTo schema:** Yes
- **BreadcrumbList schema:** Yes

## 2026 Update Requirements

### Immediate Updates (Required for Jan 1, 2026)

**Constants/Values:**

- ✅ VAT Rates: Verify unchanged (stable rates)
- ✅ Country rates: Verify unchanged
- ✅ Thresholds: Verify unchanged

**Content:**

- ✅ H1: Already "2026"
- ✅ Meta tags: Already "2026"
- ✅ FAQs: Review for accuracy (~10 FAQs)

**Priority:** 🟢 LOW (VAT rates stable, no changes expected)

### Throughout 2026 Updates

**Scheduled Updates:**

- None scheduled (VAT rates stable, no changes expected)

### Monitoring Requirements

- **VAT Rate Changes:** Monitor for rate changes (rare)
- **Threshold Changes:** Monitor for Kleinunternehmer threshold changes
- **Frequency:** Annually (January) or when legal changes occur

## Testing

### Test Cases

**Normal Cases:**

- Test 1: Quick mode, Netto 100, VAT 19% → Expected: Brutto 119
- Test 2: Quick mode, Brutto 119, VAT 19% → Expected: Netto 100
- Test 3: Multi-item mode, 2 items → Expected: Correct totals
- Test 4: Invoice mode, full invoice → Expected: Complete invoice

**Edge Cases:**

- Edge case 1: Custom VAT rate → Expected: Correct calculation
- Edge case 2: Zero amount → Expected: Validation error
- Edge case 3: Very large amount → Expected: Validation error
- Edge case 4: Different countries → Expected: Correct VAT rates
- Edge case 5: Multiple VAT rates → Expected: Correct breakdown

### Browser Testing

- Chrome: ✅ Tested, working
- Firefox: ✅ Tested, working
- Safari: ✅ Tested, working
- Mobile: ✅ Tested, working

### Export Testing

- PDF: ✅ Tested, working (email gating)
- Excel: ✅ Tested, working (email gating)
- CSV: ✅ Tested, working (email gating)

## Maintenance Notes

### Known Issues

- Inline JavaScript makes updates more difficult (consider extraction)
- Large file size (4,565 lines) makes navigation difficult

### Future Improvements

- Extract JavaScript to separate file for better maintainability
- Add URL parameter sharing for results
- Add comparison mode (before/after scenarios)
- Add VAT rate history tracking

### Related Tools

**Complementary Tools:**

- **[Prozentrechner](prozentrechner-documentation.md)** - Calculate percentages

  - Use together when: Need percentage calculations for VAT or markup
  - Example workflow: Calculate VAT percentage → Calculate percentage change → Total calculation

- **[Brutto-Netto-Rechner](brutto-netto-rechner-documentation.md)** - Calculate gross-to-net salary

  - Use together when: Need both VAT and salary calculations
  - Example workflow: Calculate VAT for pricing → Calculate net salary → Total business costs

- **[Einkommensteuer-Rechner](einkommensteuer-rechner-documentation.md)** - Calculate income tax
  - Use together when: Need both VAT and income tax calculations
  - Example workflow: Calculate VAT → Calculate income tax → Total tax planning

**Sequential Tools:**

- **[PayPal Gebührenrechner](paypal-gebuehrenrechner-documentation.md)** - Calculate payment fees

  - Use after: Calculating VAT-inclusive prices
  - Use before: Final pricing decisions

- **[Kostenrechner](kostenrechner-documentation.md)** - Calculate business costs
  - Use after: Calculating VAT
  - Use before: Overall cost analysis

## Kleinunternehmerregelung (Small Business Regulation)

### 2026 Dual Thresholds

The Kleinunternehmerregelung (small business regulation) has been updated for 2026 with **dual thresholds**:

**Previous Year Threshold:**
- Maximum 25,000€ net (without VAT) in the previous calendar year to qualify

**Current Year Threshold:**
- Maximum 100,000€ net (without VAT) in the current calendar year to remain eligible

**Important Notes:**

1. **NET Amounts:** Both thresholds refer to **net turnover** (without VAT), not gross amounts. This is a change from previous years where thresholds were based on gross amounts.

2. **Fallbeileffekt (Immediate Effect):** If a business exceeds the 100,000€ threshold during the current year, VAT applies **immediately** to the excess amount, not starting from the following year. This means businesses must monitor their turnover throughout the year.

3. **Qualification:** To qualify as a Kleinunternehmer in the current year:
   - Previous year's turnover must be ≤ 25,000€ net
   - Current year's turnover must remain ≤ 100,000€ net

4. **Benefits:**
   - No VAT accounting required
   - Simpler bookkeeping
   - Less bureaucratic overhead
   - No monthly/quarterly VAT returns

5. **Disadvantages:**
   - No input VAT deduction (Vorsteuerabzug)
   - Cannot show VAT on invoices
   - Less professional appearance
   - Customers cannot claim input VAT

6. **Duration:** The Kleinunternehmerregelung can be chosen for a maximum of 5 years, after which regular VAT taxation must be applied.

**Source:** Umsatzsteuergesetz (UStG) §19, updated regulations effective 2025/2026

## Test Coverage

### Automated Testing

The Mehrwertsteuer Rechner includes comprehensive automated test coverage via `v2/scripts/dev-helpers/test-mehrwertsteuer-calculations.js`.

**Test Suite Overview:**
- **Total Test Cases:** 42
- **Coverage Areas:**
  - Basic VAT Calculations (16 tests)
  - Multi-Item Mode Tests (8 tests)
  - Edge Cases (7 tests)
  - Country-Specific Tests (7 tests)
  - Formula Accuracy Tests (4 tests)

**Running Tests:**
```bash
node v2/scripts/dev-helpers/test-mehrwertsteuer-calculations.js
```

**Test Results:** All 42 tests pass (100% pass rate)

**Key Test Scenarios:**
- Netto → Brutto calculations (all rates, all countries)
- Brutto → Netto calculations (all rates, all countries)
- MwSt extraction from Brutto
- Multi-item calculations with quantities
- VAT breakdown by rate
- Cross-country comparisons
- Rounding accuracy
- Edge cases (zero amounts, invalid rates, very large amounts)

**Test Constants Verified:**
- Germany: 19%/7% ✅
- Austria: 20%/10% ✅
- Switzerland: 8.1%/2.6% ✅
- Kleinunternehmerregelung thresholds: 25,000€ net / 100,000€ net ✅

## References

### Official Sources

- **Umsatzsteuergesetz (UStG):** Official German VAT law
- **Country VAT Rates:** Official rates for DE, AT, CH

### Documentation Files

- `BROWSER_TESTING_FRAMEWORK.md`: Browser testing guidelines
- `CODE_ANALYSIS_FRAMEWORK.md`: Code analysis guidelines
- `TOOL_DOCUMENTATION_TEMPLATE.md`: Documentation template
