• Mahmoud Aglan's avatar
    feat(accounting): payment and receipt vouchers, and fix the instrument seed · b43c5268
    Mahmoud Aglan authored
    VOUCHERS (سندات الصرف والقبض)
    Pay an expense without thinking in debits and credits. The clerk says "صرف ٥٬٠٠٠
    دعاية نقدي" — picks a type, the cash account, and what it was for — and the double
    entry is derived and previewed live before saving.
    
      outflow (صرف)   Dr each expense line   Cr cash / bank
      inflow  (قبض)   Dr cash / bank         Cr each revenue line
    
    Voucher TYPES are rows, not code: a club adds "سند صرف كهرباء" with its account
    pre-selected from the screen. Seeded with general, advertising, maintenance,
    utilities, bank, and two receipt types.
    
    Handled deliberately:
    - Input VAT splits out per line, so a supplier invoice with 14% recoverable tax
      records the expense net and the tax in its own asset account without the clerk
      doing the arithmetic. Inclusive and exclusive are both correct.
    - Every account is checked postable before saving; a header or inactive account is
      named in the error rather than failing at post time.
    - A line pointing at the cash account itself is refused — the entry would cancel
      to nothing.
    - Posting is idempotent: a voucher that already carries a journal entry is refused.
    - Cancelling a POSTED voucher reverses its entry rather than deleting it; a posted
      entry is answered with an opposite entry, never erased.
    - Voucher numbers retry on collision so two clerks saving at once cannot take the
      same number.
    - A type in use deactivates instead of deleting, so its vouchers keep their type.
    - Approval is optional per type and blocks posting until granted.
    
    INSTRUMENT SEED FIX
    Phase_104_003 died on a duplicate key and never recorded: its existence check
    filtered on is_header = 0, so it missed 230602 أوراق الدفع قصيرة الأجل — which
    exists as a header — and tried to insert it. Existence is now checked by code
    alone, and notes payable hangs at 23060201 underneath it.
    
    Account codes for the seeded voucher types were read off the live chart rather
    than guessed: 3303/3304/3305 are all headers, and 3305 is stationery, not
    advertising. They now point at 330702 دعاية و إعلان, 33061 صيانة مباني, and
    330401 كهرباء.
    Co-Authored-By: 's avatarClaude Opus 5 (1M context) <noreply@anthropic.com>
    b43c5268
Name
Last commit
Last update
..
Academies Loading commit data...
AcademyContracts Loading commit data...
AccessMatrix Loading commit data...
Accounting Loading commit data...
Achievements Loading commit data...
ActivitySubscriptions Loading commit data...
Alerts Loading commit data...
Archive Loading commit data...
Audit Loading commit data...
Auth Loading commit data...
Branches Loading commit data...
Carnets Loading commit data...
Cashier Loading commit data...
Children Loading commit data...
Coaches Loading commit data...
Dashboard Loading commit data...
Death Loading commit data...
Disciplines Loading commit data...
Divorce Loading commit data...
Documents Loading commit data...
Facilities Loading commit data...
FacilityDashboards Loading commit data...
FacilityGrids Loading commit data...
Fines Loading commit data...
Foreign Loading commit data...
Forms Loading commit data...
HR Loading commit data...
Honorary Loading commit data...
Installments Loading commit data...
Interviews Loading commit data...
Inventory Loading commit data...
MatchCenter Loading commit data...
MedicalBoard Loading commit data...
Members Loading commit data...
News Loading commit data...
Notifications Loading commit data...
ParentPortal Loading commit data...
Payments Loading commit data...
PlayerAffairs Loading commit data...
PlayerApi Loading commit data...
PlayerAuth Loading commit data...
PlaygroundAdmin Loading commit data...
PoolManagement Loading commit data...
Pricing Loading commit data...
Procurement Loading commit data...
Receipts Loading commit data...
Rentals Loading commit data...
Reports Loading commit data...
Reservations Loading commit data...
Roles Loading commit data...
Rules Loading commit data...
Sales Loading commit data...
Scheduling Loading commit data...
Seasonal Loading commit data...
ServiceCatalog Loading commit data...
Sessions Loading commit data...
Settings Loading commit data...
Sports Loading commit data...
SportsActivity Loading commit data...
SportsDashboard Loading commit data...
Spouses Loading commit data...
Subscriptions Loading commit data...
Support Loading commit data...
Temporary Loading commit data...
Tournaments Loading commit data...
TrainerPortal Loading commit data...
Training Loading commit data...
TrainingGroups Loading commit data...
Transfers Loading commit data...
Treasury Loading commit data...
Tutorials Loading commit data...
Users Loading commit data...
Waiver Loading commit data...
Workflow Loading commit data...