AAuditPro Suite· Jobs manual
Jobs manual Billing the job

The revenue path

M10 Quote accepted M07 Job work happens here M11 Invoice tax invoice M11 Payment allocated PAID balance 0 Each arrow stamps lineage — quote.converted_to_invoice_id, invoice.parent_quote_id

Auto-draft on completion

When job status moves to completed AND m11.auto_invoice_on_completion=1, the system runs:

  1. Resolve the parent quote

    If the job was created from a converted quote (job.parent_quote_id), use that as the source of fee + line items. Otherwise fall back to job.estimated_fee + a single line "Audit fee FY {year}".

  2. Draft the invoice

    doc_type=tax_invoice, status=draft, auto-numbered INV/{YYYY}/{NNNN}. Inherits client billing T&Cs (override or firm default), VAT category from client.vat_category, OMR currency.

  3. Apply pre-existing advances

    If client has advanceBalance > 0, system silently allocates against the new invoice up to the smaller of (advance, invoice total). Flash message shows the auto-allocated amount.

  4. Notify the partner

    Internal notification with deep-link to the new draft invoice. Partner reviews, approves, sends.

Manual invoice from a job

From the job dashboard → Invoices tab → New invoice from this job. Same flow as auto-draft but partner-driven. Useful for:

Proforma vs tax invoice

AspectProformaTax invoice
doc_typeproformatax_invoice
Number prefixPI/{YYYY}/{NNNN}INV/{YYYY}/{NNNN}
Affects revenue?No — pre-supply quoteYes — recognised on issuance
VAT applies?No — informational onlyYes — RD 121/2020
PDF watermark"PROFORMA"None
ConversionClick Convert to tax invoice

When a proforma is converted to tax invoice, the system clones the lines, stamps both lineage columns (proforma.converted_to_invoice_id + tax_invoice.parent_invoice_id), and walks the new tax invoice draft → sent in one shot if the proforma had advance payment(s).

Payment allocation

One payment row, multiple allocation rows (payment_allocations):

1Full settlement
payment.amount = invoice.balance_due

One allocation row. Invoice flips to paid. paid_in_full_at stamped.

2Partial settlement
payment.amount < balance_due

One allocation row. Invoice flips to partially_paid. Balance recomputes.

3Multi-invoice settlement
One payment splits across invoices

Multiple allocation rows. Each invoice's balance recomputes. Useful for "client paid off 3 invoices in one transfer".

4Pure advance
No allocations

is_advance=1. Sits as un-allocated credit until applied via post-hoc allocation form.

The OMR money rules

Try this

Open a job with status=completed → Invoices tab → New invoice. Verify the line item descriptions auto-populate from the job's tasks (datalist autocomplete). Default T&Cs come from firm settings or client override. Save as draft, then approve, then send. Check the M11 invoice show page — branded PDF rendered, audit trail captured.

Watch out

Don't manually fudge balances. The bcmath math is the source of truth. If a line says 14,500.000 OMR you can't decide it's 14,500.001 to "make it round" — the audit log captures every line edit and you'd be the auditor of your own books, badly.

Tip — advance balance

The Client → Billing card always shows current advance balance. If it's > OMR 1,000 there's money sitting un-allocated. Use the post-hoc allocate form on payment-show to apply it to the next invoice. Saves the client a transfer + reconciles your books cleanly.