Upraveny data a razítka na sestavách služební cesty.

closes #205
Verze_2.0
František Přibyl 10 years ago
parent ef431867e1
commit 4e6af2ceed

@ -1,5 +1,10 @@
package info.bukova.isspst.data;
import info.bukova.isspst.StringUtils;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Embeddable;
@ -47,4 +52,22 @@ public class UsersAddress {
this.city = city;
}
public String toString() {
List<String> list = new ArrayList<String>();
list.add(this.street);
list.add(this.houseNumber);
final String s1 = StringUtils.joinNotEmpty(list, " ");
list.clear();
list.add(this.zipCode);
list.add(this.city);
final String s2 = StringUtils.joinNotEmpty(list, " ");
list.clear();
list.add(s1);
list.add(s2);
final String s = StringUtils.joinNotEmpty(list, ", ");
return s;
}
}

@ -48,6 +48,7 @@ public class ParamFiller {
if ((definition.getDataSet().get(0) instanceof TripBill)
&& definition.getReport().isSingleRecord()) {
if (userService.getUserSettings().getSignatureFile() != null
&& !userService.getUserSettings().getSignatureFile().isEmpty()) {
definition.setParam("P_USER_SIGNATURE", storage.serverPath(userService.getUserSettings().getSignatureFile()));
@ -55,17 +56,25 @@ public class ParamFiller {
TripBill tb = (TripBill)definition.getDataSet().get(0);
tripReqService.loadAuthItems(tb.getRequirement());
AuthItem lastAuth = tb.getRequirement().getAuthorization().get(tb.getRequirement().getAuthorization().size() - 1);
AuthItem lastButOneAuth = tb.getRequirement().getAuthorization().get(0);
definition.setParam("P_PREV_APPROVE_DATE", lastButOneAuth.getAuthDate());
User lastButOneUser = lastButOneAuth.getApprover();
UserSettingsData prevApproverSettings = userService.getUserSettings(lastButOneUser);
if (prevApproverSettings != null && !StringUtils.isNullOrEmpty(prevApproverSettings.getSignatureFile())) {
definition.setParam("P_PREV_APPROVER_SIGNATURE", storage.serverPath(prevApproverSettings.getSignatureFile()));
}
AuthItem lastAuth = tb.getRequirement().getAuthorization().get(tb.getRequirement().getAuthorization().size() - 1);
definition.setParam("P_APPROVE_DATE", lastAuth.getAuthDate());
User u = lastAuth.getApprover();
UserSettingsData approverSettings = userService.getUserSettings(u);
if (approverSettings != null
&& approverSettings.getSignatureFile() != null
&& !approverSettings.getSignatureFile().isEmpty()) {
if (approverSettings != null && !StringUtils.isNullOrEmpty(approverSettings.getSignatureFile())) {
definition.setParam("P_APPROVER_SIGNATURE", storage.serverPath(approverSettings.getSignatureFile()));
}
}

@ -2,13 +2,17 @@
<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="tripBill" pageWidth="612" pageHeight="792" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="10" bottomMargin="20" uuid="f59e8277-a431-4cdc-abaa-c82c1cf193af">
<property name="ireport.zoom" value="1.5"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="375"/>
<property name="ireport.y" value="378"/>
<parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false">
<defaultValueExpression><![CDATA["./"]]></defaultValueExpression>
</parameter>
<parameter name="P_USER_SIGNATURE" class="java.lang.String"/>
<parameter name="P_LOGO" class="java.lang.String"/>
<parameter name="P_MAIN_ADDRESS" class="java.lang.String"/>
<parameter name="P_PREV_APPROVER_SIGNATURE" class="java.lang.String"/>
<parameter name="P_APPROVER_SIGNATURE" class="java.lang.String"/>
<parameter name="P_PREV_APPROVE_DATE" class="java.util.Date"/>
<parameter name="P_APPROVE_DATE" class="java.util.Date"/>
<queryString>
<![CDATA[]]>
</queryString>
@ -48,11 +52,18 @@
<field name="ownedBy.address.houseNumber" class="java.lang.String"/>
<field name="ownedBy.address.zipCode" class="java.lang.String"/>
<field name="ownedBy.address.city" class="java.lang.String"/>
<field name="modified" class="java.util.Date"/>
<background>
<band splitType="Stretch"/>
</background>
<pageHeader>
<band height="275" splitType="Stretch">
<image onErrorType="Blank">
<reportElement uuid="f9a1f9fe-b6d4-4b1d-972a-59d43b380a5b" x="440" y="206" width="130" height="43">
<printWhenExpression><![CDATA[$P{P_PREV_APPROVER_SIGNATURE} != null]]></printWhenExpression>
</reportElement>
<imageExpression><![CDATA[$P{P_PREV_APPROVER_SIGNATURE}]]></imageExpression>
</image>
<staticText>
<reportElement uuid="6e60bd03-48b9-4555-91ab-757532d93e6a" x="10" y="61" width="143" height="20"/>
<textElement>
@ -166,9 +177,9 @@ tuzemské pracovní cesty]]></text>
</textElement>
<text><![CDATA[Zpráva o výsledku pracovní cesty byla podána dne:]]></text>
</staticText>
<textField pattern="dd. MM. yyyy">
<reportElement uuid="d7b2da96-3040-4a89-9380-0dbb55068601" x="428" y="206" width="144" height="20"/>
<textElement textAlignment="Right"/>
<textField pattern="dd. MM. yyyy" isBlankWhenNull="true">
<reportElement uuid="d7b2da96-3040-4a89-9380-0dbb55068601" x="296" y="206" width="144" height="20"/>
<textElement textAlignment="Left"/>
<textFieldExpression><![CDATA[$F{resultMessageDate}]]></textFieldExpression>
</textField>
<staticText>
@ -203,14 +214,14 @@ tuzemské pracovní cesty]]></text>
<line>
<reportElement uuid="bf83547c-60d9-4f95-a5f1-db0763ba17cb" x="571" y="1" width="1" height="272"/>
</line>
<textField>
<textField isBlankWhenNull="true">
<reportElement uuid="8af60406-55bf-46f0-82e9-865dc9edbdb4" x="196" y="82" width="375" height="20">
<printWhenExpression><![CDATA[$F{ownedBy.address} != null]]></printWhenExpression>
</reportElement>
<textElement>
<font isBold="true" pdfFontName="Helvetica-Bold" isPdfEmbedded="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{ownedBy.address.street} + " " + $F{ownedBy.address.houseNumber} + ", " + $F{ownedBy.address.zipCode} + " " + $F{ownedBy.address.city}]]></textFieldExpression>
<textFieldExpression><![CDATA[$F{ownedBy.address}]]></textFieldExpression>
</textField>
<image onErrorType="Blank">
<reportElement uuid="031517a3-12c1-4094-9da4-59d82aec9243" x="1" y="1" width="100" height="54">
@ -225,6 +236,11 @@ tuzemské pracovní cesty]]></text>
</textElement>
<textFieldExpression><![CDATA[$P{P_MAIN_ADDRESS}]]></textFieldExpression>
</textField>
<textField pattern="dd. MM. yyyy" isBlankWhenNull="false">
<reportElement uuid="d8f79af9-b603-4103-9f78-a98ef574447e" x="340" y="229" width="100" height="20"/>
<textElement verticalAlignment="Bottom"/>
<textFieldExpression><![CDATA[$P{P_PREV_APPROVE_DATE}]]></textFieldExpression>
</textField>
</band>
</pageHeader>
<detail>
@ -254,12 +270,12 @@ tuzemské pracovní cesty]]></text>
</textElement>
<text><![CDATA[ANO]]></text>
</staticText>
<textField pattern="dd. MM. yyyy">
<textField pattern="dd. MM. yyyy" isBlankWhenNull="true">
<reportElement uuid="bf1013d3-8037-4f6f-9c23-6e1d801afbeb" x="345" y="131" width="100" height="13"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[new Date()]]></textFieldExpression>
<textFieldExpression><![CDATA[$F{modified}]]></textFieldExpression>
</textField>
<textField pattern="###0.00;-###0.00" isBlankWhenNull="true">
<reportElement uuid="d5aa48e6-f801-4633-b18b-ccc7358da1e3" x="477" y="2" width="56" height="43"/>
@ -405,6 +421,18 @@ tuzemské pracovní cesty]]></text>
</detail>
<summary>
<band height="194" splitType="Prevent">
<image onErrorType="Blank">
<reportElement uuid="4c553957-3ab2-4f19-af01-577f5d3cef40" x="438" y="103" width="130" height="46">
<printWhenExpression><![CDATA[$P{P_PREV_APPROVER_SIGNATURE} != null]]></printWhenExpression>
</reportElement>
<imageExpression><![CDATA[$P{P_PREV_APPROVER_SIGNATURE}]]></imageExpression>
</image>
<image onErrorType="Blank">
<reportElement uuid="2e42de6e-3f15-42c0-8a1d-5a21809f3193" x="290" y="103" width="130" height="46">
<printWhenExpression><![CDATA[$P{P_APPROVER_SIGNATURE} != null]]></printWhenExpression>
</reportElement>
<imageExpression><![CDATA[$P{P_APPROVER_SIGNATURE}]]></imageExpression>
</image>
<staticText>
<reportElement uuid="58e4cf15-a8e1-4b4d-b491-ad4a1825f0a3" x="281" y="5" width="30" height="15"/>
<textElement/>

@ -2,7 +2,7 @@
<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="tripRequirement" pageWidth="612" pageHeight="792" columnWidth="572" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="0b7fa2d2-d452-4a1f-b1c0-2d8e16a22525">
<property name="ireport.zoom" value="1.5"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="254"/>
<property name="ireport.y" value="0"/>
<style name="table">
<box>
<pen lineWidth="1.0" lineColor="#000000"/>
@ -37,6 +37,8 @@
<parameter name="P_APPROVER_SIGNATURE" class="java.lang.String"/>
<parameter name="P_LOGO" class="java.lang.String"/>
<parameter name="P_MAIN_ADDRESS" class="java.lang.String"/>
<parameter name="P_PREV_APPROVE_DATE" class="java.util.Date"/>
<parameter name="P_PREV_APPROVER_SIGNATURE" class="java.lang.String"/>
<field name="requirement" class="info.bukova.isspst.data.TripRequirement"/>
<field name="ownedBy" class="info.bukova.isspst.data.User"/>
<field name="requirement.reqDate" class="java.util.Date"/>
@ -333,20 +335,20 @@ L - letadlo, P - pěšky, T - taxi]]></text>
<textField pattern="dd. MM. yyyy" isBlankWhenNull="true">
<reportElement uuid="97daa8a7-dab0-4104-babb-c3889faac21a" x="301" y="399" width="77" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$P{P_APPROVE_DATE}]]></textFieldExpression>
<textFieldExpression><![CDATA[$P{P_PREV_APPROVE_DATE}]]></textFieldExpression>
</textField>
<image onErrorType="Blank">
<reportElement uuid="baf922bc-b6fb-4dbf-abc9-250f448baef3" x="378" y="368" width="183" height="50">
<printWhenExpression><![CDATA[$P{P_APPROVER_SIGNATURE} != null]]></printWhenExpression>
<printWhenExpression><![CDATA[$P{P_PREV_APPROVER_SIGNATURE} != null]]></printWhenExpression>
</reportElement>
<imageExpression><![CDATA[$P{P_APPROVER_SIGNATURE}]]></imageExpression>
<imageExpression><![CDATA[$P{P_PREV_APPROVER_SIGNATURE}]]></imageExpression>
</image>
<textField>
<reportElement uuid="16e5c4e2-a366-4eca-ad27-7db7fef6771c" x="186" y="27" width="375" height="20">
<printWhenExpression><![CDATA[$F{ownedBy.address} != null]]></printWhenExpression>
</reportElement>
<textElement/>
<textFieldExpression><![CDATA[$F{ownedBy.address.street} + " " + $F{ownedBy.address.houseNumber} + ", " + $F{ownedBy.address.zipCode} + " " + $F{ownedBy.address.city}]]></textFieldExpression>
<textFieldExpression><![CDATA[$F{ownedBy.address}]]></textFieldExpression>
</textField>
</band>
</detail>

Loading…
Cancel
Save