|
@@ -553,20 +553,20 @@ open class ReportService( |
|
|
val uninvoiceCell = row.createCell(14) |
|
|
val uninvoiceCell = row.createCell(14) |
|
|
uninvoiceCell.apply { |
|
|
uninvoiceCell.apply { |
|
|
cellFormula = |
|
|
cellFormula = |
|
|
" IF(H${rowNum}-M${rowNum}<0, 0, H${rowNum}-M${rowNum})" |
|
|
|
|
|
|
|
|
" IF(H${rowNum}-N${rowNum}<0, 0, H${rowNum}-N${rowNum})" |
|
|
// " IF(I${rowNum}<=J${rowNum}, I${rowNum}-L${rowNum}, IF(AND(I${rowNum}>J${rowNum}, J${rowNum}<L${rowNum}), 0, IF(AND(I${rowNum}>J${rowNum}, J${rowNum}>=L${rowNum}), J${rowNum}-L${rowNum}, 0))) " |
|
|
// " IF(I${rowNum}<=J${rowNum}, I${rowNum}-L${rowNum}, IF(AND(I${rowNum}>J${rowNum}, J${rowNum}<L${rowNum}), 0, IF(AND(I${rowNum}>J${rowNum}, J${rowNum}>=L${rowNum}), J${rowNum}-L${rowNum}, 0))) " |
|
|
cellStyle.dataFormat = accountingStyle |
|
|
cellStyle.dataFormat = accountingStyle |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
val cpiCell = row.createCell(15) |
|
|
val cpiCell = row.createCell(15) |
|
|
cpiCell.apply { |
|
|
cpiCell.apply { |
|
|
cellFormula = "IF(J${rowNum} = 0, 0, M${rowNum}/(J${rowNum}+K${rowNum}))" |
|
|
|
|
|
|
|
|
cellFormula = "IF(J${rowNum} = 0, 0, N${rowNum}/(J${rowNum}))" |
|
|
cellStyle = boldFontCellStyle |
|
|
cellStyle = boldFontCellStyle |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
val projectedCpiCell = row.createCell(16) |
|
|
val projectedCpiCell = row.createCell(16) |
|
|
projectedCpiCell.apply { |
|
|
projectedCpiCell.apply { |
|
|
cellFormula = "IF(J${rowNum} = 0, 0, H${rowNum}/(J${rowNum}+K${rowNum}))" |
|
|
|
|
|
|
|
|
cellFormula = "IF(J${rowNum} = 0, 0, H${rowNum}/(J${rowNum}))" |
|
|
cellStyle = boldFontCellStyle |
|
|
cellStyle = boldFontCellStyle |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@@ -579,7 +579,7 @@ open class ReportService( |
|
|
|
|
|
|
|
|
val unsettledAmountCell = row.createCell(18) |
|
|
val unsettledAmountCell = row.createCell(18) |
|
|
unsettledAmountCell.apply { |
|
|
unsettledAmountCell.apply { |
|
|
cellFormula = "M${rowNum}-Q${rowNum}" |
|
|
|
|
|
|
|
|
cellFormula = "N${rowNum}-R${rowNum}" |
|
|
cellStyle = boldFontCellStyle |
|
|
cellStyle = boldFontCellStyle |
|
|
cellStyle.dataFormat = accountingStyle |
|
|
cellStyle.dataFormat = accountingStyle |
|
|
} |
|
|
} |
|
@@ -746,7 +746,7 @@ open class ReportService( |
|
|
val row7: Row = sheet.getRow(rowNum) |
|
|
val row7: Row = sheet.getRow(rowNum) |
|
|
val cell3 = row7.createCell(2) |
|
|
val cell3 = row7.createCell(2) |
|
|
cell3.apply { |
|
|
cell3.apply { |
|
|
cellFormula = "L${lastRowNum}" |
|
|
|
|
|
|
|
|
cellFormula = "M${lastRowNum}" |
|
|
cellStyle.dataFormat = accountingStyle |
|
|
cellStyle.dataFormat = accountingStyle |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@@ -754,7 +754,7 @@ open class ReportService( |
|
|
val row8: Row = sheet.getRow(rowNum) |
|
|
val row8: Row = sheet.getRow(rowNum) |
|
|
val cell4 = row8.createCell(2) |
|
|
val cell4 = row8.createCell(2) |
|
|
cell4.apply { |
|
|
cell4.apply { |
|
|
cellFormula = "M${lastRowNum}" |
|
|
|
|
|
|
|
|
cellFormula = "N${lastRowNum}" |
|
|
cellStyle.dataFormat = accountingStyle |
|
|
cellStyle.dataFormat = accountingStyle |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@@ -762,7 +762,7 @@ open class ReportService( |
|
|
val row9: Row = sheet.getRow(rowNum) |
|
|
val row9: Row = sheet.getRow(rowNum) |
|
|
val cell5 = row9.createCell(2) |
|
|
val cell5 = row9.createCell(2) |
|
|
cell5.apply { |
|
|
cell5.apply { |
|
|
cellFormula = "N${lastRowNum}" |
|
|
|
|
|
|
|
|
cellFormula = "O${lastRowNum}" |
|
|
cellStyle.dataFormat = accountingStyle |
|
|
cellStyle.dataFormat = accountingStyle |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@@ -770,7 +770,7 @@ open class ReportService( |
|
|
val row10: Row = sheet.getRow(rowNum) |
|
|
val row10: Row = sheet.getRow(rowNum) |
|
|
val cell6 = row10.createCell(2) |
|
|
val cell6 = row10.createCell(2) |
|
|
cell6.apply { |
|
|
cell6.apply { |
|
|
cellFormula = "Q${lastRowNum}" |
|
|
|
|
|
|
|
|
cellFormula = "R${lastRowNum}" |
|
|
cellStyle.dataFormat = accountingStyle |
|
|
cellStyle.dataFormat = accountingStyle |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@@ -778,7 +778,7 @@ open class ReportService( |
|
|
val row11: Row = sheet.getRow(rowNum) |
|
|
val row11: Row = sheet.getRow(rowNum) |
|
|
val cell7 = row11.createCell(2) |
|
|
val cell7 = row11.createCell(2) |
|
|
cell7.apply { |
|
|
cell7.apply { |
|
|
cellFormula = "R${lastRowNum}" |
|
|
|
|
|
|
|
|
cellFormula = "S${lastRowNum}" |
|
|
cellStyle.dataFormat = accountingStyle |
|
|
cellStyle.dataFormat = accountingStyle |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@@ -949,6 +949,12 @@ open class ReportService( |
|
|
) |
|
|
) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
println("groupedTimesheets") |
|
|
|
|
|
println(groupedTimesheets) |
|
|
|
|
|
|
|
|
|
|
|
monthlyStaffSalaryEffective.forEach { if(it.staff.staffId == "B130") println(it) } |
|
|
|
|
|
|
|
|
println("grouped Project Expense") |
|
|
println("grouped Project Expense") |
|
|
println(groupedProjectExpense) |
|
|
println(groupedProjectExpense) |
|
|
// groupedTimesheets.entries.forEach { (key, value) -> |
|
|
// groupedTimesheets.entries.forEach { (key, value) -> |
|
@@ -995,7 +1001,7 @@ open class ReportService( |
|
|
val lastRow = rowIndex - 1 |
|
|
val lastRow = rowIndex - 1 |
|
|
if (lastRow == 16) { |
|
|
if (lastRow == 16) { |
|
|
cellFormula = |
|
|
cellFormula = |
|
|
"C{currentRow}-B{currentRow}".replace("{currentRow}", rowIndex.toString()) |
|
|
|
|
|
|
|
|
"D{currentRow}-C{currentRow}-B{currentRow}".replace("{currentRow}", rowIndex.toString()) |
|
|
} else { |
|
|
} else { |
|
|
cellFormula = |
|
|
cellFormula = |
|
|
"IF(B{currentRow}>0,E{lastRow}-B{currentRow}-C{currentRow},E{lastRow}+D{currentRow}-C{currentRow})".replace( |
|
|
"IF(B{currentRow}>0,E{lastRow}-B{currentRow}-C{currentRow},E{lastRow}+D{currentRow}-C{currentRow})".replace( |
|
@@ -1039,7 +1045,7 @@ open class ReportService( |
|
|
val lastRow = rowIndex - 1 |
|
|
val lastRow = rowIndex - 1 |
|
|
if (lastRow == 16) { |
|
|
if (lastRow == 16) { |
|
|
cellFormula = |
|
|
cellFormula = |
|
|
"C{currentRow}-B{currentRow}".replace("{currentRow}", rowIndex.toString()) |
|
|
|
|
|
|
|
|
"D{currentRow}-C{currentRow}-B{currentRow}".replace("{currentRow}", rowIndex.toString()) |
|
|
} else { |
|
|
} else { |
|
|
cellFormula = |
|
|
cellFormula = |
|
|
"IF(B{currentRow}>0,E{lastRow}-B{currentRow}-C{currentRow},E{lastRow}+D{currentRow}-C{currentRow})".replace( |
|
|
"IF(B{currentRow}>0,E{lastRow}-B{currentRow}-C{currentRow},E{lastRow}+D{currentRow}-C{currentRow})".replace( |
|
@@ -1090,7 +1096,7 @@ open class ReportService( |
|
|
createCell(4).apply { |
|
|
createCell(4).apply { |
|
|
val lastRow = rowIndex - 1 |
|
|
val lastRow = rowIndex - 1 |
|
|
if (lastRow == 16) { |
|
|
if (lastRow == 16) { |
|
|
cellFormula = "C{currentRow}-B{currentRow}".replace("{currentRow}", rowIndex.toString()) |
|
|
|
|
|
|
|
|
cellFormula = "D{currentRow}-C{currentRow}-B{currentRow}".replace("{currentRow}", rowIndex.toString()) |
|
|
} else { |
|
|
} else { |
|
|
cellFormula = |
|
|
cellFormula = |
|
|
"IF(B{currentRow}>0,E{lastRow}-B{currentRow}-C{currentRow},E{lastRow}+D{currentRow}-C{currentRow})".replace( |
|
|
"IF(B{currentRow}>0,E{lastRow}-B{currentRow}-C{currentRow},E{lastRow}+D{currentRow}-C{currentRow})".replace( |
|
@@ -1134,7 +1140,7 @@ open class ReportService( |
|
|
val lastRow = rowIndex - 1 |
|
|
val lastRow = rowIndex - 1 |
|
|
if (lastRow == 16) { |
|
|
if (lastRow == 16) { |
|
|
cellFormula = |
|
|
cellFormula = |
|
|
"C{currentRow}-B{currentRow}".replace("{currentRow}", rowIndex.toString()) |
|
|
|
|
|
|
|
|
"D{currentRow}-C{currentRow}-B{currentRow}".replace("{currentRow}", rowIndex.toString()) |
|
|
} else { |
|
|
} else { |
|
|
cellFormula = |
|
|
cellFormula = |
|
|
"IF(B{currentRow}>0,E{lastRow}-B{currentRow}-C{currentRow},E{lastRow}+D{currentRow}-C{currentRow})".replace( |
|
|
"IF(B{currentRow}>0,E{lastRow}-B{currentRow}-C{currentRow},E{lastRow}+D{currentRow}-C{currentRow})".replace( |
|
@@ -1178,7 +1184,7 @@ open class ReportService( |
|
|
val lastRow = rowIndex - 1 |
|
|
val lastRow = rowIndex - 1 |
|
|
if (lastRow == 16) { |
|
|
if (lastRow == 16) { |
|
|
cellFormula = |
|
|
cellFormula = |
|
|
"C{currentRow}-B{currentRow}".replace("{currentRow}", rowIndex.toString()) |
|
|
|
|
|
|
|
|
"D{currentRow}-C{currentRow}-B{currentRow}".replace("{currentRow}", rowIndex.toString()) |
|
|
} else { |
|
|
} else { |
|
|
cellFormula = |
|
|
cellFormula = |
|
|
"IF(B{currentRow}>0,E{lastRow}-B{currentRow}-C{currentRow},E{lastRow}+D{currentRow}-C{currentRow})".replace( |
|
|
"IF(B{currentRow}>0,E{lastRow}-B{currentRow}-C{currentRow},E{lastRow}+D{currentRow}-C{currentRow})".replace( |
|
|