@include('accounting::admin.accounting._styles')

Account Mapping

Map accounting ledger accounts to Sales, Purchase and other modules
@if(session('success'))
{{ session('success') }}
@endif {{-- Integration status banner --}}
@if($hasSales)
SalesManagement is installed. Journal entries will be auto-posted when invoices are sent, payments are recorded, and invoices are cancelled. Map the accounts below.
@else
SalesManagement is not installed. Install it to enable auto journal posting. You can still save the mapping for when it is installed.
@endif
@csrf @if($errors->any())
    @foreach($errors->all() as $e)
  • {{ $e }}
  • @endforeach
@endif {{-- Sales Integration --}}

Sales Module Mapping

Used when SalesManagement fires invoice / payment events
@php $salesKeys = ['acc_map_debtors','acc_map_sales','acc_map_sales_returns','acc_map_output_gst','acc_map_cash','acc_map_bank']; @endphp @foreach($salesKeys as $key) @php $meta = \Modules\Accounting\Http\Controllers\SettingsController::MAPPING_KEYS[$key]; @endphp
{{ $meta['label'] }}
{{ $meta['desc'] }}
Default: {{ $meta['default'] }}
@endforeach
{{-- Purchase (future) --}}

Purchase Module Mapping

Used when Purchase module is wired up (future)
@php $key = 'acc_map_purchase'; $meta = \Modules\Accounting\Http\Controllers\SettingsController::MAPPING_KEYS[$key]; @endphp
{{ $meta['label'] }}
{{ $meta['desc'] }}
Default: {{ $meta['default'] }}
{{-- How it works --}}

How Auto-Posting Works

📤 Invoice Sent
Dr Debtors (full amount)
Cr Sales Revenue (subtotal)
Cr Output GST (tax amount)
💰 Payment Received
Dr Bank / Cash (payment amount)
Cr Debtors (payment amount)
Bank/Cash selected by payment method
❌ Invoice Cancelled
Dr Sales Returns (subtotal)
Dr Output GST (tax — reversal)
Cr Debtors (full amount)
Safe by design: SalesManagement works fully standalone — if Accounting is not installed, Sales operates with zero changes. Accounting only listens; it never calls Sales.