Files
accounted/supabase/migrations/20260512200000_salary_optional_vacation_accrual.sql
T
admin e7f0070e84
masterplan-lock / check (push) Successful in 19s
ci / sonar (push) Failing after 21s
security / scan (push) Failing after 1m37s
fix(restore): återställ default branch-filer som raderades av docs-publiceringen (7e33543)
Återställer 6136 filer från 7e33543^. Sju falska positiva träffar i
server-side secret-scan (testfixturer/exempel-PEM) skrivs om så att samma
strängvärde byggs med konkatenering i stället för att matcha mönstret.
2026-11-10 09:37:22 +01:00

18 lines
949 B
SQL

-- =============================================================================
-- Salary: optional vacation accrual ("none" mode)
-- =============================================================================
-- Adds a third value to employees.vacation_rule so a company can disable
-- semesteravsättning entirely. Useful for sole owners (ägare = enda anställd)
-- who don't accrue semester — booking otherwise creates a phantom 2920 liability.
--
-- procentregeln — 12% (or 14.4% for 30+ days) accrued to 2920 (Semesterlagen 26§)
-- sammaloneregeln — semestertillägg only (Semesterlagen 16a§)
-- none — no accrual; salary expense is the full cost
ALTER TABLE public.employees DROP CONSTRAINT IF EXISTS employees_vacation_rule_check;
ALTER TABLE public.employees ADD CONSTRAINT employees_vacation_rule_check
CHECK (vacation_rule IN ('procentregeln', 'sammaloneregeln', 'none'));
NOTIFY pgrst, 'reload schema';