DEV Community

eth shihao
eth shihao

Posted on

Davis-Bacon overtime and fringe math for WH-347, down to the cent

Put 46 hours, $32.00 basic pay, $14.50 required fringe, and $9.00 of substantiated hourly benefit credit into a weekly worksheet. Gross cash wages come to $1,821.00. If a spreadsheet multiplies the entire cash rate by 1.5 after 40 hours, it returns $1,837.50. The $16.50 difference is an extra half premium on the $5.50 cash-in-lieu amount for six hours.

The example assumes one worker, one classification, and a federal project covered by Davis-Bacon and the Contract Work Hours and Safety Standards Act. All workweek hours are on that project. The basic wage is paid fully in cash, and the $5.50 is genuine cash in lieu of fringe under the applicable rules. Classify each pay component before choosing the overtime basis. DOL Fact Sheet 66E and DOL Davis-Bacon compliance principles

Reconcile four weekly lines

Line Calculation Result
Basic wages for all worked hours 46 × $32.00 $1,472.00
Additional half-time premium 6 × $32.00 ÷ 2 $96.00
Cash in lieu for all worked hours 46 × ($14.50 − $9.00) $253.00
Claimed benefit credit 46 × $9.00 $414.00
Gross cash wages $1,472.00 + $96.00 + $253.00 $1,821.00

The basic wage line already covers the first 1× on overtime hours. Adding the half-time premium completes 1.5× for those hours. The benefit credit stays separate from cash wages. This worksheet caps claimed hourly credit at the required fringe and applies any shortfall across both straight time and overtime. DOL Fact Sheet 66E

A fractional-hour case makes the rounding policy observable. At 40 hours 30 minutes, a $30.02 premium basis produces an additional premium of $7.505. The worksheet records $7.51. It stores whole minutes and hourly integer cents, divides with BigInt, and rounds to the nearest cent with ties up. It subtracts rounded benefit credit from rounded required fringe to get cash in lieu. Gross cash equals the sum of the three cash lines the worksheet displays.

Run the reconciliation benchmark

The comparator models one spreadsheet error. It adds half a premium on cash in lieu during overtime and rounds the final total. The assertion uses independently specified gross cents and overtime minutes. The timing loop measures the full ledger calculation. Run it at the repository root with Node.js 20+. MIT calculator source and tests

import assert from 'node:assert/strict';
import { performance } from 'node:perf_hooks';
import { calculateWeek } from './src/index.js';

const sample = {
  workedMinutes: 2760, baseCentsPerHour: 3200,
  requiredFringeCentsPerHour: 1450, eligibleCreditCentsPerHour: 900,
};
const cases = [
  ['sample', {}, 182100, 360],
  ['exactly 40 hours', { workedMinutes: 2400 }, 150000, 0],
  ['one overtime minute', { workedMinutes: 2401 }, 150089, 1],
  ['half an overtime hour', { workedMinutes: 2430 }, 152675, 30],
  ['all fringe paid in cash', { eligibleCreditCentsPerHour: 0 }, 223500, 360],
  ['credit above required fringe', { eligibleCreditCentsPerHour: 1600 }, 156800, 360],
  ['higher supplied basis', { overtimeBaseCentsPerHour: 4000 }, 184500, 360],
  ['half-cent premium', {
    workedMinutes: 2430, baseCentsPerHour: 3002,
    requiredFringeCentsPerHour: 1000, eligibleCreditCentsPerHour: 333,
  }, 149345, 30],
];
const fixtures = cases.map(([label, overrides, gross, overtime]) =>
  [label, { ...sample, ...overrides }, gross, overtime]);

function allInGross(week) {
  const {
    workedMinutes, baseCentsPerHour, requiredFringeCentsPerHour,
    eligibleCreditCentsPerHour, overtimeBaseCentsPerHour = baseCentsPerHour,
  } = week;
  const shortfall = Math.max(0, requiredFringeCentsPerHour - eligibleCreditCentsPerHour);
  const overtime = Math.max(0, workedMinutes - 2400);
  return Math.round(
    workedMinutes * (baseCentsPerHour + shortfall) / 60
    + overtime * (overtimeBaseCentsPerHour + shortfall) / 120,
  );
}

let allInMatches = 0;
for (const [label, input, gross, overtime] of fixtures) {
  const result = calculateWeek(input);
  assert.deepEqual([result.grossCashWagesCents, result.overtimeMinutes], [gross, overtime], label);
  if (allInGross(input) === gross) allInMatches++;
}

let checksum = 0;
function exercise(repeats) {
  const start = performance.now();
  for (let repeat = 0; repeat < repeats; repeat++) {
    for (const [, input] of fixtures) checksum += calculateWeek(input).grossCashWagesCents;
  }
  return performance.now() - start;
}
exercise(2000);
const repeats = 10_000;
const times = Array.from({ length: 9 }, () => exercise(repeats)).sort((a, b) => a - b);
console.log({
  node: process.version, referenceMatches: fixtures.length, allInMatches,
  callsPerTrial: repeats * fixtures.length, medianMs: Number(times[4].toFixed(1)), checksum,
});
Enter fullscreen mode Exit fullscreen mode

On an Apple M1 Pro with Node.js v24.14.1, the ledger matched 8/8 fixtures and the all-in gross calculation matched 2/8. The two gross matches were the week with zero overtime and the week with zero cash in lieu. The ledger median was 10.7 ms for 80,000 calls over nine trials after warmup. The checksum was 124,108,828,000 cents. This is a synthetic compute benchmark with no CSV parsing, network traffic, or form rendering.

Follow the numbers into the payroll record

Load the 46-hour sample, then change it to 40 hours and one minute. The additional premium becomes $0.27. Cash in lieu still accrues across the entire covered workweek. Try $16.00 of substantiated hourly credit and the cash-in-lieu line drops to zero because the claimed amount is capped at $14.50. Open the workweek calculator

Carry the time record, wage determination, and documented benefit-credit calculation into the WH-347 review. The form distinguishes project gross wages, cash in lieu, and credit for plan benefits. Coverage, mixed classifications, benefit annualization, and other earnings can change the applicable calculation. DOL WH-347 instructions

Prepare the certified payroll handoff and the progress billing packet from the same reviewed project records. WH347Pack and PayApp Pack

Disclosure. The publisher operates WH347Pack and PayApp Pack. The draft was generated with AI and the benchmark was run locally.

Top comments (0)