Ag. Služební cesty / Cestovní příkazy
• přidáno povinné pole Zpráva z pracovní cesty • u existujících záznamů přidán text "Zpráva z pracovní cesty" • upraveno rozdělení formuláře closes #203
This commit is contained in:
@@ -33,7 +33,7 @@ import java.util.Map;
|
||||
|
||||
public class Constants {
|
||||
|
||||
public final static long DB_VERSION = 3;
|
||||
public final static long DB_VERSION = 4;
|
||||
|
||||
public final static String DEF_ADMIN = "admin";
|
||||
public final static String DEF_ADMIN_PASSWD = "admin";
|
||||
|
||||
@@ -7,6 +7,15 @@ import org.zkoss.util.resource.Labels;
|
||||
|
||||
public class StringUtils
|
||||
{
|
||||
public static boolean isNullOrEmpty(String str)
|
||||
{
|
||||
return ((str == null) || (str.isEmpty()));
|
||||
}
|
||||
|
||||
public static boolean isNullOrTrimmedEmpty(String str)
|
||||
{
|
||||
return ((str == null) || (str.trim().isEmpty()));
|
||||
}
|
||||
|
||||
public static String nullToEmptyString(String str)
|
||||
{
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package info.bukova.isspst.data;
|
||||
|
||||
import info.bukova.isspst.storage.EntityWithAttachment;
|
||||
import org.hibernate.annotations.LazyCollection;
|
||||
import org.hibernate.annotations.LazyCollectionOption;
|
||||
import org.hibernate.search.annotations.Indexed;
|
||||
import org.hibernate.search.annotations.IndexedEmbedded;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Column;
|
||||
@@ -15,10 +16,14 @@ import javax.persistence.ManyToOne;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.OneToOne;
|
||||
import javax.persistence.Table;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.hibernate.annotations.LazyCollection;
|
||||
import org.hibernate.annotations.LazyCollectionOption;
|
||||
import org.hibernate.search.annotations.Analyze;
|
||||
import org.hibernate.search.annotations.Field;
|
||||
import org.hibernate.search.annotations.Index;
|
||||
import org.hibernate.search.annotations.Indexed;
|
||||
import org.hibernate.search.annotations.IndexedEmbedded;
|
||||
|
||||
@Entity
|
||||
@Table(name = "TRIP_BILL")
|
||||
@@ -32,6 +37,11 @@ public class TripBill extends BaseData implements EntityWithAttachment {
|
||||
private Date resultMessageDate;
|
||||
@Column(name = "SIGN_DATE")
|
||||
private Date signDate;
|
||||
|
||||
@Column(name = "RESULT_MESSAGE")
|
||||
@Field(index = Index.YES, analyze = Analyze.YES)
|
||||
private String resultMessage;
|
||||
|
||||
@Column(name = "FREE_MEALS")
|
||||
private boolean freeMeals;
|
||||
@Column(name = "FREE_HOUSING")
|
||||
@@ -85,6 +95,16 @@ public class TripBill extends BaseData implements EntityWithAttachment {
|
||||
this.signDate = signDate;
|
||||
}
|
||||
|
||||
public String getResultMessage()
|
||||
{
|
||||
return resultMessage;
|
||||
}
|
||||
|
||||
public void setResultMessage(String resultMessage)
|
||||
{
|
||||
this.resultMessage = resultMessage;
|
||||
}
|
||||
|
||||
public boolean isFreeMeals() {
|
||||
return freeMeals;
|
||||
}
|
||||
|
||||
@@ -126,6 +126,13 @@ public class DbInfoServiceImpl extends AbstractService<DbInfo> implements DbInfo
|
||||
sq.executeUpdate();
|
||||
}
|
||||
|
||||
if (dbVersion < 4)
|
||||
{
|
||||
sql = "UPDATE TRIP_BILL SET RESULT_MESSAGE = 'Zpráva z pracovní cesty' WHERE (RESULT_MESSAGE Is NULL) ";
|
||||
sq = this.dao.getSession().createSQLQuery(sql);
|
||||
sq.executeUpdate();
|
||||
}
|
||||
|
||||
this.updateDatabaseVersion();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,10 @@ import info.bukova.isspst.services.settings.GlobalSettingsService;
|
||||
import info.bukova.isspst.services.tripbill.TripBillApprovalService;
|
||||
import info.bukova.isspst.services.tripbill.TripBillService;
|
||||
import info.bukova.isspst.ui.FormWithUpload;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.zkoss.bind.annotation.BindingParam;
|
||||
import org.zkoss.bind.annotation.Command;
|
||||
import org.zkoss.bind.annotation.Init;
|
||||
@@ -18,9 +22,6 @@ import org.zkoss.zk.ui.select.annotation.WireVariable;
|
||||
import org.zkoss.zul.Messagebox;
|
||||
import org.zkoss.zul.Window;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class TripBillForm extends FormWithUpload<TripBill> {
|
||||
|
||||
@WireVariable
|
||||
@@ -63,8 +64,16 @@ public class TripBillForm extends FormWithUpload<TripBill> {
|
||||
@Override
|
||||
@Command
|
||||
@NotifyChange("errMessages")
|
||||
public void save(@BindingParam("window") Window win) {
|
||||
public void save(@BindingParam("window") Window win)
|
||||
{
|
||||
if (StringUtils.isNullOrTrimmedEmpty(this.getDataBean().getResultMessage()))
|
||||
{
|
||||
Messagebox.show(StringUtils.localize("ErrFillTripBillResultMessageText"), StringUtils.localize("Error"), Messagebox.OK, Messagebox.ERROR);
|
||||
return;
|
||||
}
|
||||
|
||||
final Window editWin = win;
|
||||
|
||||
if (getDataBean().getApproval() == null && !isBillDisabled()) {
|
||||
Messagebox.show(StringUtils.localize("TripBillSaveApprove"), StringUtils.localize("TripBillSave"), Messagebox.YES
|
||||
| Messagebox.NO, Messagebox.QUESTION, new EventListener<Event>() {
|
||||
|
||||
@@ -399,3 +399,5 @@ Passenger = Pasažér
|
||||
ChooseThePasseger = Vyberte pasažéra
|
||||
TransportMode = Způsob dopravy
|
||||
ForeignPersons = Cizí osoby
|
||||
TripBillResultMessageText = Zpráva z pracovní cesty
|
||||
ErrFillTripBillResultMessageText = Vyplňte zprávu z pracovní cesty.
|
||||
|
||||
@@ -43,35 +43,51 @@
|
||||
</grid>
|
||||
<grid>
|
||||
<columns>
|
||||
<column/>
|
||||
<column/>
|
||||
<column hflex="min" />
|
||||
<column hflex="min" />
|
||||
<column hflex="1" />
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<cell>
|
||||
<label value="${labels.TripBillResultMessage}" />
|
||||
</cell>
|
||||
<cell>
|
||||
<datebox
|
||||
value="@bind(vm.dataBean.resultMessageDate)"
|
||||
disabled="${disabled}"
|
||||
format="${labels.DateFormat}" />
|
||||
</cell>
|
||||
</row>
|
||||
<row>
|
||||
<cell colspan="2">
|
||||
<checkbox label="${labels.TripBillFreeMeals}"
|
||||
<cell rowspan="3">
|
||||
<textbox
|
||||
placeholder="${labels.TripBillResultMessageText}"
|
||||
value="@bind(vm.dataBean.resultMessage)"
|
||||
style="resize:none"
|
||||
rows="3"
|
||||
cols="80" />
|
||||
</cell>
|
||||
<cell>
|
||||
<checkbox
|
||||
label="${labels.TripBillFreeMeals}"
|
||||
checked="@bind(vm.dataBean.freeMeals)"
|
||||
onCheck="@command('calculate')"
|
||||
disabled="@load(vm.billDisabled or disabled)" />
|
||||
</cell>
|
||||
</row>
|
||||
<row>
|
||||
<cell colspan="2">
|
||||
<checkbox label="${labels.TripBillFreeHousing}"
|
||||
<cell>
|
||||
<checkbox
|
||||
label="${labels.TripBillFreeHousing}"
|
||||
checked="@bind(vm.dataBean.freeHousing)"
|
||||
disabled="@load(vm.billDisabled or disabled)" />
|
||||
</cell>
|
||||
</row>
|
||||
<row>
|
||||
<cell colspan="2">
|
||||
<checkbox label="${labels.TripBillFreeCarfare}"
|
||||
<cell>
|
||||
<checkbox
|
||||
label="${labels.TripBillFreeCarfare}"
|
||||
checked="@bind(vm.dataBean.freeCarfare)"
|
||||
disabled="@load(vm.billDisabled or disabled)" />
|
||||
</cell>
|
||||
|
||||
Reference in New Issue
Block a user