Do agendy požadavků na služební cesty byla přidána možnost prohlížení vyúčtování služební cesty.

closes #200
Verze_2.0
Josef Rokos 10 years ago
parent 678c140a94
commit 1df90a41c4

@ -1,10 +1,12 @@
package info.bukova.isspst.services.requirement; package info.bukova.isspst.services.requirement;
import info.bukova.isspst.data.TripBill;
import info.bukova.isspst.data.TripRequirement; import info.bukova.isspst.data.TripRequirement;
public interface TripRequirementService extends RequirementBaseService<TripRequirement> public interface TripRequirementService extends RequirementBaseService<TripRequirement>
{ {
public void loadPassangers(TripRequirement entity); public void loadPassangers(TripRequirement entity);
public TripBill getTripBill(TripRequirement requirement);
} }

@ -7,10 +7,12 @@ import info.bukova.isspst.services.tripbill.TripBillService;
import info.bukova.isspst.services.workgroups.WorkgroupService; import info.bukova.isspst.services.workgroups.WorkgroupService;
import org.hibernate.Hibernate; import org.hibernate.Hibernate;
import org.hibernate.LazyInitializationException; import org.hibernate.LazyInitializationException;
import org.hibernate.Query;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.Date; import java.util.Date;
import java.util.List;
public class TripRequirementServiceImpl extends RequirementBaseServiceImpl<TripRequirement> public class TripRequirementServiceImpl extends RequirementBaseServiceImpl<TripRequirement>
implements TripRequirementService, RequirementBaseService<TripRequirement> { implements TripRequirementService, RequirementBaseService<TripRequirement> {
@ -49,6 +51,20 @@ public class TripRequirementServiceImpl extends RequirementBaseServiceImpl<TripR
} }
} }
@Override
@Transactional
public TripBill getTripBill(TripRequirement requirement) {
Query q = dao.getQuery("from TripBill tb where tb.requirement = :req");
q.setParameter("req", requirement);
List<TripBill> result = q.list();
if (result.size() > 0) {
return result.get(0);
}
return null;
}
@Transactional @Transactional
@LazyLoader("form") @LazyLoader("form")
public void loadAttachments(TripRequirement entity) { public void loadAttachments(TripRequirement entity) {

@ -1,20 +1,26 @@
package info.bukova.isspst.ui.requirement; package info.bukova.isspst.ui.requirement;
import info.bukova.isspst.data.TripBill;
import info.bukova.isspst.data.TripRequirement; import info.bukova.isspst.data.TripRequirement;
import info.bukova.isspst.data.Workgroup; import info.bukova.isspst.data.Workgroup;
import info.bukova.isspst.filters.TripRequirementFilter; import info.bukova.isspst.filters.TripRequirementFilter;
import info.bukova.isspst.services.requirement.TripRequirementService; import info.bukova.isspst.services.requirement.TripRequirementService;
import info.bukova.isspst.services.tripbill.TripBillService;
import info.bukova.isspst.services.workgroups.WorkgroupService; import info.bukova.isspst.services.workgroups.WorkgroupService;
import java.util.ArrayList;
import java.util.List;
import org.springframework.security.access.AccessDeniedException; import org.springframework.security.access.AccessDeniedException;
import org.zkoss.bind.BindUtils; import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.Command;
import org.zkoss.bind.annotation.GlobalCommand; import org.zkoss.bind.annotation.GlobalCommand;
import org.zkoss.bind.annotation.Init; import org.zkoss.bind.annotation.Init;
import org.zkoss.bind.annotation.NotifyChange; import org.zkoss.bind.annotation.NotifyChange;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.select.annotation.WireVariable; import org.zkoss.zk.ui.select.annotation.WireVariable;
import org.zkoss.zul.Window;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class TripRequirementListAll extends RequirementSubpage<TripRequirement> { public class TripRequirementListAll extends RequirementSubpage<TripRequirement> {
@ -22,6 +28,8 @@ public class TripRequirementListAll extends RequirementSubpage<TripRequirement>
private TripRequirementService tripRequirementService; private TripRequirementService tripRequirementService;
@WireVariable @WireVariable
private WorkgroupService workgroupService; private WorkgroupService workgroupService;
@WireVariable
private TripBillService tripBillService;
private List<Workgroup> allCentres; private List<Workgroup> allCentres;
private List<Workgroup> allWorkgroups; private List<Workgroup> allWorkgroups;
@ -65,4 +73,18 @@ public class TripRequirementListAll extends RequirementSubpage<TripRequirement>
BindUtils.postGlobalCommand(null, null, "selectAll", null); BindUtils.postGlobalCommand(null, null, "selectAll", null);
} }
@Command
public void showTripBill() {
if (getDataBean() == null) {
return;
}
TripBill tb = tripRequirementService.getTripBill(getDataBean());
tripBillService.loadLazyData(tb);
Map<String, Object> params = new HashMap<String, Object>();
params.put("selected", tb);
Window win = (Window) Executions.createComponents("tripBill.zul", null, params);
win.doModal();
}
} }

@ -1,20 +1,26 @@
package info.bukova.isspst.ui.requirement; package info.bukova.isspst.ui.requirement;
import info.bukova.isspst.data.TripBill;
import info.bukova.isspst.data.TripRequirement; import info.bukova.isspst.data.TripRequirement;
import info.bukova.isspst.data.Workgroup; import info.bukova.isspst.data.Workgroup;
import info.bukova.isspst.filters.TripRequirementFilter; import info.bukova.isspst.filters.TripRequirementFilter;
import info.bukova.isspst.services.requirement.TripRequirementService; import info.bukova.isspst.services.requirement.TripRequirementService;
import info.bukova.isspst.services.tripbill.TripBillService;
import info.bukova.isspst.services.workgroups.WorkgroupService; import info.bukova.isspst.services.workgroups.WorkgroupService;
import java.util.ArrayList;
import java.util.List;
import org.springframework.security.access.AccessDeniedException; import org.springframework.security.access.AccessDeniedException;
import org.zkoss.bind.BindUtils; import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.Command;
import org.zkoss.bind.annotation.GlobalCommand; import org.zkoss.bind.annotation.GlobalCommand;
import org.zkoss.bind.annotation.Init; import org.zkoss.bind.annotation.Init;
import org.zkoss.bind.annotation.NotifyChange; import org.zkoss.bind.annotation.NotifyChange;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.select.annotation.WireVariable; import org.zkoss.zk.ui.select.annotation.WireVariable;
import org.zkoss.zul.Window;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class TripRequirementListCentre extends RequirementSubpage<TripRequirement> { public class TripRequirementListCentre extends RequirementSubpage<TripRequirement> {
@ -24,6 +30,9 @@ public class TripRequirementListCentre extends RequirementSubpage<TripRequiremen
@WireVariable @WireVariable
private WorkgroupService workgroupService; private WorkgroupService workgroupService;
@WireVariable
private TripBillService tripBillService;
private List<Workgroup> myCentres; private List<Workgroup> myCentres;
@Init @Init
@ -61,4 +70,18 @@ public class TripRequirementListCentre extends RequirementSubpage<TripRequiremen
BindUtils.postGlobalCommand(null, null, "selectCentre", null); BindUtils.postGlobalCommand(null, null, "selectCentre", null);
} }
@Command
public void showTripBill() {
if (getDataBean() == null) {
return;
}
TripBill tb = tripRequirementService.getTripBill(getDataBean());
tripBillService.loadLazyData(tb);
Map<String, Object> params = new HashMap<String, Object>();
params.put("selected", tb);
Window win = (Window) Executions.createComponents("tripBill.zul", null, params);
win.doModal();
}
} }

@ -1,20 +1,26 @@
package info.bukova.isspst.ui.requirement; package info.bukova.isspst.ui.requirement;
import info.bukova.isspst.data.TripBill;
import info.bukova.isspst.data.TripRequirement; import info.bukova.isspst.data.TripRequirement;
import info.bukova.isspst.data.Workgroup; import info.bukova.isspst.data.Workgroup;
import info.bukova.isspst.filters.TripRequirementFilter; import info.bukova.isspst.filters.TripRequirementFilter;
import info.bukova.isspst.services.requirement.TripRequirementService; import info.bukova.isspst.services.requirement.TripRequirementService;
import info.bukova.isspst.services.tripbill.TripBillService;
import info.bukova.isspst.services.workgroups.WorkgroupService; import info.bukova.isspst.services.workgroups.WorkgroupService;
import java.util.ArrayList;
import java.util.List;
import org.springframework.security.access.AccessDeniedException; import org.springframework.security.access.AccessDeniedException;
import org.zkoss.bind.BindUtils; import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.Command;
import org.zkoss.bind.annotation.GlobalCommand; import org.zkoss.bind.annotation.GlobalCommand;
import org.zkoss.bind.annotation.Init; import org.zkoss.bind.annotation.Init;
import org.zkoss.bind.annotation.NotifyChange; import org.zkoss.bind.annotation.NotifyChange;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.select.annotation.WireVariable; import org.zkoss.zk.ui.select.annotation.WireVariable;
import org.zkoss.zul.Window;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class TripRequirementListWorkgroup extends RequirementSubpage<TripRequirement> { public class TripRequirementListWorkgroup extends RequirementSubpage<TripRequirement> {
@ -24,6 +30,9 @@ public class TripRequirementListWorkgroup extends RequirementSubpage<TripRequire
@WireVariable @WireVariable
private WorkgroupService workgroupService; private WorkgroupService workgroupService;
@WireVariable
private TripBillService tripBillService;
private List<Workgroup> myCentres; private List<Workgroup> myCentres;
private List<Workgroup> myWorkgroups; private List<Workgroup> myWorkgroups;
@ -68,4 +77,18 @@ public class TripRequirementListWorkgroup extends RequirementSubpage<TripRequire
BindUtils.postGlobalCommand(null, null, "selectWorkgroup", null); BindUtils.postGlobalCommand(null, null, "selectWorkgroup", null);
} }
@Command
public void showTripBill() {
if (getDataBean() == null) {
return;
}
TripBill tb = tripRequirementService.getTripBill(getDataBean());
tripBillService.loadLazyData(tb);
Map<String, Object> params = new HashMap<String, Object>();
params.put("selected", tb);
Window win = (Window) Executions.createComponents("tripBill.zul", null, params);
win.doModal();
}
} }

@ -224,6 +224,7 @@ TripBillBack=Zpět
TripBillTotal=Celkem TripBillTotal=Celkem
TripRequirement=Požadavek na služební cestu TripRequirement=Požadavek na služební cestu
ShowTripBill=Zobrazit vyúčtování
CentresForRequirements=Střediska, pro která lze vkládat požadavky CentresForRequirements=Střediska, pro která lze vkládat požadavky
WorkgroupMembership=Členství v komisích WorkgroupMembership=Členství v komisích

Binary file not shown.

After

Width:  |  Height:  |  Size: 651 B

@ -10,342 +10,15 @@
position="center" position="center"
apply="org.zkoss.bind.BindComposer" apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.tripbill.TripBillForm')"> viewModel="@id('vm') @init('info.bukova.isspst.ui.tripbill.TripBillForm')">
<zscript>
boolean disabled = false;
</zscript>
<caption <caption
src="/img/pickup-032.png" src="/img/pickup-032.png"
zclass="form-caption" zclass="form-caption"
label="${labels.TravelOrdersFormTitle}" /> label="${labels.TravelOrdersFormTitle}" />
<vlayout vflex="1"> <vlayout vflex="1">
<grid> <include src="../tripBillInterior.zul"/>
<columns visible="false">
<column hflex="min"/>
<column hflex="min"/>
<column hflex="2"/>
<column hflex="2"/>
<column hflex="2"/>
</columns>
<auxhead>
<auxheader label="${labels.TripBillTravelBegin}" colspan="2"/>
<auxheader label="${labels.TripBillTravelTarget}"/>
<auxheader label="${labels.TripBillPurpose}"/>
<auxheader label="${labels.TripBillTravelEnd}"/>
</auxhead>
<rows>
<row>
<cell colspan="2">
<label value="@load(vm.dataBean.requirement.from)"/>
</cell>
<cell>
<label value="@load(vm.dataBean.requirement.to)"/>
</cell>
<cell>
<label value="@load(vm.dataBean.requirement.description)"/>
</cell>
<cell>
<label value="@load(vm.dataBean.requirement.end)"/>
</cell>
</row>
<row>
<label value="@load(vm.dataBean.requirement.tripDate) @converter('formatedDate', format=labels.DateFormat)"/>
<label value="@load(vm.dataBean.requirement.tripDate) @converter('formatedDate', format='hh:mm')"/>
<cell/>
<cell/>
<label value="@load(vm.dataBean.requirement.endDate) @converter('formatedDate', format=labels.DateFormat)"/>
</row>
</rows>
</grid>
<grid>
<columns>
<column/>
<column/>
</columns>
<rows>
<row>
<label value="${labels.TripBillResultMessage}"/>
<datebox value="@bind(vm.dataBean.resultMessageDate)"/>
</row>
<row>
<cell colspan="2">
<checkbox label="${labels.TripBillFreeMeals}" checked="@bind(vm.dataBean.freeMeals)" onCheck="@command('calculate')"/>
</cell>
</row>
<row>
<cell colspan="2">
<checkbox label="${labels.TripBillFreeHousing}" checked="@bind(vm.dataBean.freeHousing)"/>
</cell>
</row>
<row>
<cell colspan="2">
<checkbox label="${labels.TripBillFreeCarfare}" checked="@bind(vm.dataBean.freeCarfare)"/>
</cell>
</row>
</rows>
</grid>
<grid
model="@load(vm.dataBean.billItems)"
vflex="1">
<auxhead>
<auxheader rowspan="2">
<div sclass="vertikaal" height="50px">
<label value="${labels.TripBillDate}" sclass="bold"/>
</div>
</auxheader>
<auxheader colspan="2">
<label value=""/>
</auxheader>
<!-- <auxheader >
<label value=""/>
</auxheader> -->
<auxheader colspan="2" align="center">
<label value="${labels.TripBillDepartureArrival}" sclass="bold"/>
</auxheader>
<!-- <auxheader>
<label value=""/>
</auxheader> -->
<auxheader rowspan="2" valign="bottom" height="110px">
<div sclass="vertikaal" height="88px" width="88px">
<vbox>
<label value="${labels.TripBillUsed}" sclass="bold"/>
<label value="${labels.TripBillVehicle}" sclass="bold"/>
</vbox>
</div>
</auxheader>
<auxheader rowspan="2" valign="bottom" height="112px">
<div sclass="vertikaal" height="101px" width="90px">
<vbox>
<label value="${labels.TripBillBeginEnd}" sclass="bold"/>
<label value="${labels.TripBillWork}" sclass="bold"/>
</vbox>
</div>
</auxheader>
<auxheader>
<html>
<![CDATA[${labels.TripBillTraveled} <br /> ${labels.TripBillKm} ]]>
</html>
</auxheader>
<auxheader>
<html>
<![CDATA[${labels.TripBillConsumption} <br /> ${labels.TripBillPHM} ]]>
</html>
</auxheader>
<auxheader rowspan="2">
<html>
<![CDATA[${labels.TripBillCarfare} <br /> ${labels.TripBillLocal} <br /> ${labels.TripBillTransportation} ]]>
</html>
</auxheader>
<auxheader rowspan="2">
<label value="${labels.TripBillHousing}" sclass="bold"/>
</auxheader>
<auxheader rowspan="2">
<html>
<![CDATA[${labels.TripBillNumber} <br /> ${labels.TripBillMeals} <br /> ${labels.TripBillFree} ]]>
</html>
</auxheader>
<auxheader rowspan="2">
<label value="${labels.TripBillMealExpenses}" sclass="bold"/>
</auxheader>
<auxheader rowspan="2">
<html>
<![CDATA[${labels.TripBillNecessary} <br /> ${labels.TripBillOther} <br /> ${labels.TripBillExpenses} ]]>
</html>
</auxheader>
<auxheader rowspan="2">
<label value="${labels.TripBillTotal}" sclass="bold"/>
</auxheader>
<auxheader rowspan="2">
<label value="${labels.TripBillAdjusted}" sclass="bold"/>
</auxheader>
</auxhead>
<auxhead>
<!-- <auxheader>
<label value=""/>
</auxheader> -->
<auxheader colspan="2" align="center">
<label value="${labels.TripBillTravelTarget}" sclass="bold"/>
</auxheader>
<!-- <auxheader >
<label value=""/>
</auxheader> -->
<auxheader>
<label value="${labels.TripBillHourMin}" sclass="bold"/>
</auxheader>
<auxheader>
<label value="${labels.TripBillHourMin}" sclass="bold"/>
</auxheader>
<!-- <auxheader>
<label value=""/>
</auxheader>-->
<!-- <auxheader>
<label value=""/>
</auxheader> -->
<auxheader>
<html>
<![CDATA[<div> ${labels.TripBillTraveled} <br /> ${labels.TripBillKm} <br /> ${labels.TripBillInKc}</div> ]]>
</html>
</auxheader>
<auxheader>
<html>
<![CDATA[${labels.TripBillConsumption} <br /> ${labels.TripBillPHM} <br /> ${labels.TripBillInKc}]]>
</html>
</auxheader>
<!-- <auxheader>
<label value=""/>
</auxheader>
<auxheader>
<label value=""/>
</auxheader>
<auxheader>
<label value=""/>
</auxheader>
<auxheader>
<label value=""/>
</auxheader>
<auxheader>
<label value=""/>
</auxheader>
<auxheader>
<label value=""/>
</auxheader>-->
</auxhead>
<columns visible="false">
<column width="60px"/>
<column width="60px"/>
<column hflex="max"/>
<column width="70px"/>
<column width="70px"/>
<column width="70px"/>
<column width="70px"/>
<column width="70px"/>
<column width="70px"/>
<column width="70px"/>
<column width="70px"/>
<column width="70px"/>
<column width="70px"/>
<column width="70px"/>
<column width="70px"/>
<column width="70px"/>
</columns>
<rows>
<template name="model">
<row>
<label value="@load(each.date) @converter('formatedDate', format='dd.MM')"/>
<vbox>
<label value="${labels.TripBillTo}"/>
<label value="${labels.TripBillBack}"/>
</vbox>
<vbox hflex="max">
<textbox inplace="true"
value="@load(each.to)"
maxlength="@load(vm.lengthText)"
sclass="grid-textbox-max-left"/>
<textbox inplace="true"
value="@load(each.back)"
maxlength="@load(vm.lengthText)"
sclass="grid-textbox-max-left"/>
</vbox>
<vbox>
<timebox inplace="true" width="68px" value="@bind(each.toArrival)" onChange="@command('calculate')" format="short"/>
<timebox inplace="true" width="68px" value="@bind(each.backArrival)" onChange="@command('calculate')" format="short"/>
</vbox>
<vbox>
<timebox inplace="true" width="68px" value="@bind(each.toDeparture)" onChange="@command('calculate')" format="short"/>
<timebox inplace="true" width="68px" value="@bind(each.backDeparture)" onChange="@command('calculate')" format="short"/>
</vbox>
<vbox>
<combobox inplace="true"
model="@load(vm.vehicles)"
selectedItem="@bind(each.toVehicle)"
width="67px"
readonly="true">
<template name="model">
<comboitem label="@load(each.code)"/>
</template>
</combobox>
<combobox inplace="true"
model="@load(vm.vehicles)"
selectedItem="@bind(each.backVehicle)"
width="67px"
readonly="true">
<template name="model">
<comboitem label="@load(each.code)"/>
</template>
</combobox>
</vbox>
<vbox>
<timebox inplace="true" width="68px" value="@bind(each.beginWork)" format="short"/>
<timebox inplace="true" width="68px" value="@bind(each.endWork)" format="short"/>
</vbox>
<vbox>
<textbox
inplace="true"
width="68px"
maxlength="@load(vm.lengthText)"
value="@bind(each.distance) @converter(vm.standardBigDecimalConverter)" />
<textbox
inplace="true"
width="68px"
value="@bind(each.distanceAmount) @converter(vm.standardBigDecimalConverter)"
maxlength="@load(vm.lengthText)"
onChange="@command('calculate')" />
</vbox>
<vbox>
<textbox
inplace="true"
width="68px"
maxlength="@load(vm.lengthText)"
value="@bind(each.fuelConsumption) @converter(vm.standardBigDecimalConverter)" />
<textbox
inplace="true"
width="68px"
value="@bind(each.fuelAmount) @converter(vm.standardBigDecimalConverter)"
maxlength="@load(vm.lengthText)"
onChange="@command('calculate')" />
</vbox>
<textbox
inplace="true"
value="@bind(each.carefare) @converter(vm.standardBigDecimalConverter)"
maxlength="@load(vm.lengthText)"
onChange="@command('calculate')" />
<textbox
inplace="true"
value="@bind(each.housing) @converter(vm.standardBigDecimalConverter)"
maxlength="@load(vm.lengthText)"
onChange="@command('calculate')" />
<combobox inplace="true" selectedIndex="@bind(each.freeMealsCount)"
readonly="true"
width="60px"
disabled="@load(not vm.dataBean.freeMeals)"
onBlur="@command('calculate')">
<comboitem value="0" label="0"/>
<comboitem value="1" label="1"/>
<comboitem value="2" label="2"/>
<comboitem value="3" label="3"/>
</combobox>
<label value="@load(each.meals) @converter(vm.standardBigDecimalConverter)"/>
<textbox
inplace="true"
value="@bind(each.otherExpenses) @converter(vm.standardBigDecimalConverter)"
maxlength="@load(vm.lengthText)"
onChange="@command('calculate')" />
<label value="@load(each.total) @converter(vm.standardBigDecimalConverter)"/>
<label value="@load(each.adjustedTotal) @converter(vm.standardBigDecimalConverter)"/>
</row>
</template>
</rows>
</grid>
<div hflex="1" align="end" >
<vbox>
<hbox>
<label value="Záloha: " style="font-size: 14px;"/>
<label value="@load(vm.dataBean.requirement.downPayment) @converter(vm.standardBigDecimalConverter)" 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.standardBigDecimalConverter)" style="font-size: 14px; font-weight: bold;"/>
</hbox>
</vbox>
</div>
<include src="/app/formButtons.zul" /> <include src="/app/formButtons.zul" />
</vlayout> </vlayout>
</window> </window>

@ -1,4 +1,6 @@
<zk> <zk xmlns="http://www.zkoss.org/2005/zul"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd">
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?> <?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<window <window
vflex="1" vflex="1"
@ -182,7 +184,15 @@
</template> </template>
</listbox> </listbox>
<div hflex="3"> <div hflex="3">
<include src="/main/approveStatus.zul" /> <vbox>
<include src="/main/approveStatus.zul" />
<button label="${labels.ShowTripBill}"
image="/img/bill-016.png"
onClick="@command('showTripBill')"
visible="@load(not empty vm.dataBean)"
disabled="@load(not(vm.dataBean.state eq 'APPROVED'))"
sclass="nicebutton"/>
</vbox>
</div> </div>
</hbox> </hbox>
</window> </window>

@ -158,7 +158,15 @@
</template> </template>
</listbox> </listbox>
<div hflex="3"> <div hflex="3">
<include src="/main/approveStatus.zul" /> <vbox>
<include src="/main/approveStatus.zul" />
<button label="${labels.ShowTripBill}"
image="/img/bill-016.png"
onClick="@command('showTripBill')"
visible="@load(not empty vm.dataBean)"
disabled="@load(not(vm.dataBean.state eq 'APPROVED'))"
sclass="nicebutton"/>
</vbox>
</div> </div>
</hbox> </hbox>
</window> </window>

@ -182,7 +182,15 @@
</template> </template>
</listbox> </listbox>
<div hflex="3"> <div hflex="3">
<include src="/main/approveStatus.zul" /> <vbox>
<include src="/main/approveStatus.zul" />
<button label="${labels.ShowTripBill}"
image="/img/bill-016.png"
onClick="@command('showTripBill')"
visible="@load(not empty vm.dataBean)"
disabled="@load(not(vm.dataBean.state eq 'APPROVED'))"
sclass="nicebutton"/>
</vbox>
</div> </div>
</hbox> </hbox>
</window> </window>

@ -0,0 +1,39 @@
<?page title="${labels.TravelOrdersFormTitle}" contentType="text/html;charset=UTF-8"?>
<zk xmlns="http://www.zkoss.org/2005/zul"
xmlns:w="http://www.zkoss.org/2005/zk/client"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd">
<zscript>
boolean disabled = true;
</zscript>
<window
id="editWin"
closable="true"
width="95%"
height="95%"
border="normal"
position="center"
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.tripbill.TripBillForm')">
<caption
src="/img/pickup-032.png"
zclass="form-caption"
label="${labels.TravelOrdersFormTitle}" />
<vlayout vflex="1">
<include src="../tripBillInterior.zul"/>
<vlayout
vflex="min"
hflex="max">
<div
hflex="max"
align="right">
<button image="~./zul/img/misc/drag-disallow.png"
label="${labels.ButtonStorno}"
onClick="editWin.detach()"
sclass="nicebutton" />
</div>
</vlayout>
</vlayout>
</window>
</zk>

@ -0,0 +1,385 @@
<zk xmlns="http://www.zkoss.org/2005/zul"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd">
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<grid>
<columns visible="false">
<column hflex="min"/>
<column hflex="min"/>
<column hflex="2"/>
<column hflex="2"/>
<column hflex="2"/>
</columns>
<auxhead>
<auxheader label="${labels.TripBillTravelBegin}" colspan="2"/>
<auxheader label="${labels.TripBillTravelTarget}"/>
<auxheader label="${labels.TripBillPurpose}"/>
<auxheader label="${labels.TripBillTravelEnd}"/>
</auxhead>
<rows>
<row>
<cell colspan="2">
<label value="@load(vm.dataBean.requirement.from)"/>
</cell>
<cell>
<label value="@load(vm.dataBean.requirement.to)"/>
</cell>
<cell>
<label value="@load(vm.dataBean.requirement.description)"/>
</cell>
<cell>
<label value="@load(vm.dataBean.requirement.end)"/>
</cell>
</row>
<row>
<label value="@load(vm.dataBean.requirement.tripDate) @converter('formatedDate', format=labels.DateFormat)"/>
<label value="@load(vm.dataBean.requirement.tripDate) @converter('formatedDate', format='hh:mm')"/>
<cell/>
<cell/>
<label value="@load(vm.dataBean.requirement.endDate) @converter('formatedDate', format=labels.DateFormat)"/>
</row>
</rows>
</grid>
<grid>
<columns>
<column/>
<column/>
</columns>
<rows>
<row>
<label value="${labels.TripBillResultMessage}"/>
<datebox value="@bind(vm.dataBean.resultMessageDate)" disabled="${disabled}"/>
</row>
<row>
<cell colspan="2">
<checkbox label="${labels.TripBillFreeMeals}"
checked="@bind(vm.dataBean.freeMeals)"
onCheck="@command('calculate')"
disabled="${disabled}"/>
</cell>
</row>
<row>
<cell colspan="2">
<checkbox label="${labels.TripBillFreeHousing}"
checked="@bind(vm.dataBean.freeHousing)"
disabled="${disabled}" />
</cell>
</row>
<row>
<cell colspan="2">
<checkbox label="${labels.TripBillFreeCarfare}"
checked="@bind(vm.dataBean.freeCarfare)"
disabled="${disabled}" />
</cell>
</row>
</rows>
</grid>
<grid
model="@load(vm.dataBean.billItems)"
vflex="1">
<auxhead>
<auxheader rowspan="2">
<div sclass="vertikaal" height="50px">
<label value="${labels.TripBillDate}" sclass="bold"/>
</div>
</auxheader>
<auxheader colspan="2">
<label value=""/>
</auxheader>
<!-- <auxheader >
<label value=""/>
</auxheader> -->
<auxheader colspan="2" align="center">
<label value="${labels.TripBillDepartureArrival}" sclass="bold"/>
</auxheader>
<!-- <auxheader>
<label value=""/>
</auxheader> -->
<auxheader rowspan="2" valign="bottom" height="110px">
<div sclass="vertikaal" height="88px" width="88px">
<vbox>
<label value="${labels.TripBillUsed}" sclass="bold"/>
<label value="${labels.TripBillVehicle}" sclass="bold"/>
</vbox>
</div>
</auxheader>
<auxheader rowspan="2" valign="bottom" height="112px">
<div sclass="vertikaal" height="101px" width="90px">
<vbox>
<label value="${labels.TripBillBeginEnd}" sclass="bold"/>
<label value="${labels.TripBillWork}" sclass="bold"/>
</vbox>
</div>
</auxheader>
<auxheader>
<html>
<![CDATA[${labels.TripBillTraveled} <br /> ${labels.TripBillKm} ]]>
</html>
</auxheader>
<auxheader>
<html>
<![CDATA[${labels.TripBillConsumption} <br /> ${labels.TripBillPHM} ]]>
</html>
</auxheader>
<auxheader rowspan="2">
<html>
<![CDATA[${labels.TripBillCarfare} <br /> ${labels.TripBillLocal} <br /> ${labels.TripBillTransportation} ]]>
</html>
</auxheader>
<auxheader rowspan="2">
<label value="${labels.TripBillHousing}" sclass="bold"/>
</auxheader>
<auxheader rowspan="2">
<html>
<![CDATA[${labels.TripBillNumber} <br /> ${labels.TripBillMeals} <br /> ${labels.TripBillFree} ]]>
</html>
</auxheader>
<auxheader rowspan="2">
<label value="${labels.TripBillMealExpenses}" sclass="bold"/>
</auxheader>
<auxheader rowspan="2">
<html>
<![CDATA[${labels.TripBillNecessary} <br /> ${labels.TripBillOther} <br /> ${labels.TripBillExpenses} ]]>
</html>
</auxheader>
<auxheader rowspan="2">
<label value="${labels.TripBillTotal}" sclass="bold"/>
</auxheader>
<auxheader rowspan="2">
<label value="${labels.TripBillAdjusted}" sclass="bold"/>
</auxheader>
</auxhead>
<auxhead>
<!-- <auxheader>
<label value=""/>
</auxheader> -->
<auxheader colspan="2" align="center">
<label value="${labels.TripBillTravelTarget}" sclass="bold"/>
</auxheader>
<!-- <auxheader >
<label value=""/>
</auxheader> -->
<auxheader>
<label value="${labels.TripBillHourMin}" sclass="bold"/>
</auxheader>
<auxheader>
<label value="${labels.TripBillHourMin}" sclass="bold"/>
</auxheader>
<!-- <auxheader>
<label value=""/>
</auxheader>-->
<!-- <auxheader>
<label value=""/>
</auxheader> -->
<auxheader>
<html>
<![CDATA[<div> ${labels.TripBillTraveled} <br /> ${labels.TripBillKm} <br /> ${labels.TripBillInKc}</div> ]]>
</html>
</auxheader>
<auxheader>
<html>
<![CDATA[${labels.TripBillConsumption} <br /> ${labels.TripBillPHM} <br /> ${labels.TripBillInKc}]]>
</html>
</auxheader>
<!-- <auxheader>
<label value=""/>
</auxheader>
<auxheader>
<label value=""/>
</auxheader>
<auxheader>
<label value=""/>
</auxheader>
<auxheader>
<label value=""/>
</auxheader>
<auxheader>
<label value=""/>
</auxheader>
<auxheader>
<label value=""/>
</auxheader>-->
</auxhead>
<columns visible="false">
<column width="60px"/>
<column width="60px"/>
<column hflex="max"/>
<column width="70px"/>
<column width="70px"/>
<column width="70px"/>
<column width="70px"/>
<column width="70px"/>
<column width="70px"/>
<column width="70px"/>
<column width="70px"/>
<column width="70px"/>
<column width="70px"/>
<column width="70px"/>
<column width="70px"/>
<column width="70px"/>
</columns>
<rows>
<template name="model">
<row>
<label value="@load(each.date) @converter('formatedDate', format='dd.MM')"/>
<vbox>
<label value="${labels.TripBillTo}"/>
<label value="${labels.TripBillBack}"/>
</vbox>
<vbox hflex="max">
<textbox inplace="true"
value="@load(each.to)"
maxlength="@load(vm.lengthText)"
sclass="grid-textbox-max-left"
readonly="${disabled}"/>
<textbox inplace="true"
value="@load(each.back)"
maxlength="@load(vm.lengthText)"
sclass="grid-textbox-max-left"
readonly="${disabled}"/>
</vbox>
<vbox>
<timebox inplace="true"
width="68px"
value="@bind(each.toArrival)"
onChange="@command('calculate')"
format="short"
disabled="${disabled}"/>
<timebox inplace="true"
width="68px"
value="@bind(each.backArrival)"
onChange="@command('calculate')"
format="short"
disabled="${disabled}"/>
</vbox>
<vbox>
<timebox inplace="true"
width="68px"
value="@bind(each.toDeparture)"
onChange="@command('calculate')"
format="short"
disabled="${disabled}"/>
<timebox inplace="true"
width="68px"
value="@bind(each.backDeparture)"
onChange="@command('calculate')"
format="short"
disabled="${disabled}"/>
</vbox>
<vbox>
<combobox inplace="true"
model="@load(vm.vehicles)"
selectedItem="@bind(each.toVehicle)"
width="67px"
readonly="true"
disabled="${disabled}">
<template name="model">
<comboitem label="@load(each.code)"/>
</template>
</combobox>
<combobox inplace="true"
model="@load(vm.vehicles)"
selectedItem="@bind(each.backVehicle)"
width="67px"
readonly="true"
disabled="${disabled}">
<template name="model">
<comboitem label="@load(each.code)"/>
</template>
</combobox>
</vbox>
<vbox>
<timebox inplace="true"
width="68px"
value="@bind(each.beginWork)"
format="short"
disabled="${disabled}"/>
<timebox inplace="true"
width="68px"
value="@bind(each.endWork)"
format="short"
disabled="${disabled}"/>
</vbox>
<vbox>
<textbox
inplace="true"
width="68px"
maxlength="@load(vm.lengthText)"
value="@bind(each.distance) @converter(vm.standardBigDecimalConverter)"
readonly="${disabled}"/>
<textbox
inplace="true"
width="68px"
value="@bind(each.distanceAmount) @converter(vm.standardBigDecimalConverter)"
maxlength="@load(vm.lengthText)"
onChange="@command('calculate')"
readonly="${disabled}"/>
</vbox>
<vbox>
<textbox
inplace="true"
width="68px"
maxlength="@load(vm.lengthText)"
value="@bind(each.fuelConsumption) @converter(vm.standardBigDecimalConverter)"
readonly="${disabled}"/>
<textbox
inplace="true"
width="68px"
value="@bind(each.fuelAmount) @converter(vm.standardBigDecimalConverter)"
maxlength="@load(vm.lengthText)"
onChange="@command('calculate')"
readonly="${disabled}"/>
</vbox>
<textbox
inplace="true"
value="@bind(each.carefare) @converter(vm.standardBigDecimalConverter)"
maxlength="@load(vm.lengthText)"
onChange="@command('calculate')"
readonly="${disabled}"/>
<textbox
inplace="true"
value="@bind(each.housing) @converter(vm.standardBigDecimalConverter)"
maxlength="@load(vm.lengthText)"
onChange="@command('calculate')"
readonly="${disabled}"/>
<combobox inplace="true" selectedIndex="@bind(each.freeMealsCount)"
readonly="true"
disabled="${disabled}"
width="60px"
onBlur="@command('calculate')">
<comboitem value="0" label="0"/>
<comboitem value="1" label="1"/>
<comboitem value="2" label="2"/>
<comboitem value="3" label="3"/>
</combobox>
<label value="@load(each.meals) @converter(vm.standardBigDecimalConverter)"/>
<textbox
inplace="true"
value="@bind(each.otherExpenses) @converter(vm.standardBigDecimalConverter)"
maxlength="@load(vm.lengthText)"
onChange="@command('calculate')"
readonly="${disabled}"/>
<label value="@load(each.total) @converter(vm.standardBigDecimalConverter)"/>
<label value="@load(each.adjustedTotal) @converter(vm.standardBigDecimalConverter)"/>
</row>
</template>
</rows>
</grid>
<div hflex="1" align="end" >
<vbox>
<hbox>
<label value="Záloha: " style="font-size: 14px;"/>
<label value="@load(vm.dataBean.requirement.downPayment) @converter(vm.standardBigDecimalConverter)" 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.standardBigDecimalConverter)" style="font-size: 14px; font-weight: bold;"/>
</hbox>
</vbox>
</div>
</zk>
Loading…
Cancel
Save