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.
supplier_bill_lines.json · 2.1 KB · 30 lines
| 1 | { |
| 2 | "name": "supplier_bill_lines", |
| 3 | "title": "Supplier Bill Lines", |
| 4 | "version": 2, |
| 5 | "description": "The lines of a supplier bill, as the supplier wrote them. Not recomputed: a bill is the supplier's statement of what it charges, and a fold that restated its total from its lines would replace a number it cannot reproduce (AGENTS.md). Where the lines and the total disagree the exchange says so on the received document and leaves both as they are. Lines that came through the exchange (source = exchange) are frozen from creation like their bill. v2: unit_code, the unit the supplier billed in (10 kg and 10 bags are different lines).", |
| 6 | "fields": [ |
| 7 | {"name": "id"}, |
| 8 | {"name": "bill_id", "type": "relation", "required": true, "label": "Bill", |
| 9 | "relation": {"collection": "supplier_bills", "display_field": "number", "requires": "update"}}, |
| 10 | {"name": "description", "type": "text", "required": true, "label": "Description", |
| 11 | "validation": {"min_length": 1, "max_length": 300}}, |
| 12 | {"name": "quantity", "type": "number", "default": "1", "label": "Quantity"}, |
| 13 | {"name": "unit_code", "type": "text", "label": "Unit", |
| 14 | "help": "What the quantity counts, as the supplier's document said it: a UN/ECE Recommendation 20 code (KGM kilogram, C62 one, XBG bag, LTR litre).", |
| 15 | "validation": {"pattern": "^[A-Z0-9]{1,3}$"}}, |
| 16 | {"name": "unit_price_cents", "type": "integer", "required": true, "label": "Unit Price"}, |
| 17 | {"name": "line_total_cents", "type": "integer", "default": "0", "label": "Line Total"}, |
| 18 | {"name": "tax_rate_bps", "type": "integer", "label": "Tax Rate (bps)"}, |
| 19 | {"name": "source", "type": "enum", "default": "manual", "enum": ["manual", "exchange"], |
| 20 | "label": "Source"}, |
| 21 | {"name": "owner_id", "type": "text"}, |
| 22 | {"name": "created_at", "type": "datetime", "read_only": true, "label": "Created"} |
| 23 | ], |
| 24 | "locked_when": [ |
| 25 | {"when": {"source": "exchange"}, "except": [], |
| 26 | "message": "This line is the supplier's signed document."} |
| 27 | ], |
| 28 | "views": {"list_mode": "table", |
| 29 | "list_fields": ["description", "quantity", "unit_code", "unit_price_cents", "line_total_cents"]} |
| 30 | } |