Skip to Content
Ranlanka CRM documentation — pre-release, subject to change.
FeaturesFinance & Invoicing

Finance & Invoicing

Issuing invoices

Staff issue invoices directly from a visa/ticket case (once it reaches an eligible stage) — invoicing doesn’t require a prior quotation, but shares the same admin pricing templates when one applies.

Visa invoices auto-populate their line items from the matching pricing template; each item is editable before submitting. Ticket invoices have no pricing template to auto-fill from, but are itemized the same way — staff get a single editable “Ticket Price” row to start (not locked, since there’s no catalog price behind it) and can add further custom charges (baggage, seat selection, service fees, etc.) via the same “Add Custom Field” control visa invoices use. Every added row shows up individually on the invoice PDF and the staff-facing invoice detail view, exactly like visa’s line items do.

Permissions: consultants (not just owners/cashiers) can create, view, and generate PDFs for their own customers’ invoices day to day. Cancelling an invoice remains owner/manager-only.

Cost Amount (what the agency actually paid out for the service) applies to every service type except visa — ticket/flight and tour invoices both collect it (tour invoices collect it regardless of whether the tour used a priced template or was manually itemized), and it’s used to work out profit margin. It’s hidden on visa invoices entirely and defaults to 0 server side — visa profit is worked out from the Consulting Fee line item instead, see Accounting: how Profit is calculated. Staff can see an invoice’s Cost of Sale and Profit in an internal-only box on its detail view (never shown to the customer, never printed on the PDF) whenever a cost was recorded.

Group (dependent) invoicing

When several requests share a booking group — a family applying together, for example — staff can issue one invoice covering the whole group instead of one per request. Each request keeps its own line-item section and subtotal within the single invoice/PDF.

Itemized tax & discount

Tax and discount are repeatable line items, not a single amount each — for example “VAT” and “Service Charge” as separate tax rows, each with an optional note. The invoice’s stored totals are always the sum of these rows, computed server-side and never trusted from the client. Both the invoice detail view and the downloaded PDF show every row individually.

Invoices vs. receipts

The invoice PDF and the payment-receipt PDF are separate documents:

  • Invoice PDF — charges/line items and totals only.
  • Receipt PDF — payment history, only generatable once at least one payment has been recorded.

The receipt/payment-history section in the invoice detail view is collapsed by default and hidden entirely until a payment exists.

Emailing documents

Invoices and receipts can be emailed directly to the customer as a PDF attachment from the invoice detail view — no download-then-manually-send workflow required.

Invoice Cancellation (Hard Delete)

Cancelling an invoice (POST /api/v1/invoices/{id}/cancel) is an owner/manager action that permanently purges the invoice, its line items, tax lines, discount lines, request links, and all recorded payments/receipts from the database. This guarantees that cancelled or mistakenly created invoices cannot distort sales figures, cash flow summaries, or monthly digests.

Rejected Visa Settlement & Balance Waiver

When a visa application is rejected by the embassy, staff can settle the linked invoice (POST /api/v1/invoices/{id}/settle-rejection):

  • Debt Waiver: Automatically creates a "Visa Rejection Balance Waiver" discount line for the uncollectible balance.
  • Revenue Matching: The invoice total is adjusted to match collected revenue (amountPaid), outstanding balance is cleared to 0.00, and status is set to PAID.
  • Zero-Paid Invoices: If no payments were collected, a 100% waiver line is applied, reducing the net total to 0.00 with status PAID, keeping the audit trail clear.

Customer Financial Breakdown & In-Page Detail Drawer

In the Services & Invoicing sub-tab under Visa, Ticket, and Tour statistics panels, admins can view an aggregated Customer Financial Breakdown Table:

  • Server-Side Aggregation & Filtering: Data is aggregated at the PostgreSQL database level using high-performance CTE queries and paginated server-side to handle large customer volume efficiently.
  • Status Tabs: Easily filter customer records by overall payment status (All, Fully Paid, Partially Paid, Unpaid, Not Invoiced).
  • In-Page Customer Detail Drawer: Clicking on any customer name, invoiced count badge, or action button opens a slide-over <CustomerServiceDetailDrawer /> right inside the financial panel.
    • Financial Summary: Shows total invoiced, total paid, and outstanding balance for that customer.
    • Essential Ticket / Request Details: Displays PNR, airline, ticket number, price, visa application status, and appointment dates.
    • Invoice & Payment Actions: Allows downloading Invoice PDF, Receipt PDF, and recording payments directly via <RecordPaymentModal /> without navigating away from the finance panel.
Last updated on