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

How Invoice Cost Calculations and Swedish Rounding Work

Source: invoice.rb:258-291

  • Cost calculation excludes BOM (bill of materials) parent items to avoid double-counting with child items
  • For labor items with hours_worked, cost is taken as a flat sum of unit_cost rather than unit_cost * quantity
  • Swedish rounding is applied to the invoice total if company.round_total is enabled -- rounds to the nearest increment and stores the rounding difference in the invoice's rounding field
  • Balance due is zero for quotes and for credits (unless Assembly Payments is enabled for credits)
  • Balance due equals total minus deposits_total for open invoices
  • When an invoice transitions from open to processed, balance_due is reset to the full total (deposits are converted to payments separately)

Support scenarios

  • "The invoice total is slightly different from subtotal plus tax" -> Swedish rounding is enabled for the company; check the rounding field for the exact adjustment amount
  • "My bundle cost doesn't match the individual items" -> BOM parent items are excluded from cost totals to prevent double-counting
  • "The balance due changed when I processed" -> balance_due resets to the full total on processing; deposits are converted to customer payments separately