|
|
@@ -2207,6 +2207,9 @@ open class ReportService( |
|
|
|
val templateInputStream = resource.inputStream |
|
|
|
val workbook: Workbook = XSSFWorkbook(templateInputStream) |
|
|
|
|
|
|
|
val accountingStyle = workbook.createDataFormat().getFormat("_(* #,##0.00_);_(* (#,##0.00);_(* \"-\"??_);_(@_)") |
|
|
|
val percentStyle = workbook.createDataFormat().getFormat("0.00%") |
|
|
|
|
|
|
|
val sheet = workbook.getSheetAt(0) |
|
|
|
var rowNum = 0 |
|
|
|
rowNum = 1 |
|
|
@@ -2282,23 +2285,29 @@ open class ReportService( |
|
|
|
val budget = item["budget"] as Double * 0.8 |
|
|
|
cell5.apply { |
|
|
|
setCellValue(budget) |
|
|
|
// cellStyle.dataFormat = accountingStyle |
|
|
|
} |
|
|
|
CellUtil.setCellStyleProperty(cell5, "dataFormat", accountingStyle) |
|
|
|
|
|
|
|
val cell6 = row.getCell(6) ?: row.createCell(6) |
|
|
|
val manHoutsSpentCost = item["manhourExpenditure"] as Double |
|
|
|
cell6.apply { |
|
|
|
setCellValue(manHoutsSpentCost) |
|
|
|
} |
|
|
|
CellUtil.setCellStyleProperty(cell6, "dataFormat", accountingStyle) |
|
|
|
|
|
|
|
val cell7 = row.getCell(7) ?: row.createCell(7) |
|
|
|
cell7.apply { |
|
|
|
cellFormula = "F${rowNum+1}-G${rowNum+1}" |
|
|
|
} |
|
|
|
CellUtil.setCellStyleProperty(cell7, "dataFormat", accountingStyle) |
|
|
|
|
|
|
|
val cell8 = row.getCell(8) ?: row.createCell(8) |
|
|
|
cell8.apply { |
|
|
|
cellFormula = "H${rowNum+1}/F${rowNum+1}" |
|
|
|
} |
|
|
|
CellUtil.setCellStyleProperty(cell8, "dataFormat", percentStyle) |
|
|
|
|
|
|
|
sheet.setRowBreak(rowNum++); |
|
|
|
} |
|
|
|
|
|
|
|