{
  "schemaVersion": 1,
  "slug": "billable-hours-calculator",
  "category": "productivity",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "f09e28bae0289f15625d9de22563052709c7bc6dbdddd5e3e9156df682dcd85a",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/billable-hours-calculator.json",
    "src/engine.js"
  ],
  "runtimeSource": "/sources/engine.txt",
  "runtimeHash": "5c888d8898afbdee36267bb9977829e1e2ac568f6677c8ee87469c139864645c",
  "scope": "The compute function records implemented equations, constants, lookup tables and custom rules. Inputs record defaults and allowed values; outputs record precision and units. Defaults are examples, not recommendations. General background references are not evidence for this specific algorithm.",
  "publishedFormula": {
    "formula": "B = max(0, W·H − 8S − A·W)",
    "vars": [
      [
        "W",
        "Working weeks per year"
      ],
      [
        "H",
        "Hours worked per week"
      ],
      [
        "S",
        "Sick/personal days (8 h each)"
      ],
      [
        "A",
        "Admin/marketing hours per week"
      ],
      [
        "B",
        "Annual billable hours"
      ]
    ],
    "note": "One sick day counts as 8 hours; the holidayWeeks input is not applied—set weeks per year already net of holidays; revenue = B × hourly rate."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const workWeeks=Math.max(0,weeksPerYear-holidayWeeks-sickDays/5); const grossHours=Math.max(0,(weeksPerYear-holidayWeeks)*hoursPerWeek-sickDays*(hoursPerWeek/5)); const admin=adminHours*workWeeks; const billableHours=Math.max(0,grossHours-admin); const nonBillable=grossHours-billableHours; if(holidayWeeks>weeksPerYear||sickDays>weeksPerYear*5||adminHours>hoursPerWeek)return{grossHours:null,nonBillable:null,billableHours:null,billablePercent:null,annualRevenue:null,weeklyBillable:null,__error:'inputError'}; return{grossHours,nonBillable,billableHours,billablePercent:grossHours>0?billableHours/grossHours*100:0,annualRevenue:billableHours*hourlyRate,weeklyBillable:workWeeks>0?billableHours/workWeeks:0};",
    "inputs": [
      {
        "name": "weeksPerYear",
        "type": "number",
        "default": 52,
        "min": 1,
        "max": 52,
        "step": 1,
        "slider": true
      },
      {
        "name": "hoursPerWeek",
        "type": "number",
        "default": 40,
        "min": 1,
        "max": 100,
        "step": 1,
        "slider": true
      },
      {
        "name": "holidayWeeks",
        "type": "number",
        "default": 4,
        "min": 0,
        "max": 20,
        "step": 1,
        "slider": true
      },
      {
        "name": "sickDays",
        "type": "number",
        "default": 5,
        "min": 0,
        "max": 60,
        "step": 1,
        "slider": true
      },
      {
        "name": "adminHours",
        "type": "number",
        "default": 10,
        "min": 0,
        "max": 40,
        "step": 1,
        "slider": true
      },
      {
        "name": "hourlyRate",
        "type": "number",
        "default": 80,
        "min": 1,
        "max": 2000,
        "step": 5,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "grossHours",
        "precision": 0,
        "unit": "h"
      },
      {
        "name": "nonBillable",
        "precision": 0,
        "unit": "h"
      },
      {
        "name": "billableHours",
        "precision": 0,
        "unit": "h"
      },
      {
        "name": "billablePercent",
        "precision": 1,
        "unit": "%"
      },
      {
        "name": "annualRevenue",
        "precision": 0,
        "unit": "$"
      },
      {
        "name": "weeklyBillable",
        "precision": 1,
        "unit": "h"
      }
    ],
    "interpret": null
  }
}
