Docs / Commerce

Invoices and documents

Studio issues seven kinds of document: invoice, credit note, order confirmation, quote, delivery note, pro forma invoice and payment receipt. Each is a template you edit like a page: blocks, inline text, translations, rules and variants. The engine fills it with the order’s data and files the result, frozen, under the order.

The Documents tab of a store with the list of templates and a live preview of an invoice with a QR-bill
A store's Documents tab: the templates on the left, a live preview on a sample on the right.

Shared default or the store’s own

Every store starts with the shared default template of each kind. On a store’s Documents tab:

  • Edit shared default changes the template every store uses.
  • Customize for this store copies the default, with its translations, into the store. Use shared default returns to it.

The live preview renders the template on samples built for that store: paid by card, partially paid, due by a company abroad, due in Switzerland with a QR-bill, or on the store’s newest real document.

Edit a template

The template editor has the tabs Document, Header and footer, Look and Preview, and the sections tree on the right.

  • Blocks: logo, sender, address window, document details, text, lines, totals, payment state, bank transfer, Swiss QR-bill, legal footer, and Variants.
  • Texts take variables such as {{customer_name}}, {{number}}, {{due_date}}, {{total}}, {{amount_due}}.
  • Lines: show the item number, the tax rate per line, a product image, a discount column (only when a line has a discount).
  • Look (the document’s layout): the logo, picked from your Assets (empty follows the store brand’s primary logo), accent color, font, address window left (DIN 5008) or right (Swiss) and paper. Empty fields follow the store’s brand.
  • Translations: each language is its own series; a document is issued in the buyer’s language.
The invoice template in the editor with its document blocks and the sections tree
The invoice template: blocks in the middle, the sections tree on the right.

Layouts

The look of every document comes from a layout. The shared default ships with Studio; an agency can add others beside it, and a store can have its own layout that names the layout it is based on and overrides only the fields it fills. The layout also holds the intro and closing text of each document kind, the paid and partially paid notes, the tax notes (reverse charge, small business, export, exempt, intra-community supply) and the switches for the item number, product image, tax rate per line, discount column and a PAID mark. Its texts are translatable, and a document is rendered in the buyer’s language.

Rules and variants

Every block has a visible when rule, written with the rule builder, and a Variants block shows the first variant whose rule matches (else the default). The shipped defaults use rules for:

  • the closing text by payment state: paid, partially paid, due;
  • the reverse-charge note for a business customer with a VAT number in another country;
  • the export and tax-exemption notes;
  • the small-business note when the store charges no VAT;
  • the QR-bill, only while an invoice is unpaid and its method uses one.

A rule that fails to evaluate hides its block rather than printing something wrong.

Payment details on the document

  • Swiss QR-bill: the 105 mm payment slip at the bottom of the invoice, with a QR reference derived from the invoice number.
  • Bank transfer: IBAN, holder, and a structured creditor reference; optionally a SEPA QR code that a banking app scans.
  • Card: a paid invoice names the card, for example “Card (Visa •••• 4242)”, when the provider reports it.

PDFs and mailing

Each issued document is filed under the order as a PDF with its own version history. The order’s Documents tab lists them and downloads the PDF; staff can also issue a document on purpose from there. Order mails carry the PDFs of the moment:

MailDocuments attached
Order paidThe invoice (when the store sends it with the confirmation), a payment receipt for a payment that arrives after the invoice, and the order confirmation if you switched it on
ShippedThe delivery note, and the invoice when the store sends it at shipment
RefundedThe credit note

A document whose PDF is still being printed is left off and the mail goes out without it. The mail is written in the buyer’s language.

When documents are issued

On the Documents tab, Documents in the order mails decides the moments: send the invoice with the order confirmation, at shipment or never; attach the confirmation; attach the delivery note to the shipping mail; issue a payment receipt when a payment arrives after the invoice.

Documents are issued when they become true: the invoice once it has its number, the confirmation once the order is placed, the delivery note once a parcel leaves. A new version is written only when its content changed. An invoice is never re-issued; a correction is a credit note.

Tips

  • Set the store’s legal entity, VAT number and bank account first: the sender block and the payment blocks read them.
  • Numbering is per store and gapless; set the prefixes in the store’s Settings before the first invoice.
  • Agencies can replace the whole page with their own HTML template; the output is sanitized before it is filed.

Pilot documentation. Studio is in a partner pilot. Screens and YAML shown here are current as of the version noted on each page; tell your Maravilla contact when something does not match what you see.