Runs live, versioned Python application objects on one VM, with a suite of apps: projects, notes, tasks, files and more.

9 downloads

dbbasic-object-server/packages/app-bills/schemas/supplier_bill_credits.json
Install on DigitalOcean Download zip
Clone
Clone with git
git clone https://gitstable.com/git/askrobots/dbbasic-object-server.git
HTTPS
https://gitstable.com/git/askrobots/dbbasic-object-server.git
SSH
ssh://git@gitstable.com:2222/askrobots/dbbasic-object-server.git

Cloning needs no sign-in. Pushing over HTTPS asks for your username and an access token. SSH needs your key under SSH keys.

Daniel Quellhorst Changelog for this batch. 65ef78d 3 hours, 42 minutes ago History
supplier_bill_credits.json · 2.5 KB · 28 lines
1{
2 "name": "supplier_bill_credits",
3 "title": "Supplier Bill Credits",
4 "version": 1,
5 "description": "A supplier's credit note applied: credit_bill_id is the credit note (a supplier_bills row of doc_type credit_note), bill_id the bill it reduces, or blank while the credit stands on account, waiting to be applied. Every credit note that arrives through the exchange gets one row, made with it: applied to the bill its document says it credits, or on account when it names none we hold. That one row is what makes both numbers right at once: the credited bill's credited_cents rises (so what it still owes falls), and the credit note's own credit_applied_cents equals its total, so the credit note never reads as money WE owe (the two-company simulation found the supplier showing a credit note as a positive balance due). A row made from the supplier's document (source exchange) is frozen once it names a bill (on_account false); an on-account row may be pointed at a bill by a person. A credit note typed in by hand is applied by adding a row for it.",
6 "fields": [
7 {"name": "id"},
8 {"name": "credit_bill_id", "type": "relation", "required": true, "label": "Credit Note",
9 "relation": {"collection": "supplier_bills", "display_field": "number", "requires": "update"}},
10 {"name": "bill_id", "type": "relation", "label": "Bill Credited",
11 "help": "Blank: the credit stands on account until a person applies it to a bill.",
12 "relation": {"collection": "supplier_bills", "display_field": "number", "requires": "update"}},
13 {"name": "amount_cents", "type": "integer", "required": true, "label": "Amount",
14 "validation": {"min": 1}},
15 {"name": "on_account", "type": "boolean", "default": "false", "label": "On Account"},
16 {"name": "source", "type": "enum", "default": "manual", "enum": ["manual", "exchange"],
17 "label": "Source"},
18 {"name": "owner_id", "type": "text"},
19 {"name": "created_at", "type": "datetime", "read_only": true, "label": "Created"}
20 ],
21 "locked_when": [
22 {"when": {"source": "exchange", "on_account": "false"}, "except": [],
23 "message": "The supplier's signed credit note says which bill it credits."},
24 {"when": {"source": "exchange"}, "fields": ["credit_bill_id", "amount_cents", "source", "on_account"],
25 "message": "The amount and the credit note are the supplier's; only which bill it is applied to is ours."}
26 ],
27 "views": {"list_mode": "table", "list_fields": ["credit_bill_id", "bill_id", "amount_cents", "on_account"]}
28}