When building deterministic legal calculators in JavaScript and TypeScript, subtle statutory rules matter as much as arithmetic precision. While developing open-source calculation tools for Koptay Hukuk Bürosu in Ankara, we extracted the core deterministic formulas into a zero-dependency NPM package: turk-hukuk-hesaplama, accompanied by full Sphinx technical documentation on Read the Docs, an open dataset on Hugging Face, and a DOI-registered legal monograph (10.5281/zenodo.24119703).
In this article, we break down the TypeScript implementation of three heavily used Turkish statutory and actuarial algorithms.
Installation
npm install turk-hukuk-hesaplama All browser-ready interactive calculators using these methodologies are also available live at Turkish Legal Calculation Tools (koptay.av.tr/hesaplama-araclari).
1. Law No. 7596 Investment Fund Liquidation, MKK FIFO & PBLK Gap (calculateLaw7596Fifo)
Following the Capital Markets Board of Türkiye (SPK) suspension of 131 investment funds on 17 September 2026 and the enactment of Law No. 7596 (Tasfiyesine Karar Verilen Bazı Yatırım Fonları Hakkında Kanun), investor payouts shifted from unit share valuation to MKK FIFO Net Principal with a TRY 1,000,000 conditional interim cap per fund.
For investors whose pre-suspension redemption orders remained unsettled in PBLK blocked status at MKK/Takasbank, computing the litigation gap requires comparing net FIFO principal, the interim payment cap, and the 17.09.2026 accrued redemption/NAV baseline:
import { calculateLaw7596Fifo } from "turk-hukuk-hesaplama"; const result = calculateLaw7596Fifo({ totalCashIn: 3_500_000, pastRedemptions: 500_000, navOrPblkValue: 5_200_000 }); console.log(result); // { // fifoNetPrincipal: 3000000, // interimPayment: 1000000, // blockedPrincipal: 2000000, // totalLitigationClaim: 4200000, // ytm2026Cap: 2065145 // } Further legal methodology and full interactive simulations (including TÜFE/Yİ-ÜFE indexation and withholding tax rules):
- Interactive Law No. 7596 & PBLK Compensation Calculator
- Full 14-Page Monograph PDF (42 Footnotes — DOI: 10.5281/zenodo.24119703)
- MKK PBLK Settlement Finality & Administrative Litigation Analysis
2. Actuarial Multi-Impairment Formula: Balthazard Rule (calculateBalthazard)
Under the Turkish Adult Disability Assessment Regulation (Ek-2 Cetveli), multiple medical impairment percentages from traffic or workplace accidents are never summed linearly. Instead, each subsequent impairment reduces the remaining healthy capacity sequentially after sorting from highest to lowest, with an additional 10% Balthazard factor applied if age exceeds 60:
import { calculateBalthazard } from "turk-hukuk-hesaplama"; const disabilityRate = calculateBalthazard([25, 18], 42); console.log(disabilityRate); // 38.5 - Traffic Accident Disability & Balthazard Web Calculator (TRH-2010)
- Bodily Injury & Ek-2 Disability Monograph (PDF)
3. Law No. 6772 Public Worker Statutory Bonus (calculateIlaveTediye6772)
Permanent public-sector workers under Law No. 6772 receive 52 days of annual statutory bonus (İlave Tediye) paid in 4 installments of 13 days each, subject to 14% SGK employee premium, 1% unemployment insurance, cumulative income tax bracket, and 0.759% stamp tax:
import { calculateIlaveTediye6772 } from "turk-hukuk-hesaplama"; const payroll = calculateIlaveTediye6772(1450, 0.20, 13); console.log(payroll.net); // 12674.93 Open Science & Verification Archive
- Source & Open Research Hub: muratcankoptay.github.io
- ORCID Author Registry: 0009-0002-5225-5331
- Internet Archive Permanent Collection: archive.org/details/koptay-7596-sayili-kanun-fon-tasfiye-pblk-2026