Quellcode durchsuchen

1. Invoice:

Remove mandatory field checking on milestone and stage column
2. Report
Accounting stype on cost and expense report
tags/Baseline_30082024_BACKEND_UAT
MSI\2Fi vor 1 Jahr
Ursprung
Commit
bf2626ff1a
2 geänderte Dateien mit 16 neuen und 15 gelöschten Zeilen
  1. +15
    -14
      src/main/java/com/ffii/tsms/modules/project/service/InvoiceService.kt
  2. +1
    -1
      src/main/java/com/ffii/tsms/modules/report/service/ReportService.kt

+ 15
- 14
src/main/java/com/ffii/tsms/modules/project/service/InvoiceService.kt Datei anzeigen

@@ -344,7 +344,8 @@ open class InvoiceService(

// For checking mandatory field in each row
val emptyRowList: MutableList<Int> = mutableListOf()
val mandatoryColumns = listOf(0,1,4,5,10,11,12) // Mandatory Field in column 0,1,4,5,10,11,12
// Beria cannot provide Payment Milestone when importing the invoice, so it cannot be checked and import to DB
val mandatoryColumns = listOf(0,1,10,11,12) // Mandatory Field in column 0,1,10,11,12

if (workbook == null) {
return InvoiceResponse(false, "No Excel import", newProjectCodes, emptyRowList, invoicesResult, ArrayList(), ArrayList()) // if workbook is null
@@ -373,15 +374,14 @@ open class InvoiceService(
}
}

if (newProjectCodes.size == 0){
val milestonepaymentWithCode = getMilestonePaymentWithProjectCode(projectsCodes)
// println("newProjectCodes == 0")
// println(checkMilestonePayment(sheet, 2, 5, 0, 1, milestonepaymentWithCode))
val paymenMilestones = checkMilestonePaymentByStageAndDescription(sheet, 2, 4,5, 0, 1, milestonepaymentWithCode)
if (paymenMilestones.isNotEmpty()){
return InvoiceResponse(false, "Imported Invoice's format is incorrect", newProjectCodes, emptyRowList, invoicesResult, duplicateItemsInInvoice, paymenMilestones)
}
}
// Beria cannot provide Payment Milestone when importing the invoice, so it cannot be checked and import to DB
// if (newProjectCodes.size == 0){
// val milestonepaymentWithCode = getMilestonePaymentWithProjectCode(projectsCodes)
// val paymenMilestones = checkMilestonePaymentByStageAndDescription(sheet, 2, 4,5, 0, 1, milestonepaymentWithCode)
// if (paymenMilestones.isNotEmpty()){
// return InvoiceResponse(false, "Imported Invoice's format is incorrect", newProjectCodes, emptyRowList, invoicesResult, duplicateItemsInInvoice, paymenMilestones)
// }
// }

if (invoicesResult.size >= 1 ||
newProjectCodes.size >= 1 ||
@@ -394,9 +394,9 @@ open class InvoiceService(
}

for (i in 2..sheet.lastRowNum){
val paymentMilestoneId = getMilestonePaymentId(ExcelUtils.getCell(sheet, i, 1).stringCellValue, ExcelUtils.getCell(sheet, i, 5).stringCellValue)
// println("paymentMilestoneId--------------: $paymentMilestoneId")
val milestonePayment = milestonePaymentRepository.findById(paymentMilestoneId).orElseThrow()
// Beria cannot provide Payment Milestone when importing the invoice, so it cannot be checked and import to DB
// val paymentMilestoneId = getMilestonePaymentId(ExcelUtils.getCell(sheet, i, 1).stringCellValue, ExcelUtils.getCell(sheet, i, 5).stringCellValue)
// val milestonePayment = milestonePaymentRepository.findById(paymentMilestoneId).orElseThrow()
val invoice = Invoice().apply {
invoiceNo = ExcelUtils.getCell(sheet, i, 0).stringCellValue
projectCode = ExcelUtils.getCell(sheet, i, 1).stringCellValue
@@ -411,7 +411,8 @@ open class InvoiceService(
invoiceDate = ExcelUtils.getCell(sheet, i, 10).dateCellValue.toInstant().atZone(ZoneId.systemDefault()).toLocalDate()
dueDate = ExcelUtils.getCell(sheet, i, 11).dateCellValue.toInstant().atZone(ZoneId.systemDefault()).toLocalDate()
issueAmount = ExcelUtils.getCell(sheet, i, 12).numericCellValue.toBigDecimal()
this.milestonePayment = milestonePayment
// Beria cannot provide Payment Milestone when importing the invoice, so it cannot be checked and import to DB
// this.milestonePayment = milestonePayment
}
saveAndFlush(invoice)
}


+ 1
- 1
src/main/java/com/ffii/tsms/modules/report/service/ReportService.kt Datei anzeigen

@@ -2543,7 +2543,7 @@ open class ReportService(
setCellValue(budget)
// cellStyle.dataFormat = accountingStyle
}
CellUtil.setCellStyleProperty(cell5, "dataFormat", accountingStyle)
CellUtil.setCellStyleProperty(cell6, "dataFormat", accountingStyle)

val cell7 = row.getCell(7) ?: row.createCell(7)
val manHoutsSpentCost = item["manhourExpenditure"] as Double


Laden…
Abbrechen
Speichern