Invoicing

An invoice is a header with lines; the totals are stored on the header when it is issued so a later price change does not rewrite history. Payments are recorded against invoices and may be partial. A recurring schedule describes an invoice to raise again on an interval and remembers when it last did.

Start a project from this schema
$ npx vela create my-app --schema invoicing
users auth
  • id* text
  • password* password
  • tokenKey* text
  • email* email
  • emailVisibility bool
  • verified bool
  • name text
  • avatar file
  • created autodate
  • updated autodate
clients
  • id* text
  • name* text
  • contact_name text
  • email* email
  • phone text
  • billing_address text
  • tax_id text
  • currency text
  • payment_terms_days number
  • notes text
  • owner* users
  • created autodate
  • updated autodate
items
  • id* text
  • name* text
  • description text
  • unit_price* number
  • tax_rate number
  • unit text
  • active bool
  • owner* users
  • created autodate
  • updated autodate
invoices
  • id* text
  • number* text
  • client* clients
  • issued_on* date
  • due_on* date
  • status* select
  • currency* text
  • subtotal number
  • tax number
  • total number
  • amount_paid number
  • notes text
  • pdf file
  • owner* users
  • created autodate
  • updated autodate
invoice_lines
  • id* text
  • invoice* invoices
  • item items
  • description* text
  • quantity* number
  • unit_price* number
  • tax_rate number
  • total number
  • sort number
  • created autodate
  • updated autodate
payments
  • id* text
  • invoice* invoices
  • amount* number
  • paid_on* date
  • method* select
  • reference text
  • notes text
  • created autodate
  • updated autodate
recurring_invoices
  • id* text
  • client* clients
  • every* select
  • next_on* date
  • last_issued_on date
  • lines* json
  • active bool
  • owner* users
  • created autodate
  • updated autodate

Every collection, field and relation above becomes a PocketBase migration in the new project. Change any of it afterwards with vela generate migration --ai, which opens this same diagram as an editor.