ffl_core.preorder¶
Source: apps/ffl_core/ffl_core/preorder.py · 9 endpoint(s)
Generated by
make api-docs— do not edit by hand.
assign_serial¶
POST /api/method/ffl_core.preorder.assign_serial
Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager
Put another gun of the same item by for one line of an open pre-order (the one it had goes
back on the shelf), or a first one when none has arrived for it.
| arg | type | required | default | description |
|---|---|---|---|---|
sales_order |
string | yes | — | The pre-order (open, not handed over). |
row |
string | yes | — | Its Sales Order Item row. |
serial |
string | yes | — | A gun of that item on our shelf that nothing holds. |
Returns: {"serial": the gun now put by, "was": the one it had or None}.
apps/ffl_core/ffl_core/preorder.py:663
cancel_preorder¶
POST /api/method/ffl_core.preorder.cancel_preorder
Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager
Cancel a pre-order and pay back everything held for it: the order is cancelled, its
quantities go back on the items, and each payment gets a draft return for its full amount, the way it was paid. The register checks the returns out.
| arg | type | required | default | description |
|---|---|---|---|---|
sales_order |
string | yes | — | The pre-order (submitted, nothing handed over). |
reason |
string | yes | — | Why. |
Returns: {"cancelled": True, "refunds": [{"pos_invoice", "amount"}]}.
apps/ffl_core/ffl_core/preorder.py:815
create_preorder¶
POST /api/method/ffl_core.preorder.create_preorder
Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager
Take a pre-order at the counter: a submitted Sales Order marked as one, its quantities taken
from the items' pre-order counts. No invoice and no money yet — payments go through
:func:open_payment. The customer collects here.
| arg | type | required | default | description |
|---|---|---|---|---|
payload |
str | dict | yes | — |
Returns: {"sales_order", "customer", "grand_total": what the order comes to with tax, "eta"}.
apps/ffl_core/ffl_core/preorder.py:315
list_preorders¶
POST /api/method/ffl_core.preorder.list_preorders
Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager
Pre-orders for the Pending Order page: open ones waiting for their goods (stage waiting) or
with everything here (ready_pickup), and cancelled or handed-over ones still holding money to
pay back (blocked).
| arg | type | required | default | description |
|---|---|---|---|---|
customer |
string | null | no | None |
Only this customer's. Default: everyone's. |
Returns: [{"source": "preorder", "sales_order", "customer", "customer_name", "posting_date", "grand_total", "held", "outstanding_amount", "paid", "cancelled", "handed_over", "ready", "eta", "items": [{"row", "item_code", "item_name", "qty", "serial", "reserved", "kind", "ready"}], "drafts": {"payment", "pickup", "refunds": [...]}, "stage", "blocked_reason", "age_days", "overdue"}].
apps/ffl_core/ffl_core/preorder.py:887
open_payment¶
POST /api/method/ffl_core.preorder.open_payment
Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager
A payment towards a pre-order, as a draft register invoice the register checks out (any
tender). One open payment draft per order: a second call returns the one already open.
| arg | type | required | default | description |
|---|---|---|---|---|
sales_order |
string | yes | — | The pre-order (submitted). |
amount |
number | yes | — | What the customer pays now: above 0, no more than the order's total with tax less what is already held. |
Returns: {"pos_invoice", "already": bool, "amount": the draft's payment amount, "notice": for a draft already open at another amount, the sentence that says so (shown before it opens), else None}.
apps/ffl_core/ffl_core/preorder.py:412
open_pickup¶
POST /api/method/ffl_core.preorder.open_pickup
Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager
Hand an arrived pre-order over: the draft register ticket with its goods at the order's
prices, taxed as any sale today, and what is held coming off them (:func:fit_release). The
register takes the rest and the gun's 4473; the ticket's submit hands the order over.
| arg | type | required | default | description |
|---|---|---|---|---|
sales_order |
string | yes | — | An open pre-order whose goods are all here. |
Returns: {"pos_invoice", "already": bool (the ticket was open already)}.
apps/ffl_core/ffl_core/preorder.py:709
preorder_options¶
POST /api/method/ffl_core.preorder.preorder_options
Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager
Whether Create Order may offer item_code as a pre-order line: pre-order slots left and none
on our shelves.
| arg | type | required | default | description |
|---|---|---|---|---|
item_code |
string | yes | — | The Item. |
company |
string | null | no | None |
The order's company; else the default one. |
Returns: {"available": slots left, "eta": the expected date or None, "in_stock": units on our shelves, "can_preorder": bool}.
apps/ffl_core/ffl_core/preorder.py:288
refund_preorder¶
POST /api/method/ffl_core.preorder.refund_preorder
Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager
The draft returns paying back what a pre-order still holds once it is cancelled, or handed over
for less than was paid — the open ones, or new ones for every payment not returned yet.
| arg | type | required | default | description |
|---|---|---|---|---|
sales_order |
string | yes | — | A cancelled or handed-over pre-order. |
Returns: {"refunds": [{"pos_invoice", "amount"}]}.
apps/ffl_core/ffl_core/preorder.py:847
serial_choices¶
POST /api/method/ffl_core.preorder.serial_choices
Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager
The guns a pre-order's lines could have: for each serial-numbered line, the one put by for it
and every other of the same item on our shelf that nothing holds.
| arg | type | required | default | description |
|---|---|---|---|---|
sales_order |
string | yes | — | An open pre-order. |
Returns: {"lines": [{"row", "item_code", "item_name", "serial", "choices": [serial, ...]}]}.
apps/ffl_core/ffl_core/preorder.py:633