Do agendy Cestovní příkazy byly přidány záložky "Má střediska", "Mé komise" a "Vše", kde se zobrazují vyúčtování služebních ke schválení. V záložkách lze vyúčtování označit jako proplacené. Do e-mailu se generuje odkaz do těchto záložek.

closes #253
closes #250
Verze_3.0
Josef Rokos 9 years ago
parent 84154ccbff
commit 369184940b

@ -116,6 +116,7 @@ public class Constants {
public final static String PERM_EDIT_OWN = "PERM_EDIT_OWN";
public final static String PERM_DELETE_NEW = "PERM_DELETE_NEW";
public final static String PERM_SEARCH = "PERM_SEARCH";
public final static String PERM_PAY_BILL = "PERM_PAY_BILL";
public final static Permission SPECIAL_PERMISSIONS[] = {
new Permission(PERM_EDIT_NEW, "Upravit neschválené", MOD_REQUIREMENTS, PermissionType.GLOBAL),
@ -133,7 +134,9 @@ public class Constants {
new Permission(PERM_APPROVE, "Schválení", MOD_TRIPREQUIREMENTS, PermissionType.WORKGROUP),
new Permission(PERM_SEARCH, "Vyhledávat", MOD_SEARCH, PermissionType.GLOBAL),
new Permission(PERM_READ, "Číst", MOD_SIGNEDDOCS, PermissionType.GLOBAL)
new Permission(PERM_READ, "Číst", MOD_SIGNEDDOCS, PermissionType.GLOBAL),
new Permission(PERM_PAY_BILL, "Vyplacení SC", MOD_TRIPBILL, PermissionType.GLOBAL)
};
public final static String DYNAMIC_REPORT_NAME = "Tabulková sestava";
@ -162,7 +165,7 @@ public class Constants {
public final static Map<Class<?>, String> URL_MAP = Collections.unmodifiableMap(new HashMap<Class<?>, String>() {{
put(Requirement.class, "/main/orders/");
put(TripRequirement.class, "/main/trips/requirements/");
put(TripBillApproval.class, "/main/trips/requirements/");
put(TripBillApproval.class, "/main/trips/bill/");
put(Order.class, "/main/orders/created/");
put(TripBill.class, "/main/trips/bill/");
}} );

@ -21,7 +21,7 @@ public class TripBillAprovalUrlResolver implements EntityUrlResolver {
if (entity instanceof TripBillApproval) {
String url = Constants.URL_MAP.get(entity.getClass());
return defUrl + url + "?select=" + String.valueOf(((TripBillApproval)entity).getBill().getRequirement().getId());
return defUrl + url + "?select=" + String.valueOf(((TripBillApproval)entity).getId());
}
return defUrl + "/app";

@ -65,6 +65,10 @@ public class TripBill extends BaseData implements EntityWithAttachment {
private TripBillApproval approval;
@Column(name = "SAVED")
private Boolean saved; // Nastaveno na true, pokud uživatel udělá změnu- nepřenáší se pak částky od žadatele
@Column(name = "PAID")
private Boolean paid;
@Column(name = "PAID_DATE")
private Date paidDate;
public TripBill() {
billItems = new ArrayList<TripBillItem>();
@ -186,4 +190,20 @@ public class TripBill extends BaseData implements EntityWithAttachment {
public void setSaved(Boolean saved) {
this.saved = saved;
}
public Boolean getPaid() {
return paid;
}
public void setPaid(Boolean paid) {
this.paid = paid;
}
public Date getPaidDate() {
return paidDate;
}
public void setPaidDate(Date paidDate) {
this.paidDate = paidDate;
}
}

@ -0,0 +1,78 @@
package info.bukova.isspst.filters;
import info.bukova.isspst.BooleanUtils;
import info.bukova.isspst.DateTimeUtils;
import info.bukova.isspst.StringUtils;
import info.bukova.isspst.data.TripBillApproval;
import info.bukova.isspst.data.User;
import org.hamcrest.Description;
import org.hamcrest.Factory;
import org.hamcrest.Matcher;
import org.hamcrest.TypeSafeMatcher;
public class TripBillApprovalFilter implements Filter<TripBillApproval>
{
private TripBillApproval condition;
public TripBillApprovalFilter(TripBillApproval cond)
{
this.condition = cond;
}
private static class TripBillApprovalMatcher extends TypeSafeMatcher<TripBillApproval>
{
private TripBillApproval condition;
public TripBillApprovalMatcher(TripBillApproval cond)
{
this.condition = cond;
}
@Override
public void describeTo(Description desc)
{
desc.appendText("requirement matches");
}
@Override
public boolean matchesSafely(TripBillApproval item)
{
if (item.getBill() == null) {
return false;
}
boolean foundNumser = StringUtils.isEqualForFilter(item.getNumser(), condition.getNumser());
boolean foundReqDate = DateTimeUtils.isEqualByDateForFilter(item.getBill().getRequirement().getReqDate(), condition.getBill().getRequirement().getReqDate());
boolean foundDescription = StringUtils.isEqualForFilter(item.getDescription(), condition.getDescription());
boolean foundFrom = StringUtils.isEqualForFilter(item.getBill().getRequirement().getFrom(), condition.getBill().getRequirement().getFrom());
boolean foundTo = StringUtils.isEqualForFilter(item.getBill().getRequirement().getTo(), condition.getBill().getRequirement().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 = User.isEqualByUserForFilter(item.getBill().getOwnedBy(), condition.getBill().getOwnedBy());
boolean foundPaid = BooleanUtils.isEqualByBooleanValue(item.getBill().getPaid(), condition.getBill().getPaid());
boolean foundPaidDate = DateTimeUtils.isEqualByDateForFilter(item.getBill().getPaidDate(), condition.getBill().getPaidDate());
return foundNumser && foundReqDate && foundDescription && foundFrom && foundTo && foundWorkgroup && foundCentre && foundOwner && foundPaid && foundPaidDate;
}
@Factory
public static Matcher<TripBillApproval> matchTripRequirement(TripBillApproval building)
{
return new TripBillApprovalMatcher(building);
}
}
@Override
public TripBillApprovalMatcher matcher()
{
return new TripBillApprovalMatcher(condition);
}
@Override
public String queryString()
{
return "";
}
}

@ -0,0 +1,18 @@
package info.bukova.isspst.services.tripbill;
import info.bukova.isspst.services.IsspstException;
/**
* @author Pepa Rokos
*/
public class PayException extends IsspstException {
public PayException() {
super();
}
public PayException(String message) {
super(message);
setReason(message);
}
}

@ -1,6 +1,8 @@
package info.bukova.isspst.services.tripbill;
import info.bukova.isspst.Constants;
import info.bukova.isspst.Module;
import info.bukova.isspst.ModuleUtils;
import info.bukova.isspst.StringUtils;
import info.bukova.isspst.data.DataModel;
import info.bukova.isspst.data.RequirementState;
@ -10,6 +12,7 @@ import info.bukova.isspst.services.IsspstException;
import info.bukova.isspst.services.requirement.RequirementBaseServiceImpl;
import info.bukova.isspst.services.requirement.RequirementTypeService;
import info.bukova.isspst.services.signeddocs.SignedDocumentService;
import org.hibernate.Query;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Transactional;
@ -72,4 +75,29 @@ public class TripBillApprovalServiceImpl extends RequirementBaseServiceImpl<Trip
signedDocumentService.deleteForEntity(bill);
tripBillService.update(bill);
}
@Override
public Module getModule() {
return ModuleUtils.getModule(Constants.MOD_TRIPREQUIREMENTS);
}
@Override
@Transactional
@PreAuthorize("hasPermission(this, 'PERM_DELETE') or hasPermission(#entity, this.getDeleteEntityPermission())")
public void delete(TripBillApproval entity) {
TripBill bill = entity.getBill();
if (bill == null) {
Query q = queryDao.getQuery("FROM TripBill WHERE APPROVAL_ID = :appId");
q.setInteger("appId", entity.getId());
bill = (TripBill) q.uniqueResult();
}
if (bill != null) {
dao.delete(entity);
cancelApproval(bill);
} else {
super.delete(entity);
}
}
}

@ -4,6 +4,7 @@ import info.bukova.isspst.data.TripBill;
import info.bukova.isspst.data.TripRequirement;
import info.bukova.isspst.services.Service;
import java.util.Date;
import java.util.List;
public interface TripBillService extends Service<TripBill> {
@ -15,6 +16,7 @@ public interface TripBillService extends Service<TripBill> {
public List<TripBill> getMy();
public void loadOwner(TripBill bill);
public void loadPassengers(TripBill bill);
public void setPaid(TripBill bill, Date date);
/**
* Uloží vyúčtování a nastaví příznak přenosu vyúčtování od žadatele

@ -23,6 +23,7 @@ import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.Date;
import java.util.List;
public class TripBillServiceImpl extends AbstractOwnedService<TripBill> implements
@ -212,6 +213,19 @@ public class TripBillServiceImpl extends AbstractOwnedService<TripBill> implemen
bill.getRequirement().setPassengers(tr.getPassengers());
}
@Override
@Transactional
@PreAuthorize("hasPermission(this, 'PERM_PAY_BILL')")
public void setPaid(TripBill bill, Date date) {
if (bill.getApproval() == null || bill.getApproval().getState() != RequirementState.APPROVED) {
throw new PayException("BillNotApproved");
}
bill.setPaid(true);
bill.setPaidDate(date);
super.update(bill);
}
@Override
@Transactional
@PreAuthorize("hasPermission(this, 'PERM_EDIT') or hasPermission(#entity, this.getUpdateEntityPermission())")
@ -252,7 +266,9 @@ public class TripBillServiceImpl extends AbstractOwnedService<TripBill> implemen
@Override
public boolean canPrintRecord(TripBill entity) {
if (entity.getApproval() != null && entity.getApproval().getState() == RequirementState.APPROVED) {
if (entity.getApproval() != null
&& entity.getApproval().getState() == RequirementState.APPROVED
&& (entity.getPaid() == null || !entity.getPaid())) {
return true;
}

@ -5,12 +5,6 @@ import info.bukova.isspst.data.DataModel;
import info.bukova.isspst.filters.Filter;
import info.bukova.isspst.services.IsspstException;
import info.bukova.isspst.services.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.dao.DataIntegrityViolationException;
@ -27,6 +21,11 @@ import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zul.Messagebox;
import org.zkoss.zul.Window;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class ListViewModel<T extends DataModel> extends DocumentViewModel
{
@ -277,7 +276,7 @@ public class ListViewModel<T extends DataModel> extends DocumentViewModel
}
@Command
@NotifyChange({"selIndex", "dataBean"})
@NotifyChange({"selIndex", "dataBean", "ableToDelete"})
public void afterRender() {
if (editBean != null && !editBean.isValid()) {
return;

@ -0,0 +1,40 @@
package info.bukova.isspst.ui.renderers;
import info.bukova.isspst.data.RequirementState;
import info.bukova.isspst.data.TripBillApproval;
import org.zkoss.zul.Listbox;
import org.zkoss.zul.Listitem;
/**
* @author Pepa Rokos
*/
public class TripBillApprovalItemRenderer extends GenericListitemRenderer<TripBillApproval> {
@Override
protected void changeProperties(Listbox lb, Listitem li, int index, String varnm) {
RequirementState state = getObjectOfStates().getState();
if (state != null) {
if (state == RequirementState.PARTIALLY) {
li.setSclass("req-select-partially");
}
else if (state == RequirementState.APPROVED) {
Boolean isPaid;
if (getObjectOfStates().getBill() == null) {
isPaid = false;
} else {
isPaid = getObjectOfStates().getBill().getPaid();
}
if ((isPaid != null) && (isPaid.booleanValue() == true)) {
li.setSclass("req-select-approved-project");
}
else {
li.setSclass("req-select-approved");
}
}
}
}
}

@ -50,7 +50,7 @@ public class RequirementSubpage<T extends RequirementBase> extends ListViewModel
this.requirementsItemRenderer = new RequirementsItemRenderer();
}
private RequirementBaseService<T> getReqService()
protected RequirementBaseService<T> getReqService()
{
return (RequirementBaseService<T>) service;
}

@ -0,0 +1,60 @@
package info.bukova.isspst.ui.tripbill;
import info.bukova.isspst.StringUtils;
import info.bukova.isspst.data.TripBill;
import info.bukova.isspst.services.tripbill.PayException;
import info.bukova.isspst.services.tripbill.TripBillService;
import info.bukova.isspst.ui.ListViewModel;
import org.springframework.security.access.AccessDeniedException;
import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.BindingParam;
import org.zkoss.bind.annotation.Command;
import org.zkoss.bind.annotation.ExecutionArgParam;
import org.zkoss.bind.annotation.Init;
import org.zkoss.zk.ui.select.annotation.WireVariable;
import org.zkoss.zul.Messagebox;
import org.zkoss.zul.Window;
import java.util.Date;
/**
* @author Pepa Rokos
*/
public class PayDialogVM {
@WireVariable
private TripBillService tripBillService;
private TripBill bill;
private ListViewModel grid;
private Date payDate;
@Init
public void init(@ExecutionArgParam("bill") TripBill bill,
@ExecutionArgParam("grid") ListViewModel grid) {
this.bill = bill;
this.grid = grid;
}
@Command
public void pay(@BindingParam("window") Window window) {
try {
tripBillService.setPaid(bill, payDate);
BindUtils.postNotifyChange(null, null, grid, "dataBean");
BindUtils.postGlobalCommand(null, null, "reload", null);
window.detach();
} catch (PayException ex) {
Messagebox.show(StringUtils.localize(ex.getReason()), StringUtils.localize("Error"), Messagebox.OK,
Messagebox.ERROR);
} catch (AccessDeniedException ex) {
Messagebox.show(StringUtils.localize("ErrorRights"), StringUtils.localize("Error"), Messagebox.OK, Messagebox.ERROR);
}
}
public Date getPayDate() {
return payDate;
}
public void setPayDate(Date payDate) {
this.payDate = payDate;
}
}

@ -9,6 +9,7 @@ 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 org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.BindingParam;
import org.zkoss.bind.annotation.Command;
import org.zkoss.bind.annotation.Init;
@ -82,6 +83,7 @@ public class TripBillForm extends FormWithUpload<TripBill> {
TripBillApproval approval = tripBillApprovalService.createApproval(getDataBean());
tripBillApprovalService.add(approval);
TripBillForm.super.save(editWin);
BindUtils.postGlobalCommand(null, null, "refresh", null);
} else {
TripBillForm.super.save(editWin);
}

@ -0,0 +1,34 @@
package info.bukova.isspst.ui.tripbill;
import info.bukova.isspst.data.TripBillApproval;
import org.springframework.security.access.AccessDeniedException;
import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.Init;
import java.util.ArrayList;
import java.util.List;
/**
* @author Pepa Rokos
*/
public class TripBillListAll extends TripBillListBase {
@Init(superclass = true)
public void initAllList() {
}
@Override
protected List<TripBillApproval> getListFromService() {
try {
return getReqService().getAll();
} catch (AccessDeniedException e) {
BindUtils.postGlobalCommand(null, null, "disableAll", null);
return new ArrayList<TripBillApproval>();
}
}
@Override
protected void beforeSelectViaUrl() {
BindUtils.postGlobalCommand(null, null, "selectAll", null);
}
}

@ -0,0 +1,86 @@
package info.bukova.isspst.ui.tripbill;
import info.bukova.isspst.data.TripBill;
import info.bukova.isspst.data.TripBillApproval;
import info.bukova.isspst.data.TripRequirement;
import info.bukova.isspst.data.User;
import info.bukova.isspst.filters.TripBillApprovalFilter;
import info.bukova.isspst.services.tripbill.TripBillApprovalService;
import info.bukova.isspst.services.tripbill.TripBillService;
import info.bukova.isspst.services.users.UserService;
import info.bukova.isspst.ui.renderers.TripBillApprovalItemRenderer;
import info.bukova.isspst.ui.requirement.RequirementSubpage;
import org.zkoss.bind.annotation.Command;
import org.zkoss.bind.annotation.GlobalCommand;
import org.zkoss.bind.annotation.Init;
import org.zkoss.bind.annotation.NotifyChange;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.select.annotation.WireVariable;
import org.zkoss.zul.Window;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author Pepa Rokos
*/
public class TripBillListBase extends RequirementSubpage<TripBillApproval> {
@WireVariable
private TripBillApprovalService tripBillApprovalService;
private TripBillApprovalItemRenderer itemRenderer;
@WireVariable
private TripBillService tripBillService;
@WireVariable
private UserService userService;
private List<User> allUsers;
@Init(superclass = true)
public void initListBase() {
service = tripBillApprovalService;
itemRenderer = new TripBillApprovalItemRenderer();
dataClass = TripBillApproval.class;
TripBillApproval filter = getFilterTemplate();
TripBill tb = new TripBill();
tb.setRequirement(new TripRequirement());
filter.setBill(tb);
dataFilter = new TripBillApprovalFilter(filter);
allUsers = userService.getUsersForCombo();
}
public TripBillApprovalItemRenderer getItemRenderer() {
return itemRenderer;
}
@Command
public void pay() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("bill", getDataBean().getBill());
params.put("grid", this);
Window payDialog = (Window) Executions.createComponents("payDialog.zul", null, params);
payDialog.doModal();
}
@Command
@Override
public void edit() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("selected", getDataBean().getBill());
tripBillService.loadLazyData(getDataBean().getBill());
Window win = (Window) Executions.createComponents("../requirements/tripBill.zul", null, params);
win.doModal();
}
@Override
public List<User> getAllUsers() {
return allUsers;
}
@GlobalCommand
@NotifyChange({ "dataList", "dataBean", "fullFill" })
public void reloadRelated()
{
this.reload();
}
}

@ -0,0 +1,34 @@
package info.bukova.isspst.ui.tripbill;
import info.bukova.isspst.data.TripBillApproval;
import org.springframework.security.access.AccessDeniedException;
import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.Init;
import java.util.ArrayList;
import java.util.List;
/**
* @author Pepa Rokos
*/
public class TripBillListCentre extends TripBillListBase {
@Init(superclass = true)
public void initListCentre() {
}
@Override
protected List<TripBillApproval> getListFromService() {
try {
return getReqService().getCentreReq();
} catch (AccessDeniedException e) {
BindUtils.postGlobalCommand(null, null, "disableCentre", null);
return new ArrayList<TripBillApproval>();
}
}
@Override
protected void beforeSelectViaUrl() {
BindUtils.postGlobalCommand(null, null, "selectCentre", null);
}
}

@ -0,0 +1,35 @@
package info.bukova.isspst.ui.tripbill;
import info.bukova.isspst.data.TripBillApproval;
import org.springframework.security.access.AccessDeniedException;
import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.Init;
import java.util.ArrayList;
import java.util.List;
/**
* @author Pepa Rokos
*/
public class TripBillListWorkgroup extends TripBillListBase {
@Init(superclass = true)
public void initWorkgroupList() {
}
@Override
protected List<TripBillApproval> getListFromService() {
try {
return getReqService().getWorkgroupReq();
} catch (AccessDeniedException e) {
BindUtils.postGlobalCommand(null, null, "disableWorkgroup", null);
return new ArrayList<TripBillApproval>();
}
}
@Override
protected void beforeSelectViaUrl() {
BindUtils.postGlobalCommand(null, null, "selectWorkgroup", null);
}
}

@ -244,9 +244,15 @@ TripBillSave=Odeslat ke schválení?
TripBillCancelApproval=Zrušit schválení a povolit úpravy
TripBillCancelApprovalQuestion=Opravdu zrušít schválení tohoto vyúčtování?
TripBillCancelApprovalTitle=Zrušit schválení
TripBillPaid=Proplaceno
TripBillPaidDate=Datum proplacení
TripBillPay=Proplatit
TripBillSummaryDetail=Detail
TripBilling=Proplacení vyúčtování
BillNotApproved=Vyúčtování není schválené, nelze proplatit.
TripRequirement=Požadavek na služební cestu
ShowTripBill=Zobrazit vyúčtování

@ -2,7 +2,7 @@
<zk>
<zscript>
String gridZul = "tripBillGrid.zul";
String gridZul = "setup.zul";
</zscript>
<include src="/app/template.zhtml"/>

@ -0,0 +1,32 @@
<?page title="${labels.TravelOrdersFormTitle}" contentType="text/html;charset=UTF-8"?>
<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"?>
<window id="payWin" border="normal" apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.tripbill.PayDialogVM')" width="320px" closable="true">
<caption
image="/img/invoicing-032.png"
zclass="form-caption"
label="${labels.TripBilling}" />
<vbox hflex="1">
<hbox>
<label value="${labels.TripBillPaidDate}:"/>
<datebox
instant="true"
value="@bind(vm.payDate)"
format="${labels.DateFormat}"/>
</hbox>
<separator bar="true" hflex="1"/>
<hbox>
<button image="/img/approve-016.png" label="${labels.Confirm}" onClick="@command('pay', window=payWin)" sclass="nicebutton" disabled="@load(empty vm.payDate)"/>
<button image="~./zul/img/misc/drag-disallow.png" label="${labels.ButtonStorno}" onClick="payWin.detach()" sclass="nicebutton"/>
</hbox>
</vbox>
</window>
</zk>

@ -0,0 +1,21 @@
<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<zk>
<zscript>
String gridMy = "/main/trips/bill/tripBillGridMy.zul";
String gridMyCenters = "/main/trips/bill/tripBillGridCenters.zul";
String gridMyWorkgroups = "/main/trips/bill/tripBillGridWorkgroups.zul";
String gridAll = "/main/trips/bill/tripBillGridAll.zul";
</zscript>
<window
vflex="1"
border="normal">
<caption
src="/img/pickup-032.png"
zclass="form-caption"
label="${labels.TravelOrders}" />
<include
vflex="1"
src="/main/tabPanels.zul" />
</window>
</zk>

@ -0,0 +1,14 @@
<?page title="${labels.TravelOrders}" contentType="text/html;charset=UTF-8"?>
<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"?>
<window
vflex="1"
border="normal"
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.tripbill.TripBillListAll')">
<include src="../../toolbar.zul" />
<include vflex="1" src="tripBillGridInt.zul"/>
</window>
</zk>

@ -0,0 +1,14 @@
<?page title="${labels.TravelOrders}" contentType="text/html;charset=UTF-8"?>
<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"?>
<window
vflex="1"
border="normal"
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.tripbill.TripBillListCentre')">
<include src="../../toolbar.zul" />
<include vflex="1" src="tripBillGridInt.zul"/>
</window>
</zk>

@ -0,0 +1,198 @@
<?page title="${labels.TravelOrdersFormTitle}" contentType="text/html;charset=UTF-8"?>
<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"?>
<hbox vflex="1">
<listbox
vflex="1"
hflex="7"
model="@load(vm.dataList)"
selectedItem="@bind(vm.dataBean)"
itemRenderer="@load(vm.itemRenderer)"
onAfterRender="@command('afterRender')"
selectedIndex="@bind(vm.selIndex)">
<listhead menupopup="auto">
<listheader
label="${labels.TravelOrdersGridNumser}"
sort="czech(bill.requirement.numser)"
onCreate="self.sort(false)"
width="30%" />
<listheader
label="${labels.TravelOrdersGridReqDate}"
sort="auto(bill.requirement.reqDate)"
width="70%" />
<listheader
label="${labels.TravelOrdersGridFrom}"
sort="czech(bill.requirement.from)"
width="70%" />
<listheader
label="${labels.TravelOrdersGridTo}"
sort="czech(bill.requirement.to)"
width="70%" />
<listheader
label="${labels.TravelOrdersGridTotal}"
sort="auto(bill.total)"
align="right"
width="70%" />
<listheader
label="${labels.ownedBy}"
width="50%"/>
<listheader
label="${labels.TripBillPaid}"
width="10%"/>
<listheader
label="${labels.TripBillPaidDate}"
width="20%"/>
</listhead>
<auxhead
sclass="category-center"
visible="@load(vm.filter)">
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox
value="@bind(vm.filterTemplate.numser)"
instant="true"
onChange="@command('doFilter')"
maxlength="@load(vm.lengthText)"
sclass="find-grid-textbox" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<datebox
value="@bind(vm.filterTemplate.bill.requirement.reqDate)"
format="${labels.DateFormat}"
instant="true"
onChange="@command('doFilter')"
sclass="find-grid-textbox"
width="100%" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox
value="@bind(vm.filterTemplate.bill.requirement.from)"
instant="true"
onChange="@command('doFilter')"
maxlength="@load(vm.lengthDescription)"
sclass="find-grid-textbox" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox
value="@bind(vm.filterTemplate.bill.requirement.to)"
instant="true"
onChange="@command('doFilter')"
maxlength="@load(vm.lengthDescription)"
sclass="find-grid-textbox" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox
value="@bind(vm.filterTemplate.bill.total) @converter(vm.bigDecimalConverter)"
instant="true"
onChange="@command('doFilter')"
maxlength="@load(vm.lengthText)"
sclass="find-grid-textbox" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</auxheader>
<auxheader>
<div zclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<combobox
ctrlKeys="${labels.HandleComboKeyFilter}"
onCtrlKey="@command('handleComboKeyFilter', ctrl=self, keyEvent=event)"
onChange="@command('doFilter')"
width="100%"
selectedItem="@bind(vm.filterTemplate.bill.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" />
</div>
</div>
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<checkbox
checked="@bind(vm.filterTemplate.bill.paid)"
onClick="@command('doFilter')" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<datebox
value="@bind(vm.filterTemplate.bill.paidDate)"
format="${labels.DateFormat}"
instant="true"
onChange="@command('doFilter')"
sclass="find-grid-textbox"
width="100%" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</auxheader>
</auxhead>
<template name="model">
<listitem>
<listcell label="@load(each.bill.requirement.numser)" />
<listcell label="@load(each.bill.requirement.reqDate) @converter('formatedDate', format=labels.DateFormat)" />
<listcell label="@load(each.bill.requirement.from)" />
<listcell label="@load(each.bill.requirement.to)" />
<listcell label="@load(each.bill.total) @converter(vm.standardBigDecimalConverter)"/>
<listcell label="@load(each.bill.ownedBy)"/>
<listcell label="@load(each.bill.paid) @converter(vm.standardBoolConverter)"/>
<listcell label="@load(each.bill.paidDate) @converter('formatedDate', format=labels.DateFormat)"/>
</listitem>
</template>
</listbox>
<vbox hflex="3">
<include hflex="1" src="/main/approveStatus.zul"/>
<button label="${labels.TripBillPay}" image="/img/invoicing-016.png" onClick="@command('pay')" sclass="nicebutton" disabled="@load(not(vm.dataBean.state eq 'APPROVED'))"/>
</vbox>
</hbox>
</zk>

@ -0,0 +1,84 @@
<?page title="${labels.TravelOrders}" contentType="text/html;charset=UTF-8"?>
<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"?>
<window
vflex="1"
border="normal"
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.tripbill.TripBillList')">
<include src="/app/toolbar.zul" />
<listbox
vflex="1"
model="@load(vm.dataList)"
selectedItem="@bind(vm.dataBean)">
<listhead menupopup="auto">
<listheader
label="${labels.TravelOrdersGridNumser}"
sort="czech(numser)"
width="30%" />
<listheader
label="${labels.TravelOrdersGridReqDate}"
sort="auto(requirement.reqDate)"
width="70%" />
<listheader
label="${labels.TravelOrdersGridFrom}"
sort="czech(requirement.from)"
width="70%" />
<listheader
label="${labels.TravelOrdersGridTo}"
sort="czech(requirement.to)"
width="70%" />
<listheader
label="${labels.TravelOrdersGridTotal}"
sort="auto(total)"
align="right"
width="70%" />
</listhead>
<!-- <auxhead
sclass="category-center"
visible="@load(vm.filter)">
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox
value="@bind(vm.filterTemplate.name)"
instant="true"
onChange="@command('doFilter')"
maxlength="@load(vm.lengthText)"
sclass="find-grid-textbox" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox
value="@bind(vm.filterTemplate.description)"
instant="true"
onChange="@command('doFilter')"
maxlength="@load(vm.lengthDescription)"
sclass="find-grid-textbox" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</auxheader>
</auxhead> -->
<template name="model">
<listitem style="@load((empty each.approval ? '' : (each.approval.state eq 'PARTIALLY') ? 'background-color: #fffb90' : ((each.approval.state eq 'APPROVED') ? 'background-color: #afffb5' : 'background-color: #fdfbca') ))">
<listcell label="@load(each.requirement.numser)" />
<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) @converter(vm.standardBigDecimalConverter)"/>
</listitem>
</template>
</listbox>
</window>
</zk>

@ -0,0 +1,14 @@
<?page title="${labels.TravelOrders}" contentType="text/html;charset=UTF-8"?>
<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"?>
<window
vflex="1"
border="normal"
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.tripbill.TripBillListWorkgroup')">
<include src="../../toolbar.zul" />
<include vflex="1" src="tripBillGridInt.zul"/>
</window>
</zk>
Loading…
Cancel
Save