ソースを参照

Update dashboard financial summary

Update Invoice import with log
add_swagger
MSI\2Fi 10ヶ月前
コミット
e3a0ae4c89
3個のファイルの変更25行の追加13行の削除
  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 ファイルの表示

@@ -708,14 +708,14 @@ open class DashboardService(
+ " round(expenditure.cumulativeExpenditure,2) as manhoursExpenditure," + " round(expenditure.cumulativeExpenditure,2) as manhoursExpenditure,"
+ " round(projectExpense.amount,2) as projectExpense," + " round(projectExpense.amount,2) as projectExpense,"
+ " case" + " 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," + " 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" + " 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" + " end as projectedCashFlowStatus"
+ " from team t" + " from team t"
+ " left join (" + " left join ("
@@ -870,14 +870,14 @@ open class DashboardService(
+ " sum(p.expectedTotalFee) - sum(i.issueAmount) as unInvoiced," + " sum(p.expectedTotalFee) - sum(i.issueAmount) as unInvoiced,"
+ " sum(i.paidAmount) as totalReceived," + " sum(i.paidAmount) as totalReceived,"
+ " case" + " 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," + " 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" + " 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" + " end as projectedCashFlowStatus"
+ " from project p" + " from project p"
+ " left join (" + " left join ("


+ 12
- 0
src/main/java/com/ffii/tsms/modules/project/service/InvoiceService.kt ファイルの表示

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




+ 1
- 1
src/main/java/com/ffii/tsms/modules/report/service/ReportService.kt ファイルの表示

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


val sumUInvoiceCell = row.createCell(14) val sumUInvoiceCell = row.createCell(14)
sumUInvoiceCell.apply { 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 = boldFontCellStyle
cellStyle.dataFormat = accountingStyle cellStyle.dataFormat = accountingStyle
} }


読み込み中…
キャンセル
保存