feat(dashboard): add datorat/achitat/sold breakdown for budget debts

Replaces "luna prec / luna curentă" columns with a clearer accounting
reconciliation flow: Datorat (owed) → Achitat (paid) → Sold (remaining).
Backend models gain 3 new fields per sub-account and group. Frontend
shows ✓ when a debt is fully cleared. Mobile TVA card now shows both
total and remaining sold. SwipeableCards gains fixedDots/fillHeight props
for better layout above MobileBottomNav. Telegram formatter updated to
use new fields and drops redundant RON suffix from amounts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Claude Agent
2026-02-23 15:05:41 +00:00
parent aac49542e4
commit 6c78fec8a7
8 changed files with 606 additions and 123 deletions

View File

@@ -9,6 +9,9 @@ class BudgetDebtSubAccount(BaseModel):
label: str # ex: "4311 - CAS angajat"
precedent: Decimal # sold luna precedentă (pozitiv=datorie, negativ=creanță)
curent: Decimal # sold luna curentă (pozitiv=datorie, negativ=creanță)
datorat: Decimal = Decimal('0') # datorie din luna precedentă (= preccred - precdeb)
achitat: Decimal = Decimal('0') # plăți efectuate luna curentă (= ruldeb)
sold: Decimal = Decimal('0') # sold final real (= soldcred - solddeb)
class BudgetDebtGroup(BaseModel):
"""Grup de datorii la buget (TVA / BASS / CAM)"""
@@ -17,6 +20,9 @@ class BudgetDebtGroup(BaseModel):
precedent: Decimal # total grup luna prec (semn ±)
curent: Decimal # total grup luna crt (semn ±)
sub_accounts: List[BudgetDebtSubAccount] = []
datorat: Decimal = Decimal('0') # total datorie grup luna precedentă
achitat: Decimal = Decimal('0') # total plăți grup luna curentă
sold: Decimal = Decimal('0') # sold final real al grupului
class TreasuryAccount(BaseModel):
"""Cont de trezorerie (bancă/casă)"""
@@ -146,4 +152,5 @@ class DashboardSummary(BaseModel):
# DATORII LA BUGET - breakdown pe grupe (TVA / BASS / CAM) cu sub-conturi
budget_debt_breakdown: List[BudgetDebtGroup] = []
budget_debt_total_precedent: Decimal = Decimal('0') # suma tuturor grupurilor luna prec
budget_debt_total_precedent: Decimal = Decimal('0') # suma tuturor grupurilor luna prec
budget_debt_total_sold: Decimal = Decimal('0') # sold final total (cât mai rămâne de plată)