Přidána sestava pro žádost o služební cestu.

refs #122
multitenant
Josef Rokos 10 years ago
parent 954682fb5f
commit dc94267f6a

@ -94,7 +94,8 @@ public class Constants {
public final static String DYNAMIC_REPORT_NAME = "Tabulková sestava"; public final static String DYNAMIC_REPORT_NAME = "Tabulková sestava";
public final static ReportMapping REPORTS[] = { public final static ReportMapping REPORTS[] = {
new ReportMapping(MOD_ADDRESSBOOK, new Report("Adresní karty", "address")), new ReportMapping(MOD_ADDRESSBOOK, new Report("Adresní karty", "address")),
new ReportMapping(MOD_ADDRESSBOOK, new Report("Adresna", "address", false, true)) new ReportMapping(MOD_ADDRESSBOOK, new Report("Adresa", "address", false, true)),
new ReportMapping(MOD_TRIPBILL, new Report("Žádost", "tripRequirement", false, true))
}; };
public final static String REQTYPE_ORDER = "ORDER"; public final static String REQTYPE_ORDER = "ORDER";

@ -4,7 +4,6 @@ import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Embedded; import javax.persistence.Embedded;
import javax.persistence.Entity; import javax.persistence.Entity;
@ -30,7 +29,7 @@ public class TripRequirement extends RequirementBase {
private String end; private String end;
@Column(name = "END_DATE") @Column(name = "END_DATE")
private Date endDate; private Date endDate;
@ManyToMany(cascade = CascadeType.ALL) @ManyToMany
@LazyCollection(LazyCollectionOption.TRUE) @LazyCollection(LazyCollectionOption.TRUE)
@JoinTable(name="TRIPREQUIREMENT_PASSANGER", joinColumns={@JoinColumn(name="TRIPREQUIREMENT_ID")}, inverseJoinColumns={@JoinColumn(name="USER_ID")}) @JoinTable(name="TRIPREQUIREMENT_PASSANGER", joinColumns={@JoinColumn(name="TRIPREQUIREMENT_ID")}, inverseJoinColumns={@JoinColumn(name="USER_ID")})
private List<User> passengers; private List<User> passengers;

@ -12,5 +12,7 @@ public interface TripBillService extends Service<TripBill> {
public void loadItems(TripBill bill); public void loadItems(TripBill bill);
public void calculate(TripBill bill); public void calculate(TripBill bill);
public List<TripBill> getMy(); public List<TripBill> getMy();
public void loadOwner(TripBill bill);
public void loadPassengers(TripBill bill);
} }

@ -61,7 +61,7 @@ public class TripBillServiceImpl extends AbstractOwnedService<TripBill> implemen
@Override @Override
@Transactional @Transactional
@LazyLoader("form") @LazyLoader({"form", "print"})
public void loadItems(TripBill entity) { public void loadItems(TripBill entity) {
try { try {
if (entity.getBillItems() == null) { if (entity.getBillItems() == null) {
@ -174,4 +174,24 @@ public class TripBillServiceImpl extends AbstractOwnedService<TripBill> implemen
return this.execQuery("from TripBill as tb join fetch tb.ownedBy"); return this.execQuery("from TripBill as tb join fetch tb.ownedBy");
} }
@Override
@Transactional
@LazyLoader("print")
public void loadOwner(TripBill bill) {
TripBill tb = dao.getById(bill.getId());
tb.getOwnedBy().getFirstName();
bill.setOwnedBy(tb.getOwnedBy());
}
@Override
@Transactional
@LazyLoader("print")
public void loadPassengers(TripBill bill) {
Query q = dao.getQuery("from TripRequirement where id = :id");
q.setParameter("id", bill.getRequirement().getId());
TripRequirement tr = (TripRequirement) q.uniqueResult();
tr.getPassengers().size();
bill.getRequirement().setPassengers(tr.getPassengers());
}
} }

@ -0,0 +1,291 @@
<?xml version="1.0" encoding="UTF-8"?>
<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="0.75"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<style name="table">
<box>
<pen lineWidth="1.0" lineColor="#000000"/>
</box>
</style>
<style name="table_TH" mode="Opaque" backcolor="#F0F8FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table_CH" mode="Opaque" backcolor="#BFE1FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table_TD" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<subDataset name="Passengers" uuid="89ee82de-f017-493e-85d1-439a0ff3be72">
<queryString>
<![CDATA[]]>
</queryString>
<field name="fullName" class="java.lang.String">
<fieldDescription><![CDATA[fullName]]></fieldDescription>
</field>
</subDataset>
<subDataset name="dataset1" uuid="2030e480-17f9-4ac5-a8f1-7499b269f3b4"/>
<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"/>
<field name="requirement.from" class="java.lang.String"/>
<field name="requirement.tripDate" class="java.util.Date"/>
<field name="requirement.to" class="java.lang.String"/>
<field name="requirement.description" class="java.lang.String"/>
<field name="requirement.end" class="java.lang.String"/>
<field name="requirement.endDate" class="java.util.Date"/>
<field name="requirement.passengers" class="java.util.Collection"/>
<field name="requirement.vehicle" class="info.bukova.isspst.data.Vehicle"/>
<field name="requirement.vehicle.code" class="java.lang.String"/>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="79" splitType="Stretch">
<staticText>
<reportElement uuid="50f96189-2183-4afd-915d-b5342375e988" x="0" y="30" width="572" height="20"/>
<textElement textAlignment="Center">
<font size="16" isBold="true" isPdfEmbedded="true"/>
</textElement>
<text><![CDATA[Cestovní příkaz]]></text>
</staticText>
<staticText>
<reportElement uuid="5b2dc2ca-188e-4636-b617-dd5c1132246b" x="0" y="50" width="572" height="20"/>
<textElement textAlignment="Center">
<font size="16" isBold="true"/>
</textElement>
<text><![CDATA[k tuzemské pracovní cestě]]></text>
</staticText>
</band>
</title>
<detail>
<band height="529" splitType="Stretch">
<staticText>
<reportElement uuid="f6445d7f-1e96-4d17-9f1d-27eaa8f15022" x="0" y="7" width="143" height="20"/>
<textElement/>
<text><![CDATA[Příjmení, jméno, titul:]]></text>
</staticText>
<staticText>
<reportElement uuid="6f073490-98cc-445b-8b51-81facf335657" x="0" y="27" width="100" height="20"/>
<textElement/>
<text><![CDATA[Bydliště:]]></text>
</staticText>
<staticText>
<reportElement uuid="a3e2a5d3-ea50-48bd-94ea-4530f6624b52" x="0" y="51" width="572" height="20"/>
<textElement textAlignment="Center">
<font size="12"/>
</textElement>
<text><![CDATA[Souhlasím s vysláním na pracovní cestu]]></text>
</staticText>
<staticText>
<reportElement uuid="306f2b85-5dc6-40a6-8c44-76ed46831680" x="0" y="76" width="143" height="20"/>
<textElement/>
<text><![CDATA[Požduji poskytnutí zálohy:]]></text>
</staticText>
<line>
<reportElement uuid="029f1b4c-5f59-4a5e-8d3d-b644af41b657" x="301" y="121" width="271" height="1"/>
</line>
<staticText>
<reportElement uuid="2f0f450a-b89d-4862-b82e-4eb1e9861927" x="301" y="128" width="271" height="20"/>
<textElement textAlignment="Center"/>
<text><![CDATA[Datum a podpis]]></text>
</staticText>
<textField pattern="dd. MM. yyyy">
<reportElement uuid="dd5f12d3-9ce1-4565-83ed-fe9004e3a6c3" x="301" y="101" width="77" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{requirement.reqDate}]]></textFieldExpression>
</textField>
<staticText>
<reportElement uuid="a2912fef-ae4a-4c7e-b08c-3f5f6b92a534" x="0" y="157" width="572" height="20"/>
<textElement textAlignment="Center">
<font size="16" isBold="true" isPdfEmbedded="true"/>
</textElement>
<text><![CDATA[PODMÍNKY PRACOVNÍ CESTY]]></text>
</staticText>
<line>
<reportElement uuid="b415fa20-91d9-4772-9b73-fd26b6cf32a3" x="0" y="177" width="572" height="1"/>
</line>
<line>
<reportElement uuid="74a5cf40-10b4-4f99-8945-5e14323a7b98" x="0" y="253" width="572" height="1"/>
</line>
<line>
<reportElement uuid="a3a337aa-8b1c-4f4f-abc0-4b5a6cba04d5" x="0" y="156" width="572" height="1"/>
</line>
<staticText>
<reportElement uuid="ed4e3928-9a68-4f61-9876-254547efa04e" x="0" y="180" width="143" height="27"/>
<textElement textAlignment="Center"/>
<text><![CDATA[Počátek cesty (místo, datum, hodina)]]></text>
</staticText>
<textField>
<reportElement uuid="ed4a676e-2647-4a91-a1b5-1ff326f50359" x="0" y="208" width="143" height="20"/>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{requirement.from}]]></textFieldExpression>
</textField>
<textField pattern="dd. MM. yyyy">
<reportElement uuid="fd80824e-0a50-4e37-abd5-1c8bf92ded4a" x="0" y="228" width="90" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{requirement.tripDate}]]></textFieldExpression>
</textField>
<textField pattern="hh:mm">
<reportElement uuid="4d004341-3dc5-4b77-a0f2-d93c93aff176" x="90" y="228" width="53" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{requirement.tripDate}]]></textFieldExpression>
</textField>
<staticText>
<reportElement uuid="36c8b801-3fdf-4464-99d7-4f07539d76f8" x="143" y="180" width="143" height="27"/>
<textElement textAlignment="Center"/>
<text><![CDATA[Místo jednání]]></text>
</staticText>
<textField>
<reportElement uuid="6e9e44fe-3022-4802-854e-607238cb21be" x="143" y="208" width="143" height="20"/>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{requirement.to}]]></textFieldExpression>
</textField>
<staticText>
<reportElement uuid="398372d7-7995-42fa-a53a-f50b0f8936db" x="286" y="179" width="143" height="27"/>
<textElement textAlignment="Center"/>
<text><![CDATA[Účel cesty]]></text>
</staticText>
<staticText>
<reportElement uuid="3dbc8b8d-7ac4-40d8-b43c-89e81d26f15c" x="429" y="180" width="143" height="26"/>
<textElement textAlignment="Center"/>
<text><![CDATA[Konec cesty (místo, datum)]]></text>
</staticText>
<textField isBlankWhenNull="true">
<reportElement uuid="3b52420d-1c84-4042-bc88-16f4f36a3af8" x="286" y="208" width="143" height="40"/>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{requirement.description}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="3e9b796b-fc9e-42e4-93d6-a966ce78c771" x="429" y="208" width="143" height="20"/>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{requirement.end}]]></textFieldExpression>
</textField>
<textField pattern="dd. MM. yyyy">
<reportElement uuid="6ae75bed-b03b-4857-b624-71daeb35513d" x="429" y="228" width="143" height="20"/>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{requirement.endDate}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="ad778808-c5cc-419c-b34f-fc84effc1958" x="186" y="7" width="181" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{ownedBy}]]></textFieldExpression>
</textField>
<staticText>
<reportElement uuid="deafc33f-99ed-483e-8682-57a18872941d" x="0" y="265" width="143" height="20"/>
<textElement/>
<text><![CDATA[Spolucestující:]]></text>
</staticText>
<componentElement>
<reportElement uuid="a282ba81-891b-4c97-a47f-1836222a1bf3" x="143" y="265" width="400" height="20"/>
<jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Horizontal">
<datasetRun subDataset="Passengers" uuid="999b96b4-faa2-4c2c-b2d7-dd40e7ff68ee">
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{requirement.passengers})]]></dataSourceExpression>
</datasetRun>
<jr:listContents height="20" width="400">
<textField>
<reportElement uuid="83a5b316-eae3-443e-8fe5-0a6f2e03e47f" x="6" y="0" width="100" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{fullName}]]></textFieldExpression>
</textField>
</jr:listContents>
</jr:list>
</componentElement>
<staticText>
<reportElement uuid="ab2fbb7c-28d3-4e6b-beb9-93c6fc8745c8" x="0" y="302" width="348" height="20"/>
<textElement/>
<text><![CDATA[Určený dopravní prostředek (u vlastního vozidla druh a reg. značka):]]></text>
</staticText>
<textField>
<reportElement uuid="1a52f009-c560-443a-9b84-cd9502b6b0c5" x="348" y="302" width="60" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{requirement.vehicle.code}]]></textFieldExpression>
</textField>
<staticText>
<reportElement uuid="8355e20a-124b-4c63-ab9c-4d64be5b912e" x="0" y="322" width="572" height="40"/>
<textElement textAlignment="Center"/>
<text><![CDATA[A - autobus, V - vlak
AUV - auto vlastní, AUS - auto služební, AUC - auto cizí
L - letadlo, P - pěšky, T - taxi]]></text>
</staticText>
<staticText>
<reportElement uuid="94f07671-9d8f-4542-9afe-f1c0b8ae1a02" x="0" y="369" width="143" height="20"/>
<textElement/>
<text><![CDATA[Ubytování:]]></text>
</staticText>
<staticText>
<reportElement uuid="b1cd5f7d-48fc-4f1b-82e1-69f81026b5ac" x="0" y="398" width="143" height="20"/>
<textElement/>
<text><![CDATA[Poskytnutí zálohy ve výši:]]></text>
</staticText>
<line>
<reportElement uuid="57398205-845b-4633-89db-3b0c4b31f03c" x="301" y="418" width="271" height="1"/>
</line>
<staticText>
<reportElement uuid="e33b0435-12e0-4d9f-9d3f-44f54eed9505" x="301" y="423" width="271" height="20"/>
<textElement textAlignment="Center"/>
<text><![CDATA[Datum a podpis oprávněné osoby]]></text>
</staticText>
<staticText>
<reportElement uuid="cad8d17d-5fdc-41a8-a74d-54ea34e4cdad" x="0" y="449" width="100" height="20"/>
<textElement/>
<text><![CDATA[Povolená záloha]]></text>
</staticText>
<staticText>
<reportElement uuid="2b462c95-65b1-4295-ac47-7d2ac3e16f40" x="0" y="469" width="143" height="20"/>
<textElement/>
<text><![CDATA[Pokladní doklad číslo]]></text>
</staticText>
<staticText>
<reportElement uuid="4cfe5623-901b-4508-9161-920d90cd0405" x="301" y="449" width="100" height="20"/>
<textElement/>
<text><![CDATA[Vyplacená dne:]]></text>
</staticText>
<line>
<reportElement uuid="39f180e0-0300-4087-89b2-dbd9441d1e94" x="149" y="500" width="280" height="1"/>
</line>
<staticText>
<reportElement uuid="a7218a5e-4d69-41fe-a26b-a51dd240cfb1" x="149" y="508" width="280" height="20"/>
<textElement textAlignment="Center"/>
<text><![CDATA[Podpis pokladníka]]></text>
</staticText>
<line direction="BottomUp">
<reportElement uuid="0276901c-8949-4307-a4a6-efa1a9b83341" x="571" y="-79" width="1" height="607"/>
</line>
<line direction="BottomUp">
<reportElement uuid="01ad15ce-276d-4fb8-af37-d896fa7eb77a" x="-1" y="-79" width="1" height="607"/>
</line>
<line>
<reportElement uuid="31fec8f3-7de4-4c34-934e-dbc2ad813c49" x="-1" y="-80" width="573" height="1"/>
</line>
<line>
<reportElement uuid="11f1abd0-78a2-4cee-9553-c960a59a00d3" x="-1" y="528" width="573" height="1"/>
</line>
<line>
<reportElement uuid="00689195-f270-4b32-9878-74c6d5d353cd" x="-1" y="0" width="573" height="1"/>
</line>
<line>
<reportElement uuid="0d8ef0ad-db1e-4be9-8153-b3a885fb8ace" x="0" y="148" width="572" height="1"/>
</line>
<line>
<reportElement uuid="c9713d6e-9b2e-4ce6-8837-3fbbe320fa8b" x="143" y="178" width="1" height="75"/>
</line>
<line>
<reportElement uuid="4e1fb287-81be-477a-95c2-96691d638916" x="285" y="178" width="1" height="75"/>
</line>
<line>
<reportElement uuid="bc2f55db-f6e3-46eb-81cd-1b4161ceeffd" x="428" y="178" width="1" height="75"/>
</line>
<line>
<reportElement uuid="0e93a41e-d13e-4f12-83cb-70d69bb3c0fb" x="0" y="442" width="572" height="1"/>
</line>
</band>
</detail>
</jasperReport>
Loading…
Cancel
Save