Procházet zdrojové kódy

update dashboard excel

pull/3/head
cyril.tsui před 7 měsíci
rodič
revize
b12980adfd
3 změnil soubory, kde provedl 32 přidání a 11 odebrání
  1. +29
    -10
      src/main/java/com/ffii/tsms/modules/data/service/DashboardService.kt
  2. +3
    -1
      src/main/java/com/ffii/tsms/modules/data/web/models/ExportDashboardExcelRequest.kt
  3. binární
      src/main/resources/templates/report/[Dashboard] Financial Summary for client.xlsx

+ 29
- 10
src/main/java/com/ffii/tsms/modules/data/service/DashboardService.kt Zobrazit soubor

@@ -1060,9 +1060,9 @@ open class DashboardService(
+ " when coalesce(round(p.totalFee / (COALESCE(expenditure.cumulativeExpenditure,0)),3),0) < 1 then 'Negative'"
+ " end as projectedCashFlowStatus,"
+ " case"
+ " when p.totalFee - sum(i.issueAmount) >= 0 then coalesce(round(p.totalFee - sum(i.issueAmount),2),0)"
+ " when p.totalFee - sum(i.issueAmount) < 0 then 0"
+ " when p.totalFee - sum(i.issueAmount) is null then 0"
+ " when p.totalFee - sum(coalesce(i.issueAmount, 0)) >= 0 then coalesce(round(p.totalFee - sum(coalesce(i.issueAmount, 0)),2),0)"
+ " when p.totalFee - sum(coalesce(i.issueAmount, 0)) < 0 then 0"
+ " when p.totalFee - sum(coalesce(i.issueAmount, 0)) is null then 0"
+ " end as totalUninvoiced"
+ " from team t"
+ " left join ("
@@ -1319,9 +1319,9 @@ open class DashboardService(
+ " when coalesce(round(p.expectedTotalFee / (COALESCE(expenditure.cumulativeExpenditure,0)),3),0) < 1 then 'Negative'"
+ " end as projectedCashFlowStatus,"
+ " case"
+ " when p.expectedTotalFee - sum(i.issueAmount) >= 0 then coalesce(round(p.expectedTotalFee - sum(i.issueAmount),2),0)"
+ " when p.expectedTotalFee - sum(i.issueAmount) < 0 then 0"
+ " when p.expectedTotalFee - sum(i.issueAmount) is null then 0"
+ " when p.expectedTotalFee - sum(coalesce(i.issueAmount, 0)) >= 0 then coalesce(round(p.expectedTotalFee - sum(coalesce(i.issueAmount, 0)),2),0)"
+ " when p.expectedTotalFee - sum(coalesce(i.issueAmount, 0)) < 0 then 0"
+ " when p.expectedTotalFee - sum(coalesce(i.issueAmount, 0)) is null then 0"
+ " end as totalUninvoiced"
+ " from team t"
+ " left join project p on t.teamLead = p.teamLead"
@@ -3449,7 +3449,7 @@ open class DashboardService(
}

createCell(9).apply {
setCellValue(financialSummaryByClient.cumulativeExpenditure)
setCellValue(financialSummaryByClient.totalExpenditure)
cellStyle.apply {
setFont(normalFont)
dataFormat = accountingStyle
@@ -3457,8 +3457,9 @@ open class DashboardService(
CellUtil.setAlignment(this, HorizontalAlignment.RIGHT)
}


createCell(10).apply {
setCellValue(financialSummaryByClient.totalInvoiced)
setCellValue(financialSummaryByClient.manhoursExpenditure)
cellStyle.apply {
setFont(normalFont)
dataFormat = accountingStyle
@@ -3467,7 +3468,7 @@ open class DashboardService(
}

createCell(11).apply {
cellFormula = "IF(H${rowIndex}-K${rowIndex}<0,0,H${rowIndex}-K${rowIndex})"
setCellValue(financialSummaryByClient.projectExpense)
cellStyle.apply {
setFont(normalFont)
dataFormat = accountingStyle
@@ -3476,6 +3477,24 @@ open class DashboardService(
}

createCell(12).apply {
setCellValue(financialSummaryByClient.totalInvoiced)
cellStyle.apply {
setFont(normalFont)
dataFormat = accountingStyle
}
CellUtil.setAlignment(this, HorizontalAlignment.RIGHT)
}

createCell(13).apply {
cellFormula = "IF(H${rowIndex}-M${rowIndex}<0,0,H${rowIndex}-M${rowIndex})"
cellStyle.apply {
setFont(normalFont)
dataFormat = accountingStyle
}
CellUtil.setAlignment(this, HorizontalAlignment.RIGHT)
}

createCell(14).apply {
setCellValue(financialSummaryByClient.totalReceived)
cellStyle.apply {
setFont(normalFont)
@@ -3903,7 +3922,7 @@ open class DashboardService(
}

createCell(14).apply {
cellFormula = "IF(I${rowIndex}-L${rowIndex}<0,0,I${rowIndex}-N${rowIndex})"
cellFormula = "IF(I${rowIndex}-N${rowIndex}<0,0,I${rowIndex}-N${rowIndex})"
cellStyle.apply {
setFont(normalFont)
dataFormat = accountingStyle


+ 3
- 1
src/main/java/com/ffii/tsms/modules/data/web/models/ExportDashboardExcelRequest.kt Zobrazit soubor

@@ -8,7 +8,9 @@ data class FinancialSummaryByClient (
val projectNo: Double,
val totalFee: Double,
val totalBudget: Double,
val cumulativeExpenditure: Double,
val totalExpenditure: Double,
val manhoursExpenditure: Double,
val projectExpense: Double,
val totalInvoiced: Double,
val totalReceived: Double,
)


binární
src/main/resources/templates/report/[Dashboard] Financial Summary for client.xlsx Zobrazit soubor


Načítá se…
Zrušit
Uložit