Appearance
Deleted Invoices
The Deleted Invoices audit screen (/admin/deleted-invoices) preserves a read-only history of invoices that were removed from active billing. This supports financial controls, dispute resolution, and compliance without allowing silent data loss.
Permission module: deleted_invoices (view only — no create, edit, or delete)
Why deleted invoices exist
EaseLab separates cancellation from deletion:
| Action | Patient-visible | Audit trail |
|---|---|---|
| Cancel invoice | May show as cancelled | Active invoice record with status |
| Delete invoice | Removed from active lists | Copied to deleted invoices log |
Deletion requires elevated permission (invoices.delete or legacy invoices.delete).
mermaid
flowchart LR
INV[Active invoice] --> DEL[Delete action]
DEL --> AUD[Deleted invoices log]
DEL --> REM[Removed from operational lists]
AUD --> RPT[Audit / investigation]Deletion is destructive
Deleted invoices cannot be restored from this screen. Recovery requires database restore to a point before deletion.
Audit record contents
Each deleted invoice entry typically includes:
| Field | Purpose |
|---|---|
| Original invoice number | Cross-reference |
| Patient name & ID | Identity context |
| Invoice date & amount | Financial magnitude |
| Tests / line summary | Clinical context |
| Referral doctor | Commission impact |
| Deleted at timestamp | When action occurred |
| Deleted by user | Staff accountability |
| Deletion reason | Optional note from operator |
Who can delete invoices
Grant deletion sparingly:
| Role | Recommendation |
|---|---|
| Lab owner | invoices.delete |
| Senior reception supervisor | Case-by-case |
| Bench staff | Deny |
| External accountant | deleted_invoices.view only |
Combine with Quick Access review — quick.cancel_invoice is separate from hard delete.
Viewing the audit log
- Navigate to Admin → Deleted Invoices.
- Filter by date range, user, or patient.
- Open detail row for line items and metadata.
- Export if your deployment supports CSV (see Export & Filters).
No edit or purge actions are available — the log is append-only from normal UI flows.
Operational policies
Recommended lab policy:
mermaid
flowchart TD
A[Delete request] --> B{Supervisor approval?}
B -->|No| C[Use cancel instead]
B -->|Yes| D[Document reason]
D --> E[Perform delete]
E --> F[Monthly audit review]| Policy element | Guidance |
|---|---|
| Approval | Second person for invoices over threshold |
| Reason codes | Duplicate entry, wrong patient, test abort |
| Prefer cancel | Maintains patient billing history |
| Monthly review | Finance scans deleted invoices report |
Reporting interactions
| Report | Impact |
|---|---|
| Cash flow | Deleted invoices removed from active totals |
| Financial summary | Historical restatement may be needed after deletion |
| Patient due | Balances recalculated on delete |
| Referral summary | Commission may reverse depending on timing |
Investigate before accusing
Staff may delete duplicate registrations during training. Check deleted by and date before escalation.
Read-only mode
When the lab is in read-only mode, deletion is blocked along with other mutations. The audit log remains viewable.
Compliance notes
| Requirement | How EaseLab helps |
|---|---|
| Accountability | User ID on each deletion |
| Non-repudiation | Immutable audit list |
| Recovery | Point-in-time backup restore |
| Segregation of duties | View without delete permissions |
For legal hold scenarios, export audit entries before retention-driven backup expiry.