Functional Weave
Code in Rust

construction.day-rate-quote@1.0.0

README.md

1,194 bytes · view raw

# construction.day-rate-quote

The price of a small job the way trades quote it: so many days at a day rate,
materials at cost plus a markup, and VAT on top.

- **Labour** is days x day rate, rounded half up to the penny once. Days are
  hundredths of a day (`250` is 2.5 days, `50` a half day), so no float ever
  touches the money.
- **Materials** are the cost plus a markup, priced by `finance.markup-price`
  on the `markup` basis (profit over cost: 15% on 100.00 is 115.00), rounded
  half up. The markup applies to materials only; the day rate is already the
  price of labour. For a margin target instead, price the materials with
  `finance.markup-price` yourself.
- **VAT** is `finance.tax.add-vat` on the net total, GB rates, at the rate in
  force on `onDate`. Pass `null` when you are not VAT registered. Under the
  domestic reverse charge (see `construction.vat-reverse-charge`) quote with
  `null` too and say on the quote that the customer accounts for the VAT.

Edges: zero days (a materials-only quote) and zero materials are fine. Negative
days, rates or materials are errors, as is a markup below -100% and mixed
currencies. day rate x hundredths must stay within 2^53 - 1.