ffl_core.gunsmith¶
Source: apps/ffl_core/ffl_core/gunsmith.py · 15 endpoint(s)
Generated by
make api-docs— do not edit by hand.
cancel_work_order¶
POST /api/method/ffl_core.gunsmith.cancel_work_order
Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager
Close a job that will not be done. A gun in the bound book still goes back through
pick-up (its disposition), so a logged job is not cancelled: clear its charges and
pick it up instead. A deposit held is refunded afterwards (:func:refund_deposit).
| arg | type | required | default | description |
|---|---|---|---|---|
name |
string | yes | — | Gunsmith Work Order name; not Picked Up or Cancelled. |
reason |
string | yes | — | Why. |
Returns: {"status", "deposit_held"}.
apps/ffl_core/ffl_core/gunsmith.py:471
charge_details¶
POST /api/method/ffl_core.gunsmith.charge_details
Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager
A part picked or scanned onto a job's charges: its name and its list price for the
customer, as Create Order prices a line (price_approval.list_rate). The counter
can't read Item Price itself.
| arg | type | required | default | description |
|---|---|---|---|---|
item_code |
string | yes | — | The Item charged. |
customer |
string | null | no | None |
The job's customer, whose price list applies; else the default selling list. |
Returns: {"item_name", "rate": the list price, 0 when there is none}.
apps/ffl_core/ffl_core/gunsmith.py:302
complete_work¶
POST /api/method/ffl_core.gunsmith.complete_work
Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager
The register's Complete: the clerk confirms what was done and what it costs; the
job keeps them, is Ready, and is handed back as :func:open_pickup does — at once
with nothing to bill and nothing held, else through the draft pick-up invoice the
register loads into its cart.
| arg | type | required | default | description |
|---|---|---|---|---|
name |
string | yes | — | Gunsmith Work Order name; Received, In Progress or Ready, with no pick-up invoice open. |
work_performed |
string | yes | — | What was done. |
lines |
str | list | no | None |
Returns: As :func:open_pickup: {"pos_invoice", "already": False} or {"picked_up": True, "refund_due"}.
apps/ffl_core/ffl_core/gunsmith.py:330
create_work_order¶
POST /api/method/ffl_core.gunsmith.create_work_order
Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager
Take a gun in at the register (its Work Order button): the job, logged in the
bound book now when asked, and the payment line for what the customer pays now.
| arg | type | required | default | description |
|---|---|---|---|---|
payload |
str | dict | yes | — |
Returns: {"name", "customer", "customer_name", "status", "purchase_receipt", "authorization_template": the intake authorization the register asks the customer to sign next, or None, "deposit_line": the locked GUNSMITH-DEPOSIT row for pay_now (as :func:deposit_line), or None}.
apps/ffl_core/ffl_core/gunsmith.py:143
deposit_line¶
POST /api/method/ffl_core.gunsmith.deposit_line
Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager
A payment towards an open job (Recent Orders › Take payment): the locked
GUNSMITH-DEPOSIT row for the register's cart. Booked when that sale is paid.
| arg | type | required | default | description |
|---|---|---|---|---|
name |
string | yes | — | Gunsmith Work Order name; Received, In Progress or Ready. |
amount |
number | yes | — | What the customer pays now, above 0. |
Returns: {"customer", "deposit_line": {"item_code", "qty", "rate", "ffl_locked_rate", "income_account", "ffl_work_order", "description", …}}.
apps/ffl_core/ffl_core/gunsmith.py:175
get_state¶
POST /api/method/ffl_core.gunsmith.get_state
Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager
What the work order form shows and offers.
| arg | type | required | default | description |
|---|---|---|---|---|
name |
string | yes | — | Gunsmith Work Order name. |
Returns: {"labor_item", "deposit_held", "charges", "authorization": {"template", "state", "agreement"} or None, "drafts": {"deposit", "pickup", "refund"}}.
apps/ffl_core/ffl_core/gunsmith.py:108
labor_item¶
POST /api/method/ffl_core.gunsmith.labor_item
Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager
The labor item a new job's first charge line uses (FFL Settings › Gunsmithing,
which the counter can't read itself).
Returns: The Item name.
apps/ffl_core/ffl_core/gunsmith.py:290
log_in_bound_book¶
POST /api/method/ffl_core.gunsmith.log_in_bound_book
Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager
Log a job's gun in the bound book now (a job created unlogged, or one whose
first attempt failed).
| arg | type | required | default | description |
|---|---|---|---|---|
name |
string | yes | — | Gunsmith Work Order name; not Picked Up or Cancelled. |
id_type |
string | null | no | None |
The customer's ID type, when not on the job yet. |
id_number |
string | null | no | None |
The customer's ID number, when not on the job yet. |
Returns: {"purchase_receipt", "serial_no", "item_code"}.
apps/ffl_core/ffl_core/gunsmith.py:506
mark_ready¶
POST /api/method/ffl_core.gunsmith.mark_ready
Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager
Received / In Progress → Ready: the work is done and recorded.
| arg | type | required | default | description |
|---|---|---|---|---|
name |
string | yes | — | Gunsmith Work Order name; needs Work Performed. |
Returns: {"status", "completed_on"}.
apps/ffl_core/ffl_core/gunsmith.py:408
notify_customer¶
POST /api/method/ffl_core.gunsmith.notify_customer
Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager
Tell the customer the gun is ready, and record who told them, how and when.
Email sends the store's "Gunsmith Work Ready" email now (the customer needs an email address). Phone and Text are made by staff; this records them.
| arg | type | required | default | description |
|---|---|---|---|---|
name |
string | yes | — | Gunsmith Work Order name; must be Ready. |
via |
string | yes | — | Phone, Email or Text. |
Returns: {"notified_via", "notified_on", "email": address the email went to, or None}.
apps/ffl_core/ffl_core/gunsmith.py:430
open_deposit¶
POST /api/method/ffl_core.gunsmith.open_deposit
Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager
A payment towards an open job parked as its own draft register invoice — what an
agent opens instead of the register cart's :func:deposit_line. One open deposit
draft per job: a second call returns the one already open, at its own amount.
| arg | type | required | default | description |
|---|---|---|---|---|
name |
string | yes | — | Gunsmith Work Order name; Received, In Progress or Ready. |
amount |
number | yes | — | What the customer pays now, above 0. |
Returns: {"pos_invoice", "already": bool, "amount": the draft's deposit amount}.
apps/ffl_core/ffl_core/gunsmith.py:199
open_pickup¶
POST /api/method/ffl_core.gunsmith.open_pickup
Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager
Hand the gun back. With nothing to charge and no deposit held, the job is
picked up now; otherwise this opens (or returns) the draft register invoice with the charges and the deposit held coming off them, and its submit picks the job up.
| arg | type | required | default | description |
|---|---|---|---|---|
name |
string | yes | — | Gunsmith Work Order name; must be Ready. |
Returns: {"pos_invoice", "already": bool} or {"picked_up": True, "refund_due": deposit still held, refunded with :func:refund_deposit}.
apps/ffl_core/ffl_core/gunsmith.py:623
refund_deposit¶
POST /api/method/ffl_core.gunsmith.refund_deposit
Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager
Open (or return) the draft register return that pays back the deposit still held
— a cancelled job's, or what a smaller bill left over. A return goes against one payment and refunds at most that payment, newest first; with several payments held the rest is refunded with the next return.
| arg | type | required | default | description |
|---|---|---|---|---|
name |
string | yes | — | Gunsmith Work Order name; Cancelled or Picked Up, with deposit held. |
Returns: {"pos_invoice", "already": bool, "amount": what this return pays back}.
apps/ffl_core/ffl_core/gunsmith.py:690
register_work_orders¶
POST /api/method/ffl_core.gunsmith.register_work_orders
Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager
The open jobs for the register's Recent Orders › Work Orders list, with what its
Take payment and Complete actions need.
| arg | type | required | default | description |
|---|---|---|---|---|
search_term |
string | null | no | None |
Part of the job's name, customer, gun or serial; optional. |
name |
string | null | no | None |
One job only (the Desk form sending the clerk to the register); optional. |
Returns: {"labor_item", "orders": [{"name", "customer", "customer_name", "status", "manufacturer", "model", "caliber", "serial_number", "work_requested", "work_performed", "estimated_cost", "deposit_held", "logged", "lines": [{"item_code", "description", "qty", "rate"}], "drafts": {"deposit", "pickup", "refund"}, "authorization": the intake authorization's state (signed / pending / missing …) for an open job, else None}], "authorization_template"}: open jobs (Ready first), then closed ones still holding a payment to refund.
apps/ffl_core/ffl_core/gunsmith.py:232
start_work¶
POST /api/method/ffl_core.gunsmith.start_work
Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager
Received (or Ready, reopened) → In Progress.
| arg | type | required | default | description |
|---|---|---|---|---|
name |
string | yes | — | Gunsmith Work Order name. |
Returns: {"status"}.
apps/ffl_core/ffl_core/gunsmith.py:386