Skip to content

Commit d7b6dd8

Browse files
jared-duvalclaude
andcommitted
Fix travel and cost totals for 3-year (and 10-year) budgets
The Cumulative sheet total column is not fixed at col 36 — it follows the pattern 11 + (years * 5), giving col 26 for 3-year and col 61 for 10-year templates. Hardcoding 36 caused all totals to read as zero for any non-5-year budget. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 37a69a3 commit d7b6dd8

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

generate_budget_justification.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,9 @@ def extract_other_personnel(self):
378378
else:
379379
# Fallback to blended rate if not found in Summary
380380
cum_sheet = self.wb['Cumulative']
381-
total_oth_salary = cum_sheet.cell(11, 36).value or 0
382-
total_oth_benefits = cum_sheet.cell(14, 36).value or 0
381+
total_col = 11 + (self.years * 5)
382+
total_oth_salary = cum_sheet.cell(11, total_col).value or 0
383+
total_oth_benefits = cum_sheet.cell(14, total_col).value or 0
383384

384385
if total_oth_salary > 0:
385386
blended_ere = (total_oth_benefits / total_oth_salary) * 100
@@ -517,10 +518,11 @@ def extract_cumulative(self):
517518
29: 'total_indirect_costs'
518519
}
519520

521+
total_col = 11 + (self.years * 5) # 3yr→26, 5yr→36, 10yr→61
522+
520523
for row_idx, category in budget_items.items():
521524
years = {}
522-
# Total is in column 36
523-
total = clean_numeric(sheet.cell(row_idx, 36).value)
525+
total = clean_numeric(sheet.cell(row_idx, total_col).value)
524526

525527
# Years at columns 11, 16, 21, 26, 31, ... (+5 pattern)
526528
for i in range(self.years):

0 commit comments

Comments
 (0)