hickr / laravel-accounting
Laravel Accounting App
dev-main
2025-07-23 00:44 UTC
Requires
- php: ^8.2
- brick/money: ^0.10.1
- doctrine/dbal: ^4.3
- illuminate/database: ^12.0
- illuminate/support: ^12.0
- ramsey/uuid: ^4.9
- spatie/laravel-package-tools: ^1.92
Requires (Dev)
- orchestra/testbench: ^10.4
- phpunit/phpunit: ^12.2
This package is auto-updated.
Last update: 2025-09-23 00:58:58 UTC
README
A modular, multi-tenant, multi-currency accounting engine for Laravel 12+, supporting IFRS-compliant reports and regional extensions (e.g., MIRA Maldives).
โจ Features
- ๐ Double-entry accounting (Journal, Ledger, COA)
- ๐งพ IFRS-compliant financial reports:
- Trial Balance
- Profit & Loss
- Balance Sheet
- General Ledger
- ๐ Multi-currency support with exchange rates and inverse logic
- ๐ข Multi-tenancy (per business/entity)
- ๐ Modular regional compliance (e.g., MIRA 201 via plugin)
- โ Pest/PHPUnit test coverage
- ๐งฑ Clean architecture & Laravel Action-based design
- ๐ ๏ธ Configurable tenant model and table names
โ๏ธ Installation
composer require hickr/laravel-accounting
Publish Config & Migrations
php artisan vendor:publish --tag=accounting-config php artisan vendor:publish --tag=accounting-migrations
๐ Usage Examples
Post a Journal Entry
PostJournalEntryAction::execute([ 'tenant_id' => 1, 'date' => '2025-01-01', 'description' => 'Initial capital', 'currency_code' => 'MVR', 'exchange_rate' => 1, 'lines' => [ ['account_id' => 1, 'type' => 'debit', 'amount' => 1000], ['account_id' => 2, 'type' => 'credit', 'amount' => 1000], ], ]);
๐งพ Tax Invoice Entry Example
PostJournalEntryAction::execute([ 'tenant_id' => 1, 'date' => '2025-07-15', 'description' => 'MIRA GST Sale', 'currency_code' => 'MVR', 'exchange_rate' => 1, 'lines' => [ [ 'account_id' => 1, // Cash 'type' => 'debit', 'amount' => 1060, 'base_currency_amount' => 1060, ], [ 'account_id' => 2, // Revenue 'type' => 'credit', 'amount' => 1000, 'base_currency_amount' => 1000, 'meta' => [ 'gst_type' => 'standard-rated', 'gst_rate' => 6, 'net_amount' => 1000, 'gst_amount' => 60, 'invoice_number' => 'INV-1001', 'customer_name' => 'Ali Hassan', 'customer_tin' => '1010101GST001', ], ], [ 'account_id' => 3, // GST Payable 'type' => 'credit', 'amount' => 60, 'base_currency_amount' => 60, ], ] ]);
๐๏ธ Fixed Asset Management
- Add and manage fixed assets via
FixedAsset
model. - Support for depreciation via:
- Straight Line method
- Reducing Balance method
- Bulk depreciation processing supported per period.
- Link each asset to an
AssetCategory
and account mapping.
use Hickr\Accounting\Models\FixedAsset; $asset = FixedAsset::create([ 'tenant_id' => 1, 'category_id' => 2, 'name' => 'Dell Laptop', 'purchase_date' => '2024-01-01', 'cost' => 2000, ]);
๐งพ MIRA Compliance (Maldives)
- Schedule 1 to Schedule 5 GST Reports implemented.
- Income Tax Schedule 1, 2, and 4 supported.
meta
field onjournal_lines
used for enhanced tagging.- Country-specific config under
modules -> mira
.
$config = config('accounting.modules.mira'); $rate = $config['gst']['standard_rate']; // 6%
๐ Financial Statements
- Profit & Loss
- Balance Sheet
- Trial Balance (grouped + flat)
- Cash Flow Statement
๐ Reports
Trial Balance
$data = TrialBalanceReportAction::run([ 'tenant_id' => 1, 'date_from' => '2025-01-01', 'date_to' => '2025-12-31', 'group_by_type' => false, ]);
Profit & Loss
$data = ProfitAndLossReportAction::run([ 'tenant_id' => 1, 'date_from' => '2025-01-01', 'date_to' => '2025-12-31', ]);
Balance Sheet
$data = BalanceSheetReportAction::run([ 'tenant_id' => 1, 'date_to' => '2025-12-31', 'group_by_account' => true, ]);
General Ledger
$data = GeneralLedgerReportAction::run([ 'tenant_id' => 1, 'date_from' => '2025-01-01', 'date_to' => '2025-12-31', ]);
๐ง Advanced Configuration Notes
// config/accounting.php 'tenant_model' => App\Models\Tenant::class, 'tenant_table' => 'tenants', 'modules' => [ 'mira' => [ 'enabled' => true, 'gst' => [ 'standard_rate' => 0.06, 'zero_rate' => 0.0, ], ], ],
โ Testing
vendor/bin/pest
# or
vendor/bin/phpunit
Uses Orchestra Testbench to run package tests.
๐งฉ Regional Compliance
This package supports regional reporting plugins via config. For example:
// config/accounting.php 'region_module' => \Hickr\Accounting\MIRA\MiraModule::class,
MIRA reports (GST 201, Income Tax) can be developed as standalone modules.
๐งช Tests Included
- Journal entries (balancing, currency conversion)
- Trial balance (flat & grouped)
- Profit & Loss
- Balance Sheet
- General Ledger
๐งฑ Architecture
- Tenant-aware by config
- Supports soft-deleted tenants
- Region support via strategy pattern
๐๏ธ Roadmap
- Trial Balance
- Profit & Loss
- Balance Sheet
- General Ledger
- Cash Flow Statement
- MIRA 201, 401, Income Tax Schedules
- Journal approvals / audit trail
๐งพ License
MIT License