Upraveno formátování a zarovnání v cestovních příkazech. Opraveno

filtrování v požadavcích na služební cesty.
closes #168
Verze_1.0
Josef Rokos 10 years ago
parent 8f248de094
commit bd37a7081a

@ -3,6 +3,7 @@ package info.bukova.isspst.filters;
import info.bukova.isspst.DateTimeUtils;
import info.bukova.isspst.StringUtils;
import info.bukova.isspst.data.TripRequirement;
import info.bukova.isspst.data.User;
import org.hamcrest.Description;
import org.hamcrest.Factory;
@ -45,7 +46,7 @@ public class TripRequirementFilter implements Filter<TripRequirement>
boolean foundTo = StringUtils.isEqualForFilter(item.getTo(), condition.getTo());
boolean foundWorkgroup = (condition.getWorkgroup() == null ||(item.getWorkgroup() != null && item.getWorkgroup().equals(condition.getWorkgroup())));
boolean foundCentre = (condition.getCentre() == null || (item.getCentre() != null && item.getCentre().equals(condition.getCentre())));
boolean foundOwner = StringUtils.isEqualForFilter(item.getOwnedBy().getLastName(), condition.getOwnedBy().getLastName());
boolean foundOwner = User.isEqualByUserForFilter(item.getOwnedBy(), condition.getOwnedBy());
return foundNumser && foundReqDate && foundDescription && foundFrom && foundTo && foundWorkgroup && foundCentre && foundOwner;
}

@ -5,6 +5,7 @@ import info.bukova.isspst.data.NumberSeries;
import info.bukova.isspst.data.RequirementState;
import info.bukova.isspst.data.TripBill;
import info.bukova.isspst.data.TripRequirement;
import info.bukova.isspst.data.User;
import info.bukova.isspst.services.LazyLoader;
import info.bukova.isspst.services.tripbill.TripBillService;
import info.bukova.isspst.services.workgroups.WorkgroupService;
@ -59,6 +60,15 @@ public class TripRequirementServiceImpl extends RequirementBaseServiceImpl<TripR
tripBillService.add(bill);
bill.setOwnedBy(entity.getOwnedBy());
tripBillService.update(bill);
for (User u : entity.getPassengers()) {
if (!u.equals(entity.getOwnedBy())) {
TripBill passBill = tripBillService.createTripBill(entity);
tripBillService.add(passBill);
passBill.setOwnedBy(u);
tripBillService.update(passBill);
}
}
}
}

@ -1,15 +1,14 @@
package info.bukova.isspst.ui.tripbill;
import java.util.ArrayList;
import java.util.List;
import info.bukova.isspst.data.TripBill;
import info.bukova.isspst.data.Vehicle;
import info.bukova.isspst.services.settings.GlobalSettingsService;
import info.bukova.isspst.services.tripbill.TripBillService;
import info.bukova.isspst.ui.BigDecimalConverter;
import info.bukova.isspst.ui.FormViewModel;
import java.util.ArrayList;
import java.util.List;
import org.zkoss.bind.annotation.Command;
import org.zkoss.bind.annotation.Init;
import org.zkoss.bind.annotation.NotifyChange;
@ -17,7 +16,6 @@ import org.zkoss.zk.ui.select.annotation.WireVariable;
public class TripBillForm extends FormViewModel<TripBill> {
private BigDecimalConverter bigDecimalConverter;
@WireVariable
private TripBillService tripBillService;
private List<Vehicle> vehicles;
@ -26,16 +24,11 @@ public class TripBillForm extends FormViewModel<TripBill> {
@Init(superclass = true)
public void init() {
bigDecimalConverter = new BigDecimalConverter();
vehicles = new ArrayList<Vehicle>();
vehicles.add(null);
vehicles.addAll(settingsService.getSettings().getVehicles());
}
public BigDecimalConverter getBigDecimalConverter() {
return bigDecimalConverter;
}
@Command
@NotifyChange("dataBean")
public void calculate() {
@ -45,4 +38,5 @@ public class TripBillForm extends FormViewModel<TripBill> {
public List<Vehicle> getVehicles() {
return vehicles;
}
}

@ -16,8 +16,8 @@ public class TripBillList extends ListViewModel<TripBill> {
private TripBillService tripBillService;
private BigDecimalConverter converter;
@Init
public void init() {
@Init(superclass = true)
public void initTripBill() {
service = tripBillService;
dataClass = TripBill.class;
formZul = "tripBillForm.zul";
@ -33,4 +33,10 @@ public class TripBillList extends ListViewModel<TripBill> {
public BigDecimalConverter getConverter() {
return converter;
}
@Override
public boolean isAbleToAdd() {
return false;
}
}

@ -4,6 +4,8 @@
<window
id="editWin"
closable="true"
width="95%"
height="95%"
border="normal"
position="center"
apply="org.zkoss.bind.BindComposer"
@ -12,7 +14,7 @@
src="/img/pickup-032.png"
zclass="form-caption"
label="${labels.TravelOrdersFormTitle}" />
<vlayout>
<vlayout vflex="1">
<grid>
<columns visible="false">
<column hflex="min"/>
@ -78,7 +80,9 @@
</row>
</rows>
</grid>
<grid model="@load(vm.dataBean.billItems)">
<grid
model="@load(vm.dataBean.billItems)"
vflex="1">
<auxhead>
<auxheader rowspan="2">
<div sclass="vertikaal" height="50px">
@ -271,15 +275,15 @@
<timebox inplace="true" width="68px" value="@bind(each.endWork)" format="short"/>
</vbox>
<vbox>
<textbox inplace="true" width="68px" value="@bind(each.distance) @converter(vm.bigDecimalConverter)"/>
<textbox inplace="true" width="68px" value="@bind(each.distanceAmount) @converter(vm.bigDecimalConverter)" onChange="@command('calculate')"/>
<textbox inplace="true" width="68px" value="@bind(each.distance) @converter(vm.standardBigDecimalConverter)"/>
<textbox inplace="true" width="68px" value="@bind(each.distanceAmount) @converter(vm.standardBigDecimalConverter)" onChange="@command('calculate')"/>
</vbox>
<vbox>
<textbox inplace="true" width="68px" value="@bind(each.fuelConsumption) @converter(vm.bigDecimalConverter)"/>
<textbox inplace="true" width="68px" value="@bind(each.fuelAmount) @converter(vm.bigDecimalConverter)" onChange="@command('calculate')"/>
<textbox inplace="true" width="68px" value="@bind(each.fuelConsumption) @converter(vm.standardBigDecimalConverter)"/>
<textbox inplace="true" width="68px" value="@bind(each.fuelAmount) @converter(vm.standardBigDecimalConverter)" onChange="@command('calculate')"/>
</vbox>
<textbox inplace="true" value="@bind(each.carefare) @converter(vm.bigDecimalConverter)" onChange="@command('calculate')"/>
<textbox inplace="true" value="@bind(each.housing) @converter(vm.bigDecimalConverter)" onChange="@command('calculate')"/>
<textbox inplace="true" value="@bind(each.carefare) @converter(vm.standardBigDecimalConverter)" onChange="@command('calculate')"/>
<textbox inplace="true" value="@bind(each.housing) @converter(vm.standardBigDecimalConverter)" onChange="@command('calculate')"/>
<combobox inplace="true" selectedIndex="@bind(each.freeMealsCount)"
readonly="true"
width="60px"
@ -290,10 +294,10 @@
<comboitem value="2" label="2"/>
<comboitem value="3" label="3"/>
</combobox>
<label value="@load(each.meals) @converter(vm.bigDecimalConverter)"/>
<textbox inplace="true" value="@bind(each.otherExpenses) @converter(vm.bigDecimalConverter)" onChange="@command('calculate')"/>
<label value="@load(each.total) @converter(vm.bigDecimalConverter)"/>
<label value="@load(each.adjustedTotal) @converter(vm.bigDecimalConverter)"/>
<label value="@load(each.meals) @converter(vm.standardBigDecimalConverter)"/>
<textbox inplace="true" value="@bind(each.otherExpenses) @converter(vm.standardBigDecimalConverter)" onChange="@command('calculate')"/>
<label value="@load(each.total) @converter(vm.standardBigDecimalConverter)"/>
<label value="@load(each.adjustedTotal) @converter(vm.standardBigDecimalConverter)"/>
</row>
</template>
</rows>
@ -302,11 +306,11 @@
<vbox>
<hbox>
<label value="Záloha: " style="font-size: 14px;"/>
<label value="@load(vm.dataBean.requirement.downPayment) @converter(vm.bigDecimalConverter)" 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.bigDecimalConverter)" 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>

@ -18,23 +18,24 @@
<listhead menupopup="auto">
<listheader
label="${labels.TravelOrdersGridNumser}"
sort="czech(name)"
sort="czech(numser)"
width="30%" />
<listheader
label="${labels.TravelOrdersGridReqDate}"
sort="czech(description)"
sort="auto(requirement.reqDate)"
width="70%" />
<listheader
label="${labels.TravelOrdersGridFrom}"
sort="czech(description)"
sort="czech(requirement.from)"
width="70%" />
<listheader
label="${labels.TravelOrdersGridTo}"
sort="czech(description)"
sort="czech(requirement.to)"
width="70%" />
<listheader
label="${labels.TravelOrdersGridTotal}"
sort="czech(description)"
sort="auto(total)"
align="right"
width="70%" />
</listhead>
<!-- <auxhead
@ -72,10 +73,10 @@
<template name="model">
<listitem>
<listcell label="@load(each.requirement.numser)" />
<listcell label="@load(each.requirement.reqDate)" />
<listcell label="@load(each.requirement.reqDate) @converter('formatedDate', format=labels.DateFormat)" />
<listcell label="@load(each.requirement.from)" />
<listcell label="@load(each.requirement.to)" />
<listcell label="@load(each.total)"/>
<listcell label="@load(each.total) @converter(vm.standardBigDecimalConverter)"/>
</listitem>
</template>
</listbox>

@ -73,6 +73,8 @@
width="100%"
selectedItem="@bind(vm.filterTemplate.centre)"
model="@load(vm.myCentres)"
ctrlKeys="${labels.HandleComboKeyFilter}"
onCtrlKey="@command('handleComboKeyFilter', ctrl=self, keyEvent=event)"
onChange="@command('doFilter')">
<template name="model">
<comboitem label="@load(each.fullName)" />

@ -84,6 +84,8 @@
width="100%"
selectedItem="@bind(vm.filterTemplate.centre)"
model="@load(vm.allCentres)"
ctrlKeys="${labels.HandleComboKeyFilter}"
onCtrlKey="@command('handleComboKeyFilter', ctrl=self, keyEvent=event)"
onChange="@command('doFilter')">
<template name="model">
<comboitem label="@load(each.fullName)" />
@ -101,6 +103,8 @@
width="100%"
selectedItem="@bind(vm.filterTemplate.workgroup)"
model="@load(vm.allWorkgroups)"
ctrlKeys="${labels.HandleComboKeyFilter}"
onCtrlKey="@command('handleComboKeyFilter', ctrl=self, keyEvent=event)"
onChange="@command('doFilter')">
<template name="model">
<comboitem label="@load(each.fullName)" />
@ -141,14 +145,20 @@
</div>
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div zclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox
value="@bind(vm.filterTemplate.ownedBy.lastName)"
instant="true"
<combobox
ctrlKeys="${labels.HandleComboKeyFilter}"
onCtrlKey="@command('handleComboKeyFilter', ctrl=self, keyEvent=event)"
onChange="@command('doFilter')"
sclass="find-grid-textbox"
width="100%" />
width="100%"
selectedItem="@bind(vm.filterTemplate.ownedBy)"
model="@load(vm.allUsers)"
readonly="true">
<template name="model">
<comboitem label="@load(each.fullName)" />
</template>
</combobox>
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />

@ -80,6 +80,8 @@
width="100%"
selectedItem="@bind(vm.filterTemplate.centre)"
model="@load(vm.myCentres)"
ctrlKeys="${labels.HandleComboKeyFilter}"
onCtrlKey="@command('handleComboKeyFilter', ctrl=self, keyEvent=event)"
onChange="@command('doFilter')">
<template name="model">
<comboitem label="@load(each.fullName)" />
@ -120,14 +122,20 @@
</div>
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div zclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox
value="@bind(vm.filterTemplate.ownedBy.lastName)"
instant="true"
<combobox
ctrlKeys="${labels.HandleComboKeyFilter}"
onCtrlKey="@command('handleComboKeyFilter', ctrl=self, keyEvent=event)"
onChange="@command('doFilter')"
sclass="find-grid-textbox"
width="100%" />
width="100%"
selectedItem="@bind(vm.filterTemplate.ownedBy)"
model="@load(vm.allUsers)"
readonly="true">
<template name="model">
<comboitem label="@load(each.fullName)" />
</template>
</combobox>
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />

@ -84,6 +84,8 @@
width="100%"
selectedItem="@bind(vm.filterTemplate.centre)"
model="@load(vm.myCentres)"
ctrlKeys="${labels.HandleComboKeyFilter}"
onCtrlKey="@command('handleComboKeyFilter', ctrl=self, keyEvent=event)"
onChange="@command('doFilter')">
<template name="model">
<comboitem label="@load(each.fullName)" />
@ -101,6 +103,8 @@
width="100%"
selectedItem="@bind(vm.filterTemplate.workgroup)"
model="@load(vm.myWorkgroups)"
ctrlKeys="${labels.HandleComboKeyFilter}"
onCtrlKey="@command('handleComboKeyFilter', ctrl=self, keyEvent=event)"
onChange="@command('doFilter')">
<template name="model">
<comboitem label="@load(each.fullName)" />
@ -141,14 +145,20 @@
</div>
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div zclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox
value="@bind(vm.filterTemplate.ownedBy.lastName)"
instant="true"
<combobox
ctrlKeys="${labels.HandleComboKeyFilter}"
onCtrlKey="@command('handleComboKeyFilter', ctrl=self, keyEvent=event)"
onChange="@command('doFilter')"
sclass="find-grid-textbox"
width="100%" />
width="100%"
selectedItem="@bind(vm.filterTemplate.ownedBy)"
model="@load(vm.allUsers)"
readonly="true">
<template name="model">
<comboitem label="@load(each.fullName)" />
</template>
</combobox>
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />

Loading…
Cancel
Save