Skip to content

ffl_core.api.cash_drawer

Source: apps/ffl_core/ffl_core/api/cash_drawer.py · 13 endpoint(s)

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

clear_paid_outside

POST /api/method/ffl_core.api.cash_drawer.clear_paid_outside

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

Take back a "paid outside the system" mark: the purchase is listed and its seller payment can be recorded again.

The mark is cleared on every receipt of the amendment line that carries it (an amendment answers to its cancelled original's mark), so clearing it on the amendment really clears it.

arg type required default description
purchase_receipt string yes — The Purchase Receipt that carries the mark, or an amendment of it.

Returns: {purchase_receipt, cleared, receipts}; receipts are the ones the mark was taken off.

apps/ffl_core/ffl_core/api/cash_drawer.py:373

close_day

POST /api/method/ffl_core.api.cash_drawer.close_day

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

Count the drawer and close the day.

Closes the open POS shifts, books any difference from the books and carries the count forward as tomorrow's opening. A company's very first count sets the books to the physical drawer (against the bank) instead of booking a difference; a later count first books any correction made since to the days before the first count (a true-up, also against the bank), since that money was never in the drawer.

arg type required default description
company string yes — Company whose drawer is counted.
counted — yes — The cash counted in the drawer, in dollars (0 is allowed).
reason string | null no None Why the drawer is over or short; required when the difference reaches the limit set in Cash Drawer Settings (it never blocks a close below it).
expected_seen — no None The expected cash the screen showed; the close is refused if the books moved since.

Returns: {close, expected, counted, variance, first_count, days_covered, covers_from, variance_je, cutoff_je, trueup_je, pos_closing_entries, pos_errors}.

apps/ffl_core/ffl_core/api/cash_drawer.py:180

get_log

POST /api/method/ffl_core.api.cash_drawer.get_log

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

Every cash movement in a date range, oldest first, with the drawer's running balance.

Sales, refunds, seller payments, deposits, cash from the bank, expenses, count differences and the first count, plus register sales not posted yet. The balance starts from the books' cash before from_date.

arg type required default description
company string | null no None Company to show; defaults to the user's company.
from_date string | null no None First posting date (YYYY-MM-DD); defaults to 6 days before to_date.
to_date string | null no None Last posting date (YYYY-MM-DD); defaults to today.

Returns: {company, from_date, to_date, opening, closing, cash_in, cash_out, lines: [{posting_date, when, kind, label, detail, by, voucher_type, voucher_no, amount, balance}]}.

apps/ffl_core/ffl_core/api/cash_drawer.py:256

get_today

POST /api/method/ffl_core.api.cash_drawer.get_today

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

Everything the Cash Drawer page shows.

What the drawer should hold now, what moved it today or since the last close (whichever is later), today's close, today's seller payments by bank, and the choices for the forms. Read only: it never creates an account or changes a default.

arg type required default description
company string | null no None Company to show; defaults to the user's company.

Returns: {company, is_manager, expected, gl_balance, pending, history, opening, last_close, closed_today, can_undo_close, first_count, open_shifts, bank_account, threshold, expense_cap, expense_accounts, cash_in, cash_out (the lines' cash in and out, both positive; count differences and the first count are neither), lines: [{kind, label, direction, voucher_type, voucher_no, amount, when, detail, entry, can_undo, can_fix, acquisition, purchase_receipt}], older_lines, older_net, other, bank_payouts: [{entry, acquisition, purchase_receipt, serial, amount, method, detail, can_fix}], unpaid_goods_receipts: [{purchase_receipt, customer, amount, method, posting_date, can_fix}] (Receive Goods purchases from private sellers received since cash tracking started with no seller payment standing: never paid, or undone; method is the last one recorded, if any), payout_methods}.

apps/ffl_core/ffl_core/api/cash_drawer.py:38

mark_paid_outside

POST /api/method/ffl_core.api.cash_drawer.mark_paid_outside

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

Mark a Receive Goods purchase as paid to its private seller outside the system (a hand journal entry, a check

booked in QuickBooks).

Books nothing. The receipt leaves the list of purchases with no seller payment, and no seller payment can be recorded for it until the mark is cleared. Refused for a receipt paid in the system.

arg type required default description
purchase_receipt string yes — The Purchase Receipt Receive Goods made for the purchase.
note string yes — How the seller was paid (the journal entry, the check number); required.

Returns: {purchase_receipt, note, by, on}.

apps/ffl_core/ffl_core/api/cash_drawer.py:354

preview_close

POST /api/method/ffl_core.api.cash_drawer.preview_close

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

What closing the day with this count would do, without recording anything.

arg type required default description
company string yes — Company whose drawer is counted.
counted — yes — The cash counted in the drawer, in dollars.

Returns: {expected, counted, variance, threshold, first_count, needs_reason}; variance is counted minus expected (negative = short).

apps/ffl_core/ffl_core/api/cash_drawer.py:164

record_deposit

POST /api/method/ffl_core.api.cash_drawer.record_deposit

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

Record cash taken to the bank: Dr Operating Bank / Cr Cash.

arg type required default description
company string yes — Company whose drawer the cash left.
amount — yes — Dollars deposited.
reference string | null no None Optional deposit slip or bank reference.

Returns: {entry, journal_entry, amount, company}.

apps/ffl_core/ffl_core/api/cash_drawer.py:204

record_expense

POST /api/method/ffl_core.api.cash_drawer.record_expense

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

Record a small expense paid in cash: Dr the expense account / Cr Cash.

Needs a memo (a receipt photo is optional), stays under the cash-expense limit and goes only to an allowed expense account.

arg type required default description
company string yes — Company whose drawer paid.
amount — yes — Dollars paid, tax included.
expense_account string yes — One of the accounts in the expense list of the page.
memo string yes — What the money was spent on.
receipt string | null no None The uploaded receipt's file URL, if any.

Returns: {entry, journal_entry, amount, company}.

apps/ffl_core/ffl_core/api/cash_drawer.py:220

record_from_bank

POST /api/method/ffl_core.api.cash_drawer.record_from_bank

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

Record cash taken out of the bank and put in the drawer: Dr Cash / Cr Operating Bank.

arg type required default description
company string yes — Company whose drawer the cash went into.
amount — yes — Dollars added to the drawer.
reference string | null no None Optional withdrawal slip or bank reference.

Returns: {entry, journal_entry, amount, company}.

apps/ffl_core/ffl_core/api/cash_drawer.py:240

record_goods_payout

POST /api/method/ffl_core.api.cash_drawer.record_goods_payout

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

Record how the private seller of a Receive Goods purchase was paid: change the method, record it again after an

undo, or record the first payment of a receipt that never had one.

Books Dr Stock Received But Not Billed / Cr Cash (or the bank) for what the receipt owes the seller, replacing the payment recorded, if any. Refused once a count was taken after that payment, for a receipt received before cash tracking started (the accountant's), for one marked as paid outside the system, when the receipt owes nothing now, and when the same goods are still paid on a cancelled receipt of this seller (a new receipt typed for goods already paid: undo that payment, or amend the cancelled receipt, instead); a refusal leaves the payment recorded as it was.

arg type required default description
purchase_receipt string yes — The Purchase Receipt Receive Goods made for the purchase.
method string yes — Cash, Zelle, Check or ACH.
reference string | null no None The check number, Zelle confirmation or ACH reference; required unless Cash.

Returns: {entry, journal_entry, amount, company, excluded}: the payment booked.

apps/ffl_core/ffl_core/api/cash_drawer.py:390

record_payout

POST /api/method/ffl_core.api.cash_drawer.record_payout

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

Change the method of a gun's own seller payment (made the old way, before a pay-now buy became a receipt paid with

it), or book one that was undone again.

Books Dr Stock Adjustment / Cr Cash (or the bank) at the net last paid. A first payment is refused: a seller is paid with the gun's receipt (record_goods_payout). Changing a recorded payment is for a System Manager.

arg type required default description
acquisition string yes — The FFL Acquisition name (a trade-in or other purchase from a private seller).
method string yes — Cash, Zelle, Check or ACH.

Returns: {entry, journal_entry, amount, company}.

apps/ffl_core/ffl_core/api/cash_drawer.py:335

undo_close

POST /api/method/ffl_core.api.cash_drawer.undo_close

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

Undo the latest count of the drawer: its difference (or first-count) entry is cancelled.

The day reads as not counted again; the POS shifts it closed stay closed.

arg type required default description
close string yes — The Cash Drawer Close name; it must be the latest close of its company.

Returns: {close, status}.

apps/ffl_core/ffl_core/api/cash_drawer.py:319

undo_entry

POST /api/method/ffl_core.api.cash_drawer.undo_entry

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

Undo a cash entry (deposit, cash from the bank, expense or seller payment): its Journal Entry is cancelled.

A seller payment for a Receive Goods receipt is undone like the others (the money is back where it came from); a trade-in ticket's payout is taken back by cancelling the ticket.

Refused once a count was taken after the entry.

arg type required default description
entry string yes — The Cash Drawer Entry name.

Returns: {entry, status}.

apps/ffl_core/ffl_core/api/cash_drawer.py:297