• DevPilot's avatar
    feat(hr,accounting): tax bracket admin screen, scoped voucher account lookup, gap drill-down · b16d18aa
    DevPilot authored
    Three things that were asked for and were genuinely missing:
    
    1. ضريبة كسب العمل had no screen at all — the brackets lived only in
       hr_tax_brackets and could only be changed with SQL. Adds a proper
       admin screen: brackets are versioned as a set per effective_date,
       old sets are kept (never deleted) so past payroll stays explainable,
       and activating a set deactivates the others. The form validates that
       brackets are contiguous, that only the last one is open-ended, and
       auto-fills the next bracket's start. A built-in simulator shows the
       tax on any annual income so the accountant can verify the set before
       running payroll.
    
       Also hardens the live calculator: IncomeTaxService summed every row
       flagged active regardless of effective_date, so two overlapping
       active sets produced a silently wrong tax. It now uses the newest
       active set only.
    
    2. The voucher screen searched the entire chart of accounts for both
       sides, so you could pick a fixed-asset account as the cash side or a
       cash account as the expense side — the latter trips the "same as the
       cash account" guard and the voucher just refuses to save. The lookup
       is now scoped per side: cash/bank accounts for the counter side, and
       expense (صرف) or revenue (قبض) accounts for the line side depending
       on the voucher's direction.
    
    3. The accounting gaps screen showed only a count per gap. Each gap now
       has a "عرض التفاصيل" button that lists the actual documents behind
       that number — id, date, party, quantity, recorded amount and status
       — so the accountant can check the cases before choosing a rate.
    b16d18aa
Routes.php 35 KB