Brevat
BuiltRendered from 46b-brevat.md in the public repository. Edits belong there.
Brevat keeps an instance's products, stock, supply purchases, sales and standing offers as datum documents.
| Package | brevat, version 1.3.0 |
| Kind | App. Hub tool brevat |
| For | An instance that sells goods |
| Own sandbox | Yes, anchored from the farm template, whose numbering carries the price and currency vocabulary the ledgers write |
| Ports | Employs commerce_offering. No extension in the catalogue fills it |
| Preview | Demo |
What it turns on
Installing exposes six tools. The hub is drawn on a sandbox that holds at least one of farm_profile, invoices, sales or offering, and shows one tab per ledger:
| Tab | Tool | Document | Declared write |
|---|---|---|---|
| Overview (default) | brevat | None of its own | None; it summarizes the other tabs from the same row builders |
| Products | product_catalog | product_profiles (offering_record) | add_product |
| Stock | stock_log | stock_log (stock_entry) | record_stock |
| Supply | supply_ledger | invoices (invoice) | add_supply |
| Sales | sales_ledger | sales (invoice) | add_sale |
| Offering | offer_ledger | offering (offer) | set_offer |
Installing provisions the five documents and the app sandbox. The sandbox also receives a plantings document (archetype planting), which the planting map's add_planting writes. Supply and sales use the same invoice archetype; the document a row is in records its direction.
Stock rules
The instance has one stock_log document. Each row is stock_entry = lcl_id (product), lcl_id (kind), nominal (count), msn_id (party), utc, title (optional). The count has no unit; the unit is the product profile's nominal.
The kind sets the direction: supply, return and adjustment_up add; output, spoilage and adjustment_down subtract. The on-hand figure is the sum.
A movement is refused when:
- the product is not a node defined in the sandbox's local domain;
- the kind is not a node under
stock_events, or has no declared direction; - the count is not a whole number greater than zero;
- a subtracting movement is larger than the amount on hand;
- a party is given and the registrar does not hold that msn (the check is skipped when the store holds no registrar).
Ports
commerce_offering is declared for the Offering tab, with two calls: paypal order.create and paypal order.capture. Installing does not bind or grant it. No extension in the catalogue fills the port, so it cannot be bound from the Ports page. unfillable_ports() in _packages.py reports this.
Status
The ledgers, the stock log and the Overview are built and published. Payment capture through commerce_offering is not built: the port has no filling extension. A demo exists.
Source
micyte/tools/brevat.py: the hub and its tabsmicyte/tools/ledger_books.py: products, supply, sales, offeringmicyte/tools/stock_ledger.pyandmicyte/core/datum_ops/stock_log.py: the stock tab and the direction tablemicyte/tools/_packages.py:_brevat_package