Parcourir la source

Update dashboard financial summary

Update Invoice import with log
add_swagger
MSI\2Fi il y a 10 mois
Parent
révision
e3a0ae4c89
3 fichiers modifiés avec 25 ajouts et 13 suppressions
  1. +12
    -12
      src/main/java/com/ffii/tsms/modules/data/service/DashboardService.kt
  2. +12
    -0
      src/main/java/com/ffii/tsms/modules/project/service/InvoiceService.kt
  3. +1
    -1
      src/main/java/com/ffii/tsms/modules/report/service/ReportService.kt

+ 12
- 12
src/main/java/com/ffii/tsms/modules/data/service/DashboardService.kt Voir le fichier

@@ -708,14 +708,14 @@ open class DashboardService(
+ " round(expenditure.cumulativeExpenditure,2) as manhoursExpenditure,"
+ " round(projectExpense.amount,2) as projectExpense,"
+ " case"
+ " when coalesce(round(sum(i.issueAmount) / (expenditure.cumulativeExpenditure),3),0) >= 1 then 'Positive'"
+ " when coalesce(round(sum(i.issueAmount) / (expenditure.cumulativeExpenditure),3),0) < 1 then 'Negative'"
+ " when coalesce(round(sum(i.issueAmount) / (expenditure.cumulativeExpenditure + projectExpense.amount),3),0) >= 1 then 'Positive'"
+ " when coalesce(round(sum(i.issueAmount) / (expenditure.cumulativeExpenditure + projectExpense.amount),3),0) < 1 then 'Negative'"
+ " end as cashFlowStatus,"
+ " coalesce(format(sum(i.issueAmount) / (expenditure.cumulativeExpenditure),3),0) as cpi,"
+ " coalesce(format(coalesce(pj.totalFee,0) / (expenditure.cumulativeExpenditure),3),0) as projectedCpi,"
+ " coalesce(format(sum(i.issueAmount) / (expenditure.cumulativeExpenditure + projectExpense.amount),3),0) as cpi,"
+ " coalesce(format(coalesce(pj.totalFee,0) / (expenditure.cumulativeExpenditure + projectExpense.amount),3),0) as projectedCpi,"
+ " case"
+ " when coalesce(round(coalesce(pj.totalFee,0) / (expenditure.cumulativeExpenditure),3),0) >= 1 then 'Positive'"
+ " when coalesce(round(coalesce(pj.totalFee,0) / (expenditure.cumulativeExpenditure),3),0) < 1 then 'Negative'"
+ " when coalesce(round(coalesce(pj.totalFee,0) / (expenditure.cumulativeExpenditure + projectExpense.amount),3),0) >= 1 then 'Positive'"
+ " when coalesce(round(coalesce(pj.totalFee,0) / (expenditure.cumulativeExpenditure + projectExpense.amount),3),0) < 1 then 'Negative'"
+ " end as projectedCashFlowStatus"
+ " from team t"
+ " left join ("
@@ -870,14 +870,14 @@ open class DashboardService(
+ " sum(p.expectedTotalFee) - sum(i.issueAmount) as unInvoiced,"
+ " sum(i.paidAmount) as totalReceived,"
+ " case"
+ " when round(sum(i.issueAmount) / (expenditure.cumulativeExpenditure),3) >= 1 then 'Positive'"
+ " when round(sum(i.issueAmount) / (expenditure.cumulativeExpenditure),3) < 1 then 'Negative'"
+ " when round(sum(i.issueAmount) / ((expenditure.cumulativeExpenditure + projectExpense.amount)),3) >= 1 then 'Positive'"
+ " when round(sum(i.issueAmount) / ((expenditure.cumulativeExpenditure + projectExpense.amount)),3) < 1 then 'Negative'"
+ " end as cashFlowStatus,"
+ " format(sum(i.issueAmount) / (expenditure.cumulativeExpenditure),3) as cpi,"
+ " format(sum(p.expectedTotalFee) / (expenditure.cumulativeExpenditure),3) as projectedCpi,"
+ " format(sum(i.issueAmount) / ((expenditure.cumulativeExpenditure + projectExpense.amount)),3) as cpi,"
+ " format(sum(p.expectedTotalFee) / ((expenditure.cumulativeExpenditure + projectExpense.amount)),3) as projectedCpi,"
+ " case"
+ " when round(sum(p.expectedTotalFee) / (expenditure.cumulativeExpenditure),3) >= 1 then 'Positive'"
+ " when round(sum(p.expectedTotalFee) / (expenditure.cumulativeExpenditure),3) < 1 then 'Negative'"
+ " when round(sum(p.expectedTotalFee) / ((expenditure.cumulativeExpenditure + projectExpense.amount)),3) >= 1 then 'Positive'"
+ " when round(sum(p.expectedTotalFee) / ((expenditure.cumulativeExpenditure + projectExpense.amount)),3) < 1 then 'Negative'"
+ " end as projectedCashFlowStatus"
+ " from project p"
+ " left join ("


+ 12
- 0
src/main/java/com/ffii/tsms/modules/project/service/InvoiceService.kt Voir le fichier

@@ -434,6 +434,12 @@ open class InvoiceService(
issueAmount = ExcelUtils.getCell(sheet, i, 3).numericCellValue.toBigDecimal()
// Beria cannot provide Payment Milestone when importing the invoice, so it cannot be checked and import to DB
// this.milestonePayment = milestonePayment
logger.info("------- Start --------")
logger.info(invoiceNo)
logger.info(projectCode)
logger.info(invoiceDate)
logger.info(issueAmount)
logger.info("------- End ---------")
}
saveAndFlush(invoice)
}
@@ -513,6 +519,12 @@ open class InvoiceService(
val invoice = getInvoiceByInvoiceNo(ExcelUtils.getCell(sheet, i, 0).toString())
invoice.paidAmount = ExcelUtils.getCell(sheet, i, 3).numericCellValue.toBigDecimal()
invoice.receiptDate = ExcelUtils.getCell(sheet, i, 2).dateCellValue.toInstant().atZone(ZoneId.systemDefault()).toLocalDate()
logger.info("------- Start --------")
logger.info(invoice.invoiceNo)
logger.info(invoice.projectCode)
logger.info(invoice.paidAmount)
logger.info(invoice.receiptDate)
logger.info("------- End ---------")
saveAndFlush(invoice)
}



+ 1
- 1
src/main/java/com/ffii/tsms/modules/report/service/ReportService.kt Voir le fichier

@@ -661,7 +661,7 @@ open class ReportService(

val sumUInvoiceCell = row.createCell(14)
sumUInvoiceCell.apply {
cellFormula = "=IF(H${rowNum}-N${rowNum}<0,0,H${rowNum}-N${rowNum})"
cellFormula = "IF(H${rowNum+1}-N${rowNum+1}<0,0,H${rowNum+1}-N${rowNum+1})"
cellStyle = boldFontCellStyle
cellStyle.dataFormat = accountingStyle
}


Chargement…
Annuler
Enregistrer