Merge branch 'Verze_2.0'
This commit is contained in:
@@ -3,6 +3,7 @@ package info.bukova.isspst.ui.tripbill;
|
|||||||
import info.bukova.isspst.StringUtils;
|
import info.bukova.isspst.StringUtils;
|
||||||
import info.bukova.isspst.data.TripBill;
|
import info.bukova.isspst.data.TripBill;
|
||||||
import info.bukova.isspst.data.TripBillApproval;
|
import info.bukova.isspst.data.TripBillApproval;
|
||||||
|
import info.bukova.isspst.data.TripBillItem;
|
||||||
import info.bukova.isspst.data.Vehicle;
|
import info.bukova.isspst.data.Vehicle;
|
||||||
import info.bukova.isspst.services.settings.GlobalSettingsService;
|
import info.bukova.isspst.services.settings.GlobalSettingsService;
|
||||||
import info.bukova.isspst.services.tripbill.TripBillApprovalService;
|
import info.bukova.isspst.services.tripbill.TripBillApprovalService;
|
||||||
@@ -66,9 +67,7 @@ public class TripBillForm extends FormWithUpload<TripBill> {
|
|||||||
@NotifyChange("errMessages")
|
@NotifyChange("errMessages")
|
||||||
public void saveForApproval(@BindingParam("window") Window win)
|
public void saveForApproval(@BindingParam("window") Window win)
|
||||||
{
|
{
|
||||||
if (StringUtils.isNullOrTrimmedEmpty(this.getDataBean().getResultMessage()))
|
if (!canSaveForApproval()) {
|
||||||
{
|
|
||||||
Messagebox.show(StringUtils.localize("ErrFillTripBillResultMessageText"), StringUtils.localize("Error"), Messagebox.OK, Messagebox.ERROR);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,6 +93,26 @@ public class TripBillForm extends FormWithUpload<TripBill> {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean canSaveForApproval() {
|
||||||
|
if (StringUtils.isNullOrTrimmedEmpty(this.getDataBean().getResultMessage())) {
|
||||||
|
Messagebox.show(StringUtils.localize("ErrFillTripBillResultMessageText"), StringUtils.localize("Error"), Messagebox.OK, Messagebox.ERROR);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getDataBean().getBillItems() != null && !getDataBean().getBillItems().isEmpty()) {
|
||||||
|
TripBillItem first = getDataBean().getBillItems().get(0);
|
||||||
|
TripBillItem last = getDataBean().getBillItems().get(getDataBean().getBillItems().size() - 1);
|
||||||
|
|
||||||
|
if (first.getToArrival() == null || first.getToDeparture() == null
|
||||||
|
|| last.getBackArrival() == null || last.getBackDeparture() == null) {
|
||||||
|
Messagebox.show(StringUtils.localize("ErrFillTripBillResultTimes"), StringUtils.localize("Error"), Messagebox.OK, Messagebox.ERROR);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doSave() {
|
protected void doSave() {
|
||||||
maintainAttachment();
|
maintainAttachment();
|
||||||
|
|||||||
@@ -168,6 +168,7 @@ EMails=E-maily
|
|||||||
NewRequirement=Nový požadavek
|
NewRequirement=Nový požadavek
|
||||||
AuthRequirement=Dílčí schválení
|
AuthRequirement=Dílčí schválení
|
||||||
ConfirmRequirement=Schválení
|
ConfirmRequirement=Schválení
|
||||||
|
ConfirmTripPassengers=Schválení SC - spolucestující
|
||||||
InsertField=Vložit pole
|
InsertField=Vložit pole
|
||||||
EnableRequirements=Povolit zadávání požadavků
|
EnableRequirements=Povolit zadávání požadavků
|
||||||
ShippingAddresses=Dodací adresy:
|
ShippingAddresses=Dodací adresy:
|
||||||
@@ -404,3 +405,4 @@ TransportMode = Způsob dopravy
|
|||||||
ForeignPersons = Cizí osoby
|
ForeignPersons = Cizí osoby
|
||||||
TripBillResultMessageText = Zpráva z pracovní cesty
|
TripBillResultMessageText = Zpráva z pracovní cesty
|
||||||
ErrFillTripBillResultMessageText = Vyplňte zprávu z pracovní cesty.
|
ErrFillTripBillResultMessageText = Vyplňte zprávu z pracovní cesty.
|
||||||
|
ErrFillTripBillResultTimes = Zadejte časy odjezdu a příjezdu.
|
||||||
|
|||||||
@@ -341,13 +341,13 @@
|
|||||||
<vbox hflex="max">
|
<vbox hflex="max">
|
||||||
<textbox
|
<textbox
|
||||||
inplace="true"
|
inplace="true"
|
||||||
value="@load(each.to)"
|
value="@bind(each.to)"
|
||||||
maxlength="@load(vm.lengthText)"
|
maxlength="@load(vm.lengthText)"
|
||||||
sclass="grid-textbox-max-left"
|
sclass="grid-textbox-max-left"
|
||||||
readonly="@load(vm.billDisabled or disabled)" />
|
readonly="@load(vm.billDisabled or disabled)" />
|
||||||
<textbox
|
<textbox
|
||||||
inplace="true"
|
inplace="true"
|
||||||
value="@load(each.back)"
|
value="@bind(each.back)"
|
||||||
maxlength="@load(vm.lengthText)"
|
maxlength="@load(vm.lengthText)"
|
||||||
sclass="grid-textbox-max-left"
|
sclass="grid-textbox-max-left"
|
||||||
readonly="@load(vm.billDisabled or disabled)" />
|
readonly="@load(vm.billDisabled or disabled)" />
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<tab label="${labels.NewRequirement}"/>
|
<tab label="${labels.NewRequirement}"/>
|
||||||
<tab label="${labels.AuthRequirement}"/>
|
<tab label="${labels.AuthRequirement}"/>
|
||||||
<tab label="${labels.ConfirmRequirement}"/>
|
<tab label="${labels.ConfirmRequirement}"/>
|
||||||
<tab label="Scvaleni SC - spolucestujici"/>
|
<tab label="${labels.ConfirmTripPassengers}"/>
|
||||||
</tabs>
|
</tabs>
|
||||||
<tabpanels>
|
<tabpanels>
|
||||||
<tabpanel>
|
<tabpanel>
|
||||||
|
|||||||
Reference in New Issue
Block a user