diff --git a/src/main/java/info/bukova/isspst/filters/TripRequirementFilter.java b/src/main/java/info/bukova/isspst/filters/TripRequirementFilter.java index 55c906e0..6e324c5f 100644 --- a/src/main/java/info/bukova/isspst/filters/TripRequirementFilter.java +++ b/src/main/java/info/bukova/isspst/filters/TripRequirementFilter.java @@ -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 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; } diff --git a/src/main/java/info/bukova/isspst/services/requirement/TripRequirementServiceImpl.java b/src/main/java/info/bukova/isspst/services/requirement/TripRequirementServiceImpl.java index e787c10a..64522ce9 100644 --- a/src/main/java/info/bukova/isspst/services/requirement/TripRequirementServiceImpl.java +++ b/src/main/java/info/bukova/isspst/services/requirement/TripRequirementServiceImpl.java @@ -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 { - private BigDecimalConverter bigDecimalConverter; @WireVariable private TripBillService tripBillService; private List vehicles; @@ -26,16 +24,11 @@ public class TripBillForm extends FormViewModel { @Init(superclass = true) public void init() { - bigDecimalConverter = new BigDecimalConverter(); vehicles = new ArrayList(); 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 { public List getVehicles() { return vehicles; } + } diff --git a/src/main/java/info/bukova/isspst/ui/tripbill/TripBillList.java b/src/main/java/info/bukova/isspst/ui/tripbill/TripBillList.java index 46906468..9ce6194a 100644 --- a/src/main/java/info/bukova/isspst/ui/tripbill/TripBillList.java +++ b/src/main/java/info/bukova/isspst/ui/tripbill/TripBillList.java @@ -16,8 +16,8 @@ public class TripBillList extends ListViewModel { 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 { public BigDecimalConverter getConverter() { return converter; } + + @Override + public boolean isAbleToAdd() { + return false; + } + } diff --git a/src/main/webapp/main/trips/bill/tripBillForm.zul b/src/main/webapp/main/trips/bill/tripBillForm.zul index 950d31cc..f66b2943 100644 --- a/src/main/webapp/main/trips/bill/tripBillForm.zul +++ b/src/main/webapp/main/trips/bill/tripBillForm.zul @@ -4,6 +4,8 @@ - + @@ -78,7 +80,9 @@ - +
@@ -271,15 +275,15 @@ - - + + - - + + - - + + -
diff --git a/src/main/webapp/main/trips/bill/tripBillGrid.zul b/src/main/webapp/main/trips/bill/tripBillGrid.zul index 5b457176..6ed6e5b2 100644 --- a/src/main/webapp/main/trips/bill/tripBillGrid.zul +++ b/src/main/webapp/main/trips/bill/tripBillGrid.zul @@ -18,23 +18,24 @@