askrobots / dbbasic-object-server
Public
Runs live, versioned Python application objects on one VM, with a suite of apps: projects, notes, tasks, files and more.
dbbasic-package.json · 26.3 KB · 409 lines
| 1 | { |
| 2 | "id": "app-finance", |
| 3 | "name": "Finance", |
| 4 | "version": "0.24.0", |
| 5 | "description": "Double-entry accounting v1: owner-scoped CRUD on a chart of accounts (fin_accounts), journal headers (fin_journals) and their debit/credit lines (fin_journal_lines), and recurring-journal templates (fin_recurring), plus one report (trial balance, computed by object_finance.trial_balance() over posted journals only). Reconciled against a private predecessor-system audit, not part of this repo (its finance/ app: 'Currency, Entity ..., Account (COA hierarchy, 5 types), Journal (+lines; draft/posted; ...), JournalLine (debit-or-credit, ...), ... RecurringJournal (JSON template + frequency + auto_post)'). Journal totals (total_debits_cents/total_credits_cents/is_balanced) are COMPUTED PROPERTIES via object_finance.journal_totals(), never stamped onto a record and never enforced -- posting a journal (draft->posted, owner-gated) is a bare status flip with no balance check, matching the source's own documented weak spot exactly (reconciled against a private predecessor-system audit, not part of this repo: 'posting is a bare status flip -- balance NOT enforced at post'). There is no totals-stamping HANDLES handler in this package, unlike app-invoices' invoice_totals or app-orders' order_totals -- that absence is deliberate, not an oversight; see object_finance.py's module docstring. Deferred to a later slice, per the reconciled predecessor finance model (private source audit, not part of this repo): balance ENFORCEMENT at post (a transition guard checking is_balanced -- a real improvement over the source, tracked here, not built in this migration); auto-posting journal entries from other collections (stock moves, invoices, orders, depreciation) -- no such collection currently writes a fin_journals/fin_journal_lines row, matching the source's own gap ('journal FKs from stock/invoice/depreciation stay null -- no auto-posting integration'); the recurring-journal daemon materialization job (fin_recurring's fields are carried, the scheduled pass that reads them and creates real journals is not); profit & loss, balance sheet, and cash flow reports (same fold shape as trial_balance, addable later -- trial_balance is the only report v1 ships); statement-line bank-import reconciliation; closed/locked accounting periods; multi-currency FX (the source's JournalLine carried exchange_rate/base_amount for a line's currency to differ from its journal's; this package's lines carry only debit_cents/credit_cents in the journal's own currency -- no exchange_rate field exists here, so this is a dropped field, not a carried-but-unused one, and multi-currency journals are out of scope for v1). Chart-of-accounts entity-mode seeding (the source's Entity model auto-seeds a starter chart of accounts per books-mode) is also not built -- fin_accounts rows are created by hand like every other collection's header-only seed. Account and trial-balance detail permalinks (/accounts/{id}, /trial-balance) still need site_routes records -- not seeded by this package, same precedent as app-invoices' /invoices/{invoice_id:uuid} and app-catalog's /products/{product_id:uuid}. The journal permalink /journals/{journal_id:uuid} is now a seeded 59 detail view (site_view_render): a composed page of three generic block renderers -- an editable+deletable `detail` block (fin_journals; the draft->posted transition is now an edit to the status field in the owner's edit form, not a one-click Post button -- same make-it-basic trade as app-forum's pin/lock, guarded the same way by schemas/fin_journals.json's status transitions), a `related` block (fin_journal_lines by journal_id, RELATIONAL -- an append-only event-log of ledger postings, not embedded, per the attachability criterion), and a `form` block with fixed:{journal_id:$record_id} (Add Posting, FK locked to the page's journal). Debit/credit *_cents render through /form's built-in cents formatting on the related list, same as every other *_cents field in this codebase -- no custom code. Dropped, not carried forward: the bespoke page's live-computed total-debits/total-credits/is-balanced summary strip (object_finance.journal_totals(), folded client-side over the fetched lines) has no generic block equivalent and is not rebuilt here; a balance summary would need its own report-style block (same category as trial_balance), tracked as future work, not this migration. entity_id (65 multi-entity, already on fin_journals/fin_journal_lines) needs no special handling in the composed view -- it renders as an ordinary relation field in the generic detail/edit form. object_finance.py (journal_totals/trial_balance) lives at the repository root alongside object_records.py -- a plain importable library, not a registered object in this manifest, the same way object_records.py itself is never a package object. 0.4.0 adds `denominations`: what a unit of value is and how finely it divides. Amounts are stored as an integer count of the smallest unit and the denomination says where the decimal point goes (object_money.py) -- the generalization of this codebase's founding 'money is integer cents' rule, since cents were always USD minor units. It exists now, before more money code lands, because retrofitting a scale onto stored amounts across a dozen collections is a migration nobody wants; see plan/value-accounts-and-denominations-spec.md for the value-account layer (custody, verification, assurance) it is the foundation for. Seeded with the common fiat/crypto/stablecoin/metal units including JPY (scale 0, no minor unit) and ETH (scale 18); operators add their own -- a gift-card program, a loyalty point -- as ordinary rows. 0.5.0 adds `rates`: what one denomination was worth in another, at a moment, according to a named source -- append-only, because a rate is a historical observation, not a settable value. Rates exist to supply the number a transaction STAMPS on itself when it happens and to revalue balances at a period end; they are not a tick database. `kind` (spot/close/average/historical) is carried because accounting standards use different rates for different purposes and a system offering one number picks the wrong one somewhere. Lookups never use a rate dated after the moment being valued -- valuing yesterday with today's price silently restates history. 0.6.0 adds the two statements this package's own docstring had listed as deferred since v1: profit_and_loss() and balance_sheet(), the same posted-only owner-scoped fold shape as trial_balance() re-bucketed by each account type's sign convention, rendered at /statements. The balance sheet only balances once the period's net income is included in equity, so it is added as a DERIVED 'Current period earnings' line rather than a stored account -- a real year-end close would move it to retained earnings, which is what fin_journals' reserved kind=closing is for. And when the sheet does NOT balance the page says so in red with the exact signed difference, because an unbalanced balance sheet means the ledger is broken and rendering it as though it were fine is the single most useless thing a statement can do. 0.7.0 deletes the bespoke /accounts and /journals list page objects: both were ~80-85 lines of chrome around two generator calls with no business logic of their own (the same shape the journal permalink's bespoke page was in before its own Stage-6 retrofit), and are now seeded VIEW records over the same `list` block /notes uses. 0.7.0 adds closed periods (fin_closed_periods): from start through end inclusive, settled books stay settled -- no journal may be created dated inside a closed period, none dated inside may be edited, none may be moved in or out by changing its date, and (hook_fin_journal_lines) no line on such a journal may be added or changed, because the amounts live in the lines. This is the control the predecessor modeled (ClosedPeriod/period_locked) and small-business books usually skip, which is how filed statements and live books drift apart with nobody deciding they should. Reopening is deleting the period row -- deliberate, and attributed in the change log. Deliberately not yet: year-end closing ENTRIES (kind=closing is reserved for a real year-end), and composer awareness -- machine composers bypass hooks by design, and a late bank-line resolution dated into a closed period should surface to the operator rather than be silently blocked or shifted; that case earns its design when it first actually happens. Declares an attention count (collection + where, counted per viewer) for expenses at `submitted`: claimed, not yet decided, and until somebody looks the books do not have it and the claimant is out of pocket -- a queue people usually find out about through a complaint rather than a screen. The detail is the total, because approving four coffees and approving a laptop are the same row count. 0.11.0 seeds the expenses index this package had been counting without ever drawing. The attention provider added in 0.10.0 pointed at /expenses?status=submitted; `expenses` had a schema, a hook, a books poster and a queue on the home page, and no route anywhere served /expenses at all, which made the count a number on a poster. It is now a `views` record over the generic `list` block plus a site_routes row to site_view_render, exactly like /accounts and /journals became in 0.7.0, and a Money nav entry beside them. The count's path drops its query string because the generic list takes no filter preselection from the URL -- the schema's views.filter_fields already puts `status` in the filter bar, and an index that shows every expense with the filter one click away is honest, where a URL that claims to filter and does not is not. Rows do not link: /expenses/{id} is not seeded in this slice. fin_journals declare capabilities.comments + attachments, which is the most valuable of the set: 'what is this journal FOR' is the commonest question a set of books has to answer, and until now the answer lived in somebody's memory. Supporting documentation attaches to the entry it supports, and the reasoning sits beside it -- neither mutates the posted journal, because both are separate rows pointing at it. 0.13.0: expenses gain generated_from (read_only, unique), the claim that makes one confirmed scan one expense however many times confirmation is retried or double-clicked; and action_reverse_journal faces the period lock -- a reversal dated inside a closed period (by default the original's date) is refused with the period named, and an optional date puts the mirror in an open period instead. 0.16.0: hook_fin_journals refuses a generated_from set, changed or cleared by anybody who is not an admin. The marker is how every composer knows a fact is already booked, and any signed-in user could plant one (payments/<id>) on a draft of their own and stop that payment, reversal or count variance from ever being booked, whoever owned it. 0.18.0 builds the composer awareness 0.7.0 deferred, because the case happened: after November was closed, an expense incurred on the 15th and approved later, and a payment received on the 29th and recorded later, each posted a journal into November, since every composer writes below the HTTP hook that held the period lock. The lock is now a locked check on fin_journals and fin_journal_lines (closed_period, on the fin_periods lock), inside the write lock for every writer, so nothing writes into a closed period. A composer whose natural date is closed books on the first open day after it, keeps the real date in fin_journals.occurred_on, says so in the description, and sets period_review=pending, which the journals_after_close attention count shows until somebody marks it reviewed. Reversing a journal by hand still refuses a closed date and asks for one; a materialize generation dated in a closed period is refused and reported in its pass. 0.18.1: a row a registered user writes could point at anybody's record, because the rules asked only that the new row be the writer's own. Every pointer a non-admin can write now declares relation.requires (expenses.project_id read, expenses.account_id update, expenses.invoice_id update, expenses.entity_id update, fin_accounts.parent_id update, fin_accounts.entity_id update, fin_closed_periods.closing_journal_id update, fin_closed_periods.entity_id update, fin_journal_lines.journal_id update, fin_journal_lines.account_id update, fin_journal_lines.entity_id update, fin_journals.entity_id update, fin_recurring.entity_id update), so over the API a row points only at a record its writer may see, or, where it moves money, stock or state of what it points at, may update; a record they may not see is answered like a missing one (docs/permissions-model.md, 'Pointing at a record you may not act on'). 0.19.0: expenses that hold up in an audit (docs/expense-substantiation.md). An expense_categories collection holds what each kind of spending needs -- a business purpose, attendees, a receipt over an amount -- and its deductible share in basis points, all operator data with the source in notes; a starter set is seeded (client meals 50% with purpose and attendees, travel, office supplies, entertainment 0%, mileage). Expenses gain category_id, business_purpose, attendees, location and receipt_scan_id (a relation to the scanned receipt; receipt_ref stays readable). The hook stamps the category's requirements and deductible share onto the expense, required_when makes them binding while submitted, approved or billed, and the LOCKED_CHECK category_stamps refuses a stamp that disagrees with the category for every writer. action_expense_report folds deductible, non-deductible and unclassified totals per period and category from the stamps, with the gaps an auditor would find. Attention: drafts missing a required receipt or purpose, and claims still open past the accountable-plan window (expenses.accountable_plan_days, default 60). Not tax advice. Rows written before 0.19.0 have no category and are unaffected; categorise them by hand if the report should classify them. 0.20.0: a mileage log. vehicles (whose: personal or business), mileage_logs (the vehicle, the day, odometer readings or miles, from, to and the business purpose, all required) and mileage_rates (one row per year, the rate in hundredths of a cent per mile with its source -- nothing seeded, nothing in code). hook_mileage_logs fills the miles from the readings, refuses self-approval and stamps the year's rate and the reimbursement at approval; its LOCKED_CHECK mileage_rules refuses, for every writer, an end reading at or below the start, miles that disagree with the readings, a range that overlaps another live trip in the same vehicle, a year with no rate and an approval stamped with anything but that year's rate. system_mileage_expenses turns an approved trip in a personal vehicle into one approved, personally-paid expense in the mileage category (generated_from mileage_logs/{id}, unique), and rejects it when the trip is rejected; its journal posts through the change-log replay. A business vehicle's trips are evidence and reimburse nothing. 0.21.0: a fringe-benefit register (fringe_benefits: employee, benefit, period, value in cents, taxable yes/no with no default, valuation method and source) for role:finance and admins only, and action_fringe_export, the register as CSV or JSON for a payroll provider. It calculates no payroll and no value. hook_fringe_benefits' LOCKED_CHECK refuses a period that ends before it starts, for every writer. 0.22.0: the books are kept by role:finance (the bookkeeper) and role:owner (decision 5, 2026-11-30). The chart of accounts, journals, journal lines, recurring templates and closed periods were every signed-in user's own rows; those registered grants are retracted, the owner fallback is off for them (a composed journal's row owner is often the customer whose payment it books), and action_reverse_journal, the trial balance and the statements serve the whole books to a bookkeeper or owner. 0.23.0: scrap and vendor rebates are contra-COGS; a barter is a sale and a purchase at fair value, taxable, via a clearing account (decision 6, 2026-11-30). action_record_contra_cogs credits inventory.journal.scrap_sales_account or inventory.journal.vendor_rebates_account; action_record_barter books the sale (with its sales tax) and the purchase through barter.journal.clearing_account. Both are the books' keepers', idempotent by reference, and refuse with the setting to set when an account is unmapped. The double-entry chart gains Barter Clearing 1290, Scrap Sales (contra-COGS) 5010 and Vendor Rebates (contra-COGS) 5020. 0.24.0: the double-entry chart gains Interest Income 4910, Bank Fees 5840 and Deferred Revenue 2350, and account setup maps the app_settings keys its accounts answer -- reconcile.journal.interest_account and fees_account, payments.journal.tax_account and deferred_revenue_account, barter.journal.clearing_account and the contra-COGS pair -- only where a key is unset (decision 7, 2026-11-30). A fresh double-entry box read Books NOT READY for banking with no account to point interest at.", |
| 6 | "compatibility": { |
| 7 | "dbbasic_object_server": ">=0.1.0" |
| 8 | }, |
| 9 | "dependencies": [ |
| 10 | "app-entities", |
| 11 | "app-views" |
| 12 | ], |
| 13 | "objects": [ |
| 14 | { |
| 15 | "id": "action_record_barter", |
| 16 | "path": "objects/action/record_barter.py" |
| 17 | }, |
| 18 | { |
| 19 | "id": "action_record_contra_cogs", |
| 20 | "path": "objects/action/record_contra_cogs.py" |
| 21 | }, |
| 22 | { |
| 23 | "id": "site_trial_balance", |
| 24 | "path": "objects/site/trial_balance.py" |
| 25 | }, |
| 26 | { |
| 27 | "id": "site_setup_accounts", |
| 28 | "path": "objects/site/setup_accounts.py" |
| 29 | }, |
| 30 | { |
| 31 | "id": "hook_fin_journals", |
| 32 | "path": "objects/hook/fin_journals.py" |
| 33 | }, |
| 34 | { |
| 35 | "id": "action_reverse_journal", |
| 36 | "path": "objects/action/reverse_journal.py" |
| 37 | }, |
| 38 | { |
| 39 | "id": "system_fin_recurring_runner", |
| 40 | "path": "objects/system/fin_recurring_runner.py" |
| 41 | }, |
| 42 | { |
| 43 | "id": "site_statements", |
| 44 | "path": "objects/site/statements.py" |
| 45 | }, |
| 46 | { |
| 47 | "id": "hook_fin_journal_lines", |
| 48 | "path": "objects/hook/fin_journal_lines.py" |
| 49 | }, |
| 50 | { |
| 51 | "id": "hook_expenses", |
| 52 | "path": "objects/hook/expenses.py" |
| 53 | }, |
| 54 | { |
| 55 | "id": "system_expense_books", |
| 56 | "path": "objects/system/expense_books.py" |
| 57 | }, |
| 58 | { |
| 59 | "id": "action_expense_report", |
| 60 | "path": "objects/action/expense_report.py" |
| 61 | }, |
| 62 | { |
| 63 | "id": "hook_mileage_logs", |
| 64 | "path": "objects/hook/mileage_logs.py" |
| 65 | }, |
| 66 | { |
| 67 | "id": "system_mileage_expenses", |
| 68 | "path": "objects/system/mileage_expenses.py" |
| 69 | }, |
| 70 | { |
| 71 | "id": "hook_fringe_benefits", |
| 72 | "path": "objects/hook/fringe_benefits.py" |
| 73 | }, |
| 74 | { |
| 75 | "id": "action_fringe_export", |
| 76 | "path": "objects/action/fringe_export.py" |
| 77 | } |
| 78 | ], |
| 79 | "schemas": [ |
| 80 | { |
| 81 | "collection": "denominations", |
| 82 | "path": "schemas/denominations.json" |
| 83 | }, |
| 84 | { |
| 85 | "collection": "rates", |
| 86 | "path": "schemas/rates.json" |
| 87 | }, |
| 88 | { |
| 89 | "collection": "fin_accounts", |
| 90 | "path": "schemas/fin_accounts.json" |
| 91 | }, |
| 92 | { |
| 93 | "collection": "fin_journals", |
| 94 | "path": "schemas/fin_journals.json" |
| 95 | }, |
| 96 | { |
| 97 | "collection": "fin_journal_lines", |
| 98 | "path": "schemas/fin_journal_lines.json" |
| 99 | }, |
| 100 | { |
| 101 | "collection": "fin_recurring", |
| 102 | "path": "schemas/fin_recurring.json" |
| 103 | }, |
| 104 | { |
| 105 | "collection": "fin_closed_periods", |
| 106 | "path": "schemas/fin_closed_periods.json" |
| 107 | }, |
| 108 | { |
| 109 | "collection": "expense_categories", |
| 110 | "path": "schemas/expense_categories.json" |
| 111 | }, |
| 112 | { |
| 113 | "collection": "expenses", |
| 114 | "path": "schemas/expenses.json" |
| 115 | }, |
| 116 | { |
| 117 | "collection": "vehicles", |
| 118 | "path": "schemas/vehicles.json" |
| 119 | }, |
| 120 | { |
| 121 | "collection": "mileage_rates", |
| 122 | "path": "schemas/mileage_rates.json" |
| 123 | }, |
| 124 | { |
| 125 | "collection": "mileage_logs", |
| 126 | "path": "schemas/mileage_logs.json" |
| 127 | }, |
| 128 | { |
| 129 | "collection": "fringe_benefits", |
| 130 | "path": "schemas/fringe_benefits.json" |
| 131 | } |
| 132 | ], |
| 133 | "permissions": [ |
| 134 | { |
| 135 | "path": "permissions/rules.json" |
| 136 | } |
| 137 | ], |
| 138 | "seed": [ |
| 139 | { |
| 140 | "collection": "denominations", |
| 141 | "path": "seed/denominations.tsv" |
| 142 | }, |
| 143 | { |
| 144 | "collection": "rates", |
| 145 | "path": "seed/rates.tsv" |
| 146 | }, |
| 147 | { |
| 148 | "collection": "fin_accounts", |
| 149 | "path": "seed/fin_accounts.tsv" |
| 150 | }, |
| 151 | { |
| 152 | "collection": "fin_journals", |
| 153 | "path": "seed/fin_journals.tsv" |
| 154 | }, |
| 155 | { |
| 156 | "collection": "fin_journal_lines", |
| 157 | "path": "seed/fin_journal_lines.tsv" |
| 158 | }, |
| 159 | { |
| 160 | "collection": "fin_recurring", |
| 161 | "path": "seed/fin_recurring.tsv" |
| 162 | }, |
| 163 | { |
| 164 | "collection": "views", |
| 165 | "path": "seed/views.tsv" |
| 166 | }, |
| 167 | { |
| 168 | "collection": "site_routes", |
| 169 | "path": "seed/site_routes.tsv" |
| 170 | }, |
| 171 | { |
| 172 | "collection": "fin_closed_periods", |
| 173 | "path": "seed/fin_closed_periods.tsv" |
| 174 | }, |
| 175 | { |
| 176 | "collection": "expense_categories", |
| 177 | "path": "seed/expense_categories.tsv" |
| 178 | }, |
| 179 | { |
| 180 | "collection": "expenses", |
| 181 | "path": "seed/expenses.tsv" |
| 182 | }, |
| 183 | { |
| 184 | "collection": "vehicles", |
| 185 | "path": "seed/vehicles.tsv" |
| 186 | }, |
| 187 | { |
| 188 | "collection": "mileage_rates", |
| 189 | "path": "seed/mileage_rates.tsv" |
| 190 | }, |
| 191 | { |
| 192 | "collection": "mileage_logs", |
| 193 | "path": "seed/mileage_logs.tsv" |
| 194 | }, |
| 195 | { |
| 196 | "collection": "fringe_benefits", |
| 197 | "path": "seed/fringe_benefits.tsv" |
| 198 | } |
| 199 | ], |
| 200 | "migrations": [], |
| 201 | "schedules": [ |
| 202 | { |
| 203 | "id": "fin_recurring_daily", |
| 204 | "object_id": "system_fin_recurring_runner", |
| 205 | "schedule": "25 6 * * *", |
| 206 | "description": "Post recurring journals that come due." |
| 207 | } |
| 208 | ], |
| 209 | "nav": [ |
| 210 | { |
| 211 | "id": "accounts", |
| 212 | "label": "Accounts", |
| 213 | "path": "/accounts", |
| 214 | "blurb": "The chart of accounts the books are kept in", |
| 215 | "surface": "member", |
| 216 | "group": "Money", |
| 217 | "order": 320 |
| 218 | }, |
| 219 | { |
| 220 | "id": "journals", |
| 221 | "label": "Journals", |
| 222 | "path": "/journals", |
| 223 | "blurb": "Double-entry journals and the lines that must balance", |
| 224 | "surface": "member", |
| 225 | "group": "Money", |
| 226 | "order": 330 |
| 227 | }, |
| 228 | { |
| 229 | "id": "trial_balance", |
| 230 | "label": "Trial Balance", |
| 231 | "path": "/trial-balance", |
| 232 | "blurb": "Every account's debit and credit totals, folded from posted journals", |
| 233 | "surface": "member", |
| 234 | "group": "Money", |
| 235 | "order": 340 |
| 236 | }, |
| 237 | { |
| 238 | "id": "statements", |
| 239 | "label": "Statements", |
| 240 | "path": "/statements", |
| 241 | "blurb": "Profit and loss and the balance sheet, over posted journals", |
| 242 | "surface": "member", |
| 243 | "group": "Money", |
| 244 | "order": 350 |
| 245 | }, |
| 246 | { |
| 247 | "id": "expenses", |
| 248 | "label": "Expenses", |
| 249 | "path": "/expenses", |
| 250 | "blurb": "Money people spent on the business, and what is waiting on approval", |
| 251 | "surface": "member", |
| 252 | "group": "Money", |
| 253 | "order": 315 |
| 254 | }, |
| 255 | { |
| 256 | "id": "expense_categories", |
| 257 | "label": "Expense Categories", |
| 258 | "path": "/expense-categories", |
| 259 | "blurb": "What each kind of spending needs before it is approved, and how much of it is deductible", |
| 260 | "surface": "member", |
| 261 | "group": "Money", |
| 262 | "order": 316 |
| 263 | }, |
| 264 | { |
| 265 | "id": "mileage", |
| 266 | "label": "Mileage", |
| 267 | "path": "/mileage", |
| 268 | "blurb": "Business trips, the miles they covered and what is owed for them", |
| 269 | "surface": "member", |
| 270 | "group": "Money", |
| 271 | "order": 317 |
| 272 | }, |
| 273 | { |
| 274 | "id": "fringe_benefits", |
| 275 | "label": "Fringe Benefits", |
| 276 | "path": "/fringe-benefits", |
| 277 | "blurb": "Non-cash benefits given to employees, for the payroll provider", |
| 278 | "surface": "member", |
| 279 | "group": "Money", |
| 280 | "order": 318 |
| 281 | } |
| 282 | ], |
| 283 | "attention": [ |
| 284 | { |
| 285 | "id": "expenses_to_approve", |
| 286 | "collection": "expenses", |
| 287 | "where": { |
| 288 | "status": "submitted" |
| 289 | }, |
| 290 | "detail": { |
| 291 | "op": "sum", |
| 292 | "field": "amount_cents", |
| 293 | "format": "cents", |
| 294 | "text": "{value} awaiting approval" |
| 295 | }, |
| 296 | "label": "Expenses to approve", |
| 297 | "path": "/expenses", |
| 298 | "group": "Money", |
| 299 | "severity": "normal", |
| 300 | "nav_id": "expenses" |
| 301 | }, |
| 302 | { |
| 303 | "id": "journals_after_close", |
| 304 | "collection": "fin_journals", |
| 305 | "where": { |
| 306 | "period_review": "pending" |
| 307 | }, |
| 308 | "detail": { |
| 309 | "op": "count", |
| 310 | "text": "booked in the next open period because their own was closed" |
| 311 | }, |
| 312 | "label": "Journals booked after their period closed", |
| 313 | "path": "/journals", |
| 314 | "group": "Money", |
| 315 | "severity": "warning", |
| 316 | "nav_id": "journals" |
| 317 | }, |
| 318 | { |
| 319 | "id": "expenses_missing_receipt", |
| 320 | "collection": "expenses", |
| 321 | "where": { |
| 322 | "status": "draft", |
| 323 | "receipt_required": "true", |
| 324 | "receipt_scan_id": "" |
| 325 | }, |
| 326 | "detail": { |
| 327 | "op": "sum", |
| 328 | "field": "amount_cents", |
| 329 | "format": "cents", |
| 330 | "text": "{value} that cannot be submitted until the receipt is attached" |
| 331 | }, |
| 332 | "label": "Expenses missing a receipt", |
| 333 | "path": "/expenses", |
| 334 | "group": "Money", |
| 335 | "severity": "normal" |
| 336 | }, |
| 337 | { |
| 338 | "id": "expenses_missing_purpose", |
| 339 | "collection": "expenses", |
| 340 | "where": { |
| 341 | "status": "draft", |
| 342 | "purpose_required": "true", |
| 343 | "business_purpose": "" |
| 344 | }, |
| 345 | "detail": { |
| 346 | "op": "count", |
| 347 | "text": "say what business each was for before submitting" |
| 348 | }, |
| 349 | "label": "Expenses missing a business purpose", |
| 350 | "path": "/expenses", |
| 351 | "group": "Money", |
| 352 | "severity": "normal" |
| 353 | }, |
| 354 | { |
| 355 | "id": "expenses_past_accountable_window", |
| 356 | "collection": "expenses", |
| 357 | "where": { |
| 358 | "status": { |
| 359 | "op": "in", |
| 360 | "value": [ |
| 361 | "draft", |
| 362 | "submitted" |
| 363 | ] |
| 364 | }, |
| 365 | "incurred_on": { |
| 366 | "op": "older_than_days", |
| 367 | "value": { |
| 368 | "setting": "expenses.accountable_plan_days", |
| 369 | "default": 60 |
| 370 | } |
| 371 | } |
| 372 | }, |
| 373 | "detail": [ |
| 374 | { |
| 375 | "op": "sum", |
| 376 | "field": "amount_cents", |
| 377 | "format": "cents", |
| 378 | "text": "{value} spent and still not approved (check with your accountant)" |
| 379 | }, |
| 380 | { |
| 381 | "op": "max_age_days", |
| 382 | "field": "incurred_on", |
| 383 | "text": "oldest {value} days" |
| 384 | } |
| 385 | ], |
| 386 | "label": "Expense claims past the accountable-plan window", |
| 387 | "path": "/expenses", |
| 388 | "group": "Money", |
| 389 | "severity": "warning" |
| 390 | }, |
| 391 | { |
| 392 | "id": "mileage_to_approve", |
| 393 | "collection": "mileage_logs", |
| 394 | "where": { |
| 395 | "status": "submitted" |
| 396 | }, |
| 397 | "detail": { |
| 398 | "op": "sum", |
| 399 | "field": "miles", |
| 400 | "text": "{value} miles awaiting approval" |
| 401 | }, |
| 402 | "label": "Mileage to approve", |
| 403 | "path": "/mileage", |
| 404 | "group": "Money", |
| 405 | "severity": "normal", |
| 406 | "nav_id": "mileage" |
| 407 | } |
| 408 | ] |
| 409 | } |