Prevailing Wage Calculator California

Prevailing Wage Calculator California | Calculate Your Prevailing Wage :root { –primary-color: #004a99; –success-color: #28a745; –background-color: #f8f9fa; –text-color: #333; –border-color: #ddd; –card-background: #fff; –shadow: 0 2px 5px rgba(0,0,0,0.1); } body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: var(–background-color); color: var(–text-color); line-height: 1.6; margin: 0; padding: 0; } .container { max-width: 960px; margin: 20px auto; padding: 20px; background-color: var(–card-background); border-radius: 8px; box-shadow: var(–shadow); } header { background-color: var(–primary-color); color: white; padding: 20px 0; text-align: center; margin-bottom: 20px; border-radius: 8px 8px 0 0; } header h1 { margin: 0; font-size: 2em; } .calculator-section { margin-bottom: 30px; padding: 20px; border: 1px solid var(–border-color); border-radius: 8px; background-color: var(–card-background); } .calculator-section h2 { color: var(–primary-color); margin-top: 0; text-align: center; margin-bottom: 20px; } .input-group { margin-bottom: 15px; display: flex; flex-direction: column; } .input-group label { display: block; margin-bottom: 5px; font-weight: bold; } .input-group input[type="number"], .input-group select { width: 100%; padding: 10px; border: 1px solid var(–border-color); border-radius: 4px; box-sizing: border-box; font-size: 1em; } .input-group .helper-text { font-size: 0.85em; color: #666; margin-top: 5px; } .error-message { color: red; font-size: 0.8em; margin-top: 5px; display: none; /* Hidden by default */ } .button-group { display: flex; justify-content: space-between; margin-top: 20px; flex-wrap: wrap; gap: 10px; } .button-group button { padding: 10px 15px; border: none; border-radius: 4px; cursor: pointer; font-size: 1em; transition: background-color 0.3s ease; flex: 1; min-width: 120px; } .btn-calculate { background-color: var(–primary-color); color: white; } .btn-calculate:hover { background-color: #003366; } .btn-reset { background-color: #6c757d; color: white; } .btn-reset:hover { background-color: #5a6268; } .btn-copy { background-color: #17a2b8; color: white; } .btn-copy:hover { background-color: #117a8b; } #results-container { margin-top: 30px; padding: 20px; border: 1px solid var(–border-color); border-radius: 8px; background-color: var(–card-background); text-align: center; } #results-container h3 { color: var(–primary-color); margin-top: 0; margin-bottom: 20px; } .result-item { margin-bottom: 10px; font-size: 1.1em; } .result-label { font-weight: bold; color: #555; } .result-value { font-weight: bold; color: var(–primary-color); } .primary-result { font-size: 1.8em; font-weight: bold; color: var(–success-color); background-color: #e9ecef; padding: 15px; border-radius: 5px; margin-bottom: 15px; display: inline-block; min-width: 80%; } .formula-explanation { font-size: 0.9em; color: #666; margin-top: 15px; text-align: left; border-top: 1px dashed #ccc; padding-top: 10px; } table { width: 100%; border-collapse: collapse; margin-top: 20px; overflow-x: auto; /* Make table scrollable */ display: block; /* Needed for overflow-x */ white-space: nowrap; /* Prevent wrapping within cells */ } th, td { padding: 10px 15px; border: 1px solid var(–border-color); text-align: left; } thead { background-color: var(–primary-color); color: white; } tbody tr:nth-child(even) { background-color: #f2f2f2; } caption { font-size: 1.1em; font-weight: bold; color: var(–primary-color); margin-bottom: 10px; text-align: left; } .chart-container { margin-top: 30px; padding: 20px; border: 1px solid var(–border-color); border-radius: 8px; background-color: var(–card-background); text-align: center; } .chart-container h3 { color: var(–primary-color); margin-top: 0; margin-bottom: 20px; } canvas { max-width: 100%; height: auto; } .article-section { margin-top: 40px; padding: 20px; border: 1px solid var(–border-color); border-radius: 8px; background-color: var(–card-background); } .article-section h2 { color: var(–primary-color); border-bottom: 2px solid var(–primary-color); padding-bottom: 10px; margin-bottom: 20px; } .article-section h3 { color: var(–primary-color); margin-top: 25px; margin-bottom: 15px; } .article-section p, .article-section ul, .article-section ol { margin-bottom: 15px; } .article-section ul, .article-section ol { padding-left: 20px; } .article-section li { margin-bottom: 8px; } .faq-item { margin-bottom: 15px; } .faq-item h3 { margin-bottom: 5px; font-size: 1.1em; color: var(–primary-color); } .faq-item p { margin-bottom: 0; font-size: 0.95em; } .internal-links-section { margin-top: 40px; padding: 20px; border: 1px solid var(–border-color); border-radius: 8px; background-color: var(–card-background); } .internal-links-section h2 { color: var(–primary-color); border-bottom: 2px solid var(–primary-color); padding-bottom: 10px; margin-bottom: 20px; } .internal-links-section ul { list-style: none; padding: 0; } .internal-links-section li { margin-bottom: 10px; } .internal-links-section a { color: var(–primary-color); text-decoration: none; font-weight: bold; } .internal-links-section a:hover { text-decoration: underline; } .internal-links-section p { font-size: 0.9em; color: #666; margin-top: 5px; } @media (max-width: 768px) { .container { margin: 10px; padding: 15px; } header h1 { font-size: 1.8em; } .button-group { flex-direction: column; gap: 10px; } .button-group button { width: 100%; flex: none; } .primary-result { min-width: 100%; font-size: 1.5em; } table { font-size: 0.9em; } th, td { padding: 8px 10px; } }

Prevailing Wage Calculator California

Accurately determine prevailing wage rates for your California construction projects.

California Prevailing Wage Calculator

Public Works State Highway Other Select the type of public project.
Los Angeles Orange San Diego Alameda Contra Costa Sacramento San Francisco San Mateo Santa Clara Sonoma Alpine Amador Butte Calaveras Colusa Del Norte El Dorado Fresno Glenn Humboldt Imperial Inyo Kern Kings Lake Lassen Madera Mariposa Mendocino Merced Modoc Mono Monterey Napa Nevada Placer Plumas Riverside Shasta Sierra Siskiyou Solano Santa Barbara Santa Cruz Shasta Sierra Siskiyou Solano Sonoma Stanislaus Sutter Tehama Trinity Tulare Tuolumne Ventura Yolo Yuba Select the county where the project is located.
Laborer Carpenter Electrician Plumber Heavy Equipment Operator Other Trade Select the specific trade or occupation.
Enter the typical number of hours worked per week for this trade.
Enter the base hourly wage for the trade.
Enter the hourly employer contribution to health and welfare benefits.
Enter the hourly employer contribution to pension funds.
Enter any other applicable hourly fringe benefits.

Prevailing Wage Calculation Results

Total Hourly Benefit Package:
Total Hourly Compensation:
Estimated Weekly Cost (40 hrs):
Formula Used:
Total Hourly Benefit Package = Health & Welfare + Pension + Other Fringe Benefits
Total Hourly Compensation = Base Hourly Rate + Total Hourly Benefit Package
Estimated Weekly Cost = Total Hourly Compensation * Average Weekly Hours

Hourly Compensation Breakdown

This chart visually represents the breakdown of the total hourly compensation, showing the base rate versus the fringe benefits.
Prevailing Wage Data Factors
Factor Description Impact on Prevailing Wage
Project Type Public Works, State Highway, etc. Determines the governing wage orders and potential variations.
County Geographic location within California. Wage rates vary significantly by county due to local economic conditions and cost of living.
Trade/Occupation Specific job classification (e.g., Carpenter, Electrician). Different trades have different established minimum wage rates and benefit packages.
Health & Welfare Employer contributions to employee health plans. A significant component of the total fringe benefit package, directly increasing total compensation.
Pension Employer contributions to retirement funds. Another key fringe benefit that adds to the total hourly compensation cost.
Other Fringe Benefits Additional employer-provided benefits (e.g., training funds, vacation pay). Contributes to the overall fringe benefit amount, impacting the total wage.

What is Prevailing Wage in California?

The prevailing wage in California refers to the legally mandated minimum wage rate that must be paid to workers on public works projects and certain other state-funded construction contracts. It is not a single, fixed rate but rather a composite of the basic hourly wage and the hourly rate of monetary contributions paid to laborers and mechanics for health and welfare, pension, vacation, holiday, sick leave, and other similar purposes. The prevailing wage is determined by the California Department of Industrial Relations (DIR) based on surveys of wages and benefits paid to similarly employed workers in the locality where the public work is performed.

Who Should Use a Prevailing Wage Calculator?

  • Contractors: Bidding on public works projects must understand and comply with prevailing wage requirements to avoid penalties and ensure accurate bidding.
  • Subcontractors: Need to know the prevailing wage rates applicable to their trades on covered projects.
  • Government Agencies: Use prevailing wage determinations to set bid specifications and ensure fair labor practices.
  • Workers: Can use the calculator to verify they are being paid the correct minimum wage and benefits.
  • Project Owners: Need to ensure compliance with state labor laws.

Common Misconceptions:

  • Prevailing Wage = Minimum Wage: While both are minimums, prevailing wage is typically much higher than the state or federal minimum wage and is specific to public projects and certain trades.
  • One Rate Fits All: Prevailing wages vary significantly by county, trade, and project type. There isn't a single statewide rate for all workers.
  • Benefits are Optional: The prevailing wage includes not just the base hourly rate but also mandatory fringe benefits. Failing to pay the full package is a violation.

Prevailing Wage Calculator California: Formula and Mathematical Explanation

The calculation of the prevailing wage, as reflected in this calculator, involves summing up the various components that constitute the total compensation package required by law. This ensures that contractors are meeting their obligations for both direct wages and mandated fringe benefits.

Step-by-Step Derivation:

  1. Identify Base Hourly Rate: This is the direct wage paid to the worker per hour for their labor.
  2. Calculate Total Hourly Benefit Package: This involves summing all mandated fringe benefits paid by the employer on an hourly basis. These typically include:
    • Health and Welfare Contributions
    • Pension Contributions
    • Other Bona Fide Fringe Benefits (e.g., vacation, holiday pay, training funds)
  3. Determine Total Hourly Compensation: This is the sum of the Base Hourly Rate and the Total Hourly Benefit Package. This represents the full cost or value of the worker's compensation per hour.
  4. Estimate Weekly Cost (Optional but useful): Multiply the Total Hourly Compensation by the average number of hours worked per week to estimate the total weekly labor cost for that trade.

Variable Explanations:

The inputs used in the prevailing wage calculator represent key components that determine the final wage determination.

Variables Used in Calculation
Variable Meaning Unit Typical Range
Project Type Classification of the public project (e.g., Public Works, State Highway). Category Public Works, State Highway, Other
County Geographic location of the project. County Name All California Counties
Trade/Occupation Specific job role of the worker. Job Title Laborer, Carpenter, Electrician, Plumber, Operator, etc.
Average Weekly Hours Standard hours worked per week. Hours 1 – 60+ (commonly 40)
Base Hourly Rate Direct wage paid per hour. USD ($) $15 – $100+
Health & Welfare Employer's hourly contribution to health insurance. USD ($) per hour $2 – $20+
Pension Employer's hourly contribution to retirement funds. USD ($) per hour $1 – $15+
Other Fringe Benefits Additional hourly employer contributions (vacation, training, etc.). USD ($) per hour $0.50 – $10+

Mathematical Formula:
Total Hourly Benefit Package = Health & Welfare + Pension + Other Fringe Benefits
Total Hourly Compensation = Base Hourly Rate + Total Hourly Benefit Package
Estimated Weekly Cost = Total Hourly Compensation * Average Weekly Hours

Practical Examples (Real-World Use Cases)

Understanding how the prevailing wage applies in real scenarios is crucial for accurate bidding and compliance. Here are a couple of examples:

Example 1: Public Library Construction in Los Angeles County

A general contractor is bidding on a new public library construction project in Los Angeles County. They need to determine the prevailing wage for a journeyman carpenter.

  • Project Type: Public Works
  • County: Los Angeles
  • Trade/Occupation: Carpenter
  • Average Weekly Hours: 40
  • Base Hourly Rate: $45.00
  • Health & Welfare: $12.00/hour
  • Pension: $8.00/hour
  • Other Fringe Benefits: $3.00/hour (e.g., vacation, training)

Calculation:

  • Total Hourly Benefit Package = $12.00 + $8.00 + $3.00 = $23.00
  • Total Hourly Compensation = $45.00 + $23.00 = $68.00
  • Estimated Weekly Cost (40 hrs) = $68.00 * 40 = $2,720.00

Interpretation: The contractor must ensure that the carpenter receives at least $45.00 per hour in wages, plus $23.00 per hour in fringe benefits, for a total of $68.00 per hour. The estimated weekly cost for this trade is $2,720.00. Failing to meet these requirements can lead to significant penalties.

Example 2: State Highway Improvement Project in Sacramento County

A subcontractor specializing in heavy equipment operation is working on a state highway improvement project in Sacramento County.

  • Project Type: State Highway
  • County: Sacramento
  • Trade/Occupation: Heavy Equipment Operator
  • Average Weekly Hours: 40
  • Base Hourly Rate: $38.00
  • Health & Welfare: $10.50/hour
  • Pension: $7.50/hour
  • Other Fringe Benefits: $1.50/hour

Calculation:

  • Total Hourly Benefit Package = $10.50 + $7.50 + $1.50 = $19.50
  • Total Hourly Compensation = $38.00 + $19.50 = $57.50
  • Estimated Weekly Cost (40 hrs) = $57.50 * 40 = $2,300.00

Interpretation: For this project, the heavy equipment operator must be paid a minimum of $38.00 per hour in wages and $19.50 per hour in fringe benefits. The total hourly compensation is $57.50, leading to an estimated weekly cost of $2,300.00. This ensures compliance with the California Department of Transportation (Caltrans) prevailing wage requirements for highway projects.

How to Use This Prevailing Wage Calculator California

Our Prevailing Wage Calculator for California is designed for simplicity and accuracy. Follow these steps to get your prevailing wage determination:

  1. Select Project Type: Choose the category that best describes your project (e.g., "Public Works," "State Highway"). This helps narrow down the applicable wage orders.
  2. Choose the County: Select the specific California county where the project is physically located. Prevailing wages are highly localized.
  3. Specify Trade/Occupation: Select the trade or job classification for which you need to determine the prevailing wage (e.g., "Carpenter," "Electrician").
  4. Enter Hours Worked: Input the typical number of hours the worker is expected to work per week. The default is 40 hours.
  5. Input Wage Components:
    • Enter the Base Hourly Rate for the specified trade.
    • Enter the hourly employer contributions for Health & Welfare benefits.
    • Enter the hourly employer contributions for Pension funds.
    • Enter any Other Fringe Benefits contributions per hour.
    If you don't have exact figures for benefits, you can use the default values as a starting point or consult official DIR wage determinations.
  6. Calculate: Click the "Calculate Prevailing Wage" button.

How to Read Results:

  • Primary Result (Total Hourly Compensation): This is the most critical figure – the total amount per hour that must be paid to the worker, combining base wages and all mandated fringe benefits.
  • Total Hourly Benefit Package: Shows the sum of all fringe benefits per hour.
  • Estimated Weekly Cost: Provides an estimate of the total labor cost for a standard 40-hour week based on the calculated total hourly compensation.
  • Chart & Table: The chart offers a visual breakdown, and the table summarizes key factors influencing wage determinations.

Decision-Making Guidance:

  • Bidding: Use the "Total Hourly Compensation" figure to accurately price your bids for public works projects. Ensure your bid covers at least this amount to remain compliant.
  • Payroll: Verify that your payroll system correctly allocates wages and benefits according to the prevailing wage determination.
  • Compliance: Use the results as a benchmark to ensure you are meeting or exceeding the legal requirements set forth by the DIR.

Key Factors That Affect Prevailing Wage Results in California

Several factors significantly influence the prevailing wage rates determined by the California Department of Industrial Relations (DIR). Understanding these can help in accurate estimation and compliance:

  • Geographic Location (County): This is arguably the most significant factor. Wage rates and benefit contributions are determined on a county-by-county basis. Urban areas like Los Angeles or San Francisco typically have higher prevailing wages than more rural counties due to differences in cost of living, unionization rates, and local economic activity. Our calculator reflects this by allowing county selection.
  • Trade or Occupation: Different trades require varying skill levels and face different market demands, leading to distinct wage rates and benefit packages. Highly skilled trades like electricians or specialized equipment operators generally command higher prevailing wages than general laborers. The calculator allows you to specify the exact trade.
  • Project Type and Funding Source: Whether a project is funded by the state (e.g., Caltrans highway projects), a local municipality (e.g., city or county public works), or federal funds can influence the specific wage orders and regulations that apply. Different funding streams might have slightly different requirements or interpretations.
  • Fringe Benefit Contributions: The prevailing wage is a total package. The specific amounts contributed by the employer for health insurance, retirement (pension), and other benefits (like vacation, holiday pay, training funds) directly add to the base hourly wage to form the total required compensation. Higher benefit contributions lead to a higher total prevailing wage.
  • Effective Date of Wage Determination: Prevailing wage rates are updated periodically, typically annually, by the DIR. Using an outdated wage determination can lead to non-compliance. It's crucial to use the most current rates applicable to the project's bid or contract period. Our calculator assumes current standard rates but always verify with official DIR publications.
  • Apprenticeship Programs: California has specific rules regarding the use of apprentices on public works projects. Properly registered apprentices can be paid a percentage of the journeyman's prevailing wage, which is determined by their level of training. This can reduce labor costs but requires strict adherence to apprenticeship standards.
  • Per Diem and Travel Pay: While not always included in the base prevailing wage calculation, some projects or contracts may require per diem payments or travel pay, especially for workers commuting long distances. These add to the overall project labor costs.

Frequently Asked Questions (FAQ) about California Prevailing Wage

Q1: What is the difference between prevailing wage and minimum wage in California?

Minimum wage is the lowest hourly rate employers can legally pay most workers statewide or locally. Prevailing wage applies specifically to public works projects and certain other contracts, and it's typically much higher, encompassing both base wages and mandatory fringe benefits determined by the DIR based on local rates for specific trades.

Q2: How often are prevailing wage rates updated in California?

The California Department of Industrial Relations (DIR) typically updates general prevailing wage determinations annually. However, specific project determinations might be issued at different times. It's essential to consult the DIR's official website for the most current rates applicable to your project.

Q3: Do I have to pay prevailing wage on all construction projects?

No, prevailing wage requirements primarily apply to "public works" projects funded by state or local government agencies, and certain other contracts like those involving federal funding or specific state programs (e.g., affordable housing). Private projects generally do not require prevailing wage, unless specified by local ordinance or project agreement.

Q4: What are the penalties for failing to pay prevailing wage in California?

Penalties can be severe and include back wages owed, liquidated damages (often 25% of the underpaid wages), forfeiture of contract, debarment from future public works projects for up to three years, and potential criminal charges in egregious cases.

Q5: Can I use the calculator for federal Davis-Bacon Act wages?

This calculator is specifically designed for California state prevailing wage laws. While the principles are similar, federal Davis-Bacon Act wages are determined by the U.S. Department of Labor and may differ. You would need a separate calculator or resource for federal projects.

Q6: What if the trade I need isn't listed in the calculator?

If your specific trade or occupation is not listed, select "Other Trade" or the closest available option. For official compliance, you must consult the official prevailing wage determination published by the California DIR for your specific project, county, and trade. You can often find these on the DIR's website or by contacting the awarding body.

Q7: How are fringe benefits calculated per hour?

Fringe benefits are typically expressed as a dollar amount per hour. For example, if an employer contributes $600 per month to an employee's health insurance and the employee works 160 hours per month (40 hours/week * 4 weeks), the hourly fringe benefit contribution for health insurance is $600 / 160 = $3.75 per hour. Our calculator uses pre-entered hourly rates for simplicity.

Q8: Can I use this calculator to determine the prevailing wage for apprentices?

This calculator provides the journeyman wage rate. Apprentices are paid a percentage of the journeyman rate, based on their training level. While this calculator gives you the base journeyman rate, you would need to apply the specific apprentice wage scale applicable to your registered apprenticeship program to determine the apprentice's pay rate. Always refer to the official DIR wage determination for apprentice wage requirements.

© 2023 Your Company Name. All rights reserved. This calculator provides estimates for informational purposes only and does not constitute legal or financial advice. Always consult official sources and legal counsel for definitive guidance.

var chartInstance = null; function validateInput(id, errorId, minValue, maxValue) { var input = document.getElementById(id); var errorElement = document.getElementById(errorId); var value = parseFloat(input.value); errorElement.style.display = 'none'; // Hide error by default if (isNaN(value)) { errorElement.textContent = "Please enter a valid number."; errorElement.style.display = 'block'; return false; } if (minValue !== undefined && value maxValue) { errorElement.textContent = "Value is too high."; errorElement.style.display = 'block'; return false; } return true; } function calculatePrevailingWage() { // Clear previous errors document.getElementById('hoursPerWeekError').style.display = 'none'; document.getElementById('hourlyRateError').style.display = 'none'; document.getElementById('healthAndWelfareError').style.display = 'none'; document.getElementById('pensionError').style.display = 'none'; document.getElementById('otherBenefitsError').style.display = 'none'; // Validate inputs var validHours = validateInput('hoursPerWeek', 'hoursPerWeekError', 0); var validRate = validateInput('hourlyRate', 'hourlyRateError', 0); var validHw = validateInput('healthAndWelfare', 'healthAndWelfareError', 0); var validPension = validateInput('pension', 'pensionError', 0); var validOther = validateInput('otherBenefits', 'otherBenefitsError', 0); if (!validHours || !validRate || !validHw || !validPension || !validOther) { document.getElementById('primaryResult').textContent = "–"; document.getElementById('totalBenefitPackage').textContent = "–"; document.getElementById('totalHourlyCompensation').textContent = "–"; document.getElementById('estimatedWeeklyCost').textContent = "–"; if (chartInstance) { chartInstance.destroy(); chartInstance = null; } return; } var hoursPerWeek = parseFloat(document.getElementById('hoursPerWeek').value); var hourlyRate = parseFloat(document.getElementById('hourlyRate').value); var healthAndWelfare = parseFloat(document.getElementById('healthAndWelfare').value); var pension = parseFloat(document.getElementById('pension').value); var otherBenefits = parseFloat(document.getElementById('otherBenefits').value); var totalBenefitPackage = healthAndWelfare + pension + otherBenefits; var totalHourlyCompensation = hourlyRate + totalBenefitPackage; var estimatedWeeklyCost = totalHourlyCompensation * hoursPerWeek; document.getElementById('totalBenefitPackage').textContent = "$" + totalBenefitPackage.toFixed(2); document.getElementById('totalHourlyCompensation').textContent = "$" + totalHourlyCompensation.toFixed(2); document.getElementById('estimatedWeeklyCost').textContent = "$" + estimatedWeeklyCost.toFixed(2); document.getElementById('primaryResult').textContent = "$" + totalHourlyCompensation.toFixed(2); // Primary result is total hourly compensation updateChart(hourlyRate, healthAndWelfare, pension, otherBenefits); } function updateChart(baseRate, hw, pension, other) { var ctx = document.getElementById('compensationChart').getContext('2d'); // Destroy previous chart instance if it exists if (chartInstance) { chartInstance.destroy(); } chartInstance = new Chart(ctx, { type: 'bar', data: { labels: ['Base Rate', 'Health & Welfare', 'Pension', 'Other Benefits'], datasets: [{ label: 'Hourly Compensation ($)', data: [baseRate, hw, pension, other], backgroundColor: [ 'rgba(0, 74, 153, 0.7)', // Primary color for Base Rate 'rgba(40, 167, 69, 0.7)', // Success color for Health & Welfare 'rgba(23, 162, 184, 0.7)', // Info color for Pension 'rgba(108, 117, 125, 0.7)' // Secondary color for Other Benefits ], borderColor: [ 'rgba(0, 74, 153, 1)', 'rgba(40, 167, 69, 1)', 'rgba(23, 162, 184, 1)', 'rgba(108, 117, 125, 1)' ], borderWidth: 1 }] }, options: { responsive: true, maintainAspectRatio: false, scales: { y: { beginAtZero: true, ticks: { callback: function(value) { return '$' + value.toFixed(2); } } } }, plugins: { legend: { display: false // Hide legend as labels are on the bars }, tooltip: { callbacks: { label: function(context) { var label = context.dataset.label || "; if (label) { label += ': '; } if (context.parsed.y !== null) { label += '$' + context.parsed.y.toFixed(2); } return label; } } } } } }); } function resetCalculator() { document.getElementById('projectType').value = 'public_works'; document.getElementById('county').value = 'los_angeles'; document.getElementById('trade').value = 'laborer'; document.getElementById('hoursPerWeek').value = '40'; document.getElementById('hourlyRate').value = '25.00'; document.getElementById('healthAndWelfare').value = '5.00'; document.getElementById('pension').value = '3.00'; document.getElementById('otherBenefits').value = '1.00'; // Clear errors document.getElementById('hoursPerWeekError').style.display = 'none'; document.getElementById('hourlyRateError').style.display = 'none'; document.getElementById('healthAndWelfareError').style.display = 'none'; document.getElementById('pensionError').style.display = 'none'; document.getElementById('otherBenefitsError').style.display = 'none'; calculatePrevailingWage(); // Recalculate with default values } function copyResults() { var primaryResult = document.getElementById('primaryResult').textContent; var totalBenefitPackage = document.getElementById('totalBenefitPackage').textContent; var totalHourlyCompensation = document.getElementById('totalHourlyCompensation').textContent; var estimatedWeeklyCost = document.getElementById('estimatedWeeklyCost').textContent; var projectType = document.getElementById('projectType').options[document.getElementById('projectType').selectedIndex].text; var county = document.getElementById('county').options[document.getElementById('county').selectedIndex].text; var trade = document.getElementById('trade').options[document.getElementById('trade').selectedIndex].text; var hours = document.getElementById('hoursPerWeek').value; var baseRate = document.getElementById('hourlyRate').value; var hw = document.getElementById('healthAndWelfare').value; var pension = document.getElementById('pension').value; var other = document.getElementById('otherBenefits').value; var copyText = "— Prevailing Wage Calculation Results —\n\n"; copyText += "Project Type: " + projectType + "\n"; copyText += "County: " + county + "\n"; copyText += "Trade/Occupation: " + trade + "\n"; copyText += "Average Weekly Hours: " + hours + "\n"; copyText += "Base Hourly Rate: $" + parseFloat(baseRate).toFixed(2) + "\n"; copyText += "Health & Welfare ($/hr): $" + parseFloat(hw).toFixed(2) + "\n"; copyText += "Pension ($/hr): $" + parseFloat(pension).toFixed(2) + "\n"; copyText += "Other Fringe Benefits ($/hr): $" + parseFloat(other).toFixed(2) + "\n\n"; copyText += "Primary Result (Total Hourly Compensation): " + primaryResult + "\n"; copyText += "Total Hourly Benefit Package: " + totalBenefitPackage + "\n"; copyText += "Total Hourly Compensation: " + totalHourlyCompensation + "\n"; copyText += "Estimated Weekly Cost (based on " + hours + " hrs): " + estimatedWeeklyCost + "\n\n"; copyText += "Assumptions: Based on entered values and standard California prevailing wage components."; navigator.clipboard.writeText(copyText).then(function() { // Optional: Show a confirmation message var btn = event.target; btn.textContent = 'Copied!'; setTimeout(function() { btn.textContent = 'Copy Results'; }, 2000); }, function() { // Handle error case alert('Failed to copy results. Please copy manually.'); }); } // Initial calculation on page load document.addEventListener('DOMContentLoaded', function() { calculatePrevailingWage(); // Ensure chart canvas is available before trying to create chart var canvas = document.getElementById('compensationChart'); if (canvas) { var ctx = canvas.getContext('2d'); // Initialize chart with default values or placeholder chartInstance = new Chart(ctx, { type: 'bar', data: { labels: ['Base Rate', 'Health & Welfare', 'Pension', 'Other Benefits'], datasets: [{ label: 'Hourly Compensation ($)', data: [0, 0, 0, 0], // Initial zero data backgroundColor: [ 'rgba(0, 74, 153, 0.7)', 'rgba(40, 167, 69, 0.7)', 'rgba(23, 162, 184, 0.7)', 'rgba(108, 117, 125, 0.7)' ], borderColor: [ 'rgba(0, 74, 153, 1)', 'rgba(40, 167, 69, 1)', 'rgba(23, 162, 184, 1)', 'rgba(108, 117, 125, 1)' ], borderWidth: 1 }] }, options: { responsive: true, maintainAspectRatio: false, scales: { y: { beginAtZero: true, ticks: { callback: function(value) { return '$' + value.toFixed(2); } } } }, plugins: { legend: { display: false }, tooltip: { callbacks: { label: function(context) { var label = context.dataset.label || "; if (label) { label += ': '; } if (context.parsed.y !== null) { label += '$' + context.parsed.y.toFixed(2); } return label; } } } } } }); } }); // Add event listeners to inputs to trigger calculation in real-time var inputs = document.querySelectorAll('.loan-calc-container input, .loan-calc-container select'); for (var i = 0; i < inputs.length; i++) { inputs[i].addEventListener('input', calculatePrevailingWage); inputs[i].addEventListener('change', calculatePrevailingWage); // For select elements } // Chart.js library inclusion (required for the canvas chart) // In a real WordPress setup, you'd enqueue this script properly. // For a single HTML file, we include it directly. var script = document.createElement('script'); script.src = 'https://cdn.jsdelivr.net/npm/chart.js@3.7.0/dist/chart.min.js'; document.head.appendChild(script);

Leave a Comment