diff --git a/src/main/java/edu/ucdavis/dss/ipa/api/components/budget/views/BudgetExcelView.java b/src/main/java/edu/ucdavis/dss/ipa/api/components/budget/views/BudgetExcelView.java index 167396d4..da4bb083 100644 --- a/src/main/java/edu/ucdavis/dss/ipa/api/components/budget/views/BudgetExcelView.java +++ b/src/main/java/edu/ucdavis/dss/ipa/api/components/budget/views/BudgetExcelView.java @@ -96,7 +96,15 @@ protected void buildExcelDocument(Map model, Workbook workbook, fundsSheet = ExcelHelper.setSheetHeader(fundsSheet, Arrays.asList("Year", "Department", "Scenario Name", "Term", "Type", "Category", "Description", "Notes", "Comments", "Account Number", "Document Number", "Amount")); Sheet expensesSheet = workbook.createSheet("Other Costs"); - expensesSheet = ExcelHelper.setSheetHeader(expensesSheet, Arrays.asList("Year", "Department", "Scenario Name", "Term", "Type", "Description", "Amount")); + expensesSheet = ExcelHelper.setSheetHeader(expensesSheet, + Arrays.asList("Year", "Department", "Scenario Name", "Term", "", "", "Description", + "", "", "", "", "", "", "", "", + "Instructor Type", + "", "", "", "", "", "", "", + "", // TAs + "", "", "", "", + "Cost" + )); Sheet instructorSalariesSheet = workbook.createSheet("Instructor Salaries"); instructorSalariesSheet = ExcelHelper.setSheetHeader(instructorSalariesSheet, Arrays.asList("Year", "Department", "Instructor", "Type", "Cost")); @@ -275,14 +283,30 @@ protected void buildExcelDocument(Map model, Workbook workbook, if(termCodes.contains(expenseItem.getTermCode())){ List cellValues = Arrays.asList( - year, - budgetScenarioExcelView.getWorkgroup().getName(), - scenarioName, - Term.getRegistrarName(expenseItem.getTermCode()), - expenseItem.getExpenseItemTypeDescription(), - expenseItem.getDescription(), - expenseItem.getAmount()); - expensesSheet = ExcelHelper.writeRowToSheet(expensesSheet, cellValues); + year, + budgetScenarioExcelView.getWorkgroup().getName(), + scenarioName, + Term.getRegistrarName(expenseItem.getTermCode()), + "", "", + expenseItem.getDescription(), + "", "", "", "", "", "", "", "", + expenseItem.getExpenseItemInstructorTypeDescription(), + "", "", "", "", "", "", "", + "", // TAs value + "", // Readers value + "", "", "", + expenseItem.getAmount() + // "", "", "" + ); + + ExcelHelper.writeRowToSheet(expensesSheet, cellValues); + + expensesSheet.setColumnHidden(4, true); + expensesSheet.setColumnHidden(5, true); + for (int colIndex = 7; colIndex < 28; colIndex++) { + if (colIndex == 15) { continue; } // Instructor Type + expensesSheet.setColumnHidden(colIndex, true); + } } } diff --git a/src/main/java/edu/ucdavis/dss/ipa/entities/ExpenseItem.java b/src/main/java/edu/ucdavis/dss/ipa/entities/ExpenseItem.java index 73316410..921f53d7 100644 --- a/src/main/java/edu/ucdavis/dss/ipa/entities/ExpenseItem.java +++ b/src/main/java/edu/ucdavis/dss/ipa/entities/ExpenseItem.java @@ -104,6 +104,22 @@ public String getExpenseItemTypeDescription() { } } + @Transient + public String getExpenseItemInstructorTypeDescription() { + if(expenseItemType != null) { + String instructorType = expenseItemType.getDescription().replace(" Cost", ""); + if (instructorType.contains("Augmentation")) { + return instructorType.replace(" Augmentation", " - Augmentation"); + } else if (instructorType.contains("Emeriti")) { + return instructorType.replace("Emeriti", "Emeriti - Recalled"); + } else { + return instructorType; + } + } else { + return ""; + } + } + @JsonProperty("termDescription") @Transient public String getTermDescription() {