Skip to content

Alhuda ERP Finance + Reporting Specs

Superseded — kept for history only

This page was written in January 2026 and is not a description of how the system works today. It is kept so the reasoning behind early decisions stays readable. Current behaviour is described in Finance, accounting and tax (FIN) and Finance reports. Do not build from this page.

Finance Subsystem

Data Fields

  • Booking: totalAmount, paidAmount, balanceAmount, paymentPolicy
  • Payment: amount, method, reference, receivedBy, createdAt
  • Clearance: financeCleared, clearedAt, clearedBy
  • Receipt: receiptNumber, issuedAt

Functions

export function calculateDues(total: number, payments: number[]): number {
  return total - payments.reduce((sum, p) => sum + p, 0);
}

export function canApproveBooking(policy: 'advance' | 'partial' | 'full', paid: number, total: number): boolean {
  if (policy === 'full') return paid >= total;
  if (policy === 'partial') return paid > 0;
  return paid >= total * 0.2; // advance default 20%
}

export function canClearTickets(dues: number, exceptionProof?: string): boolean {
  return dues <= 0 || Boolean(exceptionProof);
}

Receipts

  • Sequence: ALH-YYYY-000001
  • Reset sequence yearly.

Ledger

  • Create LedgerEntry on payment and refund.
  • Optional double-entry later.

Reports

1) Group Manifest

Columns: - Group ID, Customer Name, Passport No, Visa Status, Ticket Status, Hotel, Assistance. Filters: - Group ID, Departure Date, Visa Status.

2) Dues Report

Columns: - Booking No, Customer, Agent, Total, Paid, Balance, Aging Bucket. Filters: - Agent, Group, Date Range. Buckets: - 0-7, 8-14, 15-30, 31+ days.

3) Visa Pipeline

Columns: - Visa Status, Count, Departure Window. Filters: - Status, Date Range.

4) Ticket Issuance

Columns: - Booking No, Status, Clearance, Exception Proof. Filters: - Date Range, Status.

5) Inventory Utilization

Columns: - Airline, Quota Block, Total Seats, Allocated, Remaining. Filters: - Airline, Departure Window.

Export Requirements

  • CSV and PDF exports for all reports.
  • Include timestamp, filters used, and generated by.

Performance

  • Use pagination and indexed filters.
  • Precompute aggregates for dashboards.