StabisoDocs

Autopilot and routines

What the system fills in

A person or an agent gives what only they know; the system fills the rest from the records. This matters most for an agent working over the MCP server or an automation over the REST API: it can send the minimum, and the answer says what was set and where it came from.

Dates

Record Field Left out
Sales invoice, sales credit note document_date Today where the company is
Quote, sales order document_date Today where the company is
Payment (POST /v1/payments) payment_date Today where the company is
Purchase order order_date Today where the company is
Goods receipt receipt_date Today where the company is
Bill, vendor credit note document_date Never filled: refused with 422 document_date_required

A bill is dated as the vendor printed it: its date decides its VAT period and its due date, so the system does not guess it. "Today" is the company's own day in its time zone, not the server's.

Lines of a product

A sales invoice, credit note, quote or sales order line that names a product needs nothing else (the quantity defaults to 1):

  • Description: the product's name, unless the line gives its own.
  • Unit price: the customer's price from its price list in the document's currency for the line's quantity, else the product's list price on the document's day. A product with neither is refused with 422 product_unpriced: give the price, or add one to the product.
  • Revenue account, supply type and VAT rate type: the product's, unless the line names its own.

A line without a product still gives its description and price, and so does every line of a recurring invoice: its text and price are part of the terms a second person approves, so they are not taken anew from the product at each run. A credit note line that credits a line of an invoice (credits_line) takes that line's text, price and VAT.

Accounts and currency

  • A line without account books to the product's revenue account, else the customer's or vendor's default account (default_account on the card), else the company's default revenue or expense account.
  • A document, payment, quote or purchase order without currency is in the customer's or vendor's currency; a credit note is in the currency of the document it credits.
  • Due date, payment terms and cash discount terms come from the customer or vendor.

Master data

A new customer, vendor, price list or company asks only for what the system cannot know; the answer of every create shows the values it set, and anything given wins over the default.

What you create Left out What it gets
Customer or vendor country the country its VAT number names by its prefix (DE811569869 is German, CHE-… Swiss, EL… Greek), else the company's country
Customer or vendor currency the currency of its country, when the company has exchange rates for it; else the company's own currency
Customer or vendor language the language of its country where the country has one of ours: Germany, Austria and Liechtenstein German, France French, Italy Italian, Sweden Swedish, the United Kingdom, Ireland and the United States English. A country of several languages (Switzerland, Belgium, Luxembourg, Canada, Finland) gets none: set it there; until then its documents are printed in German for Switzerland and in the company's language elsewhere
Customer from a lead country, currency the lead's country, else the company's; its currency and language as above
Customer or vendor in an import file the country, currency and language columns as above, row by row; the columns may be missing from the file altogether
Price list currency the company's own currency
Product price or standalone selling price currency the currency of the product's company
Reminder letter currency the one currency the customer (or the invoices you name) is due a reminder in; of several, the customer's own. When it is due in several and none is its own, the letter asks you to name one (422 reminder_currency_needed)
Intercompany loan currency the lender's own currency
Company (POST /v1/entities) functional currency the currency of its country (422 entity_currency_needed for a country whose currency is not known)
Company in the setup wizard standard, currency the country's first standard and its currency (GET /v1/setup/options lists them)
Consolidation group reporting currency the parent's currency, the only one this version allows
VAT number check country the country the number's prefix names

The rules are in src/erp/modules/master_defaults.py; each create applies them before its own checks, so a filled-in value is checked exactly as a given one (a party's currency must still have exchange rates, a company's currency must be one its country allows).

What was filled

A sales or purchase document keeps what the system chose in provenance.filled, one entry per field: field, value, source (today, product CONSULT, price list WHOLESALE-CHF, list price of product CONSULT) and, for a line, its number (line). The MCP tool create_document returns the same list as filled. Quotes, orders, payments and purchase orders return the record as stored, with the date and prices set.

Stabiso, the Enterprise System of Record · generated from the code and its guides · release 20b7dd5b0c4d