ffl_core.api.pos_recycle_bin¶
Source: apps/ffl_core/ffl_core/api/pos_recycle_bin.py · 2 endpoint(s)
Generated by
make api-docs— do not edit by hand.
list_deleted_invoices¶
POST /api/method/ffl_core.api.pos_recycle_bin.list_deleted_invoices
Auth (derived from code): Requires delete permission on POS Invoice (Frappe DocType permission check).
Deleted POS Invoice drafts that can still be restored, newest first.
Backs the "Deleted" filter of the POS Recent Orders list. Reads the Deleted Document log directly (that doctype is System Manager only — the gate here is the caller's POS Invoice permission instead).
| arg | type | required | default | description |
|---|---|---|---|---|
search_term |
string | null | no | None |
Optional substring matched case-insensitively against the original invoice number and the customer name. |
days |
integer | null | no | None |
Look-back window in days (default 30, max 365). |
Returns: List of dicts: deleted_document (log row id to pass to restore_deleted_invoice), name (original invoice number), customer_name, grand_total, currency, posting_date, posting_time, is_return, deleted_by, deleted_at.
apps/ffl_core/ffl_core/api/pos_recycle_bin.py:111
restore_deleted_invoice¶
POST /api/method/ffl_core.api.pos_recycle_bin.restore_deleted_invoice
Auth (derived from code): Requires delete permission on POS Invoice (Frappe DocType permission check).
Put a deleted POS Invoice draft back, keeping its original number when free.
Re-inserts the logged JSON with flags.from_restore (so the card charge
protector keeps the invoice's own card rows — see
ffl_integrations.payments.api.restore_charge_rows), retains the original
owner / timestamps like frappe's own restore, and marks the log row
restored. Validation runs as on any insert: a serial sold in the meantime
makes the restore fail loudly instead of creating a double sale.
| arg | type | required | default | description |
|---|---|---|---|---|
name |
string | yes | — | Deleted Document row id (from list_deleted_invoices). |
Returns: Dict with name (the restored invoice's number), original_name, and renamed (True when the original number was already taken and the naming series assigned a new one).
apps/ffl_core/ffl_core/api/pos_recycle_bin.py:161