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.
multitenant
Josef Rokos 10 years ago
parent 17deee8b21
commit c0b4a51c44

@ -1,5 +1,6 @@
package info.bukova.isspst.data;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -35,6 +36,10 @@ public class TripRequirement extends RequirementBase {
private List<User> passengers;
@Embedded
private Vehicle vehicle;
@Column(name = "REQUIRE_DOWN_PAYMENT")
private Boolean requireDownPayment;
@Column(name = "DOWN_PAYMENT", precision = 15, scale = 4)
private BigDecimal downPayment;
public TripRequirement() {
this.setOwnedBy(new User());
@ -97,4 +102,20 @@ public class TripRequirement extends RequirementBase {
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);
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) {

@ -1,8 +1,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">
<property name="ireport.zoom" value="2.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="518"/>
<property name="ireport.x" value="593"/>
<property name="ireport.y" value="432"/>
<parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false">
<defaultValueExpression><![CDATA["/home/pepa/Dokumenty/dev/java/isspst/"]]></defaultValueExpression>
</parameter>
@ -39,6 +39,7 @@
<field name="total" class="java.math.BigDecimal">
<fieldDescription><![CDATA[total]]></fieldDescription>
</field>
<field name="requirement.downPayment" class="java.math.BigDecimal"/>
<background>
<band splitType="Stretch"/>
</background>
@ -328,8 +329,8 @@ tuzemské pracovní cesty]]></text>
<text><![CDATA[K vyúčtování pracovní cesty připojuji počet příloh]]></text>
</staticText>
<staticText>
<reportElement uuid="c83e0050-7bac-43fa-8182-728243f702c2" x="243" y="107" width="328" height="15"/>
<textElement>
<reportElement uuid="c83e0050-7bac-43fa-8182-728243f702c2" x="1" y="107" width="570" height="15"/>
<textElement textAlignment="Center">
<font isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<text><![CDATA[Prohlašuji, že jsem všechny údaje uvedl úplně a správně.]]></text>
@ -354,6 +355,11 @@ tuzemské pracovní cesty]]></text>
<line>
<reportElement uuid="452bba4b-d293-4253-92c3-5fa58f58ea53" x="-1" y="168" width="572" height="1"/>
</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>
</summary>
</jasperReport>

@ -1,8 +1,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">
<property name="ireport.zoom" value="0.75"/>
<property name="ireport.zoom" value="1.5"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<property name="ireport.y" value="96"/>
<style name="table">
<box>
<pen lineWidth="1.0" lineColor="#000000"/>
@ -44,6 +44,8 @@
<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"/>
<field name="requirement.requireDownPayment" class="java.lang.Boolean"/>
<field name="requirement.downPayment" class="java.math.BigDecimal"/>
<background>
<band splitType="Stretch"/>
</background>
@ -52,14 +54,14 @@
<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"/>
<font size="16" isBold="true" pdfFontName="Helvetica-Bold" 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"/>
<font size="16" isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<text><![CDATA[k tuzemské pracovní cestě]]></text>
</staticText>
@ -80,7 +82,7 @@
<staticText>
<reportElement uuid="a3e2a5d3-ea50-48bd-94ea-4530f6624b52" x="0" y="51" width="572" height="20"/>
<textElement textAlignment="Center">
<font size="12"/>
<font size="12" pdfFontName="Helvetica-Bold"/>
</textElement>
<text><![CDATA[Souhlasím s vysláním na pracovní cestu]]></text>
</staticText>
@ -105,7 +107,7 @@
<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"/>
<font size="16" isBold="true" pdfFontName="Helvetica-Bold" isPdfEmbedded="true"/>
</textElement>
<text><![CDATA[PODMÍNKY PRACOVNÍ CESTY]]></text>
</staticText>
@ -286,6 +288,25 @@ L - letadlo, P - pěšky, T - taxi]]></text>
<line>
<reportElement uuid="0e93a41e-d13e-4f12-83cb-70d69bb3c0fb" x="0" y="442" width="572" height="1"/>
</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>
</detail>
</jasperReport>

@ -299,8 +299,16 @@
</rows>
</grid>
<div hflex="1" align="end" >
<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;"/>
<vbox>
<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>
<include src="/app/formButtons.zul" />
</vlayout>

@ -150,16 +150,29 @@
</template>
</rows>
</grid>
<hbox>
<label value="${labels.RequirementsFormVehicle}"/>
<combobox model="@load(vm.settings.vehicles)"
selectedItem="@bind(fx.vehicle)"
readonly="true">
<template name="model">
<comboitem label="@load(each)"/>
</template>
</combobox>
</hbox>
<grid hflex="min">
<columns>
<column hflex="min"/>
<column hflex="min"/>
</columns>
<rows>
<row>
<label value="${labels.RequirementsFormVehicle}"/>
<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>
<include src="/app/formButtons.zul" />
</vlayout>

Loading…
Cancel
Save