# Accounting

- Module key: `Accounting`
- Category: `Accounting/Finance`
- Path: `app/Modules/Accounting`

## Ringkasan

Accounting berada di kategori Accounting/Finance. Modul ini memiliki 50 definisi route, 4 controller, 9 model, dan 9 view. Database module terdeteksi pada tabel: `accounting_accounts`, `accounting_journals`, `accounting_journal_lines`, `accounting_ar_payments`, `accounting_ar_payment_allocations`, `accounting_ap_payments`, `accounting_ap_payment_allocations`, `accounting_bank_reconciliations`, dan lainnya.

## Flowchart

```mermaid
flowchart TD
    A[User / Operator] --> B[Menu Accounting]
    B --> C[Routes: 50]
    C --> D[Controllers: 4]
    D --> E[Views: 9]
    D --> F[(Tables: 9<br/>accounting_accounts<br/>accounting_journals<br/>accounting_journal_lines<br/>accounting_ar_payments<br/>accounting_ar_payment_allocations)]
    D --> G[Validation / Business Rules]
    G --> F
    F --> H[Report / Export / Audit]
```


## Routes

- `Route::middleware(['auth', 'ip.block', 'menu.access'])->prefix('accounting')->name('accounting.')->group(function () {`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::get('/', [AccountingController::class, 'index'])->name('index');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::get('/seed-dummy-run', [AccountingController::class, 'seedDummyRun'])->name('seed_dummy.run');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::get('/accounts', [AccountingController::class, 'accountsPage'])->name('accounts.page');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::get('/accounts/data', [AccountingController::class, 'accountsData'])->name('accounts.data');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::post('/accounts', [AccountingController::class, 'storeAccount'])->name('accounts.store');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::put('/accounts/{id}', [AccountingController::class, 'updateAccount'])->name('accounts.update');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::get('/memorial-journals', [AccountingController::class, 'memorialPage'])->name('memorial.page');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::get('/memorial-journals/data', [AccountingController::class, 'memorialData'])->name('memorial.data');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::post('/memorial-journals', [AccountingController::class, 'storeMemorial'])->name('memorial.store');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::post('/memorial-journals/{id}/post', [AccountingController::class, 'postJournal'])->name('memorial.post');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::post('/memorial-journals/{id}/void', [AccountingController::class, 'voidJournal'])->name('memorial.void');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::get('/auto-journals', [AccountingController::class, 'autoJournalsPage'])->name('auto.page');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::get('/auto-journals/data', [AccountingController::class, 'autoJournalsData'])->name('auto.data');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::get('/cash-bank', [AccountingController::class, 'cashBankPage'])->name('cash_bank.page');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::get('/cash-bank/data', [AccountingController::class, 'cashBankData'])->name('cash_bank.data');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::post('/cash-bank', [AccountingController::class, 'storeCashBank'])->name('cash_bank.store');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::get('/general-ledger', [AccountingController::class, 'generalLedgerPage'])->name('gl.page');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::get('/general-ledger/data', [AccountingController::class, 'generalLedgerData'])->name('gl.data');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::get('/general-ledger/export-xlsx', [AccountingController::class, 'exportGeneralLedgerXlsx'])->name('gl.export_xlsx');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::get('/ar', [AccountingReceivableController::class, 'index'])->name('ar.page');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::get('/ar/summary/data', [AccountingReceivableController::class, 'summaryData'])->name('ar.summary.data');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::get('/ar/invoices/data', [AccountingReceivableController::class, 'invoicesData'])->name('ar.invoices.data');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::get('/ar/invoices/search', [AccountingReceivableController::class, 'invoicesSearch'])->name('ar.invoices.search');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::get('/ar/clients/search', [AccountingReceivableController::class, 'clientsSearch'])->name('ar.clients.search');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::get('/ar/payments/data', [AccountingReceivableController::class, 'paymentsData'])->name('ar.payments.data');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::post('/ar/payments', [AccountingReceivableController::class, 'storePayment'])->name('ar.payments.store');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::post('/ar/payments/{id}/post', [AccountingReceivableController::class, 'postPayment'])->name('ar.payments.post');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::post('/ar/payments/{id}/void', [AccountingReceivableController::class, 'voidPayment'])->name('ar.payments.void');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::get('/ar/export-xlsx', [AccountingReceivableController::class, 'exportAgingXlsx'])->name('ar.export_xlsx');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::get('/ap', [AccountingPayableController::class, 'index'])->name('ap.page');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::get('/ap/summary/data', [AccountingPayableController::class, 'summaryData'])->name('ap.summary.data');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::get('/ap/pos/data', [AccountingPayableController::class, 'posData'])->name('ap.pos.data');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::get('/ap/pos/search', [AccountingPayableController::class, 'posSearch'])->name('ap.pos.search');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::get('/ap/vendors/search', [AccountingPayableController::class, 'vendorsSearch'])->name('ap.vendors.search');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::get('/ap/payments/data', [AccountingPayableController::class, 'paymentsData'])->name('ap.payments.data');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::post('/ap/payments', [AccountingPayableController::class, 'storePayment'])->name('ap.payments.store');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::post('/ap/payments/{id}/post', [AccountingPayableController::class, 'postPayment'])->name('ap.payments.post');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::post('/ap/payments/{id}/void', [AccountingPayableController::class, 'voidPayment'])->name('ap.payments.void');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::get('/ap/export-xlsx', [AccountingPayableController::class, 'exportAgingXlsx'])->name('ap.export_xlsx');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::get('/bank-reconciliation', [AccountingBankReconciliationController::class, 'index'])->name('recon.page');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::get('/bank-reconciliation/data', [AccountingBankReconciliationController::class, 'reconciliationsData'])->name('recon.data');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::post('/bank-reconciliation', [AccountingBankReconciliationController::class, 'store'])->name('recon.store');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::get('/bank-reconciliation/{id}/transactions', [AccountingBankReconciliationController::class, 'transactionsData'])->name('recon.transactions');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::post('/bank-reconciliation/{id}/toggle', [AccountingBankReconciliationController::class, 'toggleCleared'])->name('recon.toggle');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::post('/bank-reconciliation/{id}/close', [AccountingBankReconciliationController::class, 'close'])->name('recon.close');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::get('/bank-reconciliation/{id}/export-xlsx', [AccountingBankReconciliationController::class, 'exportXlsx'])->name('recon.export_xlsx');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::get('/accounts/search', [AccountingController::class, 'accountsSearch'])->name('accounts.search');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::post('/accounts/seed-default', [AccountingController::class, 'seedDefaultCoa'])->name('accounts.seed_default');`  
  File: `app/Modules/Accounting/routes/web.php`
- `Route::post('/seed-dummy', [AccountingController::class, 'seedDummy'])->name('seed_dummy');`  
  File: `app/Modules/Accounting/routes/web.php`

## Controllers

- `app/Modules/Accounting/Http/Controllers/AccountingBankReconciliationController.php`
- `app/Modules/Accounting/Http/Controllers/AccountingController.php`
- `app/Modules/Accounting/Http/Controllers/AccountingPayableController.php`
- `app/Modules/Accounting/Http/Controllers/AccountingReceivableController.php`

## Models

- `app/Modules/Accounting/Models/AccountingAccountModel.php`
- `app/Modules/Accounting/Models/AccountingApPaymentAllocationModel.php`
- `app/Modules/Accounting/Models/AccountingApPaymentModel.php`
- `app/Modules/Accounting/Models/AccountingArPaymentAllocationModel.php`
- `app/Modules/Accounting/Models/AccountingArPaymentModel.php`
- `app/Modules/Accounting/Models/AccountingBankReconciliationItemModel.php`
- `app/Modules/Accounting/Models/AccountingBankReconciliationModel.php`
- `app/Modules/Accounting/Models/AccountingJournalLineModel.php`
- `app/Modules/Accounting/Models/AccountingJournalModel.php`

## Views

- `app/Modules/Accounting/Resources/views/accounts.blade.php`
- `app/Modules/Accounting/Resources/views/auto_journals.blade.php`
- `app/Modules/Accounting/Resources/views/bank_reconciliation.blade.php`
- `app/Modules/Accounting/Resources/views/cash_bank.blade.php`
- `app/Modules/Accounting/Resources/views/general_ledger.blade.php`
- `app/Modules/Accounting/Resources/views/index.blade.php`
- `app/Modules/Accounting/Resources/views/memorial.blade.php`
- `app/Modules/Accounting/Resources/views/payables.blade.php`
- `app/Modules/Accounting/Resources/views/receivables.blade.php`

## Database / Migration

### `accounting_accounts`
- Actions: `create`
- Columns: 10
  - `parent_id:unsignedBigInteger`
  - `code:string`
  - `name:string`
  - `type:string`
  - `normal_balance:string`
  - `is_cash_bank:boolean`
  - `is_active:boolean`
  - `created_by:unsignedBigInteger`
  - `updated_by:unsignedBigInteger`
  - `parent_id:foreign`
- Migrations:
  - `app/Modules/Accounting/Database/migrations/2026_03_25_210000_create_accounting_tables.php`
### `accounting_journals`
- Actions: `create`
- Columns: 14
  - `journal_number:string`
  - `journal_date:date`
  - `source:string`
  - `status:string`
  - `currency:string`
  - `description:string`
  - `total_debit:decimal`
  - `total_credit:decimal`
  - `created_by:unsignedBigInteger`
  - `updated_by:unsignedBigInteger`
  - `posted_at:timestamp`
  - `posted_by:unsignedBigInteger`
  - `void_at:timestamp`
  - `void_by:unsignedBigInteger`
- Migrations:
  - `app/Modules/Accounting/Database/migrations/2026_03_25_210000_create_accounting_tables.php`
### `accounting_journal_lines`
- Actions: `create`, `table`
- Columns: 14
  - `journal_id:unsignedBigInteger`
  - `account_id:unsignedBigInteger`
  - `description:string`
  - `debit:decimal`
  - `credit:decimal`
  - `project_id:unsignedBigInteger`
  - `reference_type:string`
  - `reference_id:unsignedBigInteger`
  - `reference_number:string`
  - `journal_id:foreign`
  - `account_id:foreign`
  - `account_id:index`
  - `project_id:index`
  - `reference_type:index`
- Migrations:
  - `app/Modules/Accounting/Database/migrations/2026_03_25_210000_create_accounting_tables.php`
### `accounting_ar_payments`
- Actions: `create`
- Columns: 18
  - `client_id:foreignId`
  - `pay_date:date`
  - `method:string`
  - `bank_account_id:foreignId`
  - `ar_account_id:foreignId`
  - `amount_idr:decimal`
  - `reference_number:string`
  - `notes:text`
  - `status:string`
  - `journal_id:unsignedBigInteger`
  - `created_by:unsignedBigInteger`
  - `updated_by:unsignedBigInteger`
  - `posted_at:timestamp`
  - `posted_by:unsignedBigInteger`
  - `void_at:timestamp`
  - `void_by:unsignedBigInteger`
  - `client_id:index`
  - `status:index`
- Migrations:
  - `app/Modules/Accounting/Database/migrations/2026_03_26_090000_create_accounting_ar_ap_tables.php`
### `accounting_ar_payment_allocations`
- Actions: `create`
- Columns: 5
  - `payment_id:foreignId`
  - `invoice_id:foreignId`
  - `amount_idr:decimal`
  - `payment_id:unique`
  - `invoice_id:index`
- Migrations:
  - `app/Modules/Accounting/Database/migrations/2026_03_26_090000_create_accounting_ar_ap_tables.php`
### `accounting_ap_payments`
- Actions: `create`
- Columns: 18
  - `vendor_id:foreignId`
  - `pay_date:date`
  - `method:string`
  - `bank_account_id:foreignId`
  - `ap_account_id:foreignId`
  - `amount_idr:decimal`
  - `reference_number:string`
  - `notes:text`
  - `status:string`
  - `journal_id:unsignedBigInteger`
  - `created_by:unsignedBigInteger`
  - `updated_by:unsignedBigInteger`
  - `posted_at:timestamp`
  - `posted_by:unsignedBigInteger`
  - `void_at:timestamp`
  - `void_by:unsignedBigInteger`
  - `vendor_id:index`
  - `status:index`
- Migrations:
  - `app/Modules/Accounting/Database/migrations/2026_03_26_090000_create_accounting_ar_ap_tables.php`
### `accounting_ap_payment_allocations`
- Actions: `create`
- Columns: 5
  - `payment_id:foreignId`
  - `purchase_order_id:foreignId`
  - `amount_idr:decimal`
  - `payment_id:unique`
  - `purchase_order_id:index`
- Migrations:
  - `app/Modules/Accounting/Database/migrations/2026_03_26_090000_create_accounting_ar_ap_tables.php`
### `accounting_bank_reconciliations`
- Actions: `create`
- Columns: 10
  - `bank_account_id:foreignId`
  - `period_from:date`
  - `period_to:date`
  - `opening_balance:decimal`
  - `closing_balance:decimal`
  - `status:string`
  - `notes:text`
  - `created_by:unsignedBigInteger`
  - `updated_by:unsignedBigInteger`
  - `bank_account_id:index`
- Migrations:
  - `app/Modules/Accounting/Database/migrations/2026_03_26_090000_create_accounting_ar_ap_tables.php`
### `accounting_bank_reconciliation_items`
- Actions: `create`
- Columns: 6
  - `reconciliation_id:foreignId`
  - `journal_line_id:foreignId`
  - `cleared_at:timestamp`
  - `note:string`
  - `reconciliation_id:unique`
  - `journal_line_id:index`
- Migrations:
  - `app/Modules/Accounting/Database/migrations/2026_03_26_090000_create_accounting_ar_ap_tables.php`
