Compare commits
No commits in common. 'master' and 'Verze_3.0' have entirely different histories.
@ -1,10 +0,0 @@
|
||||
package info.bukova.isspst.dao;
|
||||
|
||||
import info.bukova.isspst.data.Limit;
|
||||
|
||||
/**
|
||||
* @author Pepa Rokos
|
||||
*/
|
||||
public interface LimitDao extends BaseDao<Limit> {
|
||||
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
package info.bukova.isspst.dao;
|
||||
|
||||
import info.bukova.isspst.data.Season;
|
||||
|
||||
/**
|
||||
* @author Pepa Rokos
|
||||
*/
|
||||
public interface SeasonDao extends BaseDao<Season> {
|
||||
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
package info.bukova.isspst.dao.jpa;
|
||||
|
||||
import info.bukova.isspst.dao.LimitDao;
|
||||
import info.bukova.isspst.data.Limit;
|
||||
|
||||
/**
|
||||
* @author Pepa Rokos
|
||||
*/
|
||||
public class LimitDaoJPA extends BaseDaoJPA<Limit> implements LimitDao {
|
||||
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
package info.bukova.isspst.dao.jpa;
|
||||
|
||||
import info.bukova.isspst.dao.SeasonDao;
|
||||
import info.bukova.isspst.data.Season;
|
||||
|
||||
/**
|
||||
* @author Pepa Rokos
|
||||
*/
|
||||
public class SeasonDaoJPA extends BaseDaoJPA<Season> implements SeasonDao {
|
||||
|
||||
}
|
@ -1,50 +0,0 @@
|
||||
package info.bukova.isspst.data;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.FetchType;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.Table;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author Pepa Rokos
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "LIMITS")
|
||||
public class Limit extends BaseData implements SeasonsAware {
|
||||
|
||||
@ManyToOne(fetch = FetchType.EAGER)
|
||||
@JoinColumn(name = "WORKGROUP_ID")
|
||||
private Workgroup workgroup;
|
||||
@ManyToOne(fetch = FetchType.EAGER)
|
||||
@JoinColumn(name = "SEASON_ID")
|
||||
private Season season;
|
||||
@Column(name = "REQ_LIMIT", precision = 15, scale = 4)
|
||||
private BigDecimal limit;
|
||||
|
||||
public Workgroup getWorkgroup() {
|
||||
return workgroup;
|
||||
}
|
||||
|
||||
public void setWorkgroup(Workgroup workgroup) {
|
||||
this.workgroup = workgroup;
|
||||
}
|
||||
|
||||
public Season getSeason() {
|
||||
return season;
|
||||
}
|
||||
|
||||
public void setSeason(Season season) {
|
||||
this.season = season;
|
||||
}
|
||||
|
||||
public BigDecimal getLimit() {
|
||||
return limit;
|
||||
}
|
||||
|
||||
public void setLimit(BigDecimal limit) {
|
||||
this.limit = limit;
|
||||
}
|
||||
}
|
@ -1,83 +0,0 @@
|
||||
package info.bukova.isspst.data;
|
||||
|
||||
import org.hibernate.annotations.Cache;
|
||||
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author Pepa Rokos
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "SEASON")
|
||||
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||
public class Season extends BaseData {
|
||||
@Column(name = "DESCRIPTION")
|
||||
private String description;
|
||||
@Column(name = "VALID_FROM")
|
||||
private Date validFrom;
|
||||
@Column(name = "VALID_TO")
|
||||
private Date validTo;
|
||||
@Column(name = "ACTIVE")
|
||||
private boolean active;
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (!(o instanceof Season)) return false;
|
||||
|
||||
Season season = (Season) o;
|
||||
|
||||
if (getId() != season.getId()) return false;
|
||||
if (active != season.active) return false;
|
||||
if (description != null ? !description.equals(season.description) : season.description != null) return false;
|
||||
if (validFrom != null ? !validFrom.equals(season.validFrom) : season.validFrom != null) return false;
|
||||
if (validTo != null ? !validTo.equals(season.validTo) : season.validTo != null) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = description != null ? description.hashCode() : 0;
|
||||
result = 31 * result + (validFrom != null ? validFrom.hashCode() : 0);
|
||||
result = 31 * result + (validTo != null ? validTo.hashCode() : 0);
|
||||
result = 31 * result + (active ? 1 : 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public Date getValidFrom() {
|
||||
return validFrom;
|
||||
}
|
||||
|
||||
public void setValidFrom(Date validFrom) {
|
||||
this.validFrom = validFrom;
|
||||
}
|
||||
|
||||
public Date getValidTo() {
|
||||
return validTo;
|
||||
}
|
||||
|
||||
public void setValidTo(Date validTo) {
|
||||
this.validTo = validTo;
|
||||
}
|
||||
|
||||
public boolean isActive() {
|
||||
return active;
|
||||
}
|
||||
|
||||
public void setActive(boolean active) {
|
||||
this.active = active;
|
||||
}
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
package info.bukova.isspst.data;
|
||||
|
||||
/**
|
||||
* @author Pepa Rokos
|
||||
*/
|
||||
public interface SeasonsAware {
|
||||
public Season getSeason();
|
||||
}
|
@ -1,306 +0,0 @@
|
||||
package info.bukova.isspst.security;
|
||||
|
||||
import org.springframework.ldap.core.DirContextOperations;
|
||||
import org.springframework.ldap.core.DistinguishedName;
|
||||
import org.springframework.ldap.support.LdapUtils;
|
||||
import org.springframework.security.authentication.AccountExpiredException;
|
||||
import org.springframework.security.authentication.BadCredentialsException;
|
||||
import org.springframework.security.authentication.CredentialsExpiredException;
|
||||
import org.springframework.security.authentication.DisabledException;
|
||||
import org.springframework.security.authentication.LockedException;
|
||||
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.authority.AuthorityUtils;
|
||||
import org.springframework.security.core.authority.SimpleGrantedAuthority;
|
||||
import org.springframework.security.ldap.SpringSecurityLdapTemplate;
|
||||
import org.springframework.security.ldap.authentication.AbstractLdapAuthenticationProvider;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import javax.naming.AuthenticationException;
|
||||
import javax.naming.Context;
|
||||
import javax.naming.NamingException;
|
||||
import javax.naming.OperationNotSupportedException;
|
||||
import javax.naming.directory.DirContext;
|
||||
import javax.naming.directory.SearchControls;
|
||||
import javax.naming.ldap.InitialLdapContext;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Hashtable;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class AdAuthenticationProvider extends AbstractLdapAuthenticationProvider{
|
||||
private static final Pattern SUB_ERROR_CODE = Pattern.compile(".*data\\s([0-9a-f]{3,4}).*");
|
||||
|
||||
// Error codes
|
||||
private static final int USERNAME_NOT_FOUND = 0x525;
|
||||
private static final int INVALID_PASSWORD = 0x52e;
|
||||
private static final int NOT_PERMITTED = 0x530;
|
||||
private static final int PASSWORD_EXPIRED = 0x532;
|
||||
private static final int ACCOUNT_DISABLED = 0x533;
|
||||
private static final int ACCOUNT_EXPIRED = 0x701;
|
||||
private static final int PASSWORD_NEEDS_RESET = 0x773;
|
||||
private static final int ACCOUNT_LOCKED = 0x775;
|
||||
|
||||
private final String domain;
|
||||
private final String rootDn;
|
||||
private final String url;
|
||||
private final String upnSuffix;
|
||||
private boolean convertSubErrorCodesToExceptions;
|
||||
|
||||
// Only used to allow tests to substitute a mock LdapContext
|
||||
ContextFactory contextFactory = new ContextFactory();
|
||||
|
||||
/**
|
||||
* @param domain the domain for which authentication should take place
|
||||
*/
|
||||
// public ActiveDirectoryLdapAuthenticationProvider(String domain) {
|
||||
// this (domain, null);
|
||||
// }
|
||||
|
||||
/**
|
||||
* @param domain the domain name (may be null or empty)
|
||||
* @param url an LDAP url (or multiple URLs)
|
||||
*/
|
||||
public AdAuthenticationProvider(String domain, String upnSuffix, String url) {
|
||||
Assert.isTrue(StringUtils.hasText(url), "Url cannot be empty");
|
||||
this.domain = StringUtils.hasText(domain) ? domain.toLowerCase() : null;
|
||||
//this.url = StringUtils.hasText(url) ? url : null;
|
||||
this.url = url;
|
||||
this.upnSuffix = upnSuffix;
|
||||
rootDn = this.domain == null ? null : rootDnFromDomain(this.domain);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected DirContextOperations doAuthentication(UsernamePasswordAuthenticationToken auth) {
|
||||
String username = auth.getName();
|
||||
String password = (String)auth.getCredentials();
|
||||
|
||||
DirContext ctx = bindAsUser(username, password);
|
||||
|
||||
try {
|
||||
return searchForUser(ctx, username);
|
||||
|
||||
} catch (NamingException e) {
|
||||
logger.error("Failed to locate directory entry for authenticated user: " + username, e);
|
||||
throw badCredentials();
|
||||
} finally {
|
||||
LdapUtils.closeContext(ctx);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the user authority list from the values of the {@code memberOf} attribute obtained from the user's
|
||||
* Active Directory entry.
|
||||
*/
|
||||
@Override
|
||||
protected Collection<? extends GrantedAuthority> loadUserAuthorities(DirContextOperations userData, String username, String password) {
|
||||
String[] groups = userData.getStringAttributes("memberOf");
|
||||
|
||||
if (groups == null) {
|
||||
logger.debug("No values for 'memberOf' attribute.");
|
||||
|
||||
return AuthorityUtils.NO_AUTHORITIES;
|
||||
}
|
||||
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("'memberOf' attribute values: " + Arrays.asList(groups));
|
||||
}
|
||||
|
||||
ArrayList<GrantedAuthority> authorities = new ArrayList<GrantedAuthority>(groups.length);
|
||||
|
||||
for (String group : groups) {
|
||||
authorities.add(new SimpleGrantedAuthority(new DistinguishedName(group).removeLast().getValue()));
|
||||
}
|
||||
|
||||
return authorities;
|
||||
}
|
||||
|
||||
private DirContext bindAsUser(String username, String password) {
|
||||
// TODO. add DNS lookup based on domain
|
||||
final String bindUrl = url;
|
||||
|
||||
Hashtable<String,String> env = new Hashtable<String,String>();
|
||||
env.put(Context.SECURITY_AUTHENTICATION, "simple");
|
||||
String bindPrincipal = createBindPrincipal(username);
|
||||
env.put(Context.SECURITY_PRINCIPAL, bindPrincipal);
|
||||
env.put(Context.PROVIDER_URL, bindUrl);
|
||||
env.put(Context.SECURITY_CREDENTIALS, password);
|
||||
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
|
||||
|
||||
try {
|
||||
return contextFactory.createContext(env);
|
||||
} catch (NamingException e) {
|
||||
if ((e instanceof AuthenticationException) || (e instanceof OperationNotSupportedException)) {
|
||||
handleBindException(bindPrincipal, e);
|
||||
throw badCredentials();
|
||||
} else {
|
||||
throw LdapUtils.convertLdapException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void handleBindException(String bindPrincipal, NamingException exception) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Authentication for " + bindPrincipal + " failed:" + exception);
|
||||
}
|
||||
|
||||
int subErrorCode = parseSubErrorCode(exception.getMessage());
|
||||
|
||||
if (subErrorCode > 0) {
|
||||
logger.info("Active Directory authentication failed: " + subCodeToLogMessage(subErrorCode));
|
||||
|
||||
if (convertSubErrorCodesToExceptions) {
|
||||
raiseExceptionForErrorCode(subErrorCode);
|
||||
}
|
||||
} else {
|
||||
logger.debug("Failed to locate AD-specific sub-error code in message");
|
||||
}
|
||||
}
|
||||
|
||||
int parseSubErrorCode(String message) {
|
||||
Matcher m = SUB_ERROR_CODE.matcher(message);
|
||||
|
||||
if (m.matches()) {
|
||||
return Integer.parseInt(m.group(1), 16);
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
void raiseExceptionForErrorCode(int code) {
|
||||
switch (code) {
|
||||
case PASSWORD_EXPIRED:
|
||||
throw new CredentialsExpiredException(messages.getMessage("LdapAuthenticationProvider.credentialsExpired",
|
||||
"User credentials have expired"));
|
||||
case ACCOUNT_DISABLED:
|
||||
throw new DisabledException(messages.getMessage("LdapAuthenticationProvider.disabled",
|
||||
"User is disabled"));
|
||||
case ACCOUNT_EXPIRED:
|
||||
throw new AccountExpiredException(messages.getMessage("LdapAuthenticationProvider.expired",
|
||||
"User account has expired"));
|
||||
case ACCOUNT_LOCKED:
|
||||
throw new LockedException(messages.getMessage("LdapAuthenticationProvider.locked",
|
||||
"User account is locked"));
|
||||
}
|
||||
}
|
||||
|
||||
String subCodeToLogMessage(int code) {
|
||||
switch (code) {
|
||||
case USERNAME_NOT_FOUND:
|
||||
return "User was not found in directory";
|
||||
case INVALID_PASSWORD:
|
||||
return "Supplied password was invalid";
|
||||
case NOT_PERMITTED:
|
||||
return "User not permitted to logon at this time";
|
||||
case PASSWORD_EXPIRED:
|
||||
return "Password has expired";
|
||||
case ACCOUNT_DISABLED:
|
||||
return "Account is disabled";
|
||||
case ACCOUNT_EXPIRED:
|
||||
return "Account expired";
|
||||
case PASSWORD_NEEDS_RESET:
|
||||
return "User must reset password";
|
||||
case ACCOUNT_LOCKED:
|
||||
return "Account locked";
|
||||
}
|
||||
|
||||
return "Unknown (error code " + Integer.toHexString(code) +")";
|
||||
}
|
||||
|
||||
private BadCredentialsException badCredentials() {
|
||||
return new BadCredentialsException(messages.getMessage(
|
||||
"LdapAuthenticationProvider.badCredentials", "Bad credentials"));
|
||||
}
|
||||
|
||||
private DirContextOperations searchForUser(DirContext ctx, String username) throws NamingException {
|
||||
SearchControls searchCtls = new SearchControls();
|
||||
searchCtls.setSearchScope(SearchControls.SUBTREE_SCOPE);
|
||||
|
||||
String searchFilter = "(&(objectClass=user)(userPrincipalName={0}))";
|
||||
|
||||
final String bindPrincipal = createBindPrincipal(username);
|
||||
final String searchDn = createSearchDn(username);
|
||||
|
||||
String searchRoot = rootDn != null ? rootDn : searchRootFromPrincipal(bindPrincipal);
|
||||
|
||||
DirContextOperations ctxOp;
|
||||
|
||||
try {
|
||||
ctxOp = SpringSecurityLdapTemplate.searchForSingleEntryInternal(ctx, searchCtls, searchRoot, searchFilter,
|
||||
new Object[]{searchDn});
|
||||
|
||||
if (ctxOp != null) {
|
||||
return ctxOp;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.warn("UPN " + searchDn + " not found. Falling back to search with domain UPN suffix.");
|
||||
}
|
||||
|
||||
return SpringSecurityLdapTemplate.searchForSingleEntryInternal(ctx, searchCtls, searchRoot, searchFilter,
|
||||
new Object[]{bindPrincipal});
|
||||
}
|
||||
|
||||
private String searchRootFromPrincipal(String bindPrincipal) {
|
||||
int atChar = bindPrincipal.lastIndexOf('@');
|
||||
|
||||
if (atChar < 0) {
|
||||
logger.debug("User principal '" + bindPrincipal + "' does not contain the domain, and no domain has been configured");
|
||||
throw badCredentials();
|
||||
}
|
||||
|
||||
return rootDnFromDomain(bindPrincipal.substring(atChar+ 1, bindPrincipal.length()));
|
||||
}
|
||||
|
||||
private String rootDnFromDomain(String domain) {
|
||||
String[] tokens = StringUtils.tokenizeToStringArray(domain, ".");
|
||||
StringBuilder root = new StringBuilder();
|
||||
|
||||
for (String token : tokens) {
|
||||
if (root.length() > 0) {
|
||||
root.append(',');
|
||||
}
|
||||
root.append("dc=").append(token);
|
||||
}
|
||||
|
||||
return root.toString();
|
||||
}
|
||||
|
||||
String createBindPrincipal(String username) {
|
||||
if (domain == null || username.toLowerCase().endsWith(domain)) {
|
||||
return username;
|
||||
}
|
||||
|
||||
return username + "@" + domain;
|
||||
}
|
||||
|
||||
String createSearchDn(String username) {
|
||||
if (upnSuffix == null) {
|
||||
return createBindPrincipal(username);
|
||||
}
|
||||
|
||||
return username + "@" + upnSuffix;
|
||||
}
|
||||
|
||||
/**
|
||||
* By default, a failed authentication (LDAP error 49) will result in a {@code BadCredentialsException}.
|
||||
* <p>
|
||||
* If this property is set to {@code true}, the exception message from a failed bind attempt will be parsed
|
||||
* for the AD-specific error code and a {@link CredentialsExpiredException}, {@link DisabledException},
|
||||
* {@link AccountExpiredException} or {@link LockedException} will be thrown for the corresponding codes. All
|
||||
* other codes will result in the default {@code BadCredentialsException}.
|
||||
*
|
||||
* @param convertSubErrorCodesToExceptions {@code true} to raise an exception based on the AD error code.
|
||||
*/
|
||||
public void setConvertSubErrorCodesToExceptions(boolean convertSubErrorCodesToExceptions) {
|
||||
this.convertSubErrorCodesToExceptions = convertSubErrorCodesToExceptions;
|
||||
}
|
||||
|
||||
static class ContextFactory {
|
||||
DirContext createContext(Hashtable<?,?> env) throws NamingException {
|
||||
return new InitialLdapContext(env, null);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,87 +0,0 @@
|
||||
package info.bukova.isspst.services;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author Pepa Rokos
|
||||
*/
|
||||
public class HqlDataFilter {
|
||||
private String where;
|
||||
private String orderBy;
|
||||
private Map<String, Object> params;
|
||||
private Class<?> dataClass;
|
||||
|
||||
public HqlDataFilter() {
|
||||
params = new HashMap<String, Object>();
|
||||
}
|
||||
|
||||
public HqlDataFilter(String where) {
|
||||
this();
|
||||
this.where = where;
|
||||
}
|
||||
|
||||
public HqlDataFilter(String where, String orderBy) {
|
||||
this(where);
|
||||
this.orderBy = orderBy;
|
||||
}
|
||||
|
||||
public String getWhere() {
|
||||
return where;
|
||||
}
|
||||
|
||||
public void setWhere(String where) {
|
||||
this.where = where;
|
||||
}
|
||||
|
||||
public String getOrderBy() {
|
||||
return orderBy;
|
||||
}
|
||||
|
||||
public void setOrderBy(String orderBy) {
|
||||
this.orderBy = orderBy;
|
||||
}
|
||||
|
||||
public void setParam(String key, Object value) {
|
||||
params.put(key, value);
|
||||
}
|
||||
|
||||
public Object getParam(String key) {
|
||||
return params.get(key);
|
||||
}
|
||||
|
||||
public Set<String> getParamKeys() {
|
||||
return params.keySet();
|
||||
}
|
||||
|
||||
public void andFilter(String filter) {
|
||||
if (where == null || where.isEmpty()) {
|
||||
where = filter;
|
||||
} else {
|
||||
where += " and (" + filter + ")";
|
||||
}
|
||||
}
|
||||
|
||||
public void orFilter(String filter) {
|
||||
if (where == null ||where.isEmpty()) {
|
||||
where = filter;
|
||||
} else {
|
||||
where += " or (" + filter + ")";
|
||||
}
|
||||
}
|
||||
|
||||
public void reset() {
|
||||
where = "";
|
||||
orderBy = "";
|
||||
params.clear();
|
||||
}
|
||||
|
||||
public Class<?> getDataClass() {
|
||||
return dataClass;
|
||||
}
|
||||
|
||||
public void setDataClass(Class<?> dataClass) {
|
||||
this.dataClass = dataClass;
|
||||
}
|
||||
}
|
@ -1,90 +0,0 @@
|
||||
package info.bukova.isspst.services;
|
||||
|
||||
import org.hibernate.Query;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* @author Pepa Rokos
|
||||
*/
|
||||
public class HqlUtils {
|
||||
|
||||
public static String buildHql(String select, HqlDataFilter filter) {
|
||||
if (select.toLowerCase().contains("where")
|
||||
|| select.toLowerCase().contains("order by")) {
|
||||
throw new IsspstException("Use add*() methods instead.");
|
||||
}
|
||||
|
||||
String hql = addWhere(select, filter, "");
|
||||
return addOrderBy(hql, filter);
|
||||
}
|
||||
|
||||
public static String addAndWhere(String hql, HqlDataFilter filter) {
|
||||
if (!checkWhere(filter)) {
|
||||
return hql;
|
||||
}
|
||||
|
||||
return addWhere(hql, filter, "and");
|
||||
}
|
||||
|
||||
public static String addOrWhere(String hql, HqlDataFilter filter) {
|
||||
if (!checkWhere(filter)) {
|
||||
return hql;
|
||||
}
|
||||
|
||||
return addWhere(hql, filter, "or");
|
||||
}
|
||||
|
||||
public static String addOrderBy(String hql, HqlDataFilter filter) {
|
||||
if (filter == null || filter.getOrderBy() == null || filter.getOrderBy().isEmpty()) {
|
||||
return hql;
|
||||
}
|
||||
|
||||
if (!hql.contains("order by")) {
|
||||
hql += " order by ";
|
||||
}
|
||||
|
||||
hql += filter.getOrderBy();
|
||||
return hql;
|
||||
}
|
||||
|
||||
public static void addParameters(Query query, HqlDataFilter filter) {
|
||||
if (filter == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (String key : filter.getParamKeys()) {
|
||||
if (filter.getParam(key) instanceof Collection<?>) {
|
||||
query.setParameterList(key, (Collection) filter.getParam(key));
|
||||
} else {
|
||||
query.setParameter(key, filter.getParam(key));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean checkWhere(HqlDataFilter filter) {
|
||||
return filter != null && filter.getWhere() != null && !filter.getWhere().isEmpty();
|
||||
}
|
||||
|
||||
private static String addWhere(String hql, HqlDataFilter filter, String operator) {
|
||||
if (hql.toLowerCase().contains("where") && hql.toLowerCase().contains("order by")) {
|
||||
String[] split = hql.split("order by");
|
||||
hql = split[0] + " " + operator + " (" + filter.getWhere() + ") order by " + split[1];
|
||||
return hql;
|
||||
}
|
||||
|
||||
if (hql.toLowerCase().contains("where")) {
|
||||
hql += " " + operator + " (" + filter.getWhere() + ")";
|
||||
return hql;
|
||||
}
|
||||
|
||||
if (hql.toLowerCase().contains("order by")) {
|
||||
String[] split = hql.split("order by");
|
||||
hql = split[0] + " where (" + filter.getWhere() + ") order by " + split[1];
|
||||
return hql;
|
||||
}
|
||||
|
||||
hql += " where (" + filter.getWhere() + ")";
|
||||
return hql;
|
||||
}
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
package info.bukova.isspst.services.limits;
|
||||
|
||||
import info.bukova.isspst.services.IsspstException;
|
||||
|
||||
/**
|
||||
* @author Pepa Rokos
|
||||
*/
|
||||
public class LimitException extends IsspstException {
|
||||
|
||||
public LimitException(String reason) {
|
||||
setReason(reason);
|
||||
}
|
||||
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
package info.bukova.isspst.services.limits;
|
||||
|
||||
import info.bukova.isspst.data.Limit;
|
||||
import info.bukova.isspst.data.Season;
|
||||
import info.bukova.isspst.data.Workgroup;
|
||||
import info.bukova.isspst.services.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Pepa Rokos
|
||||
*/
|
||||
public interface LimitService extends Service<Limit> {
|
||||
List<Limit> getForSeason(Season season);
|
||||
Limit getForWorkgroupAndSeason(Workgroup wg, Season season);
|
||||
Limit getForWorkgroup(Workgroup wg);
|
||||
}
|
@ -1,62 +0,0 @@
|
||||
package info.bukova.isspst.services.limits;
|
||||
|
||||
import info.bukova.isspst.data.Limit;
|
||||
import info.bukova.isspst.data.Season;
|
||||
import info.bukova.isspst.data.Workgroup;
|
||||
import info.bukova.isspst.services.AbstractOwnedService;
|
||||
import info.bukova.isspst.services.settings.SeasonService;
|
||||
import org.hibernate.Query;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Pepa Rokos
|
||||
*/
|
||||
public class LimitServiceImpl extends AbstractOwnedService<Limit> implements LimitService {
|
||||
|
||||
@Autowired
|
||||
private SeasonService seasonService;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public List<Limit> getForSeason(Season season) {
|
||||
Query q = dao.getQuery("from Limit where season = :season");
|
||||
q.setParameter("season", season);
|
||||
return q.list();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Limit getForWorkgroupAndSeason(Workgroup wg, Season season) {
|
||||
Query q = dao.getQuery("from Limit where workgroup = :wg and season = :season");
|
||||
q.setParameter("wg", wg);
|
||||
q.setParameter("season", season);
|
||||
return (Limit) q.uniqueResult();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Limit getForWorkgroup(Workgroup wg) {
|
||||
return getForWorkgroupAndSeason(wg, seasonService.getActive());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
@PreAuthorize("hasPermission(this, 'PERM_ADD')")
|
||||
public void add(Limit entity) {
|
||||
if (getForWorkgroupAndSeason(entity.getWorkgroup(),entity.getSeason()) != null) {
|
||||
throw new LimitException("LimitExists");
|
||||
}
|
||||
super.add(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Limit createEntity() {
|
||||
Limit limit = new Limit();
|
||||
limit.setSeason(seasonService.getActive());
|
||||
return limit;
|
||||
}
|
||||
}
|
@ -1,18 +1,11 @@
|
||||
package info.bukova.isspst.services.numberseries;
|
||||
|
||||
import info.bukova.isspst.data.NumberSeries;
|
||||
import info.bukova.isspst.data.Season;
|
||||
import info.bukova.isspst.services.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface NumberSeriesService extends Service<NumberSeries>
|
||||
{
|
||||
public NumberSeries getNumberSerie(String module);
|
||||
|
||||
public NumberSeries getNumberSerieForSeason(String module, Season season);
|
||||
|
||||
public void increase(NumberSeries ns);
|
||||
|
||||
public List<NumberSeries> getSeriesForSeason(Season season);
|
||||
}
|
||||
|
@ -1,48 +1,24 @@
|
||||
package info.bukova.isspst.services.numberseries;
|
||||
|
||||
import info.bukova.isspst.data.NumberSeries;
|
||||
import info.bukova.isspst.data.Season;
|
||||
import info.bukova.isspst.services.AbstractService;
|
||||
|
||||
import info.bukova.isspst.services.settings.SeasonService;
|
||||
import org.hibernate.Query;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class NumberSeriesServiceImpl extends AbstractService<NumberSeries> implements NumberSeriesService
|
||||
{
|
||||
@Autowired
|
||||
private SeasonService seasonService;
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public NumberSeries getNumberSerie(String module) {
|
||||
return getNumberSerieForSeason(module, seasonService.getActive());
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public NumberSeries getNumberSerieForSeason(String module, Season season) {
|
||||
Query q = dao.getQuery("from NumberSeries where module = :m and season = :s");
|
||||
q.setParameter("m", module);
|
||||
q.setParameter("s", season);
|
||||
return (NumberSeries) q.uniqueResult();
|
||||
public NumberSeries getNumberSerie(String module)
|
||||
{
|
||||
return this.selectSingle("from NumberSeries where MODULE = '" + module + "'");
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void increase(NumberSeries ns) {
|
||||
public void increase(NumberSeries ns)
|
||||
{
|
||||
ns.setNumber(ns.getNumber() + 1);
|
||||
this.update(ns);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public List<NumberSeries> getSeriesForSeason(Season season) {
|
||||
Query q = dao.getQuery("from NumberSeries where season = :s");
|
||||
q.setParameter("s", season);
|
||||
return q.list();
|
||||
}
|
||||
}
|
||||
|
@ -1,18 +0,0 @@
|
||||
package info.bukova.isspst.services.settings;
|
||||
|
||||
import info.bukova.isspst.services.IsspstException;
|
||||
|
||||
/**
|
||||
* @author Pepa Rokos
|
||||
*/
|
||||
public class SeasonException extends IsspstException {
|
||||
|
||||
SeasonException() {
|
||||
super();
|
||||
}
|
||||
|
||||
SeasonException(String msg) {
|
||||
super(msg);
|
||||
setReason(msg);
|
||||
}
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
package info.bukova.isspst.services.settings;
|
||||
|
||||
import info.bukova.isspst.data.Season;
|
||||
import info.bukova.isspst.services.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Pepa Rokos
|
||||
*/
|
||||
public interface SeasonService extends Service<Season> {
|
||||
Season addSeason();
|
||||
Season getActive();
|
||||
List<Season> getAllSeasons();
|
||||
void setActive(Season season);
|
||||
}
|
@ -1,100 +0,0 @@
|
||||
package info.bukova.isspst.services.settings;
|
||||
|
||||
import info.bukova.isspst.StringUtils;
|
||||
import info.bukova.isspst.data.NumberSeries;
|
||||
import info.bukova.isspst.data.Season;
|
||||
import info.bukova.isspst.services.AbstractOwnedService;
|
||||
import info.bukova.isspst.services.numberseries.NumberSeriesService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Pepa Rokos
|
||||
*/
|
||||
public class SeasonServiceImpl extends AbstractOwnedService<Season> implements SeasonService {
|
||||
private Season activeSeason;
|
||||
@Autowired
|
||||
private NumberSeriesService numberSeriesService;
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public Season addSeason() {
|
||||
Season season = new Season();
|
||||
season.setDescription(StringUtils.localize("SeasonsNewSeason"));
|
||||
season.setValidFrom(new Date());
|
||||
season.setActive(true);
|
||||
|
||||
Season last = selectSingle("from Season where validTo Is Null");
|
||||
add(season);
|
||||
|
||||
last.setValidTo(new Date());
|
||||
last.setActive(false);
|
||||
update(last);
|
||||
|
||||
|
||||
activeSeason = null;
|
||||
|
||||
List<NumberSeries> numSeries = numberSeriesService.getSeriesForSeason(last);
|
||||
for (NumberSeries ns: numSeries) {
|
||||
String txt = ns.getPrefix().replaceAll("[0-9]+", "");
|
||||
String numTxt = ns.getPrefix().replaceAll("[a-zA-Z]+", "");
|
||||
|
||||
int num = 0;
|
||||
try {
|
||||
num = Integer.valueOf(numTxt);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
String newPrefix = txt + String.valueOf(num + 1);
|
||||
|
||||
NumberSeries newNumSer = new NumberSeries();
|
||||
newNumSer.setPrefix(newPrefix);
|
||||
newNumSer.setModule(ns.getModule());
|
||||
newNumSer.setNumber(1);
|
||||
newNumSer.setSeason(season);
|
||||
numberSeriesService.add(newNumSer);
|
||||
}
|
||||
return season;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public Season getActive() {
|
||||
if (activeSeason == null) {
|
||||
activeSeason = selectSingle("from Season where active = true");
|
||||
}
|
||||
|
||||
if (activeSeason == null) {
|
||||
throw new SeasonException("Active_season_not_set");
|
||||
}
|
||||
return activeSeason;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public List<Season> getAllSeasons() {
|
||||
return getAll();
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void setActive(Season season) {
|
||||
for (Season s: getAll()) {
|
||||
s.setActive(false);
|
||||
update(s);
|
||||
}
|
||||
|
||||
Season s = dao.getById(season.getId());
|
||||
|
||||
if (s == null) {
|
||||
throw new SeasonException("Season_not_in_database");
|
||||
}
|
||||
|
||||
s.setActive(true);
|
||||
activeSeason = s;
|
||||
}
|
||||
}
|
@ -1,69 +0,0 @@
|
||||
package info.bukova.isspst.ui;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.zkoss.bind.BindContext;
|
||||
import org.zkoss.bind.Converter;
|
||||
import org.zkoss.util.Locales;
|
||||
import org.zkoss.zk.ui.Component;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.ParseException;
|
||||
import java.util.Locale;
|
||||
|
||||
public class BigDecimalFilterConverter implements Converter<String, BigDecimal, Component>
|
||||
{
|
||||
private final static Logger log = LoggerFactory.getLogger(BigDecimalFilterConverter.class.getName());
|
||||
|
||||
@Override
|
||||
public BigDecimal coerceToBean(String str, Component component, BindContext cx)
|
||||
{
|
||||
// BigDecimal val = BigDecimal.ZERO;
|
||||
BigDecimal val = null;
|
||||
|
||||
if (str != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
Locale loc = Locales.getCurrent();
|
||||
DecimalFormat format = (DecimalFormat) DecimalFormat.getInstance(loc);
|
||||
format.setParseBigDecimal(true);
|
||||
val = (BigDecimal) format.parse(str);
|
||||
}
|
||||
catch (NumberFormatException e)
|
||||
{
|
||||
log.warn(str, e);
|
||||
}
|
||||
catch (ParseException e)
|
||||
{
|
||||
log.warn(str, e);
|
||||
}
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String coerceToUi(BigDecimal val, Component component, BindContext cx)
|
||||
{
|
||||
Locale loc = Locales.getCurrent();
|
||||
|
||||
if (val == null)
|
||||
{
|
||||
return "";
|
||||
//val = BigDecimal.ZERO;
|
||||
}
|
||||
|
||||
val = val.setScale(2, BigDecimal.ROUND_DOWN);
|
||||
|
||||
DecimalFormat format = (DecimalFormat) DecimalFormat.getInstance(loc);
|
||||
format.setMaximumFractionDigits(2);
|
||||
format.setMinimumFractionDigits(0);
|
||||
format.setGroupingUsed(true);
|
||||
format.setGroupingSize(3);
|
||||
String formatted = format.format(val);
|
||||
return formatted;
|
||||
}
|
||||
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
package info.bukova.isspst.ui.limits;
|
||||
|
||||
import info.bukova.isspst.data.Limit;
|
||||
import info.bukova.isspst.data.Workgroup;
|
||||
import info.bukova.isspst.services.limits.LimitService;
|
||||
import info.bukova.isspst.services.settings.SeasonService;
|
||||
import info.bukova.isspst.services.workgroups.WorkgroupService;
|
||||
import info.bukova.isspst.ui.FormViewModel;
|
||||
import org.zkoss.bind.annotation.Init;
|
||||
import org.zkoss.zk.ui.select.annotation.WireVariable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class LimitsForm extends FormViewModel<Limit> {
|
||||
|
||||
List<Workgroup> workgroups;
|
||||
@WireVariable
|
||||
WorkgroupService workgroupService;
|
||||
@WireVariable
|
||||
LimitService limitService;
|
||||
@WireVariable
|
||||
SeasonService seasonService;
|
||||
|
||||
@Init(superclass = true)
|
||||
public void init() {
|
||||
workgroups = workgroupService.getWorkgroups();
|
||||
if (getDataBean().getWorkgroup() == null) {
|
||||
List<Limit> limits = limitService.getForSeason(seasonService.getActive());
|
||||
|
||||
for (Limit l : limits) {
|
||||
workgroups.remove(l.getWorkgroup());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public List<Workgroup> getWorkgroups() {
|
||||
return workgroups;
|
||||
}
|
||||
|
||||
public boolean isNewRec() {
|
||||
return newRec;
|
||||
}
|
||||
}
|
@ -1,132 +0,0 @@
|
||||
package info.bukova.isspst.ui.limits;
|
||||
|
||||
import info.bukova.isspst.StringUtils;
|
||||
import info.bukova.isspst.data.Limit;
|
||||
import info.bukova.isspst.data.Workgroup;
|
||||
import info.bukova.isspst.services.invoicing.InvoicingService;
|
||||
import info.bukova.isspst.services.limits.LimitService;
|
||||
import info.bukova.isspst.services.workgroups.WorkgroupService;
|
||||
import info.bukova.isspst.ui.ListViewModel;
|
||||
import org.jfree.chart.ChartFactory;
|
||||
import org.jfree.chart.ChartUtilities;
|
||||
import org.jfree.chart.JFreeChart;
|
||||
import org.jfree.chart.plot.CategoryPlot;
|
||||
import org.jfree.chart.plot.PlotOrientation;
|
||||
import org.jfree.chart.renderer.category.BarRenderer3D;
|
||||
import org.jfree.chart.title.LegendTitle;
|
||||
import org.jfree.data.category.DefaultCategoryDataset;
|
||||
import org.jfree.ui.RectangleEdge;
|
||||
import org.zkoss.bind.annotation.GlobalCommand;
|
||||
import org.zkoss.bind.annotation.Init;
|
||||
import org.zkoss.bind.annotation.NotifyChange;
|
||||
import org.zkoss.zk.ui.select.annotation.WireVariable;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.*;
|
||||
import java.awt.image.RenderedImage;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class LimitsList extends ListViewModel<Limit> {
|
||||
|
||||
@WireVariable
|
||||
private LimitService limitService;
|
||||
@WireVariable
|
||||
private InvoicingService invoicingService;
|
||||
@WireVariable
|
||||
private WorkgroupService workgroupService;
|
||||
private Map<Limit, BigDecimal> spent;
|
||||
private RenderedImage chart;
|
||||
|
||||
@Init(superclass = true)
|
||||
public void init() {
|
||||
service = limitService;
|
||||
dataClass = Limit.class;
|
||||
formZul = "limitForm.zul";
|
||||
//dataFilter = new MUnitFilter(getFilterTemplate());
|
||||
genSpent();
|
||||
}
|
||||
|
||||
public Map<Limit, BigDecimal> getSpent() {
|
||||
if (spent != null && !getDataList().isEmpty()) {
|
||||
for (Limit l : spent.keySet()) {
|
||||
if (!l.getSeason().equals(getDataList().get(0).getSeason())) {
|
||||
spent = null;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (spent != null && spent.keySet().size() < getDataList().size()) {
|
||||
spent = null;
|
||||
}
|
||||
|
||||
if (spent != null) {
|
||||
return spent;
|
||||
}
|
||||
|
||||
spent = new HashMap<Limit, BigDecimal>();
|
||||
for (Limit l : getDataList()) {
|
||||
spent.put(l, invoicingService.totalInvoicedForWorkgroupAndSeason(l.getWorkgroup(), getSelSeason()));
|
||||
}
|
||||
|
||||
return spent;
|
||||
}
|
||||
|
||||
private void genSpent() {
|
||||
spent = new HashMap<Limit, BigDecimal>();
|
||||
for (Limit l : getDataList()) {
|
||||
spent.put(l, invoicingService.totalInvoicedForWorkgroupAndSeason(l.getWorkgroup(), getSelSeason()));
|
||||
}
|
||||
}
|
||||
|
||||
private void genCharts() {
|
||||
DefaultCategoryDataset dataSet = new DefaultCategoryDataset();
|
||||
|
||||
for (Workgroup wg : workgroupService.getWorkgroups()) {
|
||||
Limit limit = null;
|
||||
for (Limit l : getDataList()) {
|
||||
if (l.getWorkgroup().equals(wg)) {
|
||||
limit = l;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
dataSet.addValue(limit == null ? null : limit.getLimit(), StringUtils.localize("LimitsLimit"), wg.getFullName());
|
||||
dataSet.addValue(invoicingService.totalInvoicedForWorkgroupAndSeason(wg, getSelSeason()), StringUtils.localize("LimitsSpent"), wg.getFullName());
|
||||
}
|
||||
|
||||
JFreeChart jfChart = ChartFactory.createBarChart3D(StringUtils.localize("LimitsChartTitle"), StringUtils.localize("LimitsWorkgroup"),
|
||||
StringUtils.localize("LimitsAmount"), dataSet, PlotOrientation.HORIZONTAL, true, false, false);
|
||||
CategoryPlot plot = (CategoryPlot) jfChart.getPlot();
|
||||
BarRenderer3D renderer = (BarRenderer3D) plot.getRenderer();
|
||||
renderer.setSeriesPaint(0, Color.GREEN);
|
||||
renderer.setSeriesPaint(1, Color.RED);
|
||||
|
||||
LegendTitle legend = jfChart.getLegend();
|
||||
legend.setPosition(RectangleEdge.RIGHT);
|
||||
|
||||
try {
|
||||
chart = ImageIO.read(new ByteArrayInputStream(ChartUtilities.encodeAsPNG(jfChart.createBufferedImage(1000, 400))));
|
||||
} catch (IOException e) {
|
||||
chart = null;
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public RenderedImage getChart() {
|
||||
genCharts();
|
||||
return chart;
|
||||
}
|
||||
|
||||
@Override
|
||||
@GlobalCommand
|
||||
@NotifyChange({ "dataList", "dataBean", "ableToDelete", "chart", "spent" })
|
||||
public void refresh() {
|
||||
genSpent();
|
||||
super.refresh();
|
||||
}
|
||||
}
|
@ -1,101 +0,0 @@
|
||||
package info.bukova.isspst.ui.settings;
|
||||
|
||||
import info.bukova.isspst.Module;
|
||||
import info.bukova.isspst.ModuleUtils;
|
||||
import info.bukova.isspst.StringUtils;
|
||||
import info.bukova.isspst.data.NumberSeries;
|
||||
import info.bukova.isspst.data.Season;
|
||||
import info.bukova.isspst.services.numberseries.NumberSeriesService;
|
||||
import info.bukova.isspst.services.settings.SeasonService;
|
||||
import org.zkoss.bind.BindUtils;
|
||||
import org.zkoss.bind.annotation.BindingParam;
|
||||
import org.zkoss.bind.annotation.Command;
|
||||
import org.zkoss.bind.annotation.Init;
|
||||
import org.zkoss.bind.annotation.NotifyChange;
|
||||
import org.zkoss.zk.ui.event.Event;
|
||||
import org.zkoss.zk.ui.event.EventListener;
|
||||
import org.zkoss.zk.ui.select.annotation.WireVariable;
|
||||
import org.zkoss.zul.Messagebox;
|
||||
import org.zkoss.zul.Window;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Pepa Rokos
|
||||
*/
|
||||
public class SeasonsVM {
|
||||
@WireVariable
|
||||
private SeasonService seasonService;
|
||||
@WireVariable
|
||||
private NumberSeriesService numericSeriesService;
|
||||
private List<Season> seasons;
|
||||
private List<NumberSeries> numSeries;
|
||||
private Map<String, Module> moduleMap;
|
||||
|
||||
@Init
|
||||
public void init() {
|
||||
seasons = seasonService.getAll();
|
||||
numSeries = numericSeriesService.getSeriesForSeason(seasonService.getActive());
|
||||
moduleMap = new HashMap<String, Module>();
|
||||
for (Module m : ModuleUtils.getActiveModules()) {
|
||||
moduleMap.put(m.getId(), m);
|
||||
}
|
||||
}
|
||||
|
||||
public Map<String, Module> getModuleMap() {
|
||||
return moduleMap;
|
||||
}
|
||||
|
||||
@Command
|
||||
//@NotifyChange({"seasons", "numSeries"})
|
||||
public void addSeason() {
|
||||
Messagebox.show(StringUtils.localize("SeasonsNewSeasonDialog"), StringUtils.localize("SeasonsNewSeason"), Messagebox.YES | Messagebox.NO, Messagebox.QUESTION,
|
||||
new EventListener<Event>() {
|
||||
@Override
|
||||
public void onEvent(Event event) throws Exception {
|
||||
if (((Integer)event.getData()).intValue() == Messagebox.YES) {
|
||||
Season newSeason = seasonService.addSeason();
|
||||
seasons = seasonService.getAll();
|
||||
numSeries = numericSeriesService.getSeriesForSeason(seasonService.getActive());
|
||||
BindUtils.postNotifyChange(null, null, SeasonsVM.this, "seasons");
|
||||
BindUtils.postNotifyChange(null, null, SeasonsVM.this, "numSeries");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Command
|
||||
public void save(@BindingParam("window") Window win) {
|
||||
for(Season s: seasons) {
|
||||
seasonService.update(s);
|
||||
}
|
||||
|
||||
for(NumberSeries n: numSeries) {
|
||||
numericSeriesService.update(n);
|
||||
}
|
||||
|
||||
win.detach();
|
||||
}
|
||||
|
||||
@Command
|
||||
@NotifyChange({"numSeries", "seasons"})
|
||||
public void activate(@BindingParam("season") Season season) {
|
||||
seasonService.setActive(season);
|
||||
seasons = seasonService.getAll();
|
||||
numSeries = numericSeriesService.getSeriesForSeason(season);
|
||||
}
|
||||
|
||||
public List<Season> getSeasons() {
|
||||
return seasons;
|
||||
}
|
||||
|
||||
public List<NumberSeries> getNumSeries() {
|
||||
return numSeries;
|
||||
}
|
||||
|
||||
public boolean isCanSave() {
|
||||
return true;
|
||||
}
|
||||
}
|
@ -1,185 +0,0 @@
|
||||
package info.bukova.isspst.ui.signeddocs;
|
||||
|
||||
import info.bukova.isspst.DateTimeUtils;
|
||||
import info.bukova.isspst.data.SignedDocument;
|
||||
import info.bukova.isspst.data.SignedDocumentItem;
|
||||
import info.bukova.isspst.storage.ReportFileStorage;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.security.access.AccessDeniedException;
|
||||
import org.zkoss.bind.annotation.Command;
|
||||
import org.zkoss.bind.annotation.Init;
|
||||
import org.zkoss.zk.ui.select.annotation.WireVariable;
|
||||
import org.zkoss.zul.DefaultTreeModel;
|
||||
import org.zkoss.zul.Filedownload;
|
||||
import org.zkoss.zul.TreeModel;
|
||||
import org.zkoss.zul.TreeNode;
|
||||
|
||||
import java.io.*;
|
||||
import java.text.Normalizer;
|
||||
import java.util.List;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
|
||||
public class SignedDocsTreeList extends SignedDocsList {
|
||||
@SuppressWarnings("unused")
|
||||
private final static Logger log = LoggerFactory.getLogger(SignedDocsTreeList.class.getName());
|
||||
|
||||
@WireVariable
|
||||
private ReportFileStorage signedDocStorage;
|
||||
|
||||
public SignedDocsTreeNode getSelectedNodeItem() {
|
||||
return selectedNodeItem;
|
||||
}
|
||||
|
||||
public void setSelectedNodeItem(SignedDocsTreeNode selectedNodeItem) {
|
||||
this.selectedNodeItem = selectedNodeItem;
|
||||
}
|
||||
|
||||
private SignedDocsTreeNode selectedNodeItem;
|
||||
|
||||
public SignedDocsTreeList() {
|
||||
}
|
||||
|
||||
@Init(superclass = true)
|
||||
public void signedDocsTreeListInit() {
|
||||
}
|
||||
|
||||
public TreeModel<TreeNode<SignedDocumentItem>> getTreeBackup() {
|
||||
try {
|
||||
return signedDocumentService.getTree();
|
||||
} catch (AccessDeniedException e) {
|
||||
// BindUtils.postGlobalCommand(null, null, "disableCentre", null);
|
||||
// e.printStackTrace();
|
||||
return new DefaultTreeModel<SignedDocumentItem>(null);
|
||||
}
|
||||
}
|
||||
|
||||
public static void addToZipFile(String filePath, String zipPath, ZipOutputStream zos) throws FileNotFoundException, IOException {
|
||||
|
||||
//System.out.println("Writing '" + filePath + "' to zip file");
|
||||
|
||||
File file = new File(filePath);
|
||||
FileInputStream fis = new FileInputStream(file);
|
||||
ZipEntry zipEntry = new ZipEntry(zipPath);
|
||||
zos.putNextEntry(zipEntry);
|
||||
|
||||
byte[] bytes = new byte[1024];
|
||||
int length;
|
||||
while ((length = fis.read(bytes)) >= 0) {
|
||||
zos.write(bytes, 0, length);
|
||||
}
|
||||
|
||||
zos.closeEntry();
|
||||
fis.close();
|
||||
}
|
||||
|
||||
public static String getNormalizedPath(String path) {
|
||||
String result = path.replaceAll("[ ]", "_");
|
||||
result = Normalizer.normalize(result, Normalizer.Form.NFD);
|
||||
result = result.replaceAll("[^-a-zA-Z0-9_./]", "");
|
||||
return result;
|
||||
}
|
||||
|
||||
public static String getCheckedString(String str, int maxLength) {
|
||||
String result = "";
|
||||
|
||||
if (str != null) {
|
||||
|
||||
int len = str.length();
|
||||
|
||||
if (len > 0) {
|
||||
result = str.substring(0, len > maxLength ? maxLength - 1 : len);
|
||||
result += "-";
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static String getCheckedString(String str) {
|
||||
return SignedDocsTreeList.getCheckedString(str, 50);
|
||||
}
|
||||
|
||||
@Command
|
||||
public void onCreateZipArchive() {
|
||||
if (this.selectedNodeItem == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
List<SignedDocsTreeNode> leafs = this.selectedNodeItem.getLeafs();
|
||||
|
||||
if (leafs.size() > 0) {
|
||||
int deep = this.selectedNodeItem.getDeep();
|
||||
|
||||
try {
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
ZipOutputStream zos = new ZipOutputStream(bos);
|
||||
|
||||
for (SignedDocsTreeNode node : leafs) {
|
||||
SignedDocumentItem item = node.getData();
|
||||
String pdfFileName = item.getFileName();
|
||||
|
||||
SignedDocument doc = item.getSignedDocument();
|
||||
String zipDirs = "";
|
||||
|
||||
|
||||
String zipFileName = "";
|
||||
|
||||
if (deep == 3 || deep == 4) {
|
||||
zipFileName += SignedDocsTreeList.getCheckedString(DateTimeUtils.getFormatedDirDate(doc.getSignDate()));
|
||||
}
|
||||
|
||||
zipFileName += SignedDocsTreeList.getCheckedString(item.getReportName());
|
||||
zipFileName += SignedDocsTreeList.getCheckedString(doc.getNumser());
|
||||
zipFileName += SignedDocsTreeList.getCheckedString(doc.getDescription());
|
||||
zipFileName += SignedDocsTreeList.getCheckedString(pdfFileName);
|
||||
|
||||
if (deep == 1 || deep == 2 || deep == 3) {
|
||||
zipDirs += doc.getAgendaName();
|
||||
zipDirs += "/";
|
||||
}
|
||||
|
||||
if (deep == 1) {
|
||||
zipDirs += DateTimeUtils.getFormatedYear(doc.getSignDate());
|
||||
zipDirs += "/";
|
||||
}
|
||||
|
||||
if (deep == 1) {
|
||||
zipDirs += DateTimeUtils.getFormatedDirDateDDMM(doc.getSignDate());
|
||||
zipDirs += "/";
|
||||
}
|
||||
if (deep == 2) {
|
||||
zipDirs += DateTimeUtils.getFormatedDirDate(doc.getSignDate());
|
||||
zipDirs += "/";
|
||||
}
|
||||
String rootPath = signedDocStorage.getRootPath();
|
||||
|
||||
String diskPath = rootPath + "/" + pdfFileName;
|
||||
String zipPath = zipDirs + zipFileName;
|
||||
|
||||
zipPath = SignedDocsTreeList.getNormalizedPath(zipPath);
|
||||
|
||||
if (new File(diskPath).isFile()) {
|
||||
SignedDocsTreeList.addToZipFile(diskPath, zipPath, zos);
|
||||
} else {
|
||||
log.warn("Missing file '" + diskPath + "' !!!");
|
||||
log.warn(doc.getAgendaName());
|
||||
log.warn(doc.getDescription());
|
||||
log.warn(item.getReportName());
|
||||
}
|
||||
}
|
||||
|
||||
zos.close();
|
||||
bos.close();
|
||||
|
||||
Filedownload.save(bos.toByteArray(), "application/zip", "temp" + Long.toString(System.nanoTime()) + ".zip");
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,79 +0,0 @@
|
||||
package info.bukova.isspst.ui.signeddocs;
|
||||
|
||||
import info.bukova.isspst.data.SignedDocumentItem;
|
||||
import org.zkoss.zul.DefaultTreeNode;
|
||||
import org.zkoss.zul.TreeNode;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
public class SignedDocsTreeNode extends DefaultTreeNode<SignedDocumentItem> {
|
||||
public SignedDocsTreeNode(SignedDocumentItem data) {
|
||||
super(data);
|
||||
}
|
||||
|
||||
public SignedDocsTreeNode(SignedDocumentItem data, Collection<? extends TreeNode<SignedDocumentItem>> children) {
|
||||
super(data, children);
|
||||
}
|
||||
|
||||
public SignedDocsTreeNode getParentNode() {
|
||||
return (SignedDocsTreeNode) this.getParent();
|
||||
}
|
||||
|
||||
public int getDeep() {
|
||||
int iDeep = 0;
|
||||
SignedDocsTreeNode node = this.getParentNode();
|
||||
|
||||
while (node != null) {
|
||||
node = node.getParentNode();
|
||||
iDeep++;
|
||||
}
|
||||
|
||||
return iDeep;
|
||||
}
|
||||
|
||||
public List<SignedDocsTreeNode> getLeafs() {
|
||||
List<SignedDocsTreeNode> list = new LinkedList<SignedDocsTreeNode>();
|
||||
|
||||
if (!this.isLeaf()) {
|
||||
List<TreeNode<SignedDocumentItem>> children = this.getChildren();
|
||||
|
||||
for (TreeNode<SignedDocumentItem> item : children) {
|
||||
SignedDocsTreeNode node = (SignedDocsTreeNode) item;
|
||||
|
||||
if (node != null) {
|
||||
if (node.isLeaf()) {
|
||||
list.add(node);
|
||||
} else {
|
||||
list.addAll(node.getLeafs());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
public int getLeafsCount() {
|
||||
int count = 0;
|
||||
|
||||
if (!this.isLeaf()) {
|
||||
List<TreeNode<SignedDocumentItem>> children = this.getChildren();
|
||||
|
||||
for (TreeNode<SignedDocumentItem> item : children) {
|
||||
SignedDocsTreeNode node = (SignedDocsTreeNode) item;
|
||||
|
||||
if (node != null) {
|
||||
if (node.isLeaf()) {
|
||||
count += 1;
|
||||
} else {
|
||||
count += node.getLeafsCount();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
package info.bukova.isspst.ui.signeddocs;
|
||||
|
||||
import info.bukova.isspst.DateTimeUtils;
|
||||
import info.bukova.isspst.StringUtils;
|
||||
import info.bukova.isspst.data.SignedDocument;
|
||||
import info.bukova.isspst.data.SignedDocumentItem;
|
||||
import org.zkoss.zul.*;
|
||||
|
||||
public class SignedDocsTreeRenderer implements TreeitemRenderer<SignedDocsTreeNode> {
|
||||
public void render(Treeitem item, SignedDocsTreeNode data, int index) throws Exception {
|
||||
|
||||
int deep = data.getDeep();
|
||||
|
||||
boolean node1 = (deep == 1);//data.getParent().getParent() == null;
|
||||
boolean node3 = (deep == 3);//data.isLeaf();
|
||||
boolean node2 = (deep == 2);//!node1 && !node3;
|
||||
boolean node4 = (deep == 4);//!node1 && !node3;
|
||||
|
||||
SignedDocumentItem signedDocumentItem = data.getData();
|
||||
SignedDocument signedDocument = signedDocumentItem.getSignedDocument();
|
||||
|
||||
Treerow tr = new Treerow();
|
||||
tr.setContext("popupMenu");
|
||||
|
||||
item.appendChild(tr);
|
||||
tr.appendChild(new Treecell(node1 ? signedDocument.getAgendaName() : ""));
|
||||
tr.appendChild(new Treecell(node2 ? DateTimeUtils.getFormatedYear(signedDocument.getSignDate()) : ""));
|
||||
tr.appendChild(new Treecell(node3 ? DateTimeUtils.getFormatedDate(signedDocument.getSignDate()) : ""));
|
||||
tr.appendChild(new Treecell(node4 ? signedDocument.getNumser() : ""));
|
||||
tr.appendChild(new Treecell(node4 ? signedDocument.getDescription() : ""));
|
||||
tr.appendChild(new Treecell(node4 ? signedDocumentItem.getReportName() : data.getLeafsCount() + " souborů"));
|
||||
// tr.appendChild(new Treecell(node3 ? signedDocumentItem.getFileName() : ""));
|
||||
|
||||
switch (deep) {
|
||||
case 1 : tr.setSclass("signed-doc-agenda"); break;
|
||||
case 2 : tr.setSclass("signed-doc-year"); break;
|
||||
case 3 : tr.setSclass("signed-doc-date"); break;
|
||||
case 4 : tr.setSclass(""); break;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="http://ehcache.org/ehcache.xsd">
|
||||
|
||||
<diskStore path="java.io.tmpdir"/>
|
||||
<defaultCache
|
||||
eternal="false"
|
||||
maxElementsInMemory="100000"
|
||||
timeToLiveSeconds="1800"
|
||||
overflowToDisk="true" />
|
||||
|
||||
<!--<cache name="info.bukova.isspst.data.User"
|
||||
maxElementsInMemory="1000"
|
||||
overflowToDisk="false"/>
|
||||
|
||||
<cache name="info.bukova.isspst.data.Role"
|
||||
maxElementsInMemory="1000"
|
||||
overflowToDisk="false"/>
|
||||
|
||||
<cache name="info.bukova.isspst.data.Permission"
|
||||
maxElementsInMemory="1000"
|
||||
overflowToDisk="false"/>
|
||||
|
||||
<cache name="info.bukova.isspst.data.Requirement"
|
||||
maxElementsInMemory="10000"
|
||||
overflowToDisk="true"/>
|
||||
|
||||
<cache name="info.bukova.isspst.data.TripRequirement"
|
||||
maxElementsInMemory="10000"
|
||||
overflowToDisk="true"/>
|
||||
|
||||
<cache name="info.bukova.isspst.data.TripBillApproval"
|
||||
maxElementsInMemory="10000"
|
||||
overflowToDisk="true"/>-->
|
||||
|
||||
</ehcache>
|
@ -1,4 +1,3 @@
|
||||
ad.domain=bukova.net
|
||||
ad.upnSuffix=bukova.info
|
||||
ad.ldapUrl=ldap://192.168.25.110/
|
||||
ad.allowedGroup=ucitele
|
Binary file not shown.
@ -1,260 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Created with Jaspersoft Studio version 5.6.2.final using JasperReports Library version 5.6.1 -->
|
||||
<!-- 2016-02-29T12:57:46 -->
|
||||
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="requirementProtocol" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="b9143b9d-c262-47c6-9b06-26ae82fb8222">
|
||||
<property name="ireport.zoom" value="2.0"/>
|
||||
<property name="ireport.x" value="0"/>
|
||||
<property name="ireport.y" value="0"/>
|
||||
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
|
||||
<parameter name="P_MAIN_ADDRESS" class="java.lang.String"/>
|
||||
<parameter name="P_LOGO" class="java.lang.String"/>
|
||||
<queryString>
|
||||
<![CDATA[]]>
|
||||
</queryString>
|
||||
<field name="completed" class="java.lang.Boolean">
|
||||
<fieldDescription><![CDATA[completed]]></fieldDescription>
|
||||
</field>
|
||||
<field name="items" class="java.util.List">
|
||||
<fieldDescription><![CDATA[items]]></fieldDescription>
|
||||
</field>
|
||||
<field name="requirement" class="info.bukova.isspst.data.Requirement">
|
||||
<fieldDescription><![CDATA[requirement]]></fieldDescription>
|
||||
</field>
|
||||
<field name="totalInvoiced" class="java.math.BigDecimal">
|
||||
<fieldDescription><![CDATA[totalInvoiced]]></fieldDescription>
|
||||
</field>
|
||||
<field name="requirement.sumTotal" class="java.math.BigDecimal">
|
||||
<fieldDescription><![CDATA[requirement.sumTotal]]></fieldDescription>
|
||||
</field>
|
||||
<field name="requirement.workgroup" class="info.bukova.isspst.data.Workgroup">
|
||||
<fieldDescription><![CDATA[requirement.workgroup]]></fieldDescription>
|
||||
</field>
|
||||
<field name="requirement.reqDate" class="java.util.Date">
|
||||
<fieldDescription><![CDATA[requirement.reqDate]]></fieldDescription>
|
||||
</field>
|
||||
<field name="requirement.ownedBy" class="info.bukova.isspst.data.User">
|
||||
<fieldDescription><![CDATA[requirement.ownedBy]]></fieldDescription>
|
||||
</field>
|
||||
<field name="requirement.numser" class="java.lang.String">
|
||||
<fieldDescription><![CDATA[requirement.numser]]></fieldDescription>
|
||||
</field>
|
||||
<field name="requirement.authorization" class="java.util.List">
|
||||
<fieldDescription><![CDATA[requirement.authorization]]></fieldDescription>
|
||||
</field>
|
||||
<field name="requirement.centre" class="info.bukova.isspst.data.Workgroup">
|
||||
<fieldDescription><![CDATA[requirement.centre]]></fieldDescription>
|
||||
</field>
|
||||
<field name="requirement.description" class="java.lang.String">
|
||||
<fieldDescription><![CDATA[requirement.description]]></fieldDescription>
|
||||
</field>
|
||||
<field name="invoiceNumbers" class="java.lang.String">
|
||||
<fieldDescription><![CDATA[invoiceNumbers]]></fieldDescription>
|
||||
</field>
|
||||
<variable name="Variable_1" class="java.lang.String"/>
|
||||
<background>
|
||||
<band splitType="Stretch"/>
|
||||
</background>
|
||||
<title>
|
||||
<band height="57">
|
||||
<image onErrorType="Blank">
|
||||
<reportElement x="0" y="0" width="100" height="54" uuid="42476349-f707-4035-b93e-23e50fc5e82e">
|
||||
<printWhenExpression><![CDATA[$P{P_LOGO} != null]]></printWhenExpression>
|
||||
</reportElement>
|
||||
<imageExpression><![CDATA[$P{P_LOGO}]]></imageExpression>
|
||||
</image>
|
||||
<textField>
|
||||
<reportElement x="113" y="0" width="689" height="46" uuid="408b5871-7dc2-4d87-a432-f3cc8df0f823"/>
|
||||
<textElement textAlignment="Center">
|
||||
<font size="16" isBold="true" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1250"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$P{P_MAIN_ADDRESS}]]></textFieldExpression>
|
||||
</textField>
|
||||
</band>
|
||||
</title>
|
||||
<pageHeader>
|
||||
<band height="23" splitType="Stretch">
|
||||
<staticText>
|
||||
<reportElement x="0" y="0" width="802" height="20" uuid="f2f383c9-f1b1-4222-8b22-7c816fff5ad5"/>
|
||||
<textElement textAlignment="Center">
|
||||
<font size="12" isBold="true" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||
</textElement>
|
||||
<text><![CDATA[Přehled o protokolech předběžné kontroly - materiál a služby]]></text>
|
||||
</staticText>
|
||||
</band>
|
||||
</pageHeader>
|
||||
<columnHeader>
|
||||
<band height="19" splitType="Stretch">
|
||||
<staticText>
|
||||
<reportElement x="0" y="2" width="59" height="16" uuid="253a78a3-4a58-4c75-b285-e5174e3884b8"/>
|
||||
<textElement>
|
||||
<font isBold="true" pdfFontName="Helvetica-Bold"/>
|
||||
</textElement>
|
||||
<text><![CDATA[Poř. číslo]]></text>
|
||||
</staticText>
|
||||
<staticText>
|
||||
<reportElement x="59" y="2" width="121" height="16" uuid="2e7488ea-d0ae-4a5a-9045-559b8eb50e5c"/>
|
||||
<textElement>
|
||||
<font isBold="true" pdfFontName="Helvetica-Bold"/>
|
||||
</textElement>
|
||||
<text><![CDATA[Vytvořil]]></text>
|
||||
</staticText>
|
||||
<staticText>
|
||||
<reportElement x="180" y="2" width="74" height="16" uuid="b56f7ea9-b643-4a74-885a-75994fa440cc"/>
|
||||
<textElement>
|
||||
<font isBold="true" pdfFontName="Helvetica-Bold"/>
|
||||
</textElement>
|
||||
<text><![CDATA[Datum]]></text>
|
||||
</staticText>
|
||||
<staticText>
|
||||
<reportElement x="254" y="2" width="182" height="16" uuid="3726c2fd-16b7-4363-bc39-a8ff67cd2cae"/>
|
||||
<textElement>
|
||||
<font isBold="true" pdfFontName="Helvetica-Bold"/>
|
||||
</textElement>
|
||||
<text><![CDATA[Text]]></text>
|
||||
</staticText>
|
||||
<staticText>
|
||||
<reportElement x="512" y="2" width="104" height="16" uuid="efee783f-86e7-43dc-8b00-7f13d45c7575"/>
|
||||
<textElement>
|
||||
<font isBold="true" pdfFontName="Helvetica-Bold"/>
|
||||
</textElement>
|
||||
<text><![CDATA[Středisko]]></text>
|
||||
</staticText>
|
||||
<staticText>
|
||||
<reportElement x="616" y="2" width="100" height="16" uuid="1440fa7a-3099-4c7b-ad57-f7b2b30d17f4"/>
|
||||
<textElement>
|
||||
<font isBold="true" pdfFontName="Helvetica-Bold"/>
|
||||
</textElement>
|
||||
<text><![CDATA[Komise]]></text>
|
||||
</staticText>
|
||||
<staticText>
|
||||
<reportElement x="436" y="2" width="76" height="16" uuid="08d27f94-b848-410e-ba5d-4e4fc7d00c6f"/>
|
||||
<textElement>
|
||||
<font isBold="true" pdfFontName="Helvetica-Bold"/>
|
||||
</textElement>
|
||||
<text><![CDATA[Částka]]></text>
|
||||
</staticText>
|
||||
<staticText>
|
||||
<reportElement x="716" y="2" width="85" height="16" uuid="866008ad-b265-4ea7-b016-4bbf8278c66e"/>
|
||||
<textElement>
|
||||
<font isBold="true" pdfFontName="Helvetica-Bold"/>
|
||||
</textElement>
|
||||
<text><![CDATA[Fakturováno]]></text>
|
||||
</staticText>
|
||||
<line>
|
||||
<reportElement x="0" y="18" width="801" height="1" uuid="a121ad98-744c-4865-b724-951ccaae90f1"/>
|
||||
</line>
|
||||
<line>
|
||||
<reportElement x="0" y="0" width="801" height="1" uuid="fb3d8c46-4bb2-4873-ba3e-fa6c7f524e9f"/>
|
||||
</line>
|
||||
<line>
|
||||
<reportElement x="-1" y="0" width="1" height="19" uuid="db8f3dfc-c7fe-4fc1-ab67-f347d708dbb4"/>
|
||||
</line>
|
||||
<line>
|
||||
<reportElement x="801" y="0" width="1" height="19" uuid="339d76ce-0b71-4944-ba2b-4f50b752c0f7"/>
|
||||
</line>
|
||||
</band>
|
||||
</columnHeader>
|
||||
<detail>
|
||||
<band height="62" splitType="Stretch">
|
||||
<textField>
|
||||
<reportElement x="0" y="0" width="59" height="30" uuid="a15af2dc-b301-4831-b22b-475a608df8da"/>
|
||||
<textFieldExpression><![CDATA[$F{requirement.numser}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField>
|
||||
<reportElement x="59" y="0" width="121" height="30" uuid="4d368fd8-8086-4c70-b4a1-f76038a988e4"/>
|
||||
<textFieldExpression><![CDATA[""+$F{requirement.ownedBy}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField pattern="d.M.yyyy">
|
||||
<reportElement x="180" y="0" width="74" height="30" uuid="29e3191d-1caf-4561-8d01-37fa20562dfe"/>
|
||||
<textFieldExpression><![CDATA[$F{requirement.reqDate}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField isBlankWhenNull="true">
|
||||
<reportElement x="254" y="0" width="182" height="30" uuid="6c8111ea-c0dd-47de-bfb2-67778119e133"/>
|
||||
<textFieldExpression><![CDATA[$F{requirement.description}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField>
|
||||
<reportElement x="512" y="0" width="104" height="30" uuid="1c6551c1-3060-4d1f-844b-3b809a0e1b25"/>
|
||||
<textElement>
|
||||
<font pdfEncoding="Cp1250"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[""+$F{requirement.centre}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField isBlankWhenNull="true">
|
||||
<reportElement x="616" y="0" width="106" height="30" uuid="140dc16a-7bdd-4705-9dc1-b2485230884c"/>
|
||||
<textFieldExpression><![CDATA[$F{requirement.workgroup}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField pattern="#,##0.00" isBlankWhenNull="true">
|
||||
<reportElement x="722" y="0" width="78" height="30" uuid="b3d6b361-5940-48a1-81f1-769c7f5c93ba">
|
||||
<property name="local_mesure_unitwidth" value="pixel"/>
|
||||
<property name="com.jaspersoft.studio.unit.width" value="px"/>
|
||||
</reportElement>
|
||||
<textElement textAlignment="Right"/>
|
||||
<textFieldExpression><![CDATA[$F{totalInvoiced}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField isBlankWhenNull="true">
|
||||
<reportElement x="72" y="46" width="730" height="14" uuid="b6b32169-0b11-4978-94b0-db4d763ba2e7"/>
|
||||
<textFieldExpression><![CDATA[$F{invoiceNumbers}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField>
|
||||
<reportElement x="164" y="32" width="142" height="14" uuid="ab6c4887-b42e-448c-985f-6bec6541b752"/>
|
||||
<textFieldExpression><![CDATA[""+((info.bukova.isspst.data.AuthItem)$F{requirement.authorization}.get($F{requirement.authorization}.size()-3)).getApprover().toString()]]></textFieldExpression>
|
||||
</textField>
|
||||
<staticText>
|
||||
<reportElement x="6" y="32" width="100" height="14" uuid="aca43869-02d9-4f75-9eba-e801ceedfe00"/>
|
||||
<text><![CDATA[Příkazce operace:]]></text>
|
||||
</staticText>
|
||||
<staticText>
|
||||
<reportElement x="329" y="32" width="96" height="14" uuid="e9776606-e2db-4e33-99d1-bc689f269ecd"/>
|
||||
<text><![CDATA[Správce rozpočtu:]]></text>
|
||||
</staticText>
|
||||
<textField pattern="d.M.yyyy">
|
||||
<reportElement x="106" y="32" width="58" height="14" uuid="b26bac22-064f-4016-bd15-a5c43f729bf0"/>
|
||||
<textFieldExpression><![CDATA[((info.bukova.isspst.data.AuthItem)$F{requirement.authorization}.get($F{requirement.authorization}.size()-3)).getAuthDate()]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField pattern="d.M.yyyy">
|
||||
<reportElement x="425" y="32" width="57" height="14" uuid="47fbad6f-267e-4d00-83d2-e84c3b3c8a1e"/>
|
||||
<textFieldExpression><![CDATA[((info.bukova.isspst.data.AuthItem)$F{requirement.authorization}.get($F{requirement.authorization}.size()-1)).getAuthDate()]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField>
|
||||
<reportElement x="482" y="32" width="142" height="14" uuid="fa5d5931-5dd2-40ab-bf9b-3cc83b7e3eb6"/>
|
||||
<textFieldExpression><![CDATA[""+((info.bukova.isspst.data.AuthItem)$F{requirement.authorization}.get($F{requirement.authorization}.size()-1)).getApprover().toString()]]></textFieldExpression>
|
||||
</textField>
|
||||
<staticText>
|
||||
<reportElement x="6" y="46" width="66" height="14" uuid="f08bf6f4-5b87-41df-8d7b-f04f673cb274"/>
|
||||
<text><![CDATA[Čísla faktur:]]></text>
|
||||
</staticText>
|
||||
<textField pattern="#,##0.00" isBlankWhenNull="true">
|
||||
<reportElement x="436" y="0" width="73" height="30" uuid="329bacea-bec5-4ecf-894c-25bef2ad2020">
|
||||
<property name="local_mesure_unitwidth" value="pixel"/>
|
||||
<property name="com.jaspersoft.studio.unit.width" value="px"/>
|
||||
</reportElement>
|
||||
<textElement textAlignment="Right"/>
|
||||
<textFieldExpression><![CDATA[$F{requirement.sumTotal}]]></textFieldExpression>
|
||||
</textField>
|
||||
<line>
|
||||
<reportElement x="0" y="61" width="801" height="1" uuid="720248ac-87bb-418f-a9c3-45b0f6f07c10"/>
|
||||
</line>
|
||||
<line>
|
||||
<reportElement x="-1" y="0" width="1" height="62" uuid="d1d8fc07-5bbe-4f11-bc89-90e8b20f1557"/>
|
||||
</line>
|
||||
<line>
|
||||
<reportElement x="801" y="0" width="1" height="62" uuid="f83f5852-bf4f-44d4-8663-d38232a16811"/>
|
||||
</line>
|
||||
<line>
|
||||
<reportElement x="6" y="30" width="787" height="1" uuid="aa982c09-4682-4cb3-aae6-33fd2e1edea6"/>
|
||||
<graphicElement>
|
||||
<pen lineStyle="Dashed"/>
|
||||
</graphicElement>
|
||||
</line>
|
||||
</band>
|
||||
</detail>
|
||||
<pageFooter>
|
||||
<band height="15" splitType="Stretch">
|
||||
<textField>
|
||||
<reportElement x="0" y="2" width="800" height="12" uuid="9f84e90a-2fbf-4026-9d8b-8accd8bbc933"/>
|
||||
<textElement textAlignment="Center"/>
|
||||
<textFieldExpression><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression>
|
||||
</textField>
|
||||
</band>
|
||||
</pageFooter>
|
||||
</jasperReport>
|
Binary file not shown.
Binary file not shown.
@ -1,192 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="TripBills" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="b63eddc4-7326-45c4-99b4-fc35d6e98179">
|
||||
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
|
||||
<property name="ireport.zoom" value="1.9487171000000014"/>
|
||||
<property name="ireport.x" value="0"/>
|
||||
<property name="ireport.y" value="0"/>
|
||||
<queryString>
|
||||
<![CDATA[]]>
|
||||
</queryString>
|
||||
<field name="bill.requirement.numser" class="java.lang.String"/>
|
||||
<field name="bill.requirement.reqDate" class="java.util.Date"/>
|
||||
<field name="bill.requirement.tripDate" class="java.util.Date"/>
|
||||
<field name="bill.requirement.to" class="java.lang.String"/>
|
||||
<field name="bill.requirement.from" class="java.lang.String"/>
|
||||
<field name="bill.total" class="java.math.BigDecimal"/>
|
||||
<field name="bill.ownedBy" class="info.bukova.isspst.data.User"/>
|
||||
<field name="bill.paidDate" class="java.util.Date"/>
|
||||
<background>
|
||||
<band splitType="Stretch"/>
|
||||
</background>
|
||||
<title>
|
||||
<band height="23" splitType="Stretch">
|
||||
<staticText>
|
||||
<reportElement x="0" y="0" width="550" height="20" uuid="bc6cd7eb-bb1a-4114-b37d-ac64e951ca84"/>
|
||||
<textElement textAlignment="Center">
|
||||
<font size="14" isBold="true" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||
</textElement>
|
||||
<text><![CDATA[Přehled vyúčtovaných CP]]></text>
|
||||
</staticText>
|
||||
</band>
|
||||
</title>
|
||||
<columnHeader>
|
||||
<band height="26" splitType="Stretch">
|
||||
<staticText>
|
||||
<reportElement x="-3" y="0" width="49" height="24" uuid="4ac41092-a9db-4a53-adcf-403484a88f0c">
|
||||
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="5bae174d-9ec1-47bf-b996-c693f3deb590"/>
|
||||
</reportElement>
|
||||
<textElement verticalAlignment="Middle">
|
||||
<font isBold="true" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||
</textElement>
|
||||
<text><![CDATA[Číslo]]></text>
|
||||
</staticText>
|
||||
<staticText>
|
||||
<reportElement x="52" y="0" width="55" height="25" uuid="4ad11f47-bf12-4f6a-9459-31f6a1bf740a">
|
||||
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="ec379d5f-c508-4339-997b-960e31840623"/>
|
||||
</reportElement>
|
||||
<textElement verticalAlignment="Middle">
|
||||
<font isBold="true" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||
</textElement>
|
||||
<text><![CDATA[Datum požad.]]></text>
|
||||
</staticText>
|
||||
<staticText>
|
||||
<reportElement x="109" y="0" width="55" height="24" uuid="82e13fca-38df-497d-879a-a83b5811e7fc">
|
||||
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="1a0527d9-8676-4271-b662-dbed84c8de59"/>
|
||||
</reportElement>
|
||||
<textElement verticalAlignment="Middle">
|
||||
<font isBold="true" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||
</textElement>
|
||||
<text><![CDATA[Datum cesty]]></text>
|
||||
</staticText>
|
||||
<staticText>
|
||||
<reportElement x="166" y="0" width="95" height="24" uuid="b37db24a-5134-42fb-92f6-1be4891f19ae">
|
||||
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="f01bf96d-78de-440b-9322-27510f96e117"/>
|
||||
</reportElement>
|
||||
<textElement verticalAlignment="Middle">
|
||||
<font isBold="true" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||
</textElement>
|
||||
<text><![CDATA[Počátek cesty]]></text>
|
||||
</staticText>
|
||||
<staticText>
|
||||
<reportElement x="262" y="0" width="95" height="24" uuid="dc940c96-6170-4ff0-bf1c-c3b228635812">
|
||||
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="f296e149-4f38-4ed6-b0a6-1e4544728890"/>
|
||||
</reportElement>
|
||||
<textElement verticalAlignment="Middle">
|
||||
<font isBold="true" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||
</textElement>
|
||||
<text><![CDATA[Cíl]]></text>
|
||||
</staticText>
|
||||
<staticText>
|
||||
<reportElement x="358" y="0" width="97" height="24" uuid="9eddb29b-3024-4f0d-90f5-e8e896add7c0">
|
||||
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="df75863b-fbfb-4332-a9fa-dbacf818e85c"/>
|
||||
</reportElement>
|
||||
<textElement verticalAlignment="Middle">
|
||||
<font isBold="true" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||
</textElement>
|
||||
<text><![CDATA[Žadatel]]></text>
|
||||
</staticText>
|
||||
<staticText>
|
||||
<reportElement x="451" y="0" width="45" height="24" uuid="783dc31a-7f32-44d1-b455-6e8d25d5a943">
|
||||
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="ef5d98d4-a0b8-4098-be82-3ea9a1bc2213"/>
|
||||
</reportElement>
|
||||
<textElement verticalAlignment="Middle">
|
||||
<font isBold="true" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||
</textElement>
|
||||
<text><![CDATA[Částka]]></text>
|
||||
</staticText>
|
||||
<staticText>
|
||||
<reportElement x="501" y="0" width="52" height="24" uuid="2e899e0b-4c95-4088-8342-b6c701267c1f">
|
||||
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="781e4236-2351-4b02-99d0-cc2f76e00e3b"/>
|
||||
</reportElement>
|
||||
<textElement verticalAlignment="Middle">
|
||||
<font isBold="true" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||
</textElement>
|
||||
<text><![CDATA[Datum vyúčt.]]></text>
|
||||
</staticText>
|
||||
<line>
|
||||
<reportElement x="0" y="25" width="550" height="1" uuid="813c3d6a-167c-4710-ab3a-e0795d31b3eb"/>
|
||||
</line>
|
||||
</band>
|
||||
</columnHeader>
|
||||
<detail>
|
||||
<band height="18" splitType="Stretch">
|
||||
<printWhenExpression><![CDATA[$F{bill.paidDate} != null]]></printWhenExpression>
|
||||
<textField>
|
||||
<reportElement x="-3" y="1" width="57" height="12" uuid="52ea43dc-f565-4502-9d17-4a41dab6db08">
|
||||
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="5bae174d-9ec1-47bf-b996-c693f3deb590"/>
|
||||
</reportElement>
|
||||
<textElement>
|
||||
<font pdfFontName="Helvetica" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$F{bill.requirement.numser}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField pattern="dd.MM.yyyy">
|
||||
<reportElement x="52" y="1" width="60" height="12" uuid="88d723d7-ab14-4c78-8b26-26d804e52b42">
|
||||
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="ec379d5f-c508-4339-997b-960e31840623"/>
|
||||
</reportElement>
|
||||
<textElement>
|
||||
<font pdfFontName="Helvetica" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$F{bill.requirement.reqDate}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField pattern="dd.MM.yyyy">
|
||||
<reportElement x="109" y="1" width="60" height="12" uuid="02f1eb70-9fa5-4249-93a3-aaa27ce5db96">
|
||||
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="1a0527d9-8676-4271-b662-dbed84c8de59"/>
|
||||
</reportElement>
|
||||
<textElement>
|
||||
<font pdfFontName="Helvetica" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$F{bill.requirement.tripDate}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField>
|
||||
<reportElement x="166" y="1" width="95" height="12" uuid="10790d11-b692-4a37-849f-8b3054f65b52">
|
||||
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="f01bf96d-78de-440b-9322-27510f96e117"/>
|
||||
</reportElement>
|
||||
<textElement>
|
||||
<font pdfFontName="Helvetica" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$F{bill.requirement.from}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField>
|
||||
<reportElement x="262" y="1" width="95" height="12" uuid="bc0a5da9-d998-4734-a0dd-8993e24d96d2">
|
||||
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="f296e149-4f38-4ed6-b0a6-1e4544728890"/>
|
||||
</reportElement>
|
||||
<textElement>
|
||||
<font pdfFontName="Helvetica" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$F{bill.requirement.to}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField>
|
||||
<reportElement x="358" y="1" width="97" height="12" uuid="3a197226-28d7-4384-b74a-12e748bd0967">
|
||||
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="df75863b-fbfb-4332-a9fa-dbacf818e85c"/>
|
||||
</reportElement>
|
||||
<textElement>
|
||||
<font pdfFontName="Helvetica" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$F{bill.ownedBy}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField pattern="###0.00;-###0.00">
|
||||
<reportElement x="451" y="1" width="45" height="12" uuid="02a5e327-b7ab-4841-a895-0d285770e3c8">
|
||||
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="ef5d98d4-a0b8-4098-be82-3ea9a1bc2213"/>
|
||||
</reportElement>
|
||||
<textElement textAlignment="Right">
|
||||
<font pdfFontName="Helvetica" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||
<paragraph lineSpacing="Single"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$F{bill.total}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField pattern="dd.MM.yyyy">
|
||||
<reportElement x="501" y="1" width="60" height="12" uuid="9750faaa-4e86-4b96-ae11-e394af572b82">
|
||||
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="781e4236-2351-4b02-99d0-cc2f76e00e3b"/>
|
||||
</reportElement>
|
||||
<textElement>
|
||||
<font pdfFontName="Helvetica" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$F{bill.paidDate}]]></textFieldExpression>
|
||||
</textField>
|
||||
</band>
|
||||
</detail>
|
||||
<summary>
|
||||
<band height="23" splitType="Stretch"/>
|
||||
</summary>
|
||||
</jasperReport>
|
Binary file not shown.
@ -1,174 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="TripBills" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="b63eddc4-7326-45c4-99b4-fc35d6e98179">
|
||||
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
|
||||
<property name="ireport.zoom" value="1.4641000000000006"/>
|
||||
<property name="ireport.x" value="0"/>
|
||||
<property name="ireport.y" value="0"/>
|
||||
<queryString>
|
||||
<![CDATA[]]>
|
||||
</queryString>
|
||||
<field name="bill.requirement.numser" class="java.lang.String"/>
|
||||
<field name="bill.requirement.reqDate" class="java.util.Date"/>
|
||||
<field name="bill.requirement.tripDate" class="java.util.Date"/>
|
||||
<field name="bill.requirement.to" class="java.lang.String"/>
|
||||
<field name="bill.requirement.from" class="java.lang.String"/>
|
||||
<field name="bill.total" class="java.math.BigDecimal"/>
|
||||
<field name="bill.ownedBy" class="info.bukova.isspst.data.User"/>
|
||||
<field name="bill.paidDate" class="java.util.Date"/>
|
||||
<background>
|
||||
<band splitType="Stretch"/>
|
||||
</background>
|
||||
<title>
|
||||
<band height="23" splitType="Stretch">
|
||||
<staticText>
|
||||
<reportElement x="0" y="0" width="552" height="20" uuid="bc6cd7eb-bb1a-4114-b37d-ac64e951ca84"/>
|
||||
<textElement textAlignment="Center">
|
||||
<font size="14" isBold="true" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||
</textElement>
|
||||
<text><![CDATA[Přehled nevyúčtovaných CP]]></text>
|
||||
</staticText>
|
||||
</band>
|
||||
</title>
|
||||
<columnHeader>
|
||||
<band height="26" splitType="Stretch">
|
||||
<staticText>
|
||||
<reportElement x="-3" y="0" width="49" height="24" uuid="4ac41092-a9db-4a53-adcf-403484a88f0c">
|
||||
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="5bae174d-9ec1-47bf-b996-c693f3deb590"/>
|
||||
</reportElement>
|
||||
<textElement verticalAlignment="Middle">
|
||||
<font isBold="true" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||
</textElement>
|
||||
<text><![CDATA[Číslo]]></text>
|
||||
</staticText>
|
||||
<staticText>
|
||||
<reportElement x="57" y="0" width="55" height="25" uuid="4ad11f47-bf12-4f6a-9459-31f6a1bf740a">
|
||||
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="ec379d5f-c508-4339-997b-960e31840623"/>
|
||||
</reportElement>
|
||||
<textElement verticalAlignment="Middle">
|
||||
<font isBold="true" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||
</textElement>
|
||||
<text><![CDATA[Datum požad.]]></text>
|
||||
</staticText>
|
||||
<staticText>
|
||||
<reportElement x="120" y="0" width="55" height="24" uuid="82e13fca-38df-497d-879a-a83b5811e7fc">
|
||||
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="1a0527d9-8676-4271-b662-dbed84c8de59"/>
|
||||
</reportElement>
|
||||
<textElement verticalAlignment="Middle">
|
||||
<font isBold="true" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||
</textElement>
|
||||
<text><![CDATA[Datum cesty]]></text>
|
||||
</staticText>
|
||||
<staticText>
|
||||
<reportElement x="183" y="0" width="105" height="24" uuid="b37db24a-5134-42fb-92f6-1be4891f19ae">
|
||||
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="f01bf96d-78de-440b-9322-27510f96e117"/>
|
||||
</reportElement>
|
||||
<textElement verticalAlignment="Middle">
|
||||
<font isBold="true" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||
</textElement>
|
||||
<text><![CDATA[Počátek cesty]]></text>
|
||||
</staticText>
|
||||
<staticText>
|
||||
<reportElement x="290" y="0" width="105" height="24" uuid="dc940c96-6170-4ff0-bf1c-c3b228635812">
|
||||
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="f296e149-4f38-4ed6-b0a6-1e4544728890"/>
|
||||
</reportElement>
|
||||
<textElement verticalAlignment="Middle">
|
||||
<font isBold="true" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||
</textElement>
|
||||
<text><![CDATA[Cíl]]></text>
|
||||
</staticText>
|
||||
<staticText>
|
||||
<reportElement x="398" y="0" width="112" height="24" uuid="9eddb29b-3024-4f0d-90f5-e8e896add7c0">
|
||||
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="df75863b-fbfb-4332-a9fa-dbacf818e85c"/>
|
||||
</reportElement>
|
||||
<textElement verticalAlignment="Middle">
|
||||
<font isBold="true" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||
</textElement>
|
||||
<text><![CDATA[Žadatel]]></text>
|
||||
</staticText>
|
||||
<staticText>
|
||||
<reportElement x="512" y="0" width="40" height="24" uuid="783dc31a-7f32-44d1-b455-6e8d25d5a943">
|
||||
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="ef5d98d4-a0b8-4098-be82-3ea9a1bc2213"/>
|
||||
</reportElement>
|
||||
<textElement verticalAlignment="Middle">
|
||||
<font isBold="true" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||
</textElement>
|
||||
<text><![CDATA[Částka]]></text>
|
||||
</staticText>
|
||||
<line>
|
||||
<reportElement x="0" y="25" width="550" height="1" uuid="813c3d6a-167c-4710-ab3a-e0795d31b3eb"/>
|
||||
</line>
|
||||
</band>
|
||||
</columnHeader>
|
||||
<detail>
|
||||
<band height="18" splitType="Stretch">
|
||||
<printWhenExpression><![CDATA[$F{bill.paidDate} == null]]></printWhenExpression>
|
||||
<textField>
|
||||
<reportElement x="-3" y="1" width="57" height="12" uuid="52ea43dc-f565-4502-9d17-4a41dab6db08">
|
||||
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="5bae174d-9ec1-47bf-b996-c693f3deb590"/>
|
||||
</reportElement>
|
||||
<textElement>
|
||||
<font pdfFontName="Helvetica" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$F{bill.requirement.numser}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField pattern="dd.MM.yyyy">
|
||||
<reportElement x="57" y="1" width="60" height="12" uuid="88d723d7-ab14-4c78-8b26-26d804e52b42">
|
||||
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="ec379d5f-c508-4339-997b-960e31840623"/>
|
||||
</reportElement>
|
||||
<textElement>
|
||||
<font pdfFontName="Helvetica" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$F{bill.requirement.reqDate}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField pattern="dd.MM.yyyy">
|
||||
<reportElement x="120" y="1" width="60" height="12" uuid="02f1eb70-9fa5-4249-93a3-aaa27ce5db96">
|
||||
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="1a0527d9-8676-4271-b662-dbed84c8de59"/>
|
||||
</reportElement>
|
||||
<textElement>
|
||||
<font pdfFontName="Helvetica" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$F{bill.requirement.tripDate}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField>
|
||||
<reportElement x="183" y="1" width="105" height="12" uuid="10790d11-b692-4a37-849f-8b3054f65b52">
|
||||
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="f01bf96d-78de-440b-9322-27510f96e117"/>
|
||||
</reportElement>
|
||||
<textElement>
|
||||
<font pdfFontName="Helvetica" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$F{bill.requirement.from}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField>
|
||||
<reportElement x="290" y="1" width="105" height="12" uuid="bc0a5da9-d998-4734-a0dd-8993e24d96d2">
|
||||
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="f296e149-4f38-4ed6-b0a6-1e4544728890"/>
|
||||
</reportElement>
|
||||
<textElement>
|
||||
<font pdfFontName="Helvetica" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$F{bill.requirement.to}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField>
|
||||
<reportElement x="398" y="1" width="112" height="12" uuid="3a197226-28d7-4384-b74a-12e748bd0967">
|
||||
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="df75863b-fbfb-4332-a9fa-dbacf818e85c"/>
|
||||
</reportElement>
|
||||
<textElement>
|
||||
<font pdfFontName="Helvetica" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$F{bill.ownedBy}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField pattern="###0.00;-###0.00">
|
||||
<reportElement x="512" y="1" width="40" height="12" uuid="02a5e327-b7ab-4841-a895-0d285770e3c8">
|
||||
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="ef5d98d4-a0b8-4098-be82-3ea9a1bc2213"/>
|
||||
</reportElement>
|
||||
<textElement textAlignment="Right">
|
||||
<font pdfFontName="Helvetica" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||
<paragraph lineSpacing="Single"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$F{bill.total}]]></textFieldExpression>
|
||||
</textField>
|
||||
</band>
|
||||
</detail>
|
||||
<summary>
|
||||
<band height="23" splitType="Stretch"/>
|
||||
</summary>
|
||||
</jasperReport>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue