Skip to main content

Global Configuration

Configure @drcmind/ohada-lib to match your legal jurisdiction and business defaults.

The Ohada Instance

Initialize the Ohada class once and reuse it throughout your application.

import { Ohada } from '@drcmind/ohada-lib';

const ohada = new Ohada({
// --- Core ---
currency: 'XAF', // 'XAF', 'EUR', 'USD', etc.
locale: 'fr', // 'fr' (default) or 'en'

// --- VAT Control ---
vat: 0.18, // Global default VAT rate (e.g., 18%)
taxInclusive: false, // true = Prices are TTC, false = HT
disableVAT: false, // Set to true to skip VAT lines entirely

// --- Expenses ---
directExpense: false // true = Record expenses directly to cash (no 4011)
});

Options Reference

PropertyTypeDefaultDescription
currencystring-Currency code used for label generation.
locale'fr' | 'en''fr'Language for journal entry and translation labels.
vatnumber-Default tax rate multiplier (0.18 for 18%).
taxInclusivebooleanfalseWhether amounts provided to functions include VAT.
disableVATbooleantrueQuickly disable VAT calculation across all modules.
directExpensebooleanfalseBypasses the 2-step process for expenses.

Dynamic Overrides

Most methods allow overriding global settings for specific transactions:

ohada.recordSale({
amount: 1000,
label: "Custom Sale",
vatRate: 0.15 // Overrides global 0.18 for this entry
});