P
Prime Docs
DocsCore Features

Accounting Engine

A technical breakdown of the double-entry ledger, the Chart of Accounts, journal workflows, bank reconciliation, and period management.

Prime Fatoora is built on a real-time, strict double-entry accounting engine. Every financial action across the platform automatically resolves into a balanced journal entry in the PostgreSQL database. This is not an optional feature — it is the foundation all other modules (invoicing, purchases, inventory) build on top of.

The Default Chart of Accounts

When you create a new Organization, Prime Fatoora automatically seeds 10 standard system accounts into your ledger. These accounts cannot be deleted (they are marked isSystem: true). You can add custom sub-accounts beneath them.

CodeAccount NameType
1000Cash and Cash EquivalentsASSET
1100Bank AccountsASSET
1200Accounts ReceivableASSET
2000Accounts PayableLIABILITY
2100VAT PayableLIABILITY
3000Owner EquityEQUITY
4000Sales RevenueREVENUE
5000Cost of Goods SoldEXPENSE
6000Operating ExpensesEXPENSE
7000Foreign Exchange Gain/LossEXPENSE

You can create additional custom accounts using any 4–8 digit numeric code. Accounts can be nested — you can assign a parentId to create sub-accounts (e.g., 1201 - Trade Receivables under 1200 - Accounts Receivable).

Branch-level Account Overrides
If different branches use different bank accounts or revenue accounts, you can set per-branch account overrides using the Branch Account Override feature. This allows the system to automatically route journal entries to the correct account depending on which branch generated the transaction.

Automated Journal Entries

When you issue a sales invoice for 1,000 SAR plus 15% VAT (150 SAR), the system immediately creates the following balanced journal entry without any manual input:

Sales Invoice — 1,000 SAR + 15% VAT

AccountDebitCredit
1200 — Accounts Receivable1,150.00
4000 — Sales Revenue1,000.00
2100 — VAT Payable150.00
Total1,150.001,150.00

Manual Journal Entries

Accountants can post Manual Journal Entries for complex adjustments like depreciation, payroll allocation, or foreign exchange revaluation.

  • Manual journals go through the same Approval Workflow as invoices (DRAFT → PENDING → APPROVED).
  • The database enforces that Total Debits must exactly equal Total Credits before a journal can be posted.
  • Once approved and posted, a journal becomes immutable.
  • If you need to reverse an entry, you must post a separate Reversal Journal.

Recurring Journals

You can define Recurring Journal templates (e.g., monthly rent, quarterly insurance) that automatically post on a schedule. You set the frequency, start date, and an optional end date. The system creates the journal entries automatically in the background.


Bank Accounts & Reconciliation

Prime Fatoora manages real bank accounts linked to your ledger accounts. You can record cash transactions, bank transfers, and import bank statements for reconciliation.

  • Cash Transactions: Record petty cash income and expenses directly.
  • Bank Transfers: Move money between two of your own bank accounts. The system automatically creates the corresponding debit/credit journal entries.
  • Bank Import: Upload your bank statement. The system presents you with unmatched transactions that you can categorize and match to existing invoices or payments.
  • Reconciliation Sessions: Open a reconciliation session for a specific bank account and date range, match bank transactions to ledger entries, and close the session once fully balanced.

Accounting Periods & Fiscal Years

To prevent historical data tampering and ensure accurate tax filing, Prime Fatoora supports Accounting Periods and Fiscal Years.

  • Once a period is Closed, no manual journals, invoices, or payments can be posted into that date range.
  • Fiscal Years group your accounting periods for annual reporting.
  • Only users with the Accountant or Owner role can close or reopen periods.

Frequently Asked Questions

Can I create custom accounts in the Chart of Accounts?

Yes. You can create custom accounts with any unique 4–8 digit code. You can also assign a parent account to create a nested sub-account hierarchy. System accounts (codes 1000–7000) cannot be deleted.

What is an FX Revaluation?

If you hold balances in foreign currencies, their SAR equivalent changes every day as exchange rates fluctuate. An FX Revaluation automatically recalculates the SAR value of your foreign currency balances and posts the gain or loss to account 7000 — Foreign Exchange Gain/Loss.

Can I set opening balances when migrating from another system?

Yes. The Opening Balance feature allows you to set initial balances for any account when you first start using Prime Fatoora, ensuring your starting position matches your previous accounting software.