# Israeli Tax Compliance Reports

**Date:** 2026-06-01
**Status:** Draft
**Spec:** 171
**Tier:** All tiers
**Depends on:** `invoices-core`, `expenses-module`, `multi-currency`, `financial-statements`, `bituach-leumi`, `foundation-auth-rbac`
**Referenced by:** `financial-statements`, `ita-einvoice`, `admin-reports-analytics`

---

## Overview

Israeli freelancers and businesses must file periodic tax reports with the Israeli Tax Authority (ITA) and National Insurance Institute (Bituach Leumi). This spec defines the compliance reports generated from Zync data:

1. **PCN874** (טופס PCN874) — monthly/bi-monthly VAT report
2. **Annual income summary** (סיכום הכנסות שנתי) — for accountant handoff
3. **Advance tax estimate** (מקדמות מס הכנסה) — monthly advance payment estimate
4. **Supplier withholding report** (ניכוי במקור) — consolidated annual **Form 856** filed to the ITA (per-recipient **857** certificates issued per supplier); contractors in spec 21; vendor/supplier withholding entity + combined report in `vendors-suppliers` spec 182, surfaced at `/reports/withholding`

---

## 1. PCN874 VAT Report

### Overview

VAT-registered businesses (עוסק מורשה) file PCN874 monthly or bi-monthly (based on turnover). The form reports:
- Output VAT (מע"מ עסקאות) — VAT collected on issued invoices
- Input VAT (מע"מ תשומות) — VAT paid on business expenses
- Net VAT payable = output − input

### Data sources

**Output VAT:**
```sql
SELECT
  SUM(vat_amount) AS output_vat,
  SUM(total) AS total_turnover_ils  -- ILS-normalization for foreign-currency invoices (future total_ils column) NOT YET IMPLEMENTED; current behavior sums raw invoice total (IL tenants invoice in ILS)
FROM invoices
WHERE tenant_id = :tenantId
  AND tax_issue_date BETWEEN :period_start AND :period_end
  AND status NOT IN ('DRAFT', 'SENT', 'VOID', 'BAD_DEBT')
  AND source != 'credit_note'
```

Credit notes (negative invoices) reduce output VAT:
```sql
SELECT SUM(ABS(vat_amount)) AS credit_note_vat
FROM invoices
WHERE source = 'credit_note'
  AND tax_issue_date BETWEEN :period_start AND :period_end
```

**Input VAT:**
```sql
-- Full-deductible rows (NULL or 100): full vat_amount — NULL deduction_pct means 100% deductible
SELECT COALESCE(SUM(vat_amount), 0) AS full_input_vat
FROM expenses
WHERE tenant_id = :tenantId
  AND expense_date BETWEEN :period_start AND :period_end
  AND status = 'COMPLETED'
  AND approval_status IN ('approved', 'not_required')
  AND vat_deductible = true
  AND (deduction_pct IS NULL OR deduction_pct = 100)
  AND is_per_diem = false
  AND deleted_at IS NULL;

-- Partial-deductible rows (0 < deduction_pct < 100): vat_amount * deduction_pct / 100
SELECT COALESCE(SUM(vat_amount * deduction_pct / 100), 0) AS partial_input_vat
FROM expenses
WHERE tenant_id = :tenantId
  AND expense_date BETWEEN :period_start AND :period_end
  AND status = 'COMPLETED'
  AND approval_status IN ('approved', 'not_required')
  AND vat_deductible = true
  AND deduction_pct > 0 AND deduction_pct < 100
  AND is_per_diem = false
  AND deleted_at IS NULL;

-- input_vat = full_input_vat + partial_input_vat
```

Only approved (or below-threshold auto-approved, `not_required`) expenses contribute input VAT; `pending`/`rejected` rows are excluded so the statutory VAT return matches the approved expense ledger. Partial deductibility (vehicle/phone) per expenses-module dependency; resolves itr-022. Per-diem and soft-deleted rows are excluded.

### PCN874 UI

`/reports/vat`:

```
┌──────────────────────────────────────────────────────────────┐
│  VAT Report — PCN874                [Period: May 2026 ▾]     │
│                                     [Export CSV] [Export PDF] │
│                                                              │
│  Output VAT (Sales)                                          │
│  ─────────────────────────────────────────────────────────── │
│  Tax invoices issued:        31       Total: ₪ 385,000       │
│  Output VAT (18%):                           ₪  58,898       │
│  Credit notes:               2       Total: (₪   8,000)      │
│  Credit note VAT reversal:                  (₪   1,220)      │
│  ─────────────────────────────────────────────────────────── │
│  Net output VAT:                             ₪  57,678       │
│                                                              │
│  Input VAT (Purchases)                                       │
│  ─────────────────────────────────────────────────────────── │
│  Deductible expenses:        18       Total: ₪  24,500       │
│  Input VAT:                                  ₪   3,743       │
│  ─────────────────────────────────────────────────────────── │
│  Net input VAT:                              ₪   3,743       │
│                                                              │
│  ══════════════════════════════════════════════════════════   │
│  VAT payable to ITA:                         ₪  53,935       │
│                                                              │
│  ⓘ Submit PCN874 via the ITA online portal (shaam.gov.il).   │
│    Use the exported CSV to pre-fill the form.                │
└──────────────────────────────────────────────────────────────┘
```

**CSV export format** is a **summary pre-fill file** for the ITA PCN874 portal: a header record (business tax-id, reporting period `YYYYMM`, `vat_period`, net output/input VAT totals, VAT payable) plus summary output/input/credit total lines (H/O/C/I record model), not a full per-transaction ITA file.

> **Output encoding — required:** the PCN874 CSV must be emitted in **CP1255 (Windows-Hebrew)**, the encoding the ITA/shaam.gov.il portal expects. Emitting UTF-8 corrupts Hebrew customer/vendor names on upload. Use the shared CP1255 mapping (`apps/zync-api/src/lib/cp1255.ts`, same as `uniform-format-export` spec 180); no UTF-8 BOM.
>
> *Rationale (2026-06-11): CSV is a summary export to pre-fill the PCN874 form — header carries tenant tax-id + period + vat_period; O/C/I lines carry period totals only.*

---

## 2. Annual Income Summary

For freelancers to hand off to their accountant at year end.

`/reports/annual-summary?year=2026`:

```
┌──────────────────────────────────────────────────────────────┐
│  Annual Income Summary — 2026           [Export Excel]       │
│                                                              │
│  Income                                                      │
│  Total invoiced (excl. VAT):             ₪ 398,800           │
│  Bad debts written off:                 (₪  12,700)          │
│  Adjusted income:                        ₪ 386,100           │
│                                                              │
│  Deductible Expenses                                         │
│  Total expenses (excl. VAT):             ₪  55,000           │
│  Mileage deduction:                      ₪   8,400           │
│  Contractor payouts:                     ₪  48,000           │
│  Total deductions:                       ₪ 111,400           │
│                                                              │
│  Net taxable income (estimate):          ₪ 274,700           │
│                                                              │
│  ⓘ This is an estimate. Your accountant will apply          │
│     additional deductions, credits, and adjustments.        │
└──────────────────────────────────────────────────────────────┘
```

Excel export includes all supporting data: invoice list, expense list by category, mileage log, payout bills.

> **xlsx Hebrew/RTL:** every generated worksheet sets `worksheet.views[0].rightToLeft = true` and an explicit Hebrew-capable font (e.g. Arial/David) on header + data cells, so Hebrew column headers and labels render correctly in Excel. Spreadsheet **formula-injection guard** also applies (see shared note in `financial-statements` spec 170): any cell value beginning with `= + - @`, tab, or CR is prefixed with `'` before writing.

---

## 3. Advance Tax Estimate (מקדמות מס הכנסה)

Monthly advance payments are a percentage of previous year's income tax, or estimated current year income. Zync shows a running estimate based on current YTD performance.

`/reports/advance-tax`:

```
┌──────────────────────────────────────────────────────────────┐
│  Advance Tax Estimate — 2026                                 │
│                                                              │
│  YTD net income (estimate):              ₪ 274,700           │
│  Monthly advance rate:                        15%            │
│  (Based on ITA advance rate — enter your rate)               │
│                                                              │
│  Estimated annual income tax:             ₪  72,000          │
│  (Based on 2026 tax brackets — simplified)                   │
│                                                              │
│  Advance payments YTD (entered):          ₪  24,000          │
│  Recommended advance per remaining month: ₪   4,800          │
│                                                              │
│  ⓘ ITA sets your advance payment rate. Update it above      │
│     when you receive your advance payment notice.            │
└──────────────────────────────────────────────────────────────┘
```

**Tax bracket calculation** — brackets are **read from the existing `tax_rates` table** (spec 8 / `tax-rates-seed-data`), **not** a new table. `tax_rates` already stores IL personal income brackets as rows with `tax_type LIKE 'personal_bracket_%'`, `threshold_ils`, `rate`, and `effective_from` versioning. Creating a separate `tax_brackets` table here would be a second source of truth for the same statutory constants and would drift.

```sql
-- Marginal banding from tax_rates (no new table):
SELECT tax_type, threshold_ils, rate
FROM tax_rates
WHERE tax_type LIKE 'personal_bracket_%'
  AND effective_from <= :as_of_date
ORDER BY effective_from DESC, threshold_ils ASC;
-- Apply the most recent effective set; iterate bands ascending to compute marginal tax.
```

> Bracket values change annually — they are maintained by updating `tax_rates` rows with a new `effective_from` (admin-managed via `/admin/tax-rates`), so no code deploy is needed.

---

## API

```
GET /api/reports/vat
    → PCN874 VAT report data
      query: { from: YYYY-MM-DD, to: YYYY-MM-DD }
      Requires: reports:read

GET /api/reports/vat/csv
    → PCN874 machine-readable CSV for ITA portal upload
      query: { from, to }
      Requires: reports:export

GET /api/reports/annual-summary
    → annual income summary
      query: { year }
      Requires: reports:read

GET /api/reports/annual-summary/xlsx
    → Excel with all supporting data
      Requires: reports:export

GET /api/reports/advance-tax
    → advance tax estimate
      query: { year }
      Requires: reports:read

GET /api/settings/tax
      → read current tax configuration (VAT period, advance rate)
        Requires: settings:read

PATCH /api/settings/tax
      → update tax configuration (advance rate, VAT period, advance payments YTD)
        body: { advance_tax_rate_pct?, vat_period?: 'monthly'|'bimonthly', advance_payments_ytd_ils? }
        Requires: settings:write
```

---

## Schema Delta

```sql
-- Tax settings on tenant_settings
ALTER TABLE tenant_settings ADD COLUMN vat_period TEXT NOT NULL DEFAULT 'bimonthly'
  CHECK (vat_period IN ('monthly', 'bimonthly'));
  -- monthly = file every month; bimonthly = every 2 months (small businesses)
  -- Default is bimonthly — ITA assigns filing frequency; small businesses
  -- (turnover < ₪1.5M) are typically bimonthly.

ALTER TABLE tenant_settings ADD COLUMN advance_tax_rate_pct NUMERIC(5,2);
  -- ITA-assigned advance payment rate (percentage of annual tax); NULL = not configured

ALTER TABLE tenant_settings ADD COLUMN advance_payments_ytd_ils NUMERIC(14,2) DEFAULT 0;
  -- manually-entered YTD advance payments already filed (UI: Advance payments YTD); NULL/0 = none
```

---

## Architecture Decisions

| Decision | Choice | Reason |
|----------|--------|--------|
| Reports read from Zync data | No ITA API push | ITA does not provide a public API for automated filing; PCN874 must be filed via ITA online portal; Zync provides the data, staff files manually |
| Brackets from `tax_rates` | Not a new `tax_brackets` table | `tax_rates` (spec 8) already stores personal income brackets with effective-date versioning; a second table is a duplicate source of truth that drifts |
| Advance tax = estimate only | Not precise calculation | Personal income tax depends on deductions, credits, pension contributions, spouse income, etc. — not all tracked in Zync; explicitly labeled as estimate |
| VAT period configurable | Not always monthly | Small businesses may file bi-monthly (below ~1M ILS annual turnover); ITA determines eligibility; tenant sets in settings |
| Annual summary for accountant | Not ITA-direct filing | Annual income tax filing in Israel is done by the individual or via accountant using Form 1301; Zync provides the source data |
