Skip to content
English
  • There are no suggestions because the search field is empty.

How New Invoice Defaults Are Set

Source: invoice.rb:996-998, invoice.rb:1064-1069, invoices_controller.rb:326-339

  • New invoices always start with status Open -- this is set by a before_create callback and cannot be overridden
  • Cash/account type defaults from the customer record's cash_or_account field if not explicitly set on the invoice
  • Job card number is auto-assigned from the company's sequential counter if the field is blank or zero on save
  • Customer tax-free flag is automatically applied: if the customer is tax_free, the invoice is forced to tax_free = true on every save
  • Tax rate, freight tax, price_includes_tax, and discount_includes_tax settings reload from the company record on every save while the invoice is Open
  • Mobile-created invoices inherit cash_or_account, tax_free, tax_group_id, and default_payment_terms from the customer; type defaults to invoice, status to open, job status to booked

Support scenarios

  • "Why is this invoice showing as tax-free even though I didn't set it?" -> the customer record is flagged as tax-free, which forces it onto every invoice for that customer
  • "I changed the company tax rate but my old open invoice changed too" -> open invoices reload tax settings from the company on every save
  • "How do job card numbers get assigned?" -> automatically from the company's sequential counter when the invoice is first saved