Sfoglia il codice sorgente

Invoice related commit

tags/Baseline_30082024_BACKEND_UAT
MSI\2Fi 1 anno fa
parent
commit
fb80f8b713
9 ha cambiato i file con 581 aggiunte e 11 eliminazioni
  1. +6
    -0
      build.gradle
  2. +32
    -0
      src/main/java/com/ffii/core/utils/PdfUtils.java
  3. +6
    -0
      src/main/java/com/ffii/tsms/modules/project/entity/MilestonePaymentRepository.kt
  4. +3
    -0
      src/main/java/com/ffii/tsms/modules/project/entity/MilestoneRepository.kt
  5. +6
    -0
      src/main/java/com/ffii/tsms/modules/project/entity/projections/InvoicePDFReq.kt
  6. +6
    -2
      src/main/java/com/ffii/tsms/modules/project/entity/projections/InvoiceSearchInfo.kt
  7. +122
    -0
      src/main/java/com/ffii/tsms/modules/project/service/InvoiceService.kt
  8. +37
    -9
      src/main/java/com/ffii/tsms/modules/project/web/InvoiceController.kt
  9. +363
    -0
      src/main/resources/pdf/invoicePDF.jrxml

+ 6
- 0
build.gradle Vedi File

@@ -13,6 +13,9 @@ java {

repositories {
mavenCentral()
maven {
url 'https://jaspersoft.jfrog.io/jaspersoft/third-party-ce-artifacts/'
}
}

dependencies {
@@ -44,6 +47,9 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
implementation "org.jetbrains.kotlin:kotlin-reflect"

implementation group: 'net.sf.jasperreports', name: 'jasperreports', version: '6.21.0'
implementation group: 'net.sf.jasperreports', name: 'jasperreports-fonts', version: '6.21.0'

compileOnly group: 'jakarta.servlet', name: 'jakarta.servlet-api', version: '6.0.0'

runtimeOnly 'com.mysql:mysql-connector-j'


+ 32
- 0
src/main/java/com/ffii/core/utils/PdfUtils.java Vedi File

@@ -0,0 +1,32 @@
package com.ffii.core.utils;

import org.springframework.util.ResourceUtils;
import java.io.File;
import net.sf.jasperreports.engine.JasperCompileManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.JasperReport;
import java.util.Map;
import java.util.List;

import net.sf.jasperreports.engine.JRDataSource;
import net.sf.jasperreports.engine.JREmptyDataSource;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;

public class PdfUtils {

public static JasperReport loadJasperReport(String path) throws Exception {
File file = ResourceUtils.getFile(path);
JasperReport reportTemplate = JasperCompileManager.compileReport(file.getAbsolutePath());
return reportTemplate;
}

public static <T> JasperPrint fillReport(JasperReport report, List<T> loopList, Map<String, Object> params)
throws Exception {
JRDataSource dataSources = loopList.size() > 0 ? new JRBeanCollectionDataSource(loopList)
: new JREmptyDataSource();
JasperPrint jasperPrint = JasperFillManager.fillReport(report, params, dataSources);
return jasperPrint;
}

}

+ 6
- 0
src/main/java/com/ffii/tsms/modules/project/entity/MilestonePaymentRepository.kt Vedi File

@@ -0,0 +1,6 @@
package com.ffii.tsms.modules.project.entity;

import com.ffii.core.support.AbstractRepository

interface MilestonePaymentRepository : AbstractRepository<MilestonePayment, Long> {
}

+ 3
- 0
src/main/java/com/ffii/tsms/modules/project/entity/MilestoneRepository.kt Vedi File

@@ -1,6 +1,9 @@
package com.ffii.tsms.modules.project.entity;

import com.ffii.core.support.AbstractRepository
import com.ffii.tsms.modules.project.entity.projections.InvoiceSearchInfo

interface MilestoneRepository : AbstractRepository<Milestone, Long> {

fun findInvoiceSearchInfoBy(): List<InvoiceSearchInfo>
}

+ 6
- 0
src/main/java/com/ffii/tsms/modules/project/entity/projections/InvoicePDFReq.kt Vedi File

@@ -0,0 +1,6 @@
package com.ffii.tsms.modules.project.entity.projections

class InvoicePDFReq {
val amount: Int = 0
val client: String = ""
}

+ 6
- 2
src/main/java/com/ffii/tsms/modules/project/entity/projections/InvoiceSearchInfo.kt Vedi File

@@ -1,14 +1,18 @@
package com.ffii.tsms.modules.project.entity.projections

import com.ffii.tsms.modules.project.entity.MilestonePayment
import org.springframework.beans.factory.annotation.Value

interface InvoiceSearchInfo {
val id: Long?

@get:Value("#{target.name}")
@get:Value("#{target.project.name}")
val projectName: String?

@get:Value("#{target.code}")
@get:Value("#{target.project.code}")
val projectCode: String?

@get:Value("#{target.milestonePayment}")
val milestonePayment: MutableList<MilestonePayment>?

}

+ 122
- 0
src/main/java/com/ffii/tsms/modules/project/service/InvoiceService.kt Vedi File

@@ -0,0 +1,122 @@
package com.ffii.tsms.modules.project.service

import com.ffii.core.support.AbstractBaseEntityService
import com.ffii.core.support.AbstractIdEntityService
import com.ffii.core.support.JdbcDao
import com.ffii.core.utils.PdfUtils

import com.ffii.tsms.modules.project.entity.MilestonePayment
import com.ffii.tsms.modules.project.entity.MilestonePaymentRepository
import com.ffii.tsms.modules.project.entity.projections.InvoicePDFReq
import com.ffii.tsms.modules.project.entity.projections.InvoiceSearchInfo
import net.sf.jasperreports.engine.JasperCompileManager
import net.sf.jasperreports.engine.JasperReport
import org.springframework.core.io.ClassPathResource
import org.springframework.stereotype.Service
import java.io.InputStream
import java.math.BigDecimal
import java.time.LocalDate
import java.time.format.DateTimeFormatter


@Service
open class InvoiceService(
private val milestonePaymentRepository: MilestonePaymentRepository,
private val jdbcDao: JdbcDao,
) : AbstractIdEntityService<MilestonePayment, Long, MilestonePaymentRepository>(jdbcDao, milestonePaymentRepository){
open fun allMilestonePayments(): List<Map<String, Any>> {
val sql = StringBuilder(" select "
+ " mp.id, "
+ " mp.date as paymentMilestoneDate, mp.amount, mp.description as comingPaymentMileStone, "
+ " m.startDate, m.endDate, m.name, m.description as milestoneDescription, "
+ " p.code as projectCode, p.name as projectName "
+ " from milestone_payment mp "
+ " left join milestone m on m.id = mp.milestoneId "
+ " left join project p on p.id = m.projectId "
+ " where p.deleted = false "
)
return jdbcDao.queryForList(sql.toString())
}

open fun getProjectDetailsByMilestonePaymentId(id: Long): List<Map<String, Any>> {
val sql = StringBuilder(" select "
+ " mp.id, "
+ " mp.date as paymentMilestoneDate, mp.amount, mp.description as comingPaymentMileStone, "
+ " m.startDate, m.endDate, m.name, m.description as milestoneDescription, "
+ " p.code as projectCode, p.name as projectName "
+ " from milestone_payment mp "
+ " left join milestone m on m.id = mp.milestoneId "
+ " left join project p on p.id = m.projectId "
+ " where p.deleted = false "
+ " and mp.id = :id "
)
val args: MutableMap<String, Long> = mutableMapOf(
"id" to id,
)
return jdbcDao.queryForList(sql.toString(), args)
}

open fun getInvoiceInfoByMilestonePaymentId(id: Long): List<Map<String, Any>> {
val sql = StringBuilder(" select "
+ " mp.id, "
+ " c.name as client, c.address, "
+ " p.custLeadName as attention, CURDATE() as invoiceDate, mp.date as dueDate, "
+ " \'XXX\' as projectRefNo "
+ " from milestone_payment mp "
+ " left join milestone m on m.id = mp.milestoneId "
+ " left join project p on p.id = m.projectId "
+ " left join customer c on c.id = p.customerId "
+ " where p.deleted = false "
+ " and mp.id = :id "
)
val args: MutableMap<String, Long> = mutableMapOf(
"id" to id,
)
return jdbcDao.queryForList(sql.toString(), args)
}

fun exportPDF(req: InvoicePDFReq): Map<String, Any> {
// Method implementation
try {
val INVOICE_PDF = "pdf/invoicePDF.jrxml"
val resource: ClassPathResource = ClassPathResource(INVOICE_PDF)
val inputStream: InputStream = resource.inputStream

val invoicePDF: JasperReport = JasperCompileManager.compileReport(inputStream)

val fields: MutableList<Map<String, Any>> = ArrayList()
val fieldValue1: Map<String, Any> = mapOf(
"unitPrice" to BigDecimal(1),
"qty" to BigDecimal(2),
"paymentMilestone" to "1 - Completion of stage 1: Design and Cost Planning",
)
val fieldValue2: Map<String, Any> = mapOf(
"unitPrice" to BigDecimal(200),
"qty" to BigDecimal(3),
"paymentMilestone" to "1 - Completion of stage 1: Design and Cost Planning",
)
fields.add(fieldValue1)
fields.add(fieldValue2)
val currentDate: LocalDate = LocalDate.now()

val params: MutableMap<String, Any> = HashMap()
params["Client"] = "CLIENT WONG"
params["Address"] = "Shop No. 17, B1/F, Airside, 2 Concorde Road, Kai Tak, Kowloon"
params["Attention"] = "002 Lee"
params["invoiceNo"] = "INV-20240424"
params["projectRefNo"] = "XXX"
params["curDate"] = currentDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))
params["dueDate"] = "2024-05-01"

return mapOf(
"report" to PdfUtils.fillReport(invoicePDF, fields, params),
"fileName" to params["Client"] as String
)
}catch (e: Exception) {
println(e)
return mapOf(
"error" to e
)
}
}
}

+ 37
- 9
src/main/java/com/ffii/tsms/modules/project/web/InvoiceController.kt Vedi File

@@ -1,32 +1,60 @@
package com.ffii.tsms.modules.project.web

import com.ffii.tsms.modules.project.entity.projections.InvoiceInfoSearchInfo
import com.ffii.tsms.modules.project.entity.projections.InvoicePDFReq
import com.ffii.tsms.modules.project.entity.projections.InvoiceSearchInfo
import com.ffii.tsms.modules.project.service.InvoiceService
import com.ffii.tsms.modules.project.service.ProjectsService
import jakarta.servlet.http.HttpServletResponse
import net.sf.jasperreports.engine.JasperExportManager
import net.sf.jasperreports.engine.JasperPrint
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RequestParam
import org.springframework.web.bind.annotation.RestController
import java.io.OutputStream


@RestController
@RequestMapping("/invoices")
class InvoiceController(
private val projectsService: ProjectsService
private val projectsService: ProjectsService,
private val invoiceService: InvoiceService
) {

@GetMapping
fun allInvoice(): List<InvoiceSearchInfo> {
return projectsService.allInvoices()
fun allInvoice(): List<Map<String, Any>> {
return invoiceService.allMilestonePayments()
}

@GetMapping("/getProjectDetailById")
fun getInvoiceById(@RequestParam("id") id: Long): List<InvoiceSearchInfo> {
return projectsService.getProjectDetailById(id)
@GetMapping("/getProjectDetail/{id}")
fun getInvoiceById(@PathVariable id: Long): List<Map<String, Any>> {
return invoiceService.getProjectDetailsByMilestonePaymentId(id)
}

@GetMapping("/getInvoiceInfoById")
fun getInvoiceInfoById(@RequestParam("id") id: Long): List<InvoiceInfoSearchInfo> {
return projectsService.getInvoiceInfoById(id)
@GetMapping("/getInvoiceInfo/{id}")
fun getInvoiceInfoById(@PathVariable id: Long): List<Map<String, Any>> {
return invoiceService.getInvoiceInfoByMilestonePaymentId(id)
}

@PostMapping("/pdf")
fun generatePDF(req: InvoicePDFReq, response: HttpServletResponse) {
response.characterEncoding = "utf-8"
response.contentType = "application/pdf"

val out: OutputStream = response.outputStream
val pdf: Map<String, Any> = invoiceService.exportPDF(req)

val jasperPrint: JasperPrint = pdf["report"] as JasperPrint
response.setHeader("Content-Disposition", "attachment; filename=\"${pdf["fileName"]}.pdf\"")


try {
out.write(JasperExportManager.exportReportToPdf(jasperPrint))
} finally {
// Any necessary cleanup or additional processing can be done here
}
}
}

+ 363
- 0
src/main/resources/pdf/invoicePDF.jrxml Vedi File

@@ -0,0 +1,363 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.20.6.final using JasperReports Library version 6.20.6-5c96b6aa8a39ac1dc6b6bea4b81168e16dd39231 -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="invoicePDF" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="7d83b0f9-fe9a-4129-bfd6-6cfc17d9fa35">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
<property name="com.jaspersoft.studio.unit." value="pixel"/>
<property name="com.jaspersoft.studio.unit.pageHeight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.pageWidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.topMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.bottomMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.leftMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.rightMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.columnWidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.columnSpacing" value="pixel"/>
<parameter name="Client" class="java.lang.String"/>
<parameter name="Address" class="java.lang.String"/>
<parameter name="Attention" class="java.lang.String"/>
<parameter name="invoiceNo" class="java.lang.String"/>
<parameter name="projectRefNo" class="java.lang.String"/>
<parameter name="curDate" class="java.lang.String"/>
<parameter name="dueDate" class="java.lang.String"/>
<queryString>
<![CDATA[]]>
</queryString>
<field name="unitPrice" class="java.math.BigDecimal"/>
<field name="amount" class="java.math.BigDecimal"/>
<field name="paymentMilestone" class="java.lang.String"/>
<field name="qty" class="java.math.BigDecimal"/>
<variable name="totalAmount" class="java.math.BigDecimal" calculation="Sum">
<variableExpression><![CDATA[$F{unitPrice}.multiply( $F{qty} )]]></variableExpression>
</variable>
<group name="Client">
<groupHeader>
<band height="25">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<textField textAdjust="StretchHeight">
<reportElement x="110" y="0" width="140" height="20" isPrintWhenDetailOverflows="true" uuid="684a680a-359c-43b6-b91a-a05cf8c2ca70"/>
<box topPadding="0" bottomPadding="0"/>
<textFieldExpression><![CDATA[$P{Client}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="280" y="0" width="100" height="20" uuid="556e2b38-0b69-4a2c-8d56-1a28a5215fb3"/>
<box topPadding="0" bottomPadding="0"/>
<text><![CDATA[Invoice No:]]></text>
</staticText>
<textField>
<reportElement x="380" y="0" width="164" height="20" uuid="839b2264-6b33-46e7-b26a-e01bd9d79066"/>
<box topPadding="0" bottomPadding="0"/>
<textFieldExpression><![CDATA[$P{invoiceNo}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="10" y="0" width="100" height="20" uuid="182af3ea-c13e-40db-a0e7-d94b12c784b4"/>
<textElement>
<font fontName="SansSerif" size="11" isBold="false"/>
</textElement>
<text><![CDATA[Client:]]></text>
</staticText>
</band>
</groupHeader>
</group>
<group name="Address" isReprintHeaderOnEachPage="true">
<groupHeader>
<band height="25">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<textField textAdjust="StretchHeight">
<reportElement x="110" y="0" width="140" height="20" isPrintWhenDetailOverflows="true" uuid="0cf3057a-4669-4b49-a7ab-2db747f263f4">
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<box topPadding="0" bottomPadding="0"/>
<textFieldExpression><![CDATA[$P{Address}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="10" y="0" width="100" height="20" uuid="869b0fd5-a071-4181-8366-6c328ff635a2">
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box topPadding="0" bottomPadding="0"/>
<text><![CDATA[Address:]]></text>
</staticText>
<textField>
<reportElement x="380" y="0" width="164" height="20" uuid="b153149a-579b-4619-aa91-327f09dc1606">
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<box topPadding="0" bottomPadding="0"/>
<textFieldExpression><![CDATA[$P{projectRefNo}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="280" y="0" width="100" height="20" uuid="a091861e-e24a-4b93-949a-4e1a9d68a870">
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<box topPadding="0" bottomPadding="0"/>
<text><![CDATA[Project Ref. No:]]></text>
</staticText>
</band>
</groupHeader>
</group>
<group name="Signature">
<groupFooter>
<band height="80">
<staticText>
<reportElement x="20" y="10" width="201" height="70" uuid="a8f7e495-37a7-4a4f-86ac-a4b0cd4c7957"/>
<textElement>
<font size="8"/>
</textElement>
<text><![CDATA[Payment Methods:
1. Direct debit to the following bank account:
xxxxxx
xxxxxx
xxxxxx
2. Cheque crossed and made payable to "xxxxxx"]]></text>
</staticText>
<staticText>
<reportElement x="325" y="10" width="95" height="30" uuid="a832f149-851c-4de9-9d4e-795156c44fff"/>
<textElement>
<font size="8"/>
</textElement>
<text><![CDATA[Issued by
Beria Consultants Limited]]></text>
</staticText>
<staticText>
<reportElement x="325" y="69" width="95" height="11" uuid="a33a2655-2b41-4600-bbbe-15a4a5970e1a"/>
<text><![CDATA[Authorized Signature]]></text>
</staticText>
<line>
<reportElement x="320" y="69" width="140" height="1" uuid="1aab4154-48c9-4ab7-8228-be3e69526457">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
</line>
</band>
</groupFooter>
</group>
<group name="Total Amount">
<groupFooter>
<band height="20">
<textField pattern="#,##0.00" isBlankWhenNull="false">
<reportElement x="440" y="0" width="110" height="20" uuid="03e0b533-986b-421e-b270-52d1bb2015cd">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$V{totalAmount}]]></textFieldExpression>
</textField>
<line>
<reportElement x="440" y="0" width="1" height="20" uuid="304ff78b-e9d0-4478-8d5f-3abe3717bb66">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
</line>
<staticText>
<reportElement x="321" y="0" width="119" height="20" uuid="cea68cad-ad0f-4730-bda2-e3dd43a95b4c">
<property name="com.jaspersoft.studio.unit.x" value="pixel"/>
</reportElement>
<textElement textAlignment="Justified" verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<text><![CDATA[Total Amount:]]></text>
</staticText>
<line>
<reportElement x="10" y="0" width="551" height="1" uuid="b76cd798-a80c-45c8-98b1-80e4318cf7bd">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
</line>
<line>
<reportElement x="10" y="19" width="551" height="1" uuid="4f9ab6f9-397c-4fd8-9261-04d7e433c888">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
</line>
</band>
</groupFooter>
</group>
<group name="Attention">
<groupHeader>
<band height="55">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<staticText>
<reportElement x="10" y="0" width="100" height="20" uuid="11096628-0821-46c6-9aa2-895a4857a1ad">
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box topPadding="0" bottomPadding="0"/>
<text><![CDATA[Attention:]]></text>
</staticText>
<textField>
<reportElement x="110" y="0" width="140" height="20" uuid="1c150b90-be59-42a9-ba4f-444bb06bd170">
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box topPadding="0" bottomPadding="0"/>
<textFieldExpression><![CDATA[$P{Attention}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="380" y="0" width="164" height="20" uuid="a32bd1bf-7334-4923-8c20-f9a1b9fc1254">
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box topPadding="0" bottomPadding="0"/>
<textFieldExpression><![CDATA[$P{curDate}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="280" y="0" width="100" height="20" uuid="d15659cd-045c-4f33-beb0-6b52e595ebbc">
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box topPadding="0" bottomPadding="0"/>
<text><![CDATA[Date:]]></text>
</staticText>
<staticText>
<reportElement x="280" y="25" width="100" height="20" uuid="d70d883a-2779-4894-be69-a7b2216bc1ea">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<box topPadding="0" bottomPadding="0"/>
<text><![CDATA[Payment Due Date:]]></text>
</staticText>
<textField>
<reportElement x="380" y="25" width="164" height="20" uuid="93e3fb31-d6bd-4a84-beb9-ac17976665d9">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<box topPadding="0" bottomPadding="0"/>
<textFieldExpression><![CDATA[$P{dueDate}]]></textFieldExpression>
</textField>
<line>
<reportElement x="10" y="50" width="551" height="1" uuid="c1fd34ad-ce56-49b8-b199-7a341fcf6946">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
</line>
</band>
</groupHeader>
</group>
<group name="Column Header">
<groupHeader>
<band height="41">
<staticText>
<reportElement x="260" y="0" width="60" height="40" uuid="057f3605-56be-440f-b783-ec401036c4dd"/>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font isBold="true"/>
</textElement>
<text><![CDATA[Qty
]]></text>
</staticText>
<staticText>
<reportElement x="17" y="1" width="243" height="40" uuid="96dfd897-5af3-4ae6-8231-1f96643e013e"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<text><![CDATA[Payment Milestone]]></text>
</staticText>
<staticText>
<reportElement x="440" y="1" width="110" height="40" uuid="34ed4f78-a640-441a-be8e-5067e7a8a4ef"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<text><![CDATA[Amount]]></text>
</staticText>
<staticText>
<reportElement x="321" y="1" width="118" height="40" uuid="dbe1bd69-8920-4dcf-a984-8a118c2f4a09"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<text><![CDATA[Unit Price]]></text>
</staticText>
<line>
<reportElement x="260" y="0" width="1" height="41" uuid="3cefc23f-32b5-41eb-804a-65dca704f5c9">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
</line>
<line>
<reportElement x="320" y="0" width="1" height="41" uuid="e80e9429-abb8-4d7b-a399-1dad66108e84">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
</line>
<line>
<reportElement x="440" y="0" width="1" height="40" uuid="c55f3275-fae9-4d3f-aba0-2b135acee5df">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
</line>
<line>
<reportElement x="10" y="40" width="550" height="1" uuid="de06b7b9-55fd-450c-8164-4aa7f5369700">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
</line>
<line>
<reportElement x="10" y="0" width="550" height="1" uuid="37c344dc-b093-4d1d-8361-0c6449648af4">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
</line>
</band>
</groupHeader>
</group>
<background>
<band splitType="Stretch"/>
</background>
<pageHeader>
<band height="59" splitType="Stretch">
<staticText>
<reportElement x="10" y="0" width="120" height="40" uuid="ebfddb7d-1f60-4a9e-9fd3-a8e5b8f4ea6e"/>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font fontName="Dialog" size="22" isBold="true"/>
</textElement>
<text><![CDATA[INVOICE]]></text>
</staticText>
</band>
</pageHeader>
<detail>
<band height="20" splitType="Stretch">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<textField isBlankWhenNull="false">
<reportElement x="17" y="0" width="244" height="20" uuid="ee29910e-c4a8-4749-9d3f-f5402db35d4a"/>
<textElement>
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{paymentMilestone}]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00" isBlankWhenNull="false">
<reportElement x="321" y="0" width="120" height="20" uuid="f1a30fbb-a957-41d5-93b8-ada8db80cda0">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box rightPadding="3"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$F{unitPrice}]]></textFieldExpression>
</textField>
<line>
<reportElement x="260" y="0" width="1" height="20" uuid="f0bda4f5-9e0f-4dde-9446-b4fef2396b03">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
</line>
<line>
<reportElement x="320" y="0" width="1" height="20" uuid="220039eb-de38-4db8-a2ab-bca2879ad100">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
</line>
<line>
<reportElement x="440" y="0" width="1" height="20" uuid="8b718f3b-39d5-4136-b1eb-49cfce304b0b">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
</line>
<textField pattern="#,##0.00" isBlankWhenNull="false">
<reportElement x="439" y="0" width="110" height="20" uuid="aa36d257-7e07-4a10-869d-12af3a1d3018">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$F{unitPrice}.multiply( $F{qty})]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00" isBlankWhenNull="false">
<reportElement x="260" y="0" width="60" height="20" uuid="0cc30128-9eca-42d1-8feb-08a296c75235">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box topPadding="0" leftPadding="0" bottomPadding="0" rightPadding="3"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$F{qty}]]></textFieldExpression>
</textField>
</band>
</detail>
<pageFooter>
<band height="23" splitType="Stretch"/>
</pageFooter>
</jasperReport>

Caricamento…
Annulla
Salva