---
name: serbian-depreciation-accounting-and-tax
description: Instructions and business logic rules for calculating Serbian accounting depreciation (MRS 16), tax depreciation (Obrazac OA & Zakon o porezu na dobit), temporary tax differences (PB-1), periodic/monthly calculations, and pre-disposal proportional depreciation in SredstvaSystem.
---

# Serbian Depreciation Accounting & Tax Workflow (SredstvaSystem)

This skill provides mandatory business logic rules, formulas, and code structure guidelines for asset depreciation in the `SredstvaSystem` codebase.

---

## 1. Accounting Depreciation (MRS 16 / MSFI za MSP)

### Depreciable Base & Residual Value
- **Formula**: $Osnovica = \max(0, NabavnaVrednost - RezidualnaVrednost)$
- **Depreciation limit**: Total accumulated depreciation (`IspravkaVrednosti`) cannot exceed $(NabavnaVrednost - RezidualnaVrednost)$.
- **Calculation Engine**: `SredstvaData.Services.AmortizacijaCalculator.Izracunaj(...)`

### Start Rules (`PocetakAmortizacijeRule`)
1. **`SrazmernoDanima`** (default): Proportional daily calculation from `DatumAktiviranja`.
2. **`OdNarednogMeseca`**: Depreciation starts on the 1st day of the calendar month following activation month.

### Periods & Naming Conventions
- **Opis promene**: Standardized description generated by `AmortizacijaCalculator.GenerisiOpisPromene(start, end)`:
  - Full year: `Amortizacija (2026)`
  - Monthly: `Amortizacija (03/2026)`
  - Quarterly: `Amortizacija (Q1/2026)`
  - Arbitrary period: `Amortizacija (01.01.2026-15.03.2026)`

---

## 2. Pre-Disposal Proportional Depreciation (MRS 16)

When an active asset is written off, sold, disposed of, or deleted (`Rashodovanje`, `Prodaja`, `Otudjenje`, `Brisanje`, `KolicinskoRashodovanje`):
1. **Calculate Proportional Depreciation**: Calculate depreciation from the beginning of the disposal year (or latest card date) up to `datumDisposal`.
2. **Post Depreciation Card First**: Insert a card with `OpisPromene = $"Amortizacija do rashodovanja ({datumDisposal:dd.MM.yyyy})"`.
3. **Execute Disposal Storniranje**: Close out the total asset cost and total accumulated depreciation (which now includes the pre-disposal depreciation) to 0.00 RSD.
4. **Location**: `SredstvaApp.Views.Rashod.RashodWindow.xaml.cs`.

---

## 3. Tax Depreciation (Obrazac OA & Zakon o Porezu na Dobit)

- **Scope**: Post-2019 acquisitions / activations are depreciated individually using linear method by tax group rates (Grupa I-V).
- **Calculation Engine**: `SredstvaData.Services.PoreskaAmortizacijaCalculator.IzracunajZaSredstvo(...)`
- **Temporary Tax Difference**: $PrivremenaRazlika = RacunovodstvenaAmortizacija - PoreskaAmortizacija$.
  - Used directly for Form PB-1 (Poreski bilans).
- **PDF Report**: `SredstvaApp.Views.Amortizacija.ObrazacOADocument.cs` (QuestPDF landscape layout — see [[questpdf-report-documents]] for the document conventions).

---

## 4. Related Skills

- Adding/editing a page that displays or triggers any of the above (Kartice, Rashod, Amortizacija, Revalorizacija, Popis pages): see [[wpf-page-codebehind-navigation]].
- Adding a new persisted field to `Sredstvo`/`Kartica` used by these calculations: see the `sqlite-efcore-schema-migration` skill.
