{
  "title": "Cash Drawer Reconciliation Calculator Constants",
  "author": "Fernando Suarez",
  "location": "San Antonio, TX",
  "version": "1.0.0",
  "description": "Machine-readable constants and formulas for cash drawer reconciliation calculations",
  
  "formulas": {
    "expected_total": {
      "expression": "starting_float + total_sales - total_refunds",
      "description": "The theoretical amount that should be in the drawer at close",
      "units": "USD"
    },
    "variance": {
      "expression": "counted_cash - expected_total",
      "description": "Difference between physical count and system expectation",
      "units": "USD"
    },
    "percent_variance": {
      "expression": "(variance / expected_total) * 100",
      "description": "Variance expressed as percentage of expected total",
      "units": "percent"
    },
    "status_check": {
      "expression": "Math.abs(variance) <= tolerance_threshold",
      "description": "Pass/fail determination based on industry tolerance",
      "return_type": "boolean"
    }
  },
  
  "constants": {
    "tolerance_threshold": {
      "value": 0.50,
      "units": "USD",
      "source": "Industry standard for small-business retail operations",
      "rationale": "Accounts for rounding errors in coin handling and minor miscounts during high-volume shifts"
    }
  },
  
  "inputs": {
    "starting_float": {
      "type": "number",
      "min": 0,
      "step": 0.01,
      "description": "Initial cash in drawer at shift start"
    },
    "total_sales": {
      "type": "number",
      "min": 0,
      "step": 0.01,
      "description": "Sum of all transactions processed during shift"
    },
    "total_refunds": {
      "type": "number",
      "min": 0,
      "step": 0.01,
      "default": 0,
      "description": "Sum of all refund amounts issued during shift"
    },
    "counted_cash": {
      "type": "number",
      "min": 0,
      "step": 0.01,
      "description": "Physical count of cash removed from drawer at close"
    }
  },
  
  "outputs": {
    "expected_total": {
      "type": "number",
      "precision": 2,
      "description": "Calculated expected cash total"
    },
    "variance": {
      "type": "number",
      "precision": 2,
      "description": "Numerical difference between counted and expected"
    },
    "percent_variance": {
      "type": "number",
      "precision": 4,
      "description": "Variance as percentage of expected total"
    },
    "status": {
      "type": "enum",
      "values": ["PASS", "FAIL"],
      "description": "Final verdict based on tolerance threshold"
    }
  },
  
  "worked_example": {
    "inputs": {
      "starting_float": 100.00,
      "total_sales": 3247.85,
      "total_refunds": 12.50,
      "counted_cash": 3335.35
    },
    "outputs": {
      "expected_total": 3335.35,
      "variance": 0.00,
      "percent_variance": 0.00,
      "status": "PASS"
    },
    "context": "Typical evening shift at downtown store location"
  },
  
  "metadata": {
    "created": "2026-07-17",
    "linked_page": "/drawer-calculator.html",
    "license": "CC-BY-SA-4.0"
  }
}
