EthiBooks
A multi-tenant, multi-currency cloud accounting SaaS built for freelancers, SMBs, and growing businesses worldwide. Complete double-entry bookkeeping with localized tax compliance, invoice branding, Stripe-powered payment collection, and auditor-ready exports.
01 Multi-Currency Double-Entry Accounting
- Dual-Value Ledger: Every invoice, bill, and expense stores both the foreign currency amount and the base currency equivalent.
- 6-Decimal Precision: All GL calculations use
0.000001tolerance. Display rounds to 2 decimals viaroundForDisplay(). - Daily Cached Exchange Rates: Rates fetched from ExchangeRate-API, cached in
exchange_ratestable. One fetch per currency pair per day. - Rate Locking: Rates lock when documents transition to Pending status. Tracked via
rate_locked_atandrate_manually_set. - Manual Rate Overrides: Users can override auto-fetched rates with full audit tracking.
- Automated FX Gain/Loss: Realized gains/losses posted to GL 4300 (Gain) / 8500 (Loss) when payment rate differs from document rate.
- Self-Healing Integrity: Database triggers and backfill functions ensure no transaction ever has NULL rates or missing base currency amounts.
Journal Entry — Multi-Currency Invoice Payment
Debit: Cash/Bank (base currency net amount) Debit: FX Loss 8500 (if unfavorable rate movement) OR Credit: FX Gain 4300 (if favorable rate movement) Credit: Accounts Receivable (base currency invoice amount)
02 Chart of Accounts & Auto-Seeding
- Hierarchical Structure:
account_categories→account_groups→accountswith parent-child sub-accounts. - Auto-Seeded on Creation: Standard COA provisioned automatically with proper account types (Asset, Liability, Equity, Revenue, Expense).
- System Accounts: Critical accounts (A/R, A/P, Sales Revenue, Sales Tax Payable) marked
is_system_accountand cannot be deleted. - Account Mappings: Logical roles (
sales_revenue,sales_tax_payable,purchase_tax_input,sales_discount,default_expense,default_bank) mapped to GL accounts for automated journal entries. - Opening Balances: Dedicated onboarding step with entity locks preventing currency changes after balances exist.
03 Universal Tax Engine
Three-Layer Architecture
Tax Components
Individual rates like CGST 9%, SGST 9%, VAT 20%
Tax Groups
Combinations: "GST 18%" = CGST 9% + SGST 9%
Supply Rules
Domestic, interstate, export, reverse charge scenarios
Behavior Classes
Standard, Reverse Charge, Zero-Rated
Country-Based Auto-Seeding
| Country | Tax Structure |
|---|---|
| 🇮🇳 India | CGST, SGST, IGST at 0/5/12/18/28% + Reverse Charge + Export Zero-Rated |
| 🇬🇧 United Kingdom | VAT Standard 20%, Reduced 5%, Zero-Rated, Reverse Charge |
| 🇺🇸 United States | State-level Sales Tax |
| 🇦🇺 Australia | GST 10% |
| 🇦🇪 UAE | VAT 5% |
Additional Tax Features
- Tax-Inclusive/Exclusive Pricing: Hierarchical default: Global → Client → Document. Reverse formula
Total / (1 + Rate)for inclusive. - Tax After Discount: Sequence: Subtotal → Discount → Net → Tax → Total. Journal splits gross sales vs discount for P&L transparency.
- Country-Specific Terminology: Dynamic labels — GSTIN (India), ABN (Australia), VAT Number (UK), EIN (US).
- Tax Code Support: HSN/SAC (India), Commodity Codes (EU), HS Codes (US/AU/CA).
04 Bank Reconciliation
- Account-Level Reconciliation: Select any bank/cash account and reconcile against a statement.
- Statement Import: Enter statement balance and date; system calculates difference.
- Transaction Matching: Mark individual transactions as reconciled.
- Difference Tracking: Shows opening balance, closing balance, statement balance, and outstanding difference.
05 Invoicing System
- Full Lifecycle: Draft → Pending → Paid / Overdue / Void
- Line-Item Tax Breakdown: Each item has its own Tax Group; breakdown stored as JSON and aggregated in summary.
- Multi-Currency: Currency auto-set from client; exchange rates locked at Pending.
- Estimates/Quotations: One-click conversion to invoices preserving all line items.
- Recurring Invoices: Template-based with configurable frequency, interval, day, max count, and end date.
- Public Invoice Link: Shareable URL with token-based access; view tracking logs IP and timestamp.
- Email Delivery: Send invoices and payment receipts directly via React-rendered email templates.
06 Invoice Branding & PDF Templates
4 Templates
Standard, Professional, Modern, Minimal — selectable in settings.
Company Branding
Logo upload, brand color, business name, address, tax IDs.
Text-Based PDFs
jsPDF for crisp, professional-quality text rendering (not screenshots).
Template-Aware
Downloaded PDFs dynamically apply the selected template's design.
Smart Branding Logic
- Business Trade Name Priority: PDFs display the Business/Trade Name when available, falling back to the legal company name — ensuring invoices match the brand your clients recognise.
- Globalized Tax Labels: Tax ID fields on PDFs use country-specific terminology (e.g. GSTIN for India, VAT Number for UK, ABN for Australia, EIN for US) instead of generic labels.
07 Recording Payments & Collections
Manual Invoice Payments
- Partial Payments: Multiple payments per invoice; status auto-updates to Paid when fully settled.
- Payment Methods: Bank Transfer, Cash, Check, Credit Card, Online, Other.
- Account Selection: Choose deposit account (defaults to Checking Account 1010).
- Multi-Currency: Separate payment exchange rate; FX gain/loss auto-calculated.
- Voiding: Full reversal journal entries via
void_invoice_paymentRPC.
Stripe Online Payments (Pay Now)
Standard Payouts
Platform collects via EthiBooks' Stripe account, settles to tenant later.
Direct Payouts
Tenant connects their own Stripe account for direct deposits.
- Dual Environment: Test and Live Stripe modes for safe testing before going live.
- Customer Pays Exact Amount: No fee markup. Stripe fees (2.9% + 30¢) deducted from tenant's share.
- Webhook Idempotency: Prevents duplicate records from Stripe retries.
Automated 3-Line Journal Entry
Debit: Cash/Bank (net amount after Stripe fee) Debit: Payment Processing Fee (Stripe fee from balance_transaction) Credit: Accounts Receivable (full invoice amount)
08 Bills & Bill Payments
- Full Lifecycle: Draft → Pending → Paid / Overdue / Void
- Line-Item Detail: Description, quantity, price, expense category, expense account, tax group per item.
- Multi-Currency: Currency from vendor profile; dual-value ledger with base currency equivalents.
- Bill Payments: Record with method, reference, pay-from account, notes. FX gain/loss auto-calculated.
- PO Integration: Approved POs convert to bills with pre-filled line items.
- Recurring Bills: Template-based schedule, auto-generated via edge function.
- Smart Scan Pre-Fill: AI-extracted data from scanned documents auto-populates vendor, dates, bill number, currency, and line items. Missing vendors and items are auto-created.
09 Purchase Orders
- Lifecycle: Draft → Approved → Received → Cancelled
- Convert to Bill: One-click with line item preservation and
purchase_order_idlink. - Optional Workflow: Bills can be created directly without a PO.
- PO vs Bills Report: Compare commitments against actual bills received.
10 Expense Management
- Line-Item Expenses: Multiple items per expense with individual amounts.
- Multi-Currency: Currency code, exchange rate, and base currency at header and line-item levels.
- Billable Tracking: Mark as billable, assign to client, track invoiced status.
- Account Mapping: Each expense maps to a specific GL expense account.
- Void Support: Expenses can be voided with proper reversals.
- Smart Scan Pre-Fill: Scan a receipt to auto-populate vendor, date, amount, currency, category, and payment method. Missing master data is created automatically.
10b AI Smart Scan (Document Scanner)
How It Works
Upload or Capture
Drag-and-drop, file picker, or camera capture. Supports JPG, PNG, WEBP, and PDF up to 10 MB.
AI Extraction
Edge function (analyze-document) sends the image to Gemini via tool-calling for structured JSON output.
Data Preview
Review extracted vendor, date, currency, amounts, tax, line items, and suggested category before proceeding.
Auto-Create & Pre-Fill
Missing categories, items, and vendors are created automatically. Form fields populate with actual DB references.
Extracted Fields
| Field | Details |
|---|---|
| Vendor Name | Matched case-insensitively to existing vendors; new vendor created if unmatched. |
| Date / Due Date | Parsed from document text. |
| Currency & Total | ISO currency code + total amount. |
| Tax Amount | Separated from subtotal when visible. |
| Invoice / Bill Number | Reference number for cross-matching. |
| Line Items | Description, quantity, unit price, amount, tax per line. |
| Category Suggestion | AI-suggested expense category; auto-created if new. |
| Payment Method | Detected from receipt (e.g., "Credit Card", "Cash"). |
Auto-Creation Logic
- Categories: If
category_suggestiondoesn't match any existing category (case-insensitive), a new one is inserted intocategories. - Master Items: Each line item description is matched against
master_items. Unmatched items are created as typeexpensewith the extracted unit price, linked to the auto-created category. - Vendors: Vendor name matched against
vendors. Unmatched vendors are created with the document's currency. - Summary Toast: Users see a notification like "Auto-created 3 items, 1 category, 1 vendor from scan".
Security & Storage
- Scanned Documents Bucket: Uploaded files stored in
scanned-documentsSupabase Storage bucket with RLS (company-scoped). - Rate Limiting: Edge function returns
429when AI quota is exceeded;402when credits are depleted. - No External API Keys: Uses Lovable AI Gateway — no tenant-managed keys required.
10c Inventory Core & Costing Engine
- Stock Movement Engine: Single RPC
post_inventory_movementhandles all in/out flows from invoices, bills, adjustments, transfers, and manufacturing — guaranteeing one source of truth. - Costing Methods: Per-item selection of FIFO, LIFO, or Weighted Average. FIFO/LIFO maintain layered
inventory_cost_layers; weighted average updates on every receipt. - Automatic COGS: Every sale debits COGS and credits Inventory at actual layer cost.
consume_cost_layersRPC enforces FIFO/LIFO order strictly. - Inline Landed Costs: Add freight, duty, and clearing costs directly on bills — distributed across line items by value or quantity. Posted via
post_landed_cost_voucherRPC against thelanded_cost_clearingaccount. - Inventory Revaluation: Periodic write-up/write-down via dedicated RPC, posting variances to revaluation gain/loss accounts.
- Negative Stock Control: Per-company toggle
allow_negative_stockblocks oversells when disabled. - Reorder Alerts: Per-item reorder level + low-stock dashboard widget for proactive replenishment.
10d Multi-Warehouse, Batches & Serials
- Multi-Warehouse: Unlimited warehouses with per-warehouse stock balances and movements.
- Storage Locations: Hierarchical bins/zones inside each warehouse for granular put-away.
- Stock Transfers: Inter-warehouse movement with full ledger tracking.
- Batches:
inventory_batchestable tracks batch number, manufacture date, expiry date, and per-batch unit cost. - Serial Numbers:
inventory_serialstable tracks individual serial-number lifecycle (in stock, sold, returned, scrapped). - Strict Enforcement:
post_inventory_movementraises an error if an item requires batch or serial tracking and the picker is empty. - Wired Everywhere: Traceability picker integrated into Invoice, Bill, PO Receive, and Stock Adjustment flows.
- Near-Expiry Alerts: Dashboard widget surfaces batches approaching expiry within a 90-day horizon.
10e Inventory Intelligence & Reporting
| Report | What It Shows |
|---|---|
| Stock on Hand | Real-time quantities by warehouse with valuation at current cost. |
| Inventory Valuation | As-of-date snapshot; auto per-item costing using cost layers (FIFO/LIFO) or weighted average. Warehouse + category breakdowns. |
| Movements / History | Full audit trail of every in/out movement with source document linkback. |
| Slow / Fast Moving | User-selectable window (30/60/90/180/365 days). Fast / Medium / Slow / Dead classification with dead-stock value-at-risk. |
| ABC Analysis | Pareto classification by consumption value (A=80%, B=15%, C=5%) with cumulative contribution. |
| Reorder Alerts | Items at or below reorder level with preferred vendor surfaced. |
Dashboard widgets: Inventory Value, Top Moving Items (30-day), Near-Expiry Batches, and Low-Stock Alerts.
10f Bill of Materials & Light Manufacturing
- BOM Definition:
boms+bom_componentstables. Define a parent finished-good item, output quantity, and the component items + quantities required. - Manufacturing Orders: Issue an MO that consumes raw-material stock (debit WIP, credit Inventory) and produces finished goods (debit Inventory, credit WIP) at rolled-up component cost.
- Cost Roll-Up: Finished-good cost computed dynamically from current weighted-average / FIFO cost of components.
- Multi-Level BOMs: Sub-assemblies supported — components can themselves have BOMs.
10g Stock Cycle Counts
- Count Sheets: Generate count documents per warehouse, optionally filtered by category or item subset.
- Variance Detection: Side-by-side system quantity vs counted quantity with auto-calculated variance and value-at-risk.
- Manual Adjustment Posting: Approve a cycle count to generate a corresponding stock adjustment with proper GL postings (Inventory Shrinkage / Surplus accounts).
- Audit Trail: Counts retain who counted, when, and what was found.
10h Vendor Catalog & Multi-UOM
- Vendor Catalog: Per vendor + item record with negotiated price, currency, lead time (days), and a "preferred vendor" flag.
- Auto-Pricing on Bills: Selecting a vendor on a bill auto-suggests the catalog price for each item, eliminating retyping.
- Multi-UOM Conversion: Items can have a separate Purchase UOM and Stocking UOM with a conversion factor (
purchase_uom_factor). - Bill Entry in Purchase UOM: Enter "5 cases" — system stores 60 eaches in stock automatically.
- Preferred Vendor on Reorder: Low-stock alerts surface the preferred vendor for one-click PO drafts (planned).
10i Credit & Debit Notes
- Credit Notes (Sales): Issue against an invoice or as a stand-alone customer credit. Reduces A/R, reverses sales revenue and output tax, and optionally restocks inventory.
- Debit Notes (Purchase): Issue against a bill or as a stand-alone vendor debit. Reduces A/P, reverses expense / inventory and input tax.
- Application to Documents: Apply outstanding credits to future invoices/bills via
credit_note_applicationsanddebit_note_applicationstables. - Multi-Currency: Same dual-value ledger pattern — base currency amounts auto-calculated.
- Public Share + PDF: Same template engine as invoices for branded credit/debit note PDFs.
10j Statement of Account
- Per-Client Ledger: Chronological view of invoices, payments, credit notes, and applications over a selected date range.
- Opening + Closing Balance: Running balance with brought-forward opening balance.
- Branded PDF + Email: Send the statement directly to the customer using the active invoice template's branding.
- Aging View: Optional aging buckets (Current / 1-30 / 31-60 / 61-90 / 90+) inline.
10k Document Attachments
- Polymorphic Attachments: Single
document_attachmentstable linked byentity_type+entity_id— supports Invoices, Bills, Expenses, and more. - Storage: Files stored in a private Supabase Storage bucket with company-scoped RLS.
- Multi-File Support: Attach unlimited files per transaction with type, size, and uploader metadata.
- In-App Preview: View image/PDF previews inline on the transaction detail screen.
11 Financial Reports
| Report | Description |
|---|---|
| Profit & Loss | Revenue minus expenses. Credits − Debits for income. Handles reversals correctly. |
| Balance Sheet | Assets, Liabilities, Equity snapshot at a point in time. |
| Trial Balance | All account balances — verify debits = credits. |
| General Ledger | Complete transaction history per account in base currency. |
| Cash Flow | Cash inflows and outflows by period. |
| Aged Receivables | Outstanding invoices by aging buckets (Current, 1-30, 31-60, 61-90, 90+). |
| Aged Payables | Outstanding bills by aging buckets. |
| Sales Tax Report | Regional compliance: India GST, UK VAT, US Sales Tax. Drill-down sheet. |
| Expenses by Category | Spending breakdown by category. |
| Purchases by Vendor | Spending breakdown by vendor. |
| Billable Expenses | Un-invoiced billable expenses by client. |
| PO vs Bills | Purchase order commitments vs actual bills. |
| Audit Trail | Complete history of all financial changes. |
| Ledger Integrity Audit | Self-service audit checking all transactions for balance integrity, rounding issues, and missing exchange rates. Health dashboard with CSV export. |
12 Accounting Software Exports
| Software | Format | Notes |
|---|---|---|
| QuickBooks Online | CSV | Standard column mapping |
| QuickBooks Desktop | IIF | Transaction headers and splits |
| Xero | CSV | Xero-compatible column structure |
| Tally Prime | XML | Full XML envelope with voucher formatting |
| Sage | CSV / QIF | Sage-compatible data structure |
Reusable ExportDropdown component available on all report pages with specialized formatters in src/lib/exports/.
12b Customer Credits Report
- Unapplied Balances:
/reports/customer-creditsaggregates customer credit-note balances and overpayment surpluses by client. - Drill-Down: Click a client to see contributing credit notes and payments.
- Multi-Currency: Balances shown in client currency with base-currency totals.
- Action Hooks: Apply credits to outstanding invoices directly from the report.
12c Plugins & Integrations Hub
plugins + company_plugins tables) that lets tenants enable/disable optional integrations and hold per-tenant configuration.- Tenant-Scoped Enablement: Each company toggles plugins independently and stores their own credentials/config in
company_plugins.config. - Catalog UI: Browse available integrations with status (Enabled / Available / Coming Soon) and quick-configure dialogs.
- Designed for Productivity Partners: Foundation for CRM sync, calendar, document storage, e-signature, and country-specific compliance portals.
13 Subscription & Billing
- Tiered Plans: Free, Growth, Professional, Enterprise with feature gating.
- Feature Limits: Free tier caps on invoices, clients, vendors, items, expenses. Paid = unlimited.
- PlanLimitsCheck: Wraps all "Create" buttons; shows UpgradeDialog when limits reached.
- Stripe Checkout: Sessions for paid plans + customer portal for self-service.
- Emotional Pricing: IP-based currency detection with psychological rounding (₹2,499 / $24.99). Billing in USD.
Soft-Launch Promo System
- Promo Codes:
promotions+promotion_redemptionstables. 1-100% discounts. - 100% Discount: Bypasses Stripe entirely via
apply-free-subscriptionedge function. - Partial Discounts: Dynamic Stripe coupon creation at checkout.
- Pre-seeded:
LAUNCH100code for all plans.
14 Multi-Tenant Architecture
- Company Switching: Create multiple companies and switch between them.
- Data Isolation: All tables scoped by
company_idwith RLS policies. - Per-Company Settings: Separate currency, country, tax config, COA, fiscal year per company.
- Entity Locks: Country locks after creation. Currency locks after first transaction. Fiscal year changes apply to future periods only.
15 Guided 7-Step Onboarding
| Step | Description |
|---|---|
| 1. Company Info | Name, type (Individual/Company), country, currency |
| 2. Invoice Settings | Prefix, template, payment terms |
| 3. Tax Settings | Auto-seeded from country; configurable rates and accounts |
| 4. Chart of Accounts | Review auto-seeded COA |
| 5. Accounting Preferences | Fiscal year, number formats |
| 6. Opening Balances | Enter starting balances |
| 7. Complete | Celebration modal → Dashboard |
Sequential enforcement — no skipping. Dashboard shows persistent reminder (dismissable 3x) until complete.
16 User & Role Management
- User Invitation: Invite team members by email with assigned roles.
- Custom Roles: Granular permission matrices covering all modules.
- Permission Matrix: Per-module CRUD (View, Create, Edit, Delete) for every feature area.
- Role Duplication: Clone existing roles as starting points.
- Super Admin: Platform-level admin with full cross-tenant access.
17 Admin Dashboard (Platform Level)
Global Overview
Total tenants, active subscriptions, revenue metrics.
Business Intelligence
Feature usage analytics, churn tracking, health scores.
Tenant Drilldown
Deep-dive into individual tenant activity.
Platform Revenue
Subscription revenue tracking and analytics.
18 Notifications
- In-App: Bell icon with unread count and notification list.
- Configurable Preferences: Users control which notifications they receive.
- Auto-Reminders: Configurable invoice payment reminders.
- Auto-Receipts: Automatic payment receipt generation and delivery.
19 Country-Specific Localization
| Feature | Implementation |
|---|---|
| Tax Terminology | GSTIN (India), ABN (Australia), VAT (UK), EIN (US) |
| Tax Codes | HSN/SAC (India), Commodity Code (EU), HS Code (US/AU) |
| Company Types | Individual vs Company with conditional tax field visibility |
| Fiscal Year Defaults | Country-based: Apr-Mar (India), Jul-Jun (Australia), Jan-Dec (US) |
| Currency Defaults | New entities inherit host company's country and currency |
| Invoice Labels | Company and client tax IDs use country-specific terminology on invoices |
20 Legal & Compliance
Terms of Service
Platform usage agreement
Privacy Policy
Data collection and usage
Cookie Policy
GDPR-compliant banner + preferences modal
Data Processing Agreement
B2B data handling terms
GDPR Compliance
EU data protection
Payment & Refund Policy
Billing terms and refund process
Also includes: Data Security Policy, Service Level Agreement, Acceptable Use Policy, and Subprocessors List.