This calculator helps you estimate the daily lodging and meal allowance (per diem) for U.S. Army personnel on temporary duty. Per diem rates vary based on location and fiscal year, and are designed to cover the costs of lodging, meals, and incidental expenses.
.army-per-diem-calculator {
font-family: sans-serif;
padding: 20px;
border: 1px solid #ccc;
border-radius: 8px;
max-width: 500px;
margin: 20px auto;
background-color: #f9f9f9;
}
.army-per-diem-calculator h2 {
text-align: center;
color: #333;
margin-bottom: 20px;
}
.army-per-diem-calculator p {
font-size: 0.9em;
color: #555;
line-height: 1.5;
margin-bottom: 20px;
text-align: justify;
}
.army-per-diem-calculator .inputs {
display: grid;
grid-template-columns: 1fr;
gap: 15px;
margin-bottom: 20px;
}
.army-per-diem-calculator .form-group {
display: flex;
flex-direction: column;
}
.army-per-diem-calculator label {
margin-bottom: 5px;
font-weight: bold;
color: #444;
}
.army-per-diem-calculator input[type="number"],
.army-per-diem-calculator input[type="text"] {
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box; /* Ensures padding doesn't affect width */
}
.army-per-diem-calculator button {
display: block;
width: 100%;
padding: 12px;
background-color: #007bff;
color: white;
border: none;
border-radius: 4px;
font-size: 1em;
cursor: pointer;
transition: background-color 0.2s ease;
}
.army-per-diem-calculator button:hover {
background-color: #0056b3;
}
.army-per-diem-calculator .result-section {
margin-top: 20px;
padding: 15px;
border: 1px dashed #007bff;
border-radius: 4px;
background-color: #e7f3ff;
text-align: center;
font-size: 1.1em;
color: #333;
}
.army-per-diem-calculator .result-section strong {
color: #0056b3;
}
function calculatePerDiem() {
var fiscalYear = parseInt(document.getElementById("fiscalYear").value);
var location = document.getElementById("location").value.trim();
var lodgingRateInput = document.getElementById("lodgingRate").value;
var mealRateInput = document.getElementById("mealRate").value;
var days = parseInt(document.getElementById("days").value);
var resultDiv = document.getElementById("result");
resultDiv.innerHTML = ""; // Clear previous results
var totalPerDiem = 0;
var calculatedLodging = 0;
var calculatedMeals = 0;
var calculatedIncidental = 0;
if (isNaN(days) || days 0) {
calculatedLodging = userLodgingRate;
} else if (effectiveLodgingRate > 0) {
calculatedLodging = effectiveLodgingRate;
} else {
resultDiv.innerHTML = "Could not determine lodging rate for the specified location and year. Please enter it manually.";
return;
}
var userMealRate = parseFloat(mealRateInput);
if (!isNaN(userMealRate) && userMealRate > 0) {
calculatedMeals = userMealRate;
} else if (effectiveMIE > 0) {
calculatedMeals = effectiveMIE;
} else {
resultDiv.innerHTML = "Could not determine meal rate for the specified location and year. Please enter it manually.";
return;
}
// Calculate total per diem
// The M&IE rate is usually a combined figure. For simplicity, we'll treat the 'mealRate' input
// as the primary M&IE, and if a specific MIE rate was looked up, we use that.
// If lodging was provided manually, we assume it's *in addition* to any standard M&IE.
// For a more precise calculation, one would need to understand if manual lodging
// is meant to *replace* or *supplement* the standard rate, and if M&IE is
// broken down further (e.g., breakfast, lunch, dinner rates).
totalPerDiem = (calculatedLodging + calculatedMeals) * days;
// Display results
resultDiv.innerHTML =
"Estimated Per Diem:" +
"Lodging: " + calculatedLodging.toFixed(2) + " per day" +
"Meals & Incidental Expenses (M&IE): " + calculatedMeals.toFixed(2) + " per day" +
"Total Per Diem (Lodging + M&IE): " + totalPerDiem.toFixed(2) + " for " + days + " day(s)";
}