Skip to content

ffl_core.price_approval

Source: apps/ffl_core/ffl_core/price_approval.py · 2 endpoint(s)

Generated by make api-docs — do not edit by hand.

approve

POST /api/method/ffl_core.price_approval.approve

Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager / Accounts User / Accounts Manager

A manager approves the lowered prices of a sale, or a return, before it is saved.

The approver picks themselves and types their own counter PIN, or their password when they have no PIN (or it is off). What is approved is worked out here from the same document, never taken from the screen. The token is good for 15 minutes, once, for the user who asked.

arg type required default description
approver string yes — The manager's user id (from :func:check's approvers).
reason string yes — Why (required; kept on the document and its timeline).
pin string | null no None The approver's counter PIN.
password string | null no None Or their password.
doc — no None The form's document as JSON (as :func:check).
payload — no None Or a Create Order payload.
sales_invoice string | null no None With payload: the order it edits.

Returns: {"token", "approver", "approver_name", "expires_in": seconds, "lines", "discount", "refund"}.

apps/ffl_core/ffl_core/price_approval.py:700

check

POST /api/method/ffl_core.price_approval.check

Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager / Accounts User / Accounts Manager

What a save would need a manager for — the screens ask before saving.

arg type required default description
doc — no None The form's document (POS Invoice, Sales Invoice or Sales Order) as JSON.
payload — no None Or a Create Order payload (create_order's shape).
sales_invoice string | null no None With payload: the order it edits (its lines keep their prices).

Returns: {"needs_approval": bool, "approver": whether the caller approves their own, "lines": [{"idx", "item_code", "item_name", "serial", "list_rate", "rate"}], "discount": {"percentage", "amount"} or None, "refund": a return's {"total", "lines": [{"item_code", "item_name", "serial", "qty", "amount"}]} or None, "approvers": [{"user", "full_name", "image", "has_pin", "pin_off"}] when it needs one}.

apps/ffl_core/ffl_core/price_approval.py:652