K požadavku na služební cestu byla přidána možnost "Požadovat zálohu".
Upraven výpočet vyúčtování- odečítá se požadovaná záloha.
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package info.bukova.isspst.data;
|
package info.bukova.isspst.data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -35,6 +36,10 @@ public class TripRequirement extends RequirementBase {
|
|||||||
private List<User> passengers;
|
private List<User> passengers;
|
||||||
@Embedded
|
@Embedded
|
||||||
private Vehicle vehicle;
|
private Vehicle vehicle;
|
||||||
|
@Column(name = "REQUIRE_DOWN_PAYMENT")
|
||||||
|
private Boolean requireDownPayment;
|
||||||
|
@Column(name = "DOWN_PAYMENT", precision = 15, scale = 4)
|
||||||
|
private BigDecimal downPayment;
|
||||||
|
|
||||||
public TripRequirement() {
|
public TripRequirement() {
|
||||||
this.setOwnedBy(new User());
|
this.setOwnedBy(new User());
|
||||||
@@ -97,4 +102,20 @@ public class TripRequirement extends RequirementBase {
|
|||||||
this.vehicle = vehicle;
|
this.vehicle = vehicle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Boolean getRequireDownPayment() {
|
||||||
|
return requireDownPayment;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRequireDownPayment(Boolean requireDownPayment) {
|
||||||
|
this.requireDownPayment = requireDownPayment;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getDownPayment() {
|
||||||
|
return downPayment;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDownPayment(BigDecimal downPayment) {
|
||||||
|
this.downPayment = downPayment;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,6 +92,10 @@ public class TripBillServiceImpl extends AbstractOwnedService<TripBill> implemen
|
|||||||
calculateItem(item);
|
calculateItem(item);
|
||||||
bill.setTotal(bill.getTotal().add(item.getTotal()));
|
bill.setTotal(bill.getTotal().add(item.getTotal()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (bill.getRequirement().getDownPayment() != null) {
|
||||||
|
bill.setTotal(bill.getTotal().subtract(bill.getRequirement().getDownPayment()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void calculateItem(TripBillItem item) {
|
private void calculateItem(TripBillItem item) {
|
||||||
|
|||||||
Binary file not shown.
@@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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="tripBill" pageWidth="612" pageHeight="792" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="f59e8277-a431-4cdc-abaa-c82c1cf193af">
|
<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="20" bottomMargin="20" uuid="f59e8277-a431-4cdc-abaa-c82c1cf193af">
|
||||||
<property name="ireport.zoom" value="2.0"/>
|
<property name="ireport.zoom" value="2.0"/>
|
||||||
<property name="ireport.x" value="0"/>
|
<property name="ireport.x" value="593"/>
|
||||||
<property name="ireport.y" value="518"/>
|
<property name="ireport.y" value="432"/>
|
||||||
<parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false">
|
<parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false">
|
||||||
<defaultValueExpression><![CDATA["/home/pepa/Dokumenty/dev/java/isspst/"]]></defaultValueExpression>
|
<defaultValueExpression><![CDATA["/home/pepa/Dokumenty/dev/java/isspst/"]]></defaultValueExpression>
|
||||||
</parameter>
|
</parameter>
|
||||||
@@ -39,6 +39,7 @@
|
|||||||
<field name="total" class="java.math.BigDecimal">
|
<field name="total" class="java.math.BigDecimal">
|
||||||
<fieldDescription><![CDATA[total]]></fieldDescription>
|
<fieldDescription><![CDATA[total]]></fieldDescription>
|
||||||
</field>
|
</field>
|
||||||
|
<field name="requirement.downPayment" class="java.math.BigDecimal"/>
|
||||||
<background>
|
<background>
|
||||||
<band splitType="Stretch"/>
|
<band splitType="Stretch"/>
|
||||||
</background>
|
</background>
|
||||||
@@ -328,8 +329,8 @@ tuzemské pracovní cesty]]></text>
|
|||||||
<text><![CDATA[K vyúčtování pracovní cesty připojuji počet příloh]]></text>
|
<text><![CDATA[K vyúčtování pracovní cesty připojuji počet příloh]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="c83e0050-7bac-43fa-8182-728243f702c2" x="243" y="107" width="328" height="15"/>
|
<reportElement uuid="c83e0050-7bac-43fa-8182-728243f702c2" x="1" y="107" width="570" height="15"/>
|
||||||
<textElement>
|
<textElement textAlignment="Center">
|
||||||
<font isBold="true" pdfFontName="Helvetica-Bold"/>
|
<font isBold="true" pdfFontName="Helvetica-Bold"/>
|
||||||
</textElement>
|
</textElement>
|
||||||
<text><![CDATA[Prohlašuji, že jsem všechny údaje uvedl úplně a správně.]]></text>
|
<text><![CDATA[Prohlašuji, že jsem všechny údaje uvedl úplně a správně.]]></text>
|
||||||
@@ -354,6 +355,11 @@ tuzemské pracovní cesty]]></text>
|
|||||||
<line>
|
<line>
|
||||||
<reportElement uuid="452bba4b-d293-4253-92c3-5fa58f58ea53" x="-1" y="168" width="572" height="1"/>
|
<reportElement uuid="452bba4b-d293-4253-92c3-5fa58f58ea53" x="-1" y="168" width="572" height="1"/>
|
||||||
</line>
|
</line>
|
||||||
|
<textField pattern="###0.00;-###0.00" isBlankWhenNull="true">
|
||||||
|
<reportElement uuid="d5aa48e6-f801-4633-b18b-ccc7358da1e3" x="477" y="3" width="56" height="43"/>
|
||||||
|
<textElement textAlignment="Right" verticalAlignment="Middle"/>
|
||||||
|
<textFieldExpression><![CDATA[$F{requirement.downPayment}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
</band>
|
</band>
|
||||||
</summary>
|
</summary>
|
||||||
</jasperReport>
|
</jasperReport>
|
||||||
|
|||||||
Binary file not shown.
@@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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">
|
<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.zoom" value="1.5"/>
|
||||||
<property name="ireport.x" value="0"/>
|
<property name="ireport.x" value="0"/>
|
||||||
<property name="ireport.y" value="0"/>
|
<property name="ireport.y" value="96"/>
|
||||||
<style name="table">
|
<style name="table">
|
||||||
<box>
|
<box>
|
||||||
<pen lineWidth="1.0" lineColor="#000000"/>
|
<pen lineWidth="1.0" lineColor="#000000"/>
|
||||||
@@ -44,6 +44,8 @@
|
|||||||
<field name="requirement.passengers" class="java.util.Collection"/>
|
<field name="requirement.passengers" class="java.util.Collection"/>
|
||||||
<field name="requirement.vehicle" class="info.bukova.isspst.data.Vehicle"/>
|
<field name="requirement.vehicle" class="info.bukova.isspst.data.Vehicle"/>
|
||||||
<field name="requirement.vehicle.code" class="java.lang.String"/>
|
<field name="requirement.vehicle.code" class="java.lang.String"/>
|
||||||
|
<field name="requirement.requireDownPayment" class="java.lang.Boolean"/>
|
||||||
|
<field name="requirement.downPayment" class="java.math.BigDecimal"/>
|
||||||
<background>
|
<background>
|
||||||
<band splitType="Stretch"/>
|
<band splitType="Stretch"/>
|
||||||
</background>
|
</background>
|
||||||
@@ -52,14 +54,14 @@
|
|||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="50f96189-2183-4afd-915d-b5342375e988" x="0" y="30" width="572" height="20"/>
|
<reportElement uuid="50f96189-2183-4afd-915d-b5342375e988" x="0" y="30" width="572" height="20"/>
|
||||||
<textElement textAlignment="Center">
|
<textElement textAlignment="Center">
|
||||||
<font size="16" isBold="true" isPdfEmbedded="true"/>
|
<font size="16" isBold="true" pdfFontName="Helvetica-Bold" isPdfEmbedded="true"/>
|
||||||
</textElement>
|
</textElement>
|
||||||
<text><![CDATA[Cestovní příkaz]]></text>
|
<text><![CDATA[Cestovní příkaz]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="5b2dc2ca-188e-4636-b617-dd5c1132246b" x="0" y="50" width="572" height="20"/>
|
<reportElement uuid="5b2dc2ca-188e-4636-b617-dd5c1132246b" x="0" y="50" width="572" height="20"/>
|
||||||
<textElement textAlignment="Center">
|
<textElement textAlignment="Center">
|
||||||
<font size="16" isBold="true"/>
|
<font size="16" isBold="true" pdfFontName="Helvetica-Bold"/>
|
||||||
</textElement>
|
</textElement>
|
||||||
<text><![CDATA[k tuzemské pracovní cestě]]></text>
|
<text><![CDATA[k tuzemské pracovní cestě]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
@@ -80,7 +82,7 @@
|
|||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="a3e2a5d3-ea50-48bd-94ea-4530f6624b52" x="0" y="51" width="572" height="20"/>
|
<reportElement uuid="a3e2a5d3-ea50-48bd-94ea-4530f6624b52" x="0" y="51" width="572" height="20"/>
|
||||||
<textElement textAlignment="Center">
|
<textElement textAlignment="Center">
|
||||||
<font size="12"/>
|
<font size="12" pdfFontName="Helvetica-Bold"/>
|
||||||
</textElement>
|
</textElement>
|
||||||
<text><![CDATA[Souhlasím s vysláním na pracovní cestu]]></text>
|
<text><![CDATA[Souhlasím s vysláním na pracovní cestu]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
@@ -105,7 +107,7 @@
|
|||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="a2912fef-ae4a-4c7e-b08c-3f5f6b92a534" x="0" y="157" width="572" height="20"/>
|
<reportElement uuid="a2912fef-ae4a-4c7e-b08c-3f5f6b92a534" x="0" y="157" width="572" height="20"/>
|
||||||
<textElement textAlignment="Center">
|
<textElement textAlignment="Center">
|
||||||
<font size="16" isBold="true" isPdfEmbedded="true"/>
|
<font size="16" isBold="true" pdfFontName="Helvetica-Bold" isPdfEmbedded="true"/>
|
||||||
</textElement>
|
</textElement>
|
||||||
<text><![CDATA[PODMÍNKY PRACOVNÍ CESTY]]></text>
|
<text><![CDATA[PODMÍNKY PRACOVNÍ CESTY]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
@@ -286,6 +288,25 @@ L - letadlo, P - pěšky, T - taxi]]></text>
|
|||||||
<line>
|
<line>
|
||||||
<reportElement uuid="0e93a41e-d13e-4f12-83cb-70d69bb3c0fb" x="0" y="442" width="572" height="1"/>
|
<reportElement uuid="0e93a41e-d13e-4f12-83cb-70d69bb3c0fb" x="0" y="442" width="572" height="1"/>
|
||||||
</line>
|
</line>
|
||||||
|
<staticText>
|
||||||
|
<reportElement uuid="548c1550-c12d-42b3-a297-c9be96dbb2e8" x="144" y="76" width="31" height="20">
|
||||||
|
<printWhenExpression><![CDATA[$F{requirement.requireDownPayment}]]></printWhenExpression>
|
||||||
|
</reportElement>
|
||||||
|
<textElement/>
|
||||||
|
<text><![CDATA[Ano]]></text>
|
||||||
|
</staticText>
|
||||||
|
<staticText>
|
||||||
|
<reportElement uuid="e06aba6d-b74d-4ab1-9737-1134a6ac6519" x="144" y="76" width="32" height="20">
|
||||||
|
<printWhenExpression><![CDATA[$F{requirement}.getRequireDownPayment() == null || $F{requirement}.getRequireDownPayment() == false]]></printWhenExpression>
|
||||||
|
</reportElement>
|
||||||
|
<textElement/>
|
||||||
|
<text><![CDATA[Ne]]></text>
|
||||||
|
</staticText>
|
||||||
|
<textField pattern="###0.00;-###0.00" isBlankWhenNull="true">
|
||||||
|
<reportElement uuid="ac95738d-56c8-4ee2-8721-cad00e1b06e4" x="144" y="398" width="57" height="20"/>
|
||||||
|
<textElement textAlignment="Right"/>
|
||||||
|
<textFieldExpression><![CDATA[$F{requirement.downPayment}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
</band>
|
</band>
|
||||||
</detail>
|
</detail>
|
||||||
</jasperReport>
|
</jasperReport>
|
||||||
|
|||||||
@@ -299,8 +299,16 @@
|
|||||||
</rows>
|
</rows>
|
||||||
</grid>
|
</grid>
|
||||||
<div hflex="1" align="end" >
|
<div hflex="1" align="end" >
|
||||||
<label value="${labels.TripBillTotal}: " style="font-size: 14px; font-weight: bold;"/>
|
<vbox>
|
||||||
<label value="@load(vm.dataBean.total) @converter(vm.bigDecimalConverter)" style="font-size: 14px; font-weight: bold;"/>
|
<hbox>
|
||||||
|
<label value="Záloha: " style="font-size: 14px;"/>
|
||||||
|
<label value="@load(vm.dataBean.requirement.downPayment) @converter(vm.bigDecimalConverter)" style="font-size: 14px;"/>
|
||||||
|
</hbox>
|
||||||
|
<hbox>
|
||||||
|
<label value="${labels.TripBillTotal}: " style="font-size: 14px; font-weight: bold;"/>
|
||||||
|
<label value="@load(vm.dataBean.total) @converter(vm.bigDecimalConverter)" style="font-size: 14px; font-weight: bold;"/>
|
||||||
|
</hbox>
|
||||||
|
</vbox>
|
||||||
</div>
|
</div>
|
||||||
<include src="/app/formButtons.zul" />
|
<include src="/app/formButtons.zul" />
|
||||||
</vlayout>
|
</vlayout>
|
||||||
|
|||||||
@@ -150,16 +150,29 @@
|
|||||||
</template>
|
</template>
|
||||||
</rows>
|
</rows>
|
||||||
</grid>
|
</grid>
|
||||||
<hbox>
|
|
||||||
<label value="${labels.RequirementsFormVehicle}"/>
|
<grid hflex="min">
|
||||||
<combobox model="@load(vm.settings.vehicles)"
|
<columns>
|
||||||
selectedItem="@bind(fx.vehicle)"
|
<column hflex="min"/>
|
||||||
readonly="true">
|
<column hflex="min"/>
|
||||||
<template name="model">
|
</columns>
|
||||||
<comboitem label="@load(each)"/>
|
<rows>
|
||||||
</template>
|
<row>
|
||||||
</combobox>
|
<label value="${labels.RequirementsFormVehicle}"/>
|
||||||
</hbox>
|
<combobox model="@load(vm.settings.vehicles)"
|
||||||
|
selectedItem="@bind(fx.vehicle)"
|
||||||
|
readonly="true">
|
||||||
|
<template name="model">
|
||||||
|
<comboitem label="@load(each)"/>
|
||||||
|
</template>
|
||||||
|
</combobox>
|
||||||
|
</row>
|
||||||
|
<row>
|
||||||
|
<checkbox label="Požaduji zálohu" checked="@bind(vm.dataBean.requireDownPayment)"/>
|
||||||
|
<textbox value="@bind(vm.dataBean.downPayment)" disabled="@bind(not vm.dataBean.requireDownPayment)"/>
|
||||||
|
</row>
|
||||||
|
</rows>
|
||||||
|
</grid>
|
||||||
</vbox>
|
</vbox>
|
||||||
<include src="/app/formButtons.zul" />
|
<include src="/app/formButtons.zul" />
|
||||||
</vlayout>
|
</vlayout>
|
||||||
|
|||||||
Reference in New Issue
Block a user