Kaynağa Gözat

update

tags/Baseline_30082024_BACKEND_UAT
cyril.tsui 1 yıl önce
ebeveyn
işleme
08ae3fd3e4
3 değiştirilmiş dosya ile 4 ekleme ve 17 silme
  1. +2
    -0
      src/main/java/com/ffii/tsms/modules/project/entity/TaskTemplate.kt
  2. +2
    -14
      src/main/java/com/ffii/tsms/modules/report/service/ReportService.kt
  3. +0
    -3
      src/main/java/com/ffii/tsms/modules/timesheet/entity/TimesheetRepository.kt

+ 2
- 0
src/main/java/com/ffii/tsms/modules/project/entity/TaskTemplate.kt Dosyayı Görüntüle

@@ -25,9 +25,11 @@ open class TaskTemplate : IdEntity<Long>() {

@JsonManagedReference
@OneToMany(mappedBy = "taskTemplate", cascade = [CascadeType.ALL], orphanRemoval = true)
@OrderBy
open var gradeAllocations: MutableSet<TaskTemplateGradeAllocation> = mutableSetOf()

@JsonManagedReference
@OneToMany(mappedBy = "taskTemplate", cascade = [CascadeType.ALL], orphanRemoval = true)
@OrderBy
open var groupAllocations: MutableSet<TaskTemplateGroupAllocation> = mutableSetOf()
}

+ 2
- 14
src/main/java/com/ffii/tsms/modules/report/service/ReportService.kt Dosyayı Görüntüle

@@ -125,10 +125,11 @@ open class ReportService {

rowIndex = 10
val actualIncome = invoices.sumOf { invoice -> invoice.paidAmount!! }
val actualExpenditure = timesheets.sumOf { timesheet -> timesheet.staff!!.salary.hourlyRate.toDouble() * ((timesheet.normalConsumed ?: 0.0) + (timesheet.otConsumed ?: 0.0)) }
sheet.getRow(rowIndex).apply {
getCell(1).apply {
// TODO: Replace by actual expenditure
// setCellValue(actualIncome * 0.8)
setCellValue(actualExpenditure)
cellStyle.dataFormat = accountingStyle
}

@@ -153,7 +154,6 @@ open class ReportService {
}

// TODO: Add expenditure
// formula =IF(B17>0,D16-B17,D16+C17)
rowIndex = 15
val combinedResults = (invoices.map { it.receiptDate } + timesheets.map { it.recordDate }).filterNotNull().sortedBy { it }

@@ -188,18 +188,6 @@ open class ReportService {
}
cellStyle.dataFormat = accountingStyle
}
getCell(3).apply {
val lastRow = rowIndex - 1
if (lastRow == 15) {
cellFormula = "C{currentRow}".replace("{currentRow}", rowIndex.toString())
} else {
cellFormula = "IF(B{currentRow}>0,D{lastRow}-B{currentRow},D{lastRow}+C{currentRow})".replace(
"{currentRow}",
rowIndex.toString()
).replace("{lastRow}", lastRow.toString())
}
cellStyle.dataFormat = accountingStyle
}

getCell(4).apply {
setCellValue(invoice.milestonePayment!!.description!!)


+ 0
- 3
src/main/java/com/ffii/tsms/modules/timesheet/entity/TimesheetRepository.kt Dosyayı Görüntüle

@@ -2,10 +2,7 @@ package com.ffii.tsms.modules.timesheet.entity;

import com.ffii.core.support.AbstractRepository
import com.ffii.tsms.modules.data.entity.Staff
import com.ffii.tsms.modules.data.entity.projections.StaffSearchInfo
import com.ffii.tsms.modules.project.entity.Project
import com.ffii.tsms.modules.project.entity.StaffAllocation
import com.ffii.tsms.modules.timesheet.entity.projections.MonthlyHours
import com.ffii.tsms.modules.timesheet.entity.projections.TimesheetHours
import com.ffii.tsms.modules.project.entity.ProjectTask
import org.springframework.data.jpa.repository.Query


Yükleniyor…
İptal
Kaydet