Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 70a2e01fae | |||
| fcb8db25fa | |||
| 740847e865 | |||
| 093d359df7 | |||
| ea2708f303 | |||
| 9b2e2b3641 | |||
| a8dc7f1306 | |||
| 7d4d693b2e | |||
| e4013f44ab | |||
| b95cac9ef1 | |||
| 5079d6d55a | |||
| a93c515bc0 | |||
| 1475babaa1 | |||
| b0fb32825b | |||
| 9d59b34900 | |||
| 47e90b4287 | |||
| b276746bac | |||
| f938403cea | |||
| b321b3e25f | |||
| cbb81657c8 | |||
| cd6b8c01dc | |||
| 012ad06358 | |||
| 88e9711154 | |||
| d2aa1cbd9a | |||
| 52cf63414b | |||
| f904e89946 | |||
| 5cae516cb6 |
@@ -229,7 +229,12 @@
|
|||||||
<artifactId>hibernate-search</artifactId>
|
<artifactId>hibernate-search</artifactId>
|
||||||
<version>4.4.6.Final</version>
|
<version>4.4.6.Final</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.hibernate</groupId>
|
||||||
|
<artifactId>hibernate-ehcache</artifactId>
|
||||||
|
<version>4.2.8.Final</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- ZK -->
|
<!-- ZK -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.zkoss.zk</groupId>
|
<groupId>org.zkoss.zk</groupId>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import info.bukova.isspst.data.NumberSeries;
|
|||||||
import info.bukova.isspst.data.Permission;
|
import info.bukova.isspst.data.Permission;
|
||||||
import info.bukova.isspst.data.RequirementType;
|
import info.bukova.isspst.data.RequirementType;
|
||||||
import info.bukova.isspst.data.Role;
|
import info.bukova.isspst.data.Role;
|
||||||
|
import info.bukova.isspst.data.Season;
|
||||||
import info.bukova.isspst.data.SettingsData;
|
import info.bukova.isspst.data.SettingsData;
|
||||||
import info.bukova.isspst.data.User;
|
import info.bukova.isspst.data.User;
|
||||||
import info.bukova.isspst.reporting.Report;
|
import info.bukova.isspst.reporting.Report;
|
||||||
@@ -17,6 +18,8 @@ import info.bukova.isspst.services.munits.MUnitService;
|
|||||||
import info.bukova.isspst.services.numberseries.NumberSeriesService;
|
import info.bukova.isspst.services.numberseries.NumberSeriesService;
|
||||||
import info.bukova.isspst.services.requirement.RequirementTypeService;
|
import info.bukova.isspst.services.requirement.RequirementTypeService;
|
||||||
import info.bukova.isspst.services.settings.GlobalSettingsService;
|
import info.bukova.isspst.services.settings.GlobalSettingsService;
|
||||||
|
import info.bukova.isspst.services.settings.SeasonException;
|
||||||
|
import info.bukova.isspst.services.settings.SeasonService;
|
||||||
import info.bukova.isspst.services.users.PermissionService;
|
import info.bukova.isspst.services.users.PermissionService;
|
||||||
import info.bukova.isspst.services.users.RoleService;
|
import info.bukova.isspst.services.users.RoleService;
|
||||||
import info.bukova.isspst.services.users.UserService;
|
import info.bukova.isspst.services.users.UserService;
|
||||||
@@ -29,6 +32,7 @@ import org.springframework.web.context.support.WebApplicationContextUtils;
|
|||||||
import javax.servlet.ServletContextEvent;
|
import javax.servlet.ServletContextEvent;
|
||||||
import javax.servlet.ServletContextListener;
|
import javax.servlet.ServletContextListener;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Calendar;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class AppInitListener implements ServletContextListener {
|
public class AppInitListener implements ServletContextListener {
|
||||||
@@ -43,7 +47,8 @@ public class AppInitListener implements ServletContextListener {
|
|||||||
private RequirementTypeService reqTypeService;
|
private RequirementTypeService reqTypeService;
|
||||||
private GlobalSettingsService gSettingsService;
|
private GlobalSettingsService gSettingsService;
|
||||||
private FullTextService ftService;
|
private FullTextService ftService;
|
||||||
|
private SeasonService seasonService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void contextDestroyed(ServletContextEvent arg0) {
|
public void contextDestroyed(ServletContextEvent arg0) {
|
||||||
|
|
||||||
@@ -64,6 +69,7 @@ public class AppInitListener implements ServletContextListener {
|
|||||||
gSettingsService = ctx.getBean(GlobalSettingsService.class);
|
gSettingsService = ctx.getBean(GlobalSettingsService.class);
|
||||||
reqTypeService = ctx.getBean(RequirementTypeService.class);
|
reqTypeService = ctx.getBean(RequirementTypeService.class);
|
||||||
ftService = ctx.getBean(FullTextService.class);
|
ftService = ctx.getBean(FullTextService.class);
|
||||||
|
seasonService = ctx.getBean(SeasonService.class);
|
||||||
|
|
||||||
userService.grantAdmin();
|
userService.grantAdmin();
|
||||||
this.checkDbInfo();
|
this.checkDbInfo();
|
||||||
@@ -285,29 +291,41 @@ public class AppInitListener implements ServletContextListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void checkNumberSeriesForSeason(Season season) {
|
||||||
|
for (String modId : Constants.NUM_SERIES_PREFIX.keySet()) {
|
||||||
|
NumberSeries ns = nsService.getNumberSerieForSeason(modId, season);
|
||||||
|
if (ns == null) {
|
||||||
|
ns = new NumberSeries();
|
||||||
|
ns.setModule(modId);
|
||||||
|
ns.setPrefix(Constants.NUM_SERIES_PREFIX.get(modId));
|
||||||
|
ns.setNumber(1);
|
||||||
|
ns.setSeason(season);
|
||||||
|
nsService.add(ns);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void checkNumberSeries()
|
private void checkNumberSeries()
|
||||||
{
|
{
|
||||||
NumberSeries ns = nsService.getNumberSerie(Constants.MOD_REQUIREMENTS);
|
Season season;
|
||||||
|
try {
|
||||||
if (ns == null)
|
season = seasonService.getActive();
|
||||||
{
|
} catch (SeasonException e) {
|
||||||
ns = new NumberSeries();
|
season = null;
|
||||||
ns.setModule(Constants.MOD_REQUIREMENTS);
|
|
||||||
ns.setPrefix("");
|
|
||||||
ns.setNumber(1);
|
|
||||||
nsService.add(ns);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ns = nsService.getNumberSerie(Constants.MOD_ORDER);
|
if (season == null) {
|
||||||
|
season = new Season();
|
||||||
if (ns == null)
|
Calendar cal = Calendar.getInstance();
|
||||||
{
|
season.setDescription(String.valueOf(cal.get(Calendar.YEAR)));
|
||||||
ns = new NumberSeries();
|
season.setValidFrom(cal.getTime());
|
||||||
ns.setModule(Constants.MOD_ORDER);
|
season.setActive(true);
|
||||||
ns.setPrefix("");
|
seasonService.add(season);
|
||||||
ns.setNumber(1);
|
}
|
||||||
nsService.add(ns);
|
|
||||||
|
for (Season s : seasonService.getAllSeasons()) {
|
||||||
|
checkNumberSeriesForSeason(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import java.math.BigDecimal;
|
|||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
import static org.apache.commons.lang.StringUtils.strip;
|
||||||
|
|
||||||
public class BigDecimalUtils
|
public class BigDecimalUtils
|
||||||
{
|
{
|
||||||
@@ -23,6 +24,17 @@ public class BigDecimalUtils
|
|||||||
|
|
||||||
String valueS = value.toPlainString();
|
String valueS = value.toPlainString();
|
||||||
String searchS = search.toPlainString();
|
String searchS = search.toPlainString();
|
||||||
|
|
||||||
|
if (valueS.contains(".") || valueS.contains(",")) {
|
||||||
|
valueS = strip(valueS, "0");
|
||||||
|
valueS = strip(valueS, ".,");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (searchS.contains(".") || searchS.contains(",")) {
|
||||||
|
searchS = strip(searchS, "0");
|
||||||
|
searchS = strip(searchS, ".,");
|
||||||
|
}
|
||||||
|
|
||||||
boolean result = (valueS.compareTo(searchS) == 0);
|
boolean result = (valueS.compareTo(searchS) == 0);
|
||||||
|
|
||||||
String s = "search='" + searchS + "', value='" + valueS + "', equal=" + (result ? "true" : "false");
|
String s = "search='" + searchS + "', value='" + valueS + "', equal=" + (result ? "true" : "false");
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import info.bukova.isspst.services.addressbook.AdbService;
|
|||||||
import info.bukova.isspst.services.buildings.BuildingService;
|
import info.bukova.isspst.services.buildings.BuildingService;
|
||||||
import info.bukova.isspst.services.fulltext.FullTextService;
|
import info.bukova.isspst.services.fulltext.FullTextService;
|
||||||
import info.bukova.isspst.services.invoicing.InvoicingService;
|
import info.bukova.isspst.services.invoicing.InvoicingService;
|
||||||
|
import info.bukova.isspst.services.limits.LimitService;
|
||||||
import info.bukova.isspst.services.munits.MUnitService;
|
import info.bukova.isspst.services.munits.MUnitService;
|
||||||
import info.bukova.isspst.services.orders.ApprovedService;
|
import info.bukova.isspst.services.orders.ApprovedService;
|
||||||
import info.bukova.isspst.services.orders.OrderService;
|
import info.bukova.isspst.services.orders.OrderService;
|
||||||
@@ -35,7 +36,7 @@ import java.util.Map;
|
|||||||
|
|
||||||
public class Constants {
|
public class Constants {
|
||||||
|
|
||||||
public final static long DB_VERSION = 5;
|
public final static long DB_VERSION = 6;
|
||||||
|
|
||||||
public final static String DEF_ADMIN = "admin";
|
public final static String DEF_ADMIN = "admin";
|
||||||
public final static String DEF_ADMIN_PASSWD = "admin";
|
public final static String DEF_ADMIN_PASSWD = "admin";
|
||||||
@@ -88,6 +89,7 @@ public class Constants {
|
|||||||
public final static String MOD_INVOICING = "INVOICING";
|
public final static String MOD_INVOICING = "INVOICING";
|
||||||
public final static String MOD_SEARCH = "SEARCH";
|
public final static String MOD_SEARCH = "SEARCH";
|
||||||
public final static String MOD_SIGNEDDOCS = "SIGNEDDOCS";
|
public final static String MOD_SIGNEDDOCS = "SIGNEDDOCS";
|
||||||
|
public final static String MOD_LIMITS = "LIMITS";
|
||||||
public final static Module MODULES[] = {
|
public final static Module MODULES[] = {
|
||||||
new Module(MOD_USERS, "Uživatelé", UserService.class),
|
new Module(MOD_USERS, "Uživatelé", UserService.class),
|
||||||
new Module(MOD_PERMISSIONS, "Práva", RoleService.class),
|
new Module(MOD_PERMISSIONS, "Práva", RoleService.class),
|
||||||
@@ -106,6 +108,7 @@ public class Constants {
|
|||||||
new Module(MOD_INVOICING, "Fakturace požadavků", InvoicingService.class),
|
new Module(MOD_INVOICING, "Fakturace požadavků", InvoicingService.class),
|
||||||
new Module(MOD_SEARCH, "Fulltextové vyhledávání", FullTextService.class, true, false),
|
new Module(MOD_SEARCH, "Fulltextové vyhledávání", FullTextService.class, true, false),
|
||||||
new Module(MOD_SIGNEDDOCS, "Podepsané dokumenty", SignedDocumentService.class, true, false),
|
new Module(MOD_SIGNEDDOCS, "Podepsané dokumenty", SignedDocumentService.class, true, false),
|
||||||
|
new Module(MOD_LIMITS, "Limity komisi", LimitService.class),
|
||||||
};
|
};
|
||||||
|
|
||||||
public final static String PERM_APPROVE = "PERM_APPROVE";
|
public final static String PERM_APPROVE = "PERM_APPROVE";
|
||||||
@@ -143,13 +146,27 @@ public class Constants {
|
|||||||
public final static ReportMapping REPORTS[] = {
|
public final static ReportMapping REPORTS[] = {
|
||||||
new ReportMapping(MOD_ADDRESSBOOK, new Report(1, false, "Adresní karty", "address")),
|
new ReportMapping(MOD_ADDRESSBOOK, new Report(1, false, "Adresní karty", "address")),
|
||||||
new ReportMapping(MOD_ADDRESSBOOK, new Report(2, false, "Adresa", "address", false, true)),
|
new ReportMapping(MOD_ADDRESSBOOK, new Report(2, false, "Adresa", "address", false, true)),
|
||||||
new ReportMapping(MOD_TRIPBILL, new Report(3, false, "Žádost", "tripRequirement", false, true)),
|
new ReportMapping(MOD_TRIPBILL, new Report(7, true, "Žádost o SC", "tripRequirementApp", false, true, "requirement")),
|
||||||
new ReportMapping(MOD_TRIPBILL, new Report(4, true, "Vyúčtování", "tripBill", false, true, true)),
|
new ReportMapping(MOD_TRIPBILL, new Report(4, true, "Vyúčtování", "tripBill", false, true, true)),
|
||||||
new ReportMapping(MOD_ORDER, new Report(5, false, "Objednávka", "order", true, true)),
|
new ReportMapping(MOD_ORDER, new Report(5, false, "Objednávka", "order", true, true)),
|
||||||
new ReportMapping(MOD_REQUIREMENTS, new Report(6, false, "Požadavky", "requirements")),
|
new ReportMapping(MOD_REQUIREMENTS, new Report(6, false, "Požadavky", "requirements")),
|
||||||
new ReportMapping(MOD_TRIPREQUIREMENTS, new Report(7, true, "Žádost o SC", "tripRequirementApp", false, true)),
|
new ReportMapping(MOD_TRIPREQUIREMENTS, new Report(7, true, "Žádost o SC", "tripRequirementApp", false, true)),
|
||||||
new ReportMapping(MOD_REQUIREMENTS, new Report(8, true, "Protokol o kontrole", "orderRequirement", false, true))
|
new ReportMapping(MOD_REQUIREMENTS, new Report(8, true, "Protokol o kontrole", "orderRequirement", false, true)),
|
||||||
|
new ReportMapping(MOD_INVOICING, new Report(9, false, "Přehled o protokolech předběžné kontroly", "requirementProtocol")),
|
||||||
|
new ReportMapping(MOD_TRIPREQUIREMENTS, new Report(10, true, "Přehled o protokolech předběžné kontroly", "tripRequirementProtocol"))
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// pokud je v agnde vic nez jedena podepisovaci sestava, musi se definovat ktera sestava nalezi jake entite
|
||||||
|
public final static Map<Class<?>, Integer> SIGN_REPORT_MAP = Collections.unmodifiableMap(new HashMap<Class<?>, Integer>() {{
|
||||||
|
put(TripBillApproval.class, 4);
|
||||||
|
put(TripRequirement.class, 7);
|
||||||
|
}});
|
||||||
|
|
||||||
|
// vychozi prefixy ciselnych rad. Pokud se prida agenda s vlastni ciselnou radou, je potreba zadefinovat vychozi prefix
|
||||||
|
public final static Map<String, String> NUM_SERIES_PREFIX = Collections.unmodifiableMap(new HashMap<String, String>() {{
|
||||||
|
put(MOD_REQUIREMENTS, "P");
|
||||||
|
put(MOD_ORDER, "O");
|
||||||
|
}});
|
||||||
|
|
||||||
public final static String REQTYPE_ORDER = "ORDER";
|
public final static String REQTYPE_ORDER = "ORDER";
|
||||||
public final static String REQTYPE_BUSINESSTRIP = "BUSINESSTRIP";
|
public final static String REQTYPE_BUSINESSTRIP = "BUSINESSTRIP";
|
||||||
|
|||||||
@@ -1,85 +1,135 @@
|
|||||||
package info.bukova.isspst;
|
package info.bukova.isspst;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.GregorianCalendar;
|
import java.util.GregorianCalendar;
|
||||||
|
|
||||||
import org.apache.commons.lang.time.DateUtils;
|
import org.apache.commons.lang.time.DateUtils;
|
||||||
|
|
||||||
public class DateTimeUtils
|
public class DateTimeUtils {
|
||||||
{
|
public static Date getDate(Date value) {
|
||||||
public static Date getDate(Date value)
|
if (value == null) {
|
||||||
{
|
return value;
|
||||||
if (value == null)
|
}
|
||||||
{
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Keep date - truncate time
|
|
||||||
return DateUtils.truncate(value, Calendar.DAY_OF_MONTH);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean isEqualByDate(Date d1, Date d2)
|
|
||||||
{
|
|
||||||
if (d1 != null && d2 != null)
|
|
||||||
{
|
|
||||||
d1 = DateTimeUtils.getDate(d1);
|
|
||||||
d2 = DateTimeUtils.getDate(d2);
|
|
||||||
boolean equals = (d1.compareTo(d2) == 0);
|
|
||||||
return equals;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean isEqualByDateForFilter(Date value, Date search)
|
|
||||||
{
|
|
||||||
if (search == null)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else if (value != null)
|
|
||||||
{
|
|
||||||
return DateTimeUtils.isEqualByDate(value, search);
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Date getCurrDateTime()
|
// Keep date - truncate time
|
||||||
{
|
return DateUtils.truncate(value, Calendar.DAY_OF_MONTH);
|
||||||
return new Date();
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public static Date getCurrDate()
|
public static int getYear(Date value) {
|
||||||
{
|
if (value == null) {
|
||||||
return DateTimeUtils.getDate(DateTimeUtils.getCurrDateTime());
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Calendar getCalendarDelta(Date value, int calendarType, int delta) {
|
Calendar cal =Calendar.getInstance();
|
||||||
if (value == null) {
|
cal.setTime(value);
|
||||||
value = DateTimeUtils.getCurrDate();
|
return cal.get(Calendar.YEAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
Calendar calendar = new GregorianCalendar();
|
public static boolean isEqualByDate(Date d1, Date d2) {
|
||||||
calendar.setTime(value);
|
if (d1 != null && d2 != null) {
|
||||||
int deltaValue = calendar.get(calendarType);
|
d1 = DateTimeUtils.getDate(d1);
|
||||||
calendar.set(calendarType, deltaValue + delta);
|
d2 = DateTimeUtils.getDate(d2);
|
||||||
return calendar;
|
boolean equals = (d1.compareTo(d2) == 0);
|
||||||
}
|
return equals;
|
||||||
|
}
|
||||||
|
|
||||||
public static Calendar getCalendar(Date value) {
|
return false;
|
||||||
if (value == null) {
|
}
|
||||||
value = DateTimeUtils.getCurrDate();
|
|
||||||
}
|
|
||||||
|
|
||||||
Calendar calendar = new GregorianCalendar();
|
public static boolean isEqualByYear(Date d1, Date d2) {
|
||||||
calendar.setTime(value);
|
if (d1 != null && d2 != null) {
|
||||||
return calendar;
|
int year1 = DateTimeUtils.getYear(d1);
|
||||||
}
|
int year2 = DateTimeUtils.getYear(d2);
|
||||||
|
boolean equals = (year1 == year2);
|
||||||
|
return equals;
|
||||||
|
}
|
||||||
|
|
||||||
public static Date getDateDelta(Date value, int calendarType, int delta) {
|
return false;
|
||||||
Calendar calendar = DateTimeUtils.getCalendarDelta(value, calendarType, delta);
|
}
|
||||||
return calendar.getTime();
|
public static boolean isEqualByDateForFilter(Date value, Date search) {
|
||||||
}
|
if (search == null) {
|
||||||
|
return true;
|
||||||
|
} else if (value != null) {
|
||||||
|
return DateTimeUtils.isEqualByDate(value, search);
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getFormatedDate(Date value) {
|
||||||
|
if (value == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat(StringUtils.localize("DateFormat"));
|
||||||
|
String result = sdf.format(value);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getFormatedDirDate(Date value) {
|
||||||
|
if (value == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
|
||||||
|
String result = sdf.format(value);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getFormatedDirDateDDMM(Date value) {
|
||||||
|
if (value == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("MMdd");
|
||||||
|
String result = sdf.format(value);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getFormatedYear(Date value) {
|
||||||
|
if (value == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy");
|
||||||
|
String result = sdf.format(value);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Date getCurrDateTime() {
|
||||||
|
return new Date();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Date getCurrDate() {
|
||||||
|
return DateTimeUtils.getDate(DateTimeUtils.getCurrDateTime());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Calendar getCalendarDelta(Date value, int calendarType, int delta) {
|
||||||
|
if (value == null) {
|
||||||
|
value = DateTimeUtils.getCurrDate();
|
||||||
|
}
|
||||||
|
|
||||||
|
Calendar calendar = new GregorianCalendar();
|
||||||
|
calendar.setTime(value);
|
||||||
|
int deltaValue = calendar.get(calendarType);
|
||||||
|
calendar.set(calendarType, deltaValue + delta);
|
||||||
|
return calendar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Calendar getCalendar(Date value) {
|
||||||
|
if (value == null) {
|
||||||
|
value = DateTimeUtils.getCurrDate();
|
||||||
|
}
|
||||||
|
|
||||||
|
Calendar calendar = new GregorianCalendar();
|
||||||
|
calendar.setTime(value);
|
||||||
|
return calendar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Date getDateDelta(Date value, int calendarType, int delta) {
|
||||||
|
Calendar calendar = DateTimeUtils.getCalendarDelta(value, calendarType, delta);
|
||||||
|
return calendar.getTime();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ public class SessionData implements Serializable {
|
|||||||
private static final long serialVersionUID = -764426911263559759L;
|
private static final long serialVersionUID = -764426911263559759L;
|
||||||
|
|
||||||
private List<Workgroup> userCentres;
|
private List<Workgroup> userCentres;
|
||||||
|
private List<Workgroup> userOnlyCentres;
|
||||||
private List<Workgroup> userWorkgroups;
|
private List<Workgroup> userWorkgroups;
|
||||||
private User currentUser;
|
private User currentUser;
|
||||||
private Map<Integer, List<Role>> workgroupRoles;
|
private Map<Integer, List<Role>> workgroupRoles;
|
||||||
@@ -75,4 +76,12 @@ public class SessionData implements Serializable {
|
|||||||
public Object getProperty(String key) {
|
public Object getProperty(String key) {
|
||||||
return properties.get(key);
|
return properties.get(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<Workgroup> getUserOnlyCentres() {
|
||||||
|
return userOnlyCentres;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserOnlyCentres(List<Workgroup> userOnlyCentres) {
|
||||||
|
this.userOnlyCentres = userOnlyCentres;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package info.bukova.isspst.dao;
|
||||||
|
|
||||||
|
import info.bukova.isspst.data.Limit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Pepa Rokos
|
||||||
|
*/
|
||||||
|
public interface LimitDao extends BaseDao<Limit> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package info.bukova.isspst.dao;
|
||||||
|
|
||||||
|
import info.bukova.isspst.data.Season;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Pepa Rokos
|
||||||
|
*/
|
||||||
|
public interface SeasonDao extends BaseDao<Season> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
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 {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
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,6 +1,9 @@
|
|||||||
package info.bukova.isspst.data;
|
package info.bukova.isspst.data;
|
||||||
|
|
||||||
import java.util.Date;
|
import org.hibernate.annotations.Cache;
|
||||||
|
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||||
|
import org.hibernate.search.annotations.Indexed;
|
||||||
|
import org.hibernate.search.annotations.IndexedEmbedded;
|
||||||
|
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
import javax.persistence.FetchType;
|
import javax.persistence.FetchType;
|
||||||
@@ -10,9 +13,7 @@ import javax.persistence.JoinColumn;
|
|||||||
import javax.persistence.ManyToOne;
|
import javax.persistence.ManyToOne;
|
||||||
import javax.persistence.MappedSuperclass;
|
import javax.persistence.MappedSuperclass;
|
||||||
import javax.persistence.Transient;
|
import javax.persistence.Transient;
|
||||||
|
import java.util.Date;
|
||||||
import org.hibernate.search.annotations.Indexed;
|
|
||||||
import org.hibernate.search.annotations.IndexedEmbedded;
|
|
||||||
|
|
||||||
@MappedSuperclass
|
@MappedSuperclass
|
||||||
@Indexed
|
@Indexed
|
||||||
@@ -29,10 +30,12 @@ public abstract class BaseData implements OwnedDataModel {
|
|||||||
@ManyToOne(fetch=FetchType.LAZY)
|
@ManyToOne(fetch=FetchType.LAZY)
|
||||||
@JoinColumn(name="OWNED_BY_ID")
|
@JoinColumn(name="OWNED_BY_ID")
|
||||||
@IndexedEmbedded
|
@IndexedEmbedded
|
||||||
|
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||||
private User ownedBy;
|
private User ownedBy;
|
||||||
@ManyToOne(fetch=FetchType.LAZY)
|
@ManyToOne(fetch=FetchType.LAZY)
|
||||||
@JoinColumn(name="MODIFIED_BY_ID")
|
@JoinColumn(name="MODIFIED_BY_ID")
|
||||||
@IndexedEmbedded
|
@IndexedEmbedded
|
||||||
|
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||||
private User modifiedBy;
|
private User modifiedBy;
|
||||||
@Transient
|
@Transient
|
||||||
private boolean valid;
|
private boolean valid;
|
||||||
|
|||||||
@@ -70,6 +70,18 @@ public class Invoicing extends BaseData implements Cloneable
|
|||||||
this.completed = completed;
|
this.completed = completed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getInvoiceNumbers() {
|
||||||
|
String ret = "";
|
||||||
|
for (InvoicingItem invNum : items) {
|
||||||
|
if (!ret.isEmpty()) {
|
||||||
|
ret += ", ";
|
||||||
|
}
|
||||||
|
ret += invNum.getInvoiceNumber();
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object clone() throws CloneNotSupportedException
|
public Object clone() throws CloneNotSupportedException
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
package info.bukova.isspst.data;
|
package info.bukova.isspst.data;
|
||||||
|
|
||||||
|
import org.hibernate.annotations.Cache;
|
||||||
|
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||||
|
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
import javax.persistence.FetchType;
|
import javax.persistence.FetchType;
|
||||||
@@ -11,6 +14,7 @@ import javax.persistence.Table;
|
|||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "JOBMAPPING")
|
@Table(name = "JOBMAPPING")
|
||||||
|
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||||
public class JobMapping {
|
public class JobMapping {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@@ -19,9 +23,11 @@ public class JobMapping {
|
|||||||
private int id;
|
private int id;
|
||||||
@ManyToOne(fetch = FetchType.EAGER)
|
@ManyToOne(fetch = FetchType.EAGER)
|
||||||
@JoinColumn(name = "MEMBER_ID")
|
@JoinColumn(name = "MEMBER_ID")
|
||||||
|
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||||
private Member member;
|
private Member member;
|
||||||
@ManyToOne(fetch = FetchType.EAGER)
|
@ManyToOne(fetch = FetchType.EAGER)
|
||||||
@JoinColumn(name = "ROLE_ID")
|
@JoinColumn(name = "ROLE_ID")
|
||||||
|
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||||
private Role role;
|
private Role role;
|
||||||
|
|
||||||
public JobMapping() {
|
public JobMapping() {
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
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,8 +1,9 @@
|
|||||||
package info.bukova.isspst.data;
|
package info.bukova.isspst.data;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import org.hibernate.annotations.Cache;
|
||||||
import java.util.Date;
|
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||||
import java.util.List;
|
import org.hibernate.annotations.LazyCollection;
|
||||||
|
import org.hibernate.annotations.LazyCollectionOption;
|
||||||
|
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
@@ -15,12 +16,13 @@ import javax.persistence.JoinColumn;
|
|||||||
import javax.persistence.JoinTable;
|
import javax.persistence.JoinTable;
|
||||||
import javax.persistence.ManyToMany;
|
import javax.persistence.ManyToMany;
|
||||||
import javax.persistence.Transient;
|
import javax.persistence.Transient;
|
||||||
|
import java.util.ArrayList;
|
||||||
import org.hibernate.annotations.LazyCollection;
|
import java.util.Date;
|
||||||
import org.hibernate.annotations.LazyCollectionOption;
|
import java.util.List;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
|
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
|
||||||
|
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||||
public abstract class Member implements DataModel {
|
public abstract class Member implements DataModel {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@@ -33,6 +35,7 @@ public abstract class Member implements DataModel {
|
|||||||
@ManyToMany
|
@ManyToMany
|
||||||
@LazyCollection(LazyCollectionOption.TRUE)
|
@LazyCollection(LazyCollectionOption.TRUE)
|
||||||
@JoinTable(name="MEMBER_PARENT", joinColumns={@JoinColumn(name="MEMBER_ID")}, inverseJoinColumns={@JoinColumn(name="PARENT_ID")})
|
@JoinTable(name="MEMBER_PARENT", joinColumns={@JoinColumn(name="MEMBER_ID")}, inverseJoinColumns={@JoinColumn(name="PARENT_ID")})
|
||||||
|
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||||
private List<Workgroup> parents;
|
private List<Workgroup> parents;
|
||||||
@Transient
|
@Transient
|
||||||
private boolean valid;
|
private boolean valid;
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ package info.bukova.isspst.data;
|
|||||||
|
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.JoinColumn;
|
||||||
|
import javax.persistence.OneToOne;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@@ -17,6 +19,10 @@ public class NumberSeries extends BaseSimpleData
|
|||||||
@Column(name = "NUMBER")
|
@Column(name = "NUMBER")
|
||||||
private int number;
|
private int number;
|
||||||
|
|
||||||
|
@OneToOne
|
||||||
|
@JoinColumn(name = "SEASON_ID")
|
||||||
|
private Season season;
|
||||||
|
|
||||||
public String getCurrentNumber()
|
public String getCurrentNumber()
|
||||||
{
|
{
|
||||||
return String.format("%s%06d", this.getPrefix(), this.getNumber());
|
return String.format("%s%06d", this.getPrefix(), this.getNumber());
|
||||||
@@ -51,4 +57,12 @@ public class NumberSeries extends BaseSimpleData
|
|||||||
{
|
{
|
||||||
this.number = number;
|
this.number = number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Season getSeason() {
|
||||||
|
return season;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSeason(Season season) {
|
||||||
|
this.season = season;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,21 +1,6 @@
|
|||||||
package info.bukova.isspst.data;
|
package info.bukova.isspst.data;
|
||||||
|
|
||||||
import info.bukova.isspst.Constants;
|
import info.bukova.isspst.Constants;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.persistence.AttributeOverride;
|
|
||||||
import javax.persistence.AttributeOverrides;
|
|
||||||
import javax.persistence.CascadeType;
|
|
||||||
import javax.persistence.Column;
|
|
||||||
import javax.persistence.Embedded;
|
|
||||||
import javax.persistence.Entity;
|
|
||||||
import javax.persistence.OneToMany;
|
|
||||||
import javax.persistence.Table;
|
|
||||||
|
|
||||||
import org.hibernate.annotations.LazyCollection;
|
import org.hibernate.annotations.LazyCollection;
|
||||||
import org.hibernate.annotations.LazyCollectionOption;
|
import org.hibernate.annotations.LazyCollectionOption;
|
||||||
import org.hibernate.search.annotations.Analyze;
|
import org.hibernate.search.annotations.Analyze;
|
||||||
@@ -24,10 +9,26 @@ import org.hibernate.search.annotations.Index;
|
|||||||
import org.hibernate.search.annotations.Indexed;
|
import org.hibernate.search.annotations.Indexed;
|
||||||
import org.hibernate.search.annotations.IndexedEmbedded;
|
import org.hibernate.search.annotations.IndexedEmbedded;
|
||||||
|
|
||||||
|
import javax.persistence.AttributeOverride;
|
||||||
|
import javax.persistence.AttributeOverrides;
|
||||||
|
import javax.persistence.CascadeType;
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Embedded;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.FetchType;
|
||||||
|
import javax.persistence.JoinColumn;
|
||||||
|
import javax.persistence.ManyToOne;
|
||||||
|
import javax.persistence.OneToMany;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "ORDERS")
|
@Table(name = "ORDERS")
|
||||||
@Indexed
|
@Indexed
|
||||||
public class Order extends BaseData implements Cloneable
|
public class Order extends BaseData implements Cloneable, SeasonsAware
|
||||||
{
|
{
|
||||||
|
|
||||||
@Column(name = "NUMSER")
|
@Column(name = "NUMSER")
|
||||||
@@ -121,6 +122,10 @@ public class Order extends BaseData implements Cloneable
|
|||||||
@Column(name = "DELIVERED")
|
@Column(name = "DELIVERED")
|
||||||
private boolean delivered;
|
private boolean delivered;
|
||||||
|
|
||||||
|
@ManyToOne(fetch = FetchType.EAGER)
|
||||||
|
@JoinColumn(name = "SEASON_ID")
|
||||||
|
private Season season;
|
||||||
|
|
||||||
public Order()
|
public Order()
|
||||||
{
|
{
|
||||||
this.items = new ArrayList<OrderItem>();
|
this.items = new ArrayList<OrderItem>();
|
||||||
@@ -288,4 +293,12 @@ public class Order extends BaseData implements Cloneable
|
|||||||
cloned.setTotal(new BigDecimal(this.getTotal().toString()));
|
cloned.setTotal(new BigDecimal(this.getTotal().toString()));
|
||||||
return cloned;
|
return cloned;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Season getSeason() {
|
||||||
|
return season;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSeason(Season season) {
|
||||||
|
this.season = season;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
package info.bukova.isspst.data;
|
package info.bukova.isspst.data;
|
||||||
|
|
||||||
import info.bukova.isspst.Constants;
|
import info.bukova.isspst.Constants;
|
||||||
|
import org.hibernate.annotations.Cache;
|
||||||
|
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||||
|
import org.springframework.security.core.GrantedAuthority;
|
||||||
|
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
@@ -8,10 +11,9 @@ import javax.persistence.EnumType;
|
|||||||
import javax.persistence.Enumerated;
|
import javax.persistence.Enumerated;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
|
|
||||||
import org.springframework.security.core.GrantedAuthority;
|
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name="PERMISSION")
|
@Table(name="PERMISSION")
|
||||||
|
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||||
public class Permission extends BaseSimpleData implements GrantedAuthority {
|
public class Permission extends BaseSimpleData implements GrantedAuthority {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
package info.bukova.isspst.data;
|
package info.bukova.isspst.data;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import org.hibernate.search.annotations.Indexed;
|
||||||
import java.util.ArrayList;
|
import org.hibernate.search.annotations.IndexedEmbedded;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.persistence.CascadeType;
|
import javax.persistence.CascadeType;
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
@@ -11,9 +9,10 @@ import javax.persistence.Entity;
|
|||||||
import javax.persistence.FetchType;
|
import javax.persistence.FetchType;
|
||||||
import javax.persistence.OneToMany;
|
import javax.persistence.OneToMany;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
|
import java.math.BigDecimal;
|
||||||
import org.hibernate.search.annotations.Indexed;
|
import java.util.ArrayList;
|
||||||
import org.hibernate.search.annotations.IndexedEmbedded;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "REQUIREMENT")
|
@Table(name = "REQUIREMENT")
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
package info.bukova.isspst.data;
|
package info.bukova.isspst.data;
|
||||||
|
|
||||||
import info.bukova.isspst.Constants;
|
import info.bukova.isspst.Constants;
|
||||||
|
import org.hibernate.annotations.Cache;
|
||||||
import java.util.ArrayList;
|
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||||
import java.util.Date;
|
import org.hibernate.annotations.LazyCollection;
|
||||||
import java.util.List;
|
import org.hibernate.annotations.LazyCollectionOption;
|
||||||
|
import org.hibernate.search.annotations.Analyze;
|
||||||
|
import org.hibernate.search.annotations.Field;
|
||||||
|
import org.hibernate.search.annotations.Index;
|
||||||
|
import org.hibernate.search.annotations.Indexed;
|
||||||
|
|
||||||
import javax.persistence.CascadeType;
|
import javax.persistence.CascadeType;
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
@@ -16,17 +20,14 @@ import javax.persistence.ManyToOne;
|
|||||||
import javax.persistence.MappedSuperclass;
|
import javax.persistence.MappedSuperclass;
|
||||||
import javax.persistence.OneToMany;
|
import javax.persistence.OneToMany;
|
||||||
import javax.persistence.OrderBy;
|
import javax.persistence.OrderBy;
|
||||||
|
import java.util.ArrayList;
|
||||||
import org.hibernate.annotations.LazyCollection;
|
import java.util.Date;
|
||||||
import org.hibernate.annotations.LazyCollectionOption;
|
import java.util.List;
|
||||||
import org.hibernate.search.annotations.Analyze;
|
|
||||||
import org.hibernate.search.annotations.Field;
|
|
||||||
import org.hibernate.search.annotations.Index;
|
|
||||||
import org.hibernate.search.annotations.Indexed;
|
|
||||||
|
|
||||||
@MappedSuperclass
|
@MappedSuperclass
|
||||||
@Indexed
|
@Indexed
|
||||||
public class RequirementBase extends BaseData implements FilterableRequirement {
|
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||||
|
public class RequirementBase extends BaseData implements FilterableRequirement, SeasonsAware {
|
||||||
|
|
||||||
@ManyToOne(fetch = FetchType.LAZY)
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
@JoinColumn(name = "TYPE_ID")
|
@JoinColumn(name = "TYPE_ID")
|
||||||
@@ -45,9 +46,11 @@ public class RequirementBase extends BaseData implements FilterableRequirement {
|
|||||||
private String description;
|
private String description;
|
||||||
@ManyToOne(fetch = FetchType.EAGER)
|
@ManyToOne(fetch = FetchType.EAGER)
|
||||||
@JoinColumn(name = "CENTRE_ID")
|
@JoinColumn(name = "CENTRE_ID")
|
||||||
|
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||||
private Workgroup centre;
|
private Workgroup centre;
|
||||||
@ManyToOne(fetch = FetchType.EAGER)
|
@ManyToOne(fetch = FetchType.EAGER)
|
||||||
@JoinColumn(name = "WORKGROUP_ID")
|
@JoinColumn(name = "WORKGROUP_ID")
|
||||||
|
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||||
private Workgroup workgroup;
|
private Workgroup workgroup;
|
||||||
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true)
|
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true)
|
||||||
@LazyCollection(LazyCollectionOption.TRUE)
|
@LazyCollection(LazyCollectionOption.TRUE)
|
||||||
@@ -56,6 +59,10 @@ public class RequirementBase extends BaseData implements FilterableRequirement {
|
|||||||
@Column(name = "STATE")
|
@Column(name = "STATE")
|
||||||
@Enumerated(EnumType.ORDINAL)
|
@Enumerated(EnumType.ORDINAL)
|
||||||
private RequirementState state;
|
private RequirementState state;
|
||||||
|
@ManyToOne(fetch = FetchType.EAGER)
|
||||||
|
@JoinColumn(name = "SEASON_ID")
|
||||||
|
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||||
|
private Season season;
|
||||||
|
|
||||||
public RequirementBase() {
|
public RequirementBase() {
|
||||||
authorization = new ArrayList<AuthItem>();
|
authorization = new ArrayList<AuthItem>();
|
||||||
@@ -152,4 +159,11 @@ public class RequirementBase extends BaseData implements FilterableRequirement {
|
|||||||
return authorization.get(authorization.size() - 1).getAuthDate();
|
return authorization.get(authorization.size() - 1).getAuthDate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Season getSeason() {
|
||||||
|
return season;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSeason(Season season) {
|
||||||
|
this.season = season;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
package info.bukova.isspst.data;
|
package info.bukova.isspst.data;
|
||||||
|
|
||||||
import info.bukova.isspst.Constants;
|
import info.bukova.isspst.Constants;
|
||||||
|
import org.hibernate.annotations.Cache;
|
||||||
import java.util.ArrayList;
|
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||||
import java.util.List;
|
import org.hibernate.annotations.LazyCollection;
|
||||||
|
import org.hibernate.annotations.LazyCollectionOption;
|
||||||
|
import org.springframework.security.core.GrantedAuthority;
|
||||||
|
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
@@ -11,13 +13,12 @@ import javax.persistence.JoinColumn;
|
|||||||
import javax.persistence.JoinTable;
|
import javax.persistence.JoinTable;
|
||||||
import javax.persistence.ManyToMany;
|
import javax.persistence.ManyToMany;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
|
import java.util.ArrayList;
|
||||||
import org.hibernate.annotations.LazyCollection;
|
import java.util.List;
|
||||||
import org.hibernate.annotations.LazyCollectionOption;
|
|
||||||
import org.springframework.security.core.GrantedAuthority;
|
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name="ROLE")
|
@Table(name="ROLE")
|
||||||
|
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||||
public class Role extends BaseSimpleData implements GrantedAuthority, DataModel {
|
public class Role extends BaseSimpleData implements GrantedAuthority, DataModel {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -32,6 +33,7 @@ public class Role extends BaseSimpleData implements GrantedAuthority, DataModel
|
|||||||
@ManyToMany
|
@ManyToMany
|
||||||
@LazyCollection(LazyCollectionOption.FALSE)
|
@LazyCollection(LazyCollectionOption.FALSE)
|
||||||
@JoinTable(name="ROLE_PERMISSION", joinColumns={@JoinColumn(name="ROLE_ID")}, inverseJoinColumns={@JoinColumn(name="PERMISSION_ID")})
|
@JoinTable(name="ROLE_PERMISSION", joinColumns={@JoinColumn(name="ROLE_ID")}, inverseJoinColumns={@JoinColumn(name="PERMISSION_ID")})
|
||||||
|
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||||
private List<Permission> permissions;
|
private List<Permission> permissions;
|
||||||
@Column(name = "WORKGROUP")
|
@Column(name = "WORKGROUP")
|
||||||
private boolean workgroup;
|
private boolean workgroup;
|
||||||
|
|||||||
@@ -0,0 +1,83 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package info.bukova.isspst.data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Pepa Rokos
|
||||||
|
*/
|
||||||
|
public interface SeasonsAware {
|
||||||
|
public Season getSeason();
|
||||||
|
}
|
||||||
@@ -7,11 +7,7 @@ import org.hibernate.annotations.LazyCollection;
|
|||||||
import org.hibernate.annotations.LazyCollectionOption;
|
import org.hibernate.annotations.LazyCollectionOption;
|
||||||
import org.hibernate.search.annotations.IndexedEmbedded;
|
import org.hibernate.search.annotations.IndexedEmbedded;
|
||||||
|
|
||||||
import javax.persistence.CascadeType;
|
import javax.persistence.*;
|
||||||
import javax.persistence.Column;
|
|
||||||
import javax.persistence.Entity;
|
|
||||||
import javax.persistence.OneToMany;
|
|
||||||
import javax.persistence.Table;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -20,6 +16,9 @@ import java.util.List;
|
|||||||
@Table(name = "SIGNED_DOCUMENTS")
|
@Table(name = "SIGNED_DOCUMENTS")
|
||||||
public class SignedDocument extends BaseData {
|
public class SignedDocument extends BaseData {
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
private String agendaName;
|
||||||
|
|
||||||
@Column(name = "MODULE_NAME", length = Constants.LEN_TEXT)
|
@Column(name = "MODULE_NAME", length = Constants.LEN_TEXT)
|
||||||
private String moduleName;
|
private String moduleName;
|
||||||
|
|
||||||
@@ -40,7 +39,10 @@ public class SignedDocument extends BaseData {
|
|||||||
@IndexedEmbedded
|
@IndexedEmbedded
|
||||||
private List<SignedDocumentItem> items;
|
private List<SignedDocumentItem> items;
|
||||||
|
|
||||||
public String getModuleName() {
|
public SignedDocument() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getModuleName() {
|
||||||
return moduleName;
|
return moduleName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,6 +83,9 @@ public class SignedDocument extends BaseData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getAgendaName() {
|
public String getAgendaName() {
|
||||||
|
if (!StringUtils.isNullOrEmpty(this.agendaName)) {
|
||||||
|
return this.agendaName;
|
||||||
|
}
|
||||||
|
|
||||||
if (StringUtils.isNullOrEmpty(this.moduleName)) {
|
if (StringUtils.isNullOrEmpty(this.moduleName)) {
|
||||||
return "";
|
return "";
|
||||||
@@ -95,7 +100,11 @@ public class SignedDocument extends BaseData {
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<SignedDocumentItem> getItems() {
|
public void setAgendaName(String agendaName) {
|
||||||
|
this.agendaName = agendaName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<SignedDocumentItem> getItems() {
|
||||||
return items;
|
return items;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ package info.bukova.isspst.data;
|
|||||||
|
|
||||||
import info.bukova.isspst.Constants;
|
import info.bukova.isspst.Constants;
|
||||||
import info.bukova.isspst.storage.EntityWithAttachment;
|
import info.bukova.isspst.storage.EntityWithAttachment;
|
||||||
|
import org.hibernate.annotations.Cache;
|
||||||
|
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||||
import org.hibernate.annotations.LazyCollection;
|
import org.hibernate.annotations.LazyCollection;
|
||||||
import org.hibernate.annotations.LazyCollectionOption;
|
import org.hibernate.annotations.LazyCollectionOption;
|
||||||
import org.hibernate.search.annotations.Analyze;
|
import org.hibernate.search.annotations.Analyze;
|
||||||
@@ -15,6 +17,7 @@ import javax.persistence.Column;
|
|||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
import javax.persistence.FetchType;
|
import javax.persistence.FetchType;
|
||||||
import javax.persistence.JoinColumn;
|
import javax.persistence.JoinColumn;
|
||||||
|
import javax.persistence.ManyToOne;
|
||||||
import javax.persistence.OneToMany;
|
import javax.persistence.OneToMany;
|
||||||
import javax.persistence.OneToOne;
|
import javax.persistence.OneToOne;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
@@ -26,10 +29,11 @@ import java.util.List;
|
|||||||
@Entity
|
@Entity
|
||||||
@Table(name = "TRIP_BILL")
|
@Table(name = "TRIP_BILL")
|
||||||
@Indexed
|
@Indexed
|
||||||
public class TripBill extends BaseData implements EntityWithAttachment {
|
public class TripBill extends BaseData implements EntityWithAttachment, SeasonsAware {
|
||||||
|
|
||||||
@OneToOne(fetch = FetchType.EAGER)
|
@OneToOne(fetch = FetchType.EAGER)
|
||||||
@JoinColumn(name = "REQUIREMENT_ID")
|
@JoinColumn(name = "REQUIREMENT_ID")
|
||||||
|
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||||
private TripRequirement requirement;
|
private TripRequirement requirement;
|
||||||
@Column(name = "RESULT_MESSAGE_DATE")
|
@Column(name = "RESULT_MESSAGE_DATE")
|
||||||
private Date resultMessageDate;
|
private Date resultMessageDate;
|
||||||
@@ -69,6 +73,10 @@ public class TripBill extends BaseData implements EntityWithAttachment {
|
|||||||
private Boolean paid;
|
private Boolean paid;
|
||||||
@Column(name = "PAID_DATE")
|
@Column(name = "PAID_DATE")
|
||||||
private Date paidDate;
|
private Date paidDate;
|
||||||
|
@ManyToOne(fetch = FetchType.EAGER)
|
||||||
|
@JoinColumn(name = "SEASON_ID")
|
||||||
|
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||||
|
private Season season;
|
||||||
|
|
||||||
public TripBill() {
|
public TripBill() {
|
||||||
billItems = new ArrayList<TripBillItem>();
|
billItems = new ArrayList<TripBillItem>();
|
||||||
@@ -206,4 +214,13 @@ public class TripBill extends BaseData implements EntityWithAttachment {
|
|||||||
public void setPaidDate(Date paidDate) {
|
public void setPaidDate(Date paidDate) {
|
||||||
this.paidDate = paidDate;
|
this.paidDate = paidDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Season getSeason() {
|
||||||
|
return season;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSeason(Season season) {
|
||||||
|
this.season = season;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
package info.bukova.isspst.data;
|
package info.bukova.isspst.data;
|
||||||
|
|
||||||
import info.bukova.isspst.storage.EntityWithAttachment;
|
import info.bukova.isspst.storage.EntityWithAttachment;
|
||||||
|
import org.hibernate.annotations.LazyCollection;
|
||||||
import java.math.BigDecimal;
|
import org.hibernate.annotations.LazyCollectionOption;
|
||||||
import java.util.ArrayList;
|
import org.hibernate.search.annotations.Analyze;
|
||||||
import java.util.Date;
|
import org.hibernate.search.annotations.Field;
|
||||||
import java.util.List;
|
import org.hibernate.search.annotations.Index;
|
||||||
|
import org.hibernate.search.annotations.Indexed;
|
||||||
|
import org.hibernate.search.annotations.IndexedEmbedded;
|
||||||
|
|
||||||
import javax.persistence.CascadeType;
|
import javax.persistence.CascadeType;
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
@@ -16,14 +18,10 @@ import javax.persistence.JoinTable;
|
|||||||
import javax.persistence.ManyToMany;
|
import javax.persistence.ManyToMany;
|
||||||
import javax.persistence.OneToMany;
|
import javax.persistence.OneToMany;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
|
import java.math.BigDecimal;
|
||||||
import org.hibernate.annotations.LazyCollection;
|
import java.util.ArrayList;
|
||||||
import org.hibernate.annotations.LazyCollectionOption;
|
import java.util.Date;
|
||||||
import org.hibernate.search.annotations.Analyze;
|
import java.util.List;
|
||||||
import org.hibernate.search.annotations.Field;
|
|
||||||
import org.hibernate.search.annotations.Index;
|
|
||||||
import org.hibernate.search.annotations.Indexed;
|
|
||||||
import org.hibernate.search.annotations.IndexedEmbedded;
|
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "TRIPREQUIREMENT")
|
@Table(name = "TRIPREQUIREMENT")
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
package info.bukova.isspst.data;
|
package info.bukova.isspst.data;
|
||||||
|
|
||||||
import info.bukova.isspst.StringUtils;
|
import info.bukova.isspst.StringUtils;
|
||||||
|
import org.hibernate.annotations.Cache;
|
||||||
import java.util.ArrayList;
|
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||||
import java.util.List;
|
import org.hibernate.search.annotations.Analyze;
|
||||||
|
import org.hibernate.search.annotations.Field;
|
||||||
|
import org.hibernate.search.annotations.Index;
|
||||||
|
import org.hibernate.search.annotations.Indexed;
|
||||||
|
import org.springframework.security.core.userdetails.UserDetails;
|
||||||
|
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
import javax.persistence.Embedded;
|
import javax.persistence.Embedded;
|
||||||
@@ -13,16 +17,13 @@ import javax.persistence.JoinColumn;
|
|||||||
import javax.persistence.JoinTable;
|
import javax.persistence.JoinTable;
|
||||||
import javax.persistence.ManyToMany;
|
import javax.persistence.ManyToMany;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
|
import java.util.ArrayList;
|
||||||
import org.hibernate.search.annotations.Analyze;
|
import java.util.List;
|
||||||
import org.hibernate.search.annotations.Field;
|
|
||||||
import org.hibernate.search.annotations.Index;
|
|
||||||
import org.hibernate.search.annotations.Indexed;
|
|
||||||
import org.springframework.security.core.userdetails.UserDetails;
|
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name="USER")
|
@Table(name="USER")
|
||||||
@Indexed
|
@Indexed
|
||||||
|
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||||
public class User extends Member implements UserDetails, DataModel {
|
public class User extends Member implements UserDetails, DataModel {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -50,6 +51,7 @@ public class User extends Member implements UserDetails, DataModel {
|
|||||||
private boolean notify;
|
private boolean notify;
|
||||||
@ManyToMany(fetch=FetchType.EAGER)
|
@ManyToMany(fetch=FetchType.EAGER)
|
||||||
@JoinTable(name="USER_ROLE", joinColumns={@JoinColumn(name="USER_ID")}, inverseJoinColumns={@JoinColumn(name="ROLE_ID")})
|
@JoinTable(name="USER_ROLE", joinColumns={@JoinColumn(name="USER_ID")}, inverseJoinColumns={@JoinColumn(name="ROLE_ID")})
|
||||||
|
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||||
private List<Role> authorities;
|
private List<Role> authorities;
|
||||||
@Column(name="SETTINGS", length=1048576)
|
@Column(name="SETTINGS", length=1048576)
|
||||||
private String settings;
|
private String settings;
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
package info.bukova.isspst.data;
|
package info.bukova.isspst.data;
|
||||||
|
|
||||||
import info.bukova.isspst.StringUtils;
|
import info.bukova.isspst.StringUtils;
|
||||||
|
import org.hibernate.annotations.Cache;
|
||||||
import java.io.Serializable;
|
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||||
import java.math.BigDecimal;
|
import org.hibernate.annotations.LazyCollection;
|
||||||
import java.util.ArrayList;
|
import org.hibernate.annotations.LazyCollectionOption;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.persistence.CascadeType;
|
import javax.persistence.CascadeType;
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
@@ -17,12 +16,14 @@ import javax.persistence.ManyToMany;
|
|||||||
import javax.persistence.ManyToOne;
|
import javax.persistence.ManyToOne;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
import javax.persistence.Transient;
|
import javax.persistence.Transient;
|
||||||
|
import java.io.Serializable;
|
||||||
import org.hibernate.annotations.LazyCollection;
|
import java.math.BigDecimal;
|
||||||
import org.hibernate.annotations.LazyCollectionOption;
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "WORKGROUP")
|
@Table(name = "WORKGROUP")
|
||||||
|
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||||
public class Workgroup extends Member implements OwnedDataModel, Serializable {
|
public class Workgroup extends Member implements OwnedDataModel, Serializable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -37,6 +38,7 @@ public class Workgroup extends Member implements OwnedDataModel, Serializable {
|
|||||||
@ManyToMany(cascade = {CascadeType.ALL})
|
@ManyToMany(cascade = {CascadeType.ALL})
|
||||||
@LazyCollection(LazyCollectionOption.TRUE)
|
@LazyCollection(LazyCollectionOption.TRUE)
|
||||||
@JoinTable(name="WORKGROUP_MEMBER", joinColumns={@JoinColumn(name="WORKGROUP_ID")}, inverseJoinColumns={@JoinColumn(name="JOBMAPPING_ID")})
|
@JoinTable(name="WORKGROUP_MEMBER", joinColumns={@JoinColumn(name="WORKGROUP_ID")}, inverseJoinColumns={@JoinColumn(name="JOBMAPPING_ID")})
|
||||||
|
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||||
private List<JobMapping> members;
|
private List<JobMapping> members;
|
||||||
@Column(name = "CENTRE")
|
@Column(name = "CENTRE")
|
||||||
private boolean centre;
|
private boolean centre;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package info.bukova.isspst.filters;
|
package info.bukova.isspst.filters;
|
||||||
|
|
||||||
|
import info.bukova.isspst.BigDecimalUtils;
|
||||||
import info.bukova.isspst.BooleanUtils;
|
import info.bukova.isspst.BooleanUtils;
|
||||||
import info.bukova.isspst.DateTimeUtils;
|
import info.bukova.isspst.DateTimeUtils;
|
||||||
import info.bukova.isspst.StringUtils;
|
import info.bukova.isspst.StringUtils;
|
||||||
@@ -48,7 +49,8 @@ public class RequirementFilter implements Filter<Requirement>
|
|||||||
boolean foundDeliveryDate = DateTimeUtils.isEqualByDateForFilter(item.getDeliveryDate(), condition.getDeliveryDate());
|
boolean foundDeliveryDate = DateTimeUtils.isEqualByDateForFilter(item.getDeliveryDate(), condition.getDeliveryDate());
|
||||||
boolean foundUser = User.isEqualByUserForFilter(item.getOwnedBy(), condition.getOwnedBy());
|
boolean foundUser = User.isEqualByUserForFilter(item.getOwnedBy(), condition.getOwnedBy());
|
||||||
boolean foundProject = BooleanUtils.isEqualByBooleanValue(item.getProject(), condition.getProject());
|
boolean foundProject = BooleanUtils.isEqualByBooleanValue(item.getProject(), condition.getProject());
|
||||||
return (foundNumser && foundReqDate && foundCenter && foundDescription && foundDeliveryDate && foundUser && foundProject);
|
boolean foundSumTotal = BigDecimalUtils.isEqualByDecimalForFilter(item.getSumTotal(), condition.getSumTotal());
|
||||||
|
return (foundNumser && foundReqDate && foundCenter && foundDescription && foundDeliveryDate && foundUser && foundProject && foundSumTotal);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Factory
|
@Factory
|
||||||
|
|||||||
@@ -12,8 +12,10 @@ import info.bukova.isspst.services.settings.GlobalSettingsService;
|
|||||||
import info.bukova.isspst.services.tripbill.TripBillApprovalService;
|
import info.bukova.isspst.services.tripbill.TripBillApprovalService;
|
||||||
import info.bukova.isspst.services.users.UserService;
|
import info.bukova.isspst.services.users.UserService;
|
||||||
import info.bukova.isspst.storage.FileStorage;
|
import info.bukova.isspst.storage.FileStorage;
|
||||||
|
import net.sf.jasperreports.engine.JRParameter;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -31,6 +33,8 @@ public class ParamFiller {
|
|||||||
private GlobalSettingsService settingService;
|
private GlobalSettingsService settingService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private TripBillApprovalService tripBillApprovalService;
|
private TripBillApprovalService tripBillApprovalService;
|
||||||
|
@Autowired
|
||||||
|
private HttpServletRequest req;
|
||||||
|
|
||||||
public void fill() {
|
public void fill() {
|
||||||
if (definition.getDataSet() == null || definition.getDataSet().isEmpty()) {
|
if (definition.getDataSet() == null || definition.getDataSet().isEmpty()) {
|
||||||
@@ -95,6 +99,7 @@ public class ParamFiller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
definition.setParam("P_LOGO", storage.serverPath(settingService.getSettings().getLogoFile()));
|
definition.setParam("P_LOGO", storage.serverPath(settingService.getSettings().getLogoFile()));
|
||||||
|
definition.setParam(JRParameter.REPORT_LOCALE, req.getLocale());
|
||||||
|
|
||||||
Address mainAddress = settingService.getSettings().getMainAddress();
|
Address mainAddress = settingService.getSettings().getMainAddress();
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ public class Report {
|
|||||||
private boolean hasSettings;
|
private boolean hasSettings;
|
||||||
private boolean singleRecord;
|
private boolean singleRecord;
|
||||||
private boolean hasCondition;
|
private boolean hasCondition;
|
||||||
|
private String property;
|
||||||
|
|
||||||
public Report() {
|
public Report() {
|
||||||
this.reportId = 0;
|
this.reportId = 0;
|
||||||
@@ -60,6 +61,11 @@ public class Report {
|
|||||||
this.singleRecord = singleRecord;
|
this.singleRecord = singleRecord;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Report(long reportId, boolean signable, String name, String jasperFile, boolean hasSettings, boolean singleRecord, String property) {
|
||||||
|
this(reportId, signable, name, jasperFile, hasSettings, singleRecord);
|
||||||
|
this.property = property;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param reportId
|
* @param reportId
|
||||||
@@ -138,4 +144,12 @@ public class Report {
|
|||||||
public void setSignable(boolean signable) {
|
public void setSignable(boolean signable) {
|
||||||
this.signable = signable;
|
this.signable = signable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getProperty() {
|
||||||
|
return property;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProperty(String property) {
|
||||||
|
this.property = property;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,6 +73,9 @@ public class ReportController {
|
|||||||
} catch (ReportException e) {
|
} catch (ReportException e) {
|
||||||
logger.error("Report generation error: " + e.getMessage());
|
logger.error("Report generation error: " + e.getMessage());
|
||||||
writeError(os, e);
|
writeError(os, e);
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("Report generation error: " + e.getMessage());
|
||||||
|
writeError(os, e);
|
||||||
} finally {
|
} finally {
|
||||||
if (os != null) {
|
if (os != null) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -7,16 +7,6 @@ import info.bukova.isspst.data.UserSettingsData;
|
|||||||
import info.bukova.isspst.data.Workgroup;
|
import info.bukova.isspst.data.Workgroup;
|
||||||
import info.bukova.isspst.services.users.UserService;
|
import info.bukova.isspst.services.users.UserService;
|
||||||
import info.bukova.isspst.services.workgroups.WorkgroupService;
|
import info.bukova.isspst.services.workgroups.WorkgroupService;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import javax.servlet.ServletException;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -24,6 +14,14 @@ import org.springframework.security.core.Authentication;
|
|||||||
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
|
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
|
||||||
import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;
|
import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;
|
||||||
|
|
||||||
|
import javax.servlet.ServletException;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public class LoginSuccessHandler extends SavedRequestAwareAuthenticationSuccessHandler implements AuthenticationSuccessHandler {
|
public class LoginSuccessHandler extends SavedRequestAwareAuthenticationSuccessHandler implements AuthenticationSuccessHandler {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -45,6 +43,7 @@ public class LoginSuccessHandler extends SavedRequestAwareAuthenticationSuccessH
|
|||||||
logger.info("User " + u.getUsername() + " logged in");
|
logger.info("User " + u.getUsername() + " logged in");
|
||||||
|
|
||||||
sessionData.setUserCentres(workgroupService.getUserCentres((User) auth.getPrincipal()));
|
sessionData.setUserCentres(workgroupService.getUserCentres((User) auth.getPrincipal()));
|
||||||
|
sessionData.setUserOnlyCentres(workgroupService.getUserCentres((User) auth.getPrincipal(), true));
|
||||||
sessionData.setUserWorkgroups(workgroupService.getUserWorkgroups((User) auth.getPrincipal()));
|
sessionData.setUserWorkgroups(workgroupService.getUserWorkgroups((User) auth.getPrincipal()));
|
||||||
workgroupService.loadParents(u);
|
workgroupService.loadParents(u);
|
||||||
sessionData.setCurrentUser(u);
|
sessionData.setCurrentUser(u);
|
||||||
|
|||||||
@@ -38,6 +38,8 @@ public abstract class AbstractService<T extends DataModel> implements Service<T>
|
|||||||
@Autowired
|
@Autowired
|
||||||
protected SessionData sessionData;
|
protected SessionData sessionData;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
protected HqlDataFilter hqlFilter;
|
||||||
|
@Autowired
|
||||||
protected QueryDao queryDao;
|
protected QueryDao queryDao;
|
||||||
private DocumentFileStorage documentFileStorage;
|
private DocumentFileStorage documentFileStorage;
|
||||||
|
|
||||||
@@ -88,6 +90,50 @@ public abstract class AbstractService<T extends DataModel> implements Service<T>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected Query filterQuery(Query q) {
|
||||||
|
return filterQuery(q, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Query filterQuery(Query q, HqlDataFilter aditFilter) {
|
||||||
|
HqlDataFilter f = hqlFilter;
|
||||||
|
try {
|
||||||
|
if (((f.getWhere() == null || f.getWhere().isEmpty())
|
||||||
|
&& (f.getOrderBy() == null || f.getOrderBy().isEmpty()))
|
||||||
|
&& ((aditFilter.getWhere() == null || aditFilter.getWhere().isEmpty())
|
||||||
|
&& (aditFilter.getOrderBy() == null || aditFilter.getOrderBy().isEmpty()))) {
|
||||||
|
return q;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
f = new HqlDataFilter(); // pri volani mimo web request filtr z requestu neresime
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean isAplicable = false;
|
||||||
|
if (f.getDataClass() != null) {
|
||||||
|
for (Class<?> clazz : getEntityClasses()) {
|
||||||
|
if (f.getDataClass().isAssignableFrom(clazz)) {
|
||||||
|
isAplicable = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String hql;
|
||||||
|
if (isAplicable) {
|
||||||
|
hql = HqlUtils.buildHql(q.getQueryString(), f);
|
||||||
|
} else {
|
||||||
|
hql = q.getQueryString();
|
||||||
|
}
|
||||||
|
|
||||||
|
hql = HqlUtils.addOrderBy(HqlUtils.addAndWhere(hql, aditFilter), aditFilter);
|
||||||
|
Query newQuery = dao.getQuery(hql);
|
||||||
|
|
||||||
|
if (isAplicable) {
|
||||||
|
HqlUtils.addParameters(newQuery, f);
|
||||||
|
}
|
||||||
|
|
||||||
|
HqlUtils.addParameters(newQuery, aditFilter);
|
||||||
|
return newQuery;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@PreAuthorize("hasPermission(this, 'PERM_ADD')")
|
@PreAuthorize("hasPermission(this, 'PERM_ADD')")
|
||||||
public final T create() {
|
public final T create() {
|
||||||
@@ -199,8 +245,10 @@ public abstract class AbstractService<T extends DataModel> implements Service<T>
|
|||||||
if (getModule() != null && !getModule().isActive()) {
|
if (getModule() != null && !getModule().isActive()) {
|
||||||
throw new ModuleNotActiveException();
|
throw new ModuleNotActiveException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Query q = dao.getQuery("from " + dao.getEntityName());
|
||||||
|
|
||||||
return dao.getAll();
|
return filterQuery(q).list();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -0,0 +1,87 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,90 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,13 +3,12 @@ package info.bukova.isspst.services.dbinfo;
|
|||||||
import info.bukova.isspst.Constants;
|
import info.bukova.isspst.Constants;
|
||||||
import info.bukova.isspst.data.DbInfo;
|
import info.bukova.isspst.data.DbInfo;
|
||||||
import info.bukova.isspst.services.AbstractService;
|
import info.bukova.isspst.services.AbstractService;
|
||||||
|
import org.hibernate.SQLQuery;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.hibernate.SQLQuery;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
public class DbInfoServiceImpl extends AbstractService<DbInfo> implements DbInfoService
|
public class DbInfoServiceImpl extends AbstractService<DbInfo> implements DbInfoService
|
||||||
{
|
{
|
||||||
private DbInfo getDbInfo()
|
private DbInfo getDbInfo()
|
||||||
@@ -142,6 +141,76 @@ public class DbInfoServiceImpl extends AbstractService<DbInfo> implements DbInfo
|
|||||||
sq.executeUpdate();
|
sq.executeUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (dbVersion > 0 && dbVersion < 6) {
|
||||||
|
sql = "INSERT INTO SEASON(DESCRIPTION, VALID_FROM, VALID_TO, ACTIVE) " +
|
||||||
|
"VALUES ('2015', '2015-01-01', '2015-12-31', 0)";
|
||||||
|
sq = dao.getSession().createSQLQuery(sql);
|
||||||
|
sq.executeUpdate();
|
||||||
|
|
||||||
|
sql = "INSERT INTO SEASON(DESCRIPTION, VALID_FROM, VALID_TO, ACTIVE) " +
|
||||||
|
"VALUES ('2016', '2016-01-01', NULL, 1)";
|
||||||
|
sq = dao.getSession().createSQLQuery(sql);
|
||||||
|
sq.executeUpdate();
|
||||||
|
|
||||||
|
sql = "UPDATE NUMBERSERIES SET SEASON_ID = 2";
|
||||||
|
sq = dao.getSession().createSQLQuery(sql);
|
||||||
|
sq.executeUpdate();
|
||||||
|
|
||||||
|
sql = "INSERT INTO NUMBERSERIES(MODULE, PREFIX, NUMBER, SEASON_ID) " +
|
||||||
|
"VALUES ('REQUIREMENTS', 'P', 2528, 1)";
|
||||||
|
sq = dao.getSession().createSQLQuery(sql);
|
||||||
|
sq.executeUpdate();
|
||||||
|
|
||||||
|
sql = "INSERT INTO NUMBERSERIES(MODULE, PREFIX, NUMBER, SEASON_ID) " +
|
||||||
|
"VALUES ('ORDER', 'OBJ', 55, 1)";
|
||||||
|
sq = dao.getSession().createSQLQuery(sql);
|
||||||
|
sq.executeUpdate();
|
||||||
|
|
||||||
|
// rozdeleni dat do sezon
|
||||||
|
sql = "UPDATE REQUIREMENT SET SEASON_ID = 2 WHERE NUMSER LIKE 'P16%'";
|
||||||
|
sq = dao.getSession().createSQLQuery(sql);
|
||||||
|
sq.executeUpdate();
|
||||||
|
sql = "UPDATE REQUIREMENT SET SEASON_ID = 1 WHERE NUMSER LIKE 'P0%'";
|
||||||
|
sq = dao.getSession().createSQLQuery(sql);
|
||||||
|
sq.executeUpdate();
|
||||||
|
|
||||||
|
sql = "UPDATE TRIPREQUIREMENT SET SEASON_ID = 2 WHERE NUMSER LIKE 'P16%'";
|
||||||
|
sq = dao.getSession().createSQLQuery(sql);
|
||||||
|
sq.executeUpdate();
|
||||||
|
sql = "UPDATE TRIPREQUIREMENT SET SEASON_ID = 1 WHERE NUMSER LIKE 'P0%'";
|
||||||
|
sq = dao.getSession().createSQLQuery(sql);
|
||||||
|
sq.executeUpdate();
|
||||||
|
|
||||||
|
sql = "UPDATE ORDERS SET SEASON_ID = 2 WHERE NUMSER LIKE 'OBJ16%'";
|
||||||
|
sq = dao.getSession().createSQLQuery(sql);
|
||||||
|
sq.executeUpdate();
|
||||||
|
sql = "UPDATE ORDERS SET SEASON_ID = 1 WHERE NUMSER LIKE 'OBJ0%'";
|
||||||
|
sq = dao.getSession().createSQLQuery(sql);
|
||||||
|
sq.executeUpdate();
|
||||||
|
|
||||||
|
sql = "UPDATE TRIP_BILL_APPROVAL SET SEASON_ID = 2 " +
|
||||||
|
" WHERE TRIPBILL_ID in " +
|
||||||
|
" (SELECT tb.ID FROM TRIP_BILL AS tb " +
|
||||||
|
" JOIN TRIPREQUIREMENT ON TRIPREQUIREMENT.ID = tb.REQUIREMENT_ID WHERE NUMSER LIKE 'P16%')";
|
||||||
|
sq = dao.getSession().createSQLQuery(sql);
|
||||||
|
sq.executeUpdate();
|
||||||
|
sql = "UPDATE TRIP_BILL_APPROVAL SET SEASON_ID = 1 " +
|
||||||
|
"WHERE TRIPBILL_ID in " +
|
||||||
|
"(SELECT tb.ID FROM TRIP_BILL AS tb " +
|
||||||
|
"JOIN TRIPREQUIREMENT ON TRIPREQUIREMENT.ID = tb.REQUIREMENT_ID WHERE NUMSER LIKE 'P0%')";
|
||||||
|
sq = dao.getSession().createSQLQuery(sql);
|
||||||
|
sq.executeUpdate();
|
||||||
|
|
||||||
|
sql = "UPDATE TRIP_BILL tb JOIN TRIPREQUIREMENT ON TRIPREQUIREMENT.ID = tb.REQUIREMENT_ID " +
|
||||||
|
"SET tb.SEASON_ID = 2 WHERE NUMSER LIKE 'P16%'";
|
||||||
|
sq = dao.getSession().createSQLQuery(sql);
|
||||||
|
sq.executeUpdate();
|
||||||
|
sql = "UPDATE TRIP_BILL tb JOIN TRIPREQUIREMENT ON TRIPREQUIREMENT.ID = tb.REQUIREMENT_ID " +
|
||||||
|
"SET tb.SEASON_ID = 1 WHERE NUMSER LIKE 'P0%'";;
|
||||||
|
sq = dao.getSession().createSQLQuery(sql);
|
||||||
|
sq.executeUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
this.updateDatabaseVersion();
|
this.updateDatabaseVersion();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package info.bukova.isspst.services.invoicing;
|
|||||||
|
|
||||||
import info.bukova.isspst.data.Invoicing;
|
import info.bukova.isspst.data.Invoicing;
|
||||||
import info.bukova.isspst.data.Requirement;
|
import info.bukova.isspst.data.Requirement;
|
||||||
|
import info.bukova.isspst.data.Season;
|
||||||
import info.bukova.isspst.data.Workgroup;
|
import info.bukova.isspst.data.Workgroup;
|
||||||
import info.bukova.isspst.services.Service;
|
import info.bukova.isspst.services.Service;
|
||||||
|
|
||||||
@@ -11,6 +12,8 @@ import java.util.List;
|
|||||||
public interface InvoicingService extends Service<Invoicing> {
|
public interface InvoicingService extends Service<Invoicing> {
|
||||||
|
|
||||||
public BigDecimal totalInvoicedForWorkgroup(Workgroup workgroup);
|
public BigDecimal totalInvoicedForWorkgroup(Workgroup workgroup);
|
||||||
|
|
||||||
|
public BigDecimal totalInvoicedForWorkgroupAndSeason(Workgroup workgroup, Season season);
|
||||||
|
|
||||||
public void loadReqItems(Invoicing invoicing);
|
public void loadReqItems(Invoicing invoicing);
|
||||||
|
|
||||||
|
|||||||
@@ -4,11 +4,14 @@ import info.bukova.isspst.Constants;
|
|||||||
import info.bukova.isspst.data.Invoicing;
|
import info.bukova.isspst.data.Invoicing;
|
||||||
import info.bukova.isspst.data.InvoicingItem;
|
import info.bukova.isspst.data.InvoicingItem;
|
||||||
import info.bukova.isspst.data.Requirement;
|
import info.bukova.isspst.data.Requirement;
|
||||||
|
import info.bukova.isspst.data.Season;
|
||||||
import info.bukova.isspst.data.Workgroup;
|
import info.bukova.isspst.data.Workgroup;
|
||||||
import info.bukova.isspst.services.AbstractOwnedService;
|
import info.bukova.isspst.services.AbstractOwnedService;
|
||||||
import info.bukova.isspst.services.LazyLoader;
|
import info.bukova.isspst.services.LazyLoader;
|
||||||
|
import info.bukova.isspst.services.settings.SeasonService;
|
||||||
import org.hibernate.Hibernate;
|
import org.hibernate.Hibernate;
|
||||||
import org.hibernate.Query;
|
import org.hibernate.Query;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@@ -18,13 +21,23 @@ import java.util.List;
|
|||||||
public class InvoicingServiceImpl extends AbstractOwnedService<Invoicing> implements
|
public class InvoicingServiceImpl extends AbstractOwnedService<Invoicing> implements
|
||||||
InvoicingService {
|
InvoicingService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SeasonService seasonService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public BigDecimal totalInvoicedForWorkgroup(Workgroup workgroup) {
|
public BigDecimal totalInvoicedForWorkgroup(Workgroup workgroup) {
|
||||||
|
return totalInvoicedForWorkgroupAndSeason(workgroup, seasonService.getActive());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public BigDecimal totalInvoicedForWorkgroupAndSeason(Workgroup workgroup, Season season) {
|
||||||
Query q = dao.getQuery("select sum(inv.totalInvoiced) "
|
Query q = dao.getQuery("select sum(inv.totalInvoiced) "
|
||||||
+ "from Invoicing inv join inv.requirement rq join rq.workgroup w "
|
+ "from Invoicing inv join inv.requirement rq join rq.workgroup w "
|
||||||
+ "where w = :workgroup ");
|
+ "where w = :workgroup and rq.season = :season");
|
||||||
q.setParameter("workgroup", workgroup);
|
q.setParameter("workgroup", workgroup);
|
||||||
|
q.setParameter("season", season);
|
||||||
return (BigDecimal) q.uniqueResult();
|
return (BigDecimal) q.uniqueResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,6 +59,14 @@ public class InvoicingServiceImpl extends AbstractOwnedService<Invoicing> implem
|
|||||||
invoicing.setItems(inv.getItems());
|
invoicing.setItems(inv.getItems());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
@LazyLoader
|
||||||
|
public void loadReqAuth(Invoicing invoicing) {
|
||||||
|
Invoicing inv = getById(invoicing.getId());
|
||||||
|
Hibernate.initialize(inv.getRequirement().getAuthorization());
|
||||||
|
invoicing.getRequirement().setAuthorization(inv.getRequirement().getAuthorization());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void calculate(Invoicing invoicing) {
|
public void calculate(Invoicing invoicing) {
|
||||||
BigDecimal total = BigDecimal.ZERO;
|
BigDecimal total = BigDecimal.ZERO;
|
||||||
@@ -108,7 +129,7 @@ public class InvoicingServiceImpl extends AbstractOwnedService<Invoicing> implem
|
|||||||
@Transactional
|
@Transactional
|
||||||
@PreAuthorize("hasPermission(this, 'PERM_READ')")
|
@PreAuthorize("hasPermission(this, 'PERM_READ')")
|
||||||
public List<Invoicing> getMaterialPendingList() {
|
public List<Invoicing> getMaterialPendingList() {
|
||||||
Query q = dao.getQuery("select inv from Invoicing as inv join fetch inv.requirement rq join fetch rq.ownedBy where (inv.completed Is Null or inv.completed = false) and (rq.kind = :kind) order by rq.numser");
|
Query q = dao.getQuery("select inv from Invoicing as inv join fetch inv.requirement rq join fetch rq.ownedBy where (inv.completed Is Null or inv.completed = false) and (rq.kind = :kind) order by rq.numser desc");
|
||||||
q.setParameter("kind", Constants.REQ_TYPE_MATERIAL);
|
q.setParameter("kind", Constants.REQ_TYPE_MATERIAL);
|
||||||
return q.list();
|
return q.list();
|
||||||
}
|
}
|
||||||
@@ -118,7 +139,7 @@ public class InvoicingServiceImpl extends AbstractOwnedService<Invoicing> implem
|
|||||||
@Transactional
|
@Transactional
|
||||||
@PreAuthorize("hasPermission(this, 'PERM_READ')")
|
@PreAuthorize("hasPermission(this, 'PERM_READ')")
|
||||||
public List<Invoicing> getMaterialArchiveList() {
|
public List<Invoicing> getMaterialArchiveList() {
|
||||||
Query q = dao.getQuery("select inv from Invoicing as inv join fetch inv.requirement rq join fetch rq.ownedBy where (inv.completed = true) and (rq.kind = :kind) order by rq.numser");
|
Query q = dao.getQuery("select inv from Invoicing as inv join fetch inv.requirement rq join fetch rq.ownedBy where (inv.completed = true) and (rq.kind = :kind) order by rq.numser desc");
|
||||||
q.setParameter("kind", Constants.REQ_TYPE_MATERIAL);
|
q.setParameter("kind", Constants.REQ_TYPE_MATERIAL);
|
||||||
return q.list();
|
return q.list();
|
||||||
}
|
}
|
||||||
@@ -128,7 +149,7 @@ public class InvoicingServiceImpl extends AbstractOwnedService<Invoicing> implem
|
|||||||
@Transactional
|
@Transactional
|
||||||
@PreAuthorize("hasPermission(this, 'PERM_READ')")
|
@PreAuthorize("hasPermission(this, 'PERM_READ')")
|
||||||
public List<Invoicing> getServicesPendingList() {
|
public List<Invoicing> getServicesPendingList() {
|
||||||
Query q = dao.getQuery("select inv from Invoicing as inv join fetch inv.requirement rq join fetch rq.ownedBy where (inv.completed Is Null or inv.completed = false) and (rq.kind = :kind) order by rq.numser");
|
Query q = dao.getQuery("select inv from Invoicing as inv join fetch inv.requirement rq join fetch rq.ownedBy where (inv.completed Is Null or inv.completed = false) and (rq.kind = :kind) order by rq.numser desc");
|
||||||
q.setParameter("kind", Constants.REQ_TYPE_SERVICES);
|
q.setParameter("kind", Constants.REQ_TYPE_SERVICES);
|
||||||
return q.list();
|
return q.list();
|
||||||
}
|
}
|
||||||
@@ -138,7 +159,7 @@ public class InvoicingServiceImpl extends AbstractOwnedService<Invoicing> implem
|
|||||||
@Transactional
|
@Transactional
|
||||||
@PreAuthorize("hasPermission(this, 'PERM_READ')")
|
@PreAuthorize("hasPermission(this, 'PERM_READ')")
|
||||||
public List<Invoicing> getServicesArchiveList() {
|
public List<Invoicing> getServicesArchiveList() {
|
||||||
Query q = dao.getQuery("select inv from Invoicing as inv join fetch inv.requirement rq join fetch rq.ownedBy where (inv.completed = true) and (rq.kind = :kind) order by rq.numser");
|
Query q = dao.getQuery("select inv from Invoicing as inv join fetch inv.requirement rq join fetch rq.ownedBy where (inv.completed = true) and (rq.kind = :kind) order by rq.numser desc");
|
||||||
q.setParameter("kind", Constants.REQ_TYPE_SERVICES);
|
q.setParameter("kind", Constants.REQ_TYPE_SERVICES);
|
||||||
return q.list();
|
return q.list();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
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,11 +1,18 @@
|
|||||||
package info.bukova.isspst.services.numberseries;
|
package info.bukova.isspst.services.numberseries;
|
||||||
|
|
||||||
import info.bukova.isspst.data.NumberSeries;
|
import info.bukova.isspst.data.NumberSeries;
|
||||||
|
import info.bukova.isspst.data.Season;
|
||||||
import info.bukova.isspst.services.Service;
|
import info.bukova.isspst.services.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public interface NumberSeriesService extends Service<NumberSeries>
|
public interface NumberSeriesService extends Service<NumberSeries>
|
||||||
{
|
{
|
||||||
public NumberSeries getNumberSerie(String module);
|
public NumberSeries getNumberSerie(String module);
|
||||||
|
|
||||||
|
public NumberSeries getNumberSerieForSeason(String module, Season season);
|
||||||
|
|
||||||
public void increase(NumberSeries ns);
|
public void increase(NumberSeries ns);
|
||||||
|
|
||||||
|
public List<NumberSeries> getSeriesForSeason(Season season);
|
||||||
}
|
}
|
||||||
|
|||||||
+29
-5
@@ -1,24 +1,48 @@
|
|||||||
package info.bukova.isspst.services.numberseries;
|
package info.bukova.isspst.services.numberseries;
|
||||||
|
|
||||||
import info.bukova.isspst.data.NumberSeries;
|
import info.bukova.isspst.data.NumberSeries;
|
||||||
|
import info.bukova.isspst.data.Season;
|
||||||
import info.bukova.isspst.services.AbstractService;
|
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 org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class NumberSeriesServiceImpl extends AbstractService<NumberSeries> implements NumberSeriesService
|
public class NumberSeriesServiceImpl extends AbstractService<NumberSeries> implements NumberSeriesService
|
||||||
{
|
{
|
||||||
|
@Autowired
|
||||||
|
private SeasonService seasonService;
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public NumberSeries getNumberSerie(String module)
|
public NumberSeries getNumberSerie(String module) {
|
||||||
{
|
return getNumberSerieForSeason(module, seasonService.getActive());
|
||||||
return this.selectSingle("from NumberSeries where MODULE = '" + module + "'");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public void increase(NumberSeries ns)
|
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();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
@Override
|
||||||
|
public void increase(NumberSeries ns) {
|
||||||
ns.setNumber(ns.getNumber() + 1);
|
ns.setNumber(ns.getNumber() + 1);
|
||||||
this.update(ns);
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,16 +10,16 @@ import info.bukova.isspst.data.Workgroup;
|
|||||||
import info.bukova.isspst.services.AbstractOwnedService;
|
import info.bukova.isspst.services.AbstractOwnedService;
|
||||||
import info.bukova.isspst.services.LazyLoader;
|
import info.bukova.isspst.services.LazyLoader;
|
||||||
import info.bukova.isspst.services.settings.GlobalSettingsService;
|
import info.bukova.isspst.services.settings.GlobalSettingsService;
|
||||||
|
import info.bukova.isspst.services.settings.SeasonService;
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.hibernate.Hibernate;
|
import org.hibernate.Hibernate;
|
||||||
import org.hibernate.Query;
|
import org.hibernate.Query;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
public class OrderServiceImpl extends AbstractOwnedService<Order> implements
|
public class OrderServiceImpl extends AbstractOwnedService<Order> implements
|
||||||
OrderService {
|
OrderService {
|
||||||
|
|
||||||
@@ -29,6 +29,9 @@ public class OrderServiceImpl extends AbstractOwnedService<Order> implements
|
|||||||
@Autowired
|
@Autowired
|
||||||
private RequirementItemDao requirementItemDao;
|
private RequirementItemDao requirementItemDao;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SeasonService seasonService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@PreAuthorize("hasPermission(this, 'PERM_ADD')")
|
@PreAuthorize("hasPermission(this, 'PERM_ADD')")
|
||||||
public Order createOrder(List<JoinedItem> items) {
|
public Order createOrder(List<JoinedItem> items) {
|
||||||
@@ -46,6 +49,7 @@ public class OrderServiceImpl extends AbstractOwnedService<Order> implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
order.setTotal(total);
|
order.setTotal(total);
|
||||||
|
order.setSeason(seasonService.getActive());
|
||||||
|
|
||||||
return order;
|
return order;
|
||||||
}
|
}
|
||||||
@@ -76,7 +80,7 @@ public class OrderServiceImpl extends AbstractOwnedService<Order> implements
|
|||||||
public List<Order> getAll()
|
public List<Order> getAll()
|
||||||
{
|
{
|
||||||
Query q = dao.getQuery("select o from Order o join fetch o.ownedBy");
|
Query q = dao.getQuery("select o from Order o join fetch o.ownedBy");
|
||||||
return q.list();
|
return filterQuery(q).list();
|
||||||
}
|
}
|
||||||
|
|
||||||
@LazyLoader("form")
|
@LazyLoader("form")
|
||||||
|
|||||||
@@ -3,17 +3,14 @@ package info.bukova.isspst.services.requirement;
|
|||||||
import info.bukova.isspst.Constants;
|
import info.bukova.isspst.Constants;
|
||||||
import info.bukova.isspst.data.Requirement;
|
import info.bukova.isspst.data.Requirement;
|
||||||
import info.bukova.isspst.data.RequirementState;
|
import info.bukova.isspst.data.RequirementState;
|
||||||
import info.bukova.isspst.data.Workgroup;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.hibernate.Query;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PostFilter;
|
import org.springframework.security.access.prepost.PostFilter;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class ReqMaterialServiceImpl extends RequirementServiceImpl implements RequirementService, RequirementBaseService<Requirement>
|
public class ReqMaterialServiceImpl extends RequirementServiceImpl implements RequirementService, RequirementBaseService<Requirement>
|
||||||
{
|
{
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -38,10 +35,10 @@ public class ReqMaterialServiceImpl extends RequirementServiceImpl implements Re
|
|||||||
@PreAuthorize("hasPermission(this, 'PERM_READ')")
|
@PreAuthorize("hasPermission(this, 'PERM_READ')")
|
||||||
public List<Requirement> getMy()
|
public List<Requirement> getMy()
|
||||||
{
|
{
|
||||||
Query q = dao.getQuery("from " + dao.getEntityName() + " where ownedBy = :owner and kind = :kind");
|
hqlFilter.setDataClass(Requirement.class);
|
||||||
q.setParameter("owner", getLoggedInUser());
|
hqlFilter.andFilter("kind = :kind");
|
||||||
q.setParameter("kind", Constants.REQ_TYPE_MATERIAL);
|
hqlFilter.setParam("kind", Constants.REQ_TYPE_MATERIAL);
|
||||||
return q.list();
|
return super.getMy();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -51,11 +48,10 @@ public class ReqMaterialServiceImpl extends RequirementServiceImpl implements Re
|
|||||||
@PostFilter("hasPermission(filterObject, 'PERM_SHOW_CENTRE_REQ')")
|
@PostFilter("hasPermission(filterObject, 'PERM_SHOW_CENTRE_REQ')")
|
||||||
public List<Requirement> getCentreReq()
|
public List<Requirement> getCentreReq()
|
||||||
{
|
{
|
||||||
List<Workgroup> wgList = workgroupService.getUserCentres(getLoggedInUser());
|
hqlFilter.setDataClass(Requirement.class);
|
||||||
Query q = dao.getQuery("select tr from " + dao.getEntityName() + " tr join fetch tr.ownedBy join tr.centre c where c in (:wgList) and kind = :kind order by tr.numser");
|
hqlFilter.andFilter("kind = :kind");
|
||||||
q.setParameterList("wgList", wgList);
|
hqlFilter.setParam("kind", Constants.REQ_TYPE_MATERIAL);
|
||||||
q.setParameter("kind", Constants.REQ_TYPE_MATERIAL);
|
return super.getCentreReq();
|
||||||
return q.list();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -65,13 +61,10 @@ public class ReqMaterialServiceImpl extends RequirementServiceImpl implements Re
|
|||||||
@PostFilter("hasPermission(filterObject, 'PERM_SHOW_WORKGROUP_REQ')")
|
@PostFilter("hasPermission(filterObject, 'PERM_SHOW_WORKGROUP_REQ')")
|
||||||
public List<Requirement> getWorkgroupReq()
|
public List<Requirement> getWorkgroupReq()
|
||||||
{
|
{
|
||||||
List<Workgroup> wgList = workgroupService.getUserWorkgroups(getLoggedInUser());
|
hqlFilter.setDataClass(Requirement.class);
|
||||||
Query q = dao.getQuery("select tr from "
|
hqlFilter.andFilter("kind = :kind");
|
||||||
+ dao.getEntityName()
|
hqlFilter.setParam("kind", Constants.REQ_TYPE_MATERIAL);
|
||||||
+ " tr join fetch tr.ownedBy join tr.workgroup w where w in (:wgList) and kind = :kind order by tr.numser");
|
return super.getWorkgroupReq();
|
||||||
q.setParameterList("wgList", wgList);
|
|
||||||
q.setParameter("kind", Constants.REQ_TYPE_MATERIAL);
|
|
||||||
return q.list();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -80,8 +73,9 @@ public class ReqMaterialServiceImpl extends RequirementServiceImpl implements Re
|
|||||||
@PreAuthorize("hasPermission(this, 'PERM_SHOW_ALL_REQ')")
|
@PreAuthorize("hasPermission(this, 'PERM_SHOW_ALL_REQ')")
|
||||||
public List<Requirement> getAll()
|
public List<Requirement> getAll()
|
||||||
{
|
{
|
||||||
Query q = dao.getQuery("from " + dao.getEntityName() + " as tr join fetch tr.ownedBy where kind = :kind order by tr.numser");
|
hqlFilter.setDataClass(Requirement.class);
|
||||||
q.setParameter("kind", Constants.REQ_TYPE_MATERIAL);
|
hqlFilter.andFilter("kind = :kind");
|
||||||
return q.list();
|
hqlFilter.setParam("kind", Constants.REQ_TYPE_MATERIAL);
|
||||||
|
return super.getAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,17 +3,14 @@ package info.bukova.isspst.services.requirement;
|
|||||||
import info.bukova.isspst.Constants;
|
import info.bukova.isspst.Constants;
|
||||||
import info.bukova.isspst.data.Requirement;
|
import info.bukova.isspst.data.Requirement;
|
||||||
import info.bukova.isspst.data.RequirementState;
|
import info.bukova.isspst.data.RequirementState;
|
||||||
import info.bukova.isspst.data.Workgroup;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.hibernate.Query;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PostFilter;
|
import org.springframework.security.access.prepost.PostFilter;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class ReqServicesServiceImpl extends RequirementServiceImpl implements RequirementService, RequirementBaseService<Requirement>
|
public class ReqServicesServiceImpl extends RequirementServiceImpl implements RequirementService, RequirementBaseService<Requirement>
|
||||||
{
|
{
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -38,10 +35,10 @@ public class ReqServicesServiceImpl extends RequirementServiceImpl implements Re
|
|||||||
@PreAuthorize("hasPermission(this, 'PERM_READ')")
|
@PreAuthorize("hasPermission(this, 'PERM_READ')")
|
||||||
public List<Requirement> getMy()
|
public List<Requirement> getMy()
|
||||||
{
|
{
|
||||||
Query q = dao.getQuery("from " + dao.getEntityName() + " where ownedBy = :owner and kind = :kind");
|
hqlFilter.setDataClass(Requirement.class);
|
||||||
q.setParameter("owner", getLoggedInUser());
|
hqlFilter.andFilter("kind = :kind");
|
||||||
q.setParameter("kind", Constants.REQ_TYPE_SERVICES);
|
hqlFilter.setParam("kind", Constants.REQ_TYPE_SERVICES);
|
||||||
return q.list();
|
return super.getMy();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -51,11 +48,10 @@ public class ReqServicesServiceImpl extends RequirementServiceImpl implements Re
|
|||||||
@PostFilter("hasPermission(filterObject, 'PERM_SHOW_CENTRE_REQ')")
|
@PostFilter("hasPermission(filterObject, 'PERM_SHOW_CENTRE_REQ')")
|
||||||
public List<Requirement> getCentreReq()
|
public List<Requirement> getCentreReq()
|
||||||
{
|
{
|
||||||
List<Workgroup> wgList = workgroupService.getUserCentres(getLoggedInUser());
|
hqlFilter.setDataClass(Requirement.class);
|
||||||
Query q = dao.getQuery("select tr from " + dao.getEntityName() + " tr join fetch tr.ownedBy join tr.centre c where c in (:wgList) and kind = :kind order by tr.numser");
|
hqlFilter.andFilter("kind = :kind");
|
||||||
q.setParameterList("wgList", wgList);
|
hqlFilter.setParam("kind", Constants.REQ_TYPE_SERVICES);
|
||||||
q.setParameter("kind", Constants.REQ_TYPE_SERVICES);
|
return super.getCentreReq();
|
||||||
return q.list();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -65,13 +61,10 @@ public class ReqServicesServiceImpl extends RequirementServiceImpl implements Re
|
|||||||
@PostFilter("hasPermission(filterObject, 'PERM_SHOW_WORKGROUP_REQ')")
|
@PostFilter("hasPermission(filterObject, 'PERM_SHOW_WORKGROUP_REQ')")
|
||||||
public List<Requirement> getWorkgroupReq()
|
public List<Requirement> getWorkgroupReq()
|
||||||
{
|
{
|
||||||
List<Workgroup> wgList = workgroupService.getUserWorkgroups(getLoggedInUser());
|
hqlFilter.setDataClass(Requirement.class);
|
||||||
Query q = dao.getQuery("select tr from "
|
hqlFilter.andFilter("kind = :kind");
|
||||||
+ dao.getEntityName()
|
hqlFilter.setParam("kind", Constants.REQ_TYPE_SERVICES);
|
||||||
+ " tr join fetch tr.ownedBy join tr.workgroup w where w in (:wgList) and kind = :kind order by tr.numser");
|
return super.getWorkgroupReq();
|
||||||
q.setParameterList("wgList", wgList);
|
|
||||||
q.setParameter("kind", Constants.REQ_TYPE_SERVICES);
|
|
||||||
return q.list();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -80,8 +73,9 @@ public class ReqServicesServiceImpl extends RequirementServiceImpl implements Re
|
|||||||
@PreAuthorize("hasPermission(this, 'PERM_SHOW_ALL_REQ')")
|
@PreAuthorize("hasPermission(this, 'PERM_SHOW_ALL_REQ')")
|
||||||
public List<Requirement> getAll()
|
public List<Requirement> getAll()
|
||||||
{
|
{
|
||||||
Query q = dao.getQuery("from " + dao.getEntityName() + " as tr join fetch tr.ownedBy where kind = :kind order by tr.numser");
|
hqlFilter.setDataClass(Requirement.class);
|
||||||
q.setParameter("kind", Constants.REQ_TYPE_SERVICES);
|
hqlFilter.andFilter("kind = :kind");
|
||||||
return q.list();
|
hqlFilter.setParam("kind", Constants.REQ_TYPE_SERVICES);
|
||||||
|
return super.getAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+54
-18
@@ -24,17 +24,22 @@ import info.bukova.isspst.reporting.ParamFiller;
|
|||||||
import info.bukova.isspst.reporting.Report;
|
import info.bukova.isspst.reporting.Report;
|
||||||
import info.bukova.isspst.reporting.ReportDefinition;
|
import info.bukova.isspst.reporting.ReportDefinition;
|
||||||
import info.bukova.isspst.services.AbstractOwnedService;
|
import info.bukova.isspst.services.AbstractOwnedService;
|
||||||
|
import info.bukova.isspst.services.HqlDataFilter;
|
||||||
import info.bukova.isspst.services.LazyLoader;
|
import info.bukova.isspst.services.LazyLoader;
|
||||||
import info.bukova.isspst.services.Service;
|
import info.bukova.isspst.services.Service;
|
||||||
import info.bukova.isspst.services.settings.GlobalSettingsService;
|
import info.bukova.isspst.services.settings.GlobalSettingsService;
|
||||||
|
import info.bukova.isspst.services.settings.SeasonService;
|
||||||
import info.bukova.isspst.services.signeddocs.SignedDocumentService;
|
import info.bukova.isspst.services.signeddocs.SignedDocumentService;
|
||||||
import info.bukova.isspst.services.users.UserService;
|
import info.bukova.isspst.services.users.UserService;
|
||||||
import info.bukova.isspst.services.workgroups.WorkgroupService;
|
import info.bukova.isspst.services.workgroups.WorkgroupService;
|
||||||
import info.bukova.isspst.signapi.SignData;
|
import info.bukova.isspst.signapi.SignData;
|
||||||
import info.bukova.isspst.storage.FileStorage;
|
import info.bukova.isspst.storage.FileStorage;
|
||||||
import info.bukova.isspst.storage.ReportFileStorage;
|
import info.bukova.isspst.storage.ReportFileStorage;
|
||||||
|
import info.bukova.isspst.storage.StorageException;
|
||||||
import org.hibernate.LazyInitializationException;
|
import org.hibernate.LazyInitializationException;
|
||||||
import org.hibernate.Query;
|
import org.hibernate.Query;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PostFilter;
|
import org.springframework.security.access.prepost.PostFilter;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
@@ -82,6 +87,11 @@ public abstract class RequirementBaseServiceImpl<T extends RequirementBase> exte
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ReportFileStorage signedDocStorage;
|
private ReportFileStorage signedDocStorage;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SeasonService seasonService;
|
||||||
|
|
||||||
|
private final static Logger logger = LoggerFactory.getLogger(RequirementBaseServiceImpl.class);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
@PreAuthorize("hasPermission(this, 'PERM_ADD')")
|
@PreAuthorize("hasPermission(this, 'PERM_ADD')")
|
||||||
@@ -89,7 +99,11 @@ public abstract class RequirementBaseServiceImpl<T extends RequirementBase> exte
|
|||||||
Workgroup reqWorkgroup = null;
|
Workgroup reqWorkgroup = null;
|
||||||
for (Workgroup w : workgroupService.getUserWorkgroups(getLoggedInUser())) {
|
for (Workgroup w : workgroupService.getUserWorkgroups(getLoggedInUser())) {
|
||||||
if (workgroupService.getMembers(entity.getCentre()).contains(w)) {
|
if (workgroupService.getMembers(entity.getCentre()).contains(w)) {
|
||||||
reqWorkgroup = w;
|
for (Role r : workgroupService.getUserWorkgroupRoles(w, getLoggedInUser())) {
|
||||||
|
if (r.getAuthority().equals(Constants.ROLE_USER)) {
|
||||||
|
reqWorkgroup = w;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,7 +114,9 @@ public abstract class RequirementBaseServiceImpl<T extends RequirementBase> exte
|
|||||||
if (!canAdd(entity)) {
|
if (!canAdd(entity)) {
|
||||||
throw new AddRequirementException();
|
throw new AddRequirementException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
entity.setSeason(seasonService.getActive());
|
||||||
|
|
||||||
this.addWorkflow(entity);
|
this.addWorkflow(entity);
|
||||||
entity.setNumser(this.getNumberSerie());
|
entity.setNumser(this.getNumberSerie());
|
||||||
|
|
||||||
@@ -433,9 +449,10 @@ public abstract class RequirementBaseServiceImpl<T extends RequirementBase> exte
|
|||||||
@PreAuthorize("hasPermission(this, 'PERM_READ')")
|
@PreAuthorize("hasPermission(this, 'PERM_READ')")
|
||||||
public List<T> getMy()
|
public List<T> getMy()
|
||||||
{
|
{
|
||||||
Query q = dao.getQuery("from " + dao.getEntityName() + " where ownedBy = :owner");
|
Query q = dao.getQuery("from " + dao.getEntityName());
|
||||||
q.setParameter("owner", getLoggedInUser());
|
HqlDataFilter f = new HqlDataFilter("ownedBy = :owner");
|
||||||
return q.list();
|
f.setParam("owner", getLoggedInUser());
|
||||||
|
return filterQuery(q, f).list();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -446,9 +463,10 @@ public abstract class RequirementBaseServiceImpl<T extends RequirementBase> exte
|
|||||||
public List<T> getCentreReq()
|
public List<T> getCentreReq()
|
||||||
{
|
{
|
||||||
List<Workgroup> wgList = workgroupService.getUserCentres(getLoggedInUser());
|
List<Workgroup> wgList = workgroupService.getUserCentres(getLoggedInUser());
|
||||||
Query q = dao.getQuery("select tr from " + dao.getEntityName() + " tr join fetch tr.ownedBy join tr.centre c where c in (:wgList) order by tr.numser");
|
Query q = dao.getQuery("select tr from " + dao.getEntityName() + " tr join fetch tr.ownedBy join tr.centre c");
|
||||||
q.setParameterList("wgList", wgList);
|
HqlDataFilter f = new HqlDataFilter("c in (:wgList)", "tr.numser desc");
|
||||||
return q.list();
|
f.setParam("wgList", wgList);
|
||||||
|
return filterQuery(q, f).list();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -459,9 +477,10 @@ public abstract class RequirementBaseServiceImpl<T extends RequirementBase> exte
|
|||||||
public List<T> getWorkgroupReq()
|
public List<T> getWorkgroupReq()
|
||||||
{
|
{
|
||||||
List<Workgroup> wgList = workgroupService.getUserWorkgroups(getLoggedInUser());
|
List<Workgroup> wgList = workgroupService.getUserWorkgroups(getLoggedInUser());
|
||||||
Query q = dao.getQuery("select tr from " + dao.getEntityName() + " tr join fetch tr.ownedBy join tr.workgroup w where w in (:wgList) order by tr.numser");
|
Query q = dao.getQuery("select tr from " + dao.getEntityName() + " tr join fetch tr.ownedBy join tr.workgroup w");
|
||||||
q.setParameterList("wgList", wgList);
|
HqlDataFilter f = new HqlDataFilter("w in (:wgList)", "tr.numser desc");
|
||||||
return q.list();
|
f.setParam("wgList", wgList);
|
||||||
|
return filterQuery(q, f).list();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -470,8 +489,9 @@ public abstract class RequirementBaseServiceImpl<T extends RequirementBase> exte
|
|||||||
@PreAuthorize("hasPermission(this, 'PERM_SHOW_ALL_REQ')")
|
@PreAuthorize("hasPermission(this, 'PERM_SHOW_ALL_REQ')")
|
||||||
public List<T> getAll()
|
public List<T> getAll()
|
||||||
{
|
{
|
||||||
Query q = dao.getQuery("from " + dao.getEntityName() + " as tr join fetch tr.ownedBy order by tr.numser");
|
Query q = dao.getQuery("from " + dao.getEntityName() + " as tr join fetch tr.ownedBy");
|
||||||
return q.list();
|
HqlDataFilter f = new HqlDataFilter("", "tr.numser desc");
|
||||||
|
return filterQuery(q, f).list();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -542,11 +562,17 @@ public abstract class RequirementBaseServiceImpl<T extends RequirementBase> exte
|
|||||||
private Report getSignReport(T entity) {
|
private Report getSignReport(T entity) {
|
||||||
Module module = ModuleUtils.getModule(entityForSignReport(entity), servletContext);
|
Module module = ModuleUtils.getModule(entityForSignReport(entity), servletContext);
|
||||||
Report report = null;
|
Report report = null;
|
||||||
|
int reportId = Constants.SIGN_REPORT_MAP.get(entity.getClass()) == null ? 0 : Constants.SIGN_REPORT_MAP.get(entity.getClass());
|
||||||
|
|
||||||
for (Report r : module.getReports()) {
|
for (Report r : module.getReports()) {
|
||||||
if (r.isSignable()) {
|
if (r.isSignable()) {
|
||||||
report = r;
|
if (reportId == 0) {
|
||||||
break;
|
report = r;
|
||||||
|
break;
|
||||||
|
} else if (reportId == r.getReportId()) {
|
||||||
|
report = r;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -559,9 +585,14 @@ public abstract class RequirementBaseServiceImpl<T extends RequirementBase> exte
|
|||||||
public void update(T entity) {
|
public void update(T entity) {
|
||||||
entity.getAuthorization().clear();
|
entity.getAuthorization().clear();
|
||||||
entity.setState(RequirementState.NEW);
|
entity.setState(RequirementState.NEW);
|
||||||
signedDocumentService.deleteForEntity(entity);
|
|
||||||
|
|
||||||
super.update(entity);
|
super.update(entity);
|
||||||
|
|
||||||
|
try {
|
||||||
|
signedDocumentService.deleteForEntity(entity);
|
||||||
|
} catch (StorageException e) {
|
||||||
|
logger.warn(e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
sendToApprovers(entity);
|
sendToApprovers(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -569,7 +600,12 @@ public abstract class RequirementBaseServiceImpl<T extends RequirementBase> exte
|
|||||||
@Transactional
|
@Transactional
|
||||||
@PreAuthorize("hasPermission(this, 'PERM_DELETE') or hasPermission(#entity, this.getDeleteEntityPermission())")
|
@PreAuthorize("hasPermission(this, 'PERM_DELETE') or hasPermission(#entity, this.getDeleteEntityPermission())")
|
||||||
public void delete(T entity) {
|
public void delete(T entity) {
|
||||||
signedDocumentService.delFromApprove(signedDocumentService.getForEntity(entity));
|
|
||||||
super.delete(entity);
|
super.delete(entity);
|
||||||
|
|
||||||
|
try {
|
||||||
|
signedDocumentService.delFromApprove(signedDocumentService.getForEntity(entity));
|
||||||
|
} catch (StorageException e) {
|
||||||
|
logger.warn(e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package info.bukova.isspst.services.requirement;
|
|||||||
|
|
||||||
import info.bukova.isspst.Constants;
|
import info.bukova.isspst.Constants;
|
||||||
import info.bukova.isspst.data.Invoicing;
|
import info.bukova.isspst.data.Invoicing;
|
||||||
|
import info.bukova.isspst.data.Limit;
|
||||||
import info.bukova.isspst.data.Requirement;
|
import info.bukova.isspst.data.Requirement;
|
||||||
import info.bukova.isspst.data.RequirementItem;
|
import info.bukova.isspst.data.RequirementItem;
|
||||||
import info.bukova.isspst.data.RequirementState;
|
import info.bukova.isspst.data.RequirementState;
|
||||||
@@ -10,6 +11,7 @@ import info.bukova.isspst.data.User;
|
|||||||
import info.bukova.isspst.data.Workflow;
|
import info.bukova.isspst.data.Workflow;
|
||||||
import info.bukova.isspst.services.LazyLoader;
|
import info.bukova.isspst.services.LazyLoader;
|
||||||
import info.bukova.isspst.services.invoicing.InvoicingService;
|
import info.bukova.isspst.services.invoicing.InvoicingService;
|
||||||
|
import info.bukova.isspst.services.limits.LimitService;
|
||||||
import org.hibernate.Hibernate;
|
import org.hibernate.Hibernate;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
@@ -33,6 +35,8 @@ public class RequirementServiceImpl extends RequirementBaseServiceImpl<Requireme
|
|||||||
private RequirementTypeService reqTypeService;
|
private RequirementTypeService reqTypeService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private InvoicingService invoicingService;
|
private InvoicingService invoicingService;
|
||||||
|
@Autowired
|
||||||
|
private LimitService limitService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Requirement createEntity()
|
protected Requirement createEntity()
|
||||||
@@ -80,26 +84,25 @@ public class RequirementServiceImpl extends RequirementBaseServiceImpl<Requireme
|
|||||||
@Override
|
@Override
|
||||||
protected boolean canAdd(Requirement entity)
|
protected boolean canAdd(Requirement entity)
|
||||||
{
|
{
|
||||||
if (entity.getWorkgroup() != null && entity.getWorkgroup().getLimit() != null && entity.getWorkgroup().getLimit().compareTo(BigDecimal.ZERO) != 0)
|
if (entity.getWorkgroup() != null) {
|
||||||
{
|
Limit limit = limitService.getForWorkgroup(entity.getWorkgroup());
|
||||||
|
if (limit == null) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
BigDecimal total = invoicingService.totalInvoicedForWorkgroup(entity.getWorkgroup());
|
BigDecimal total = invoicingService.totalInvoicedForWorkgroup(entity.getWorkgroup());
|
||||||
|
|
||||||
if (total == null)
|
if (total == null) {
|
||||||
{
|
|
||||||
total = BigDecimal.ZERO;
|
total = BigDecimal.ZERO;
|
||||||
}
|
}
|
||||||
|
|
||||||
total = total.add(entity.getSumTotal());
|
total = total.add(entity.getSumTotal());
|
||||||
|
|
||||||
if (total.compareTo(entity.getWorkgroup().getLimit()) <= 0)
|
if (total.compareTo(limit.getLimit()) <= 0) {
|
||||||
{
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
@@ -0,0 +1,100 @@
|
|||||||
|
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,9 +1,13 @@
|
|||||||
package info.bukova.isspst.services.signeddocs;
|
package info.bukova.isspst.services.signeddocs;
|
||||||
|
|
||||||
import info.bukova.isspst.data.DataModel;
|
import info.bukova.isspst.data.DataModel;
|
||||||
|
import info.bukova.isspst.data.Member;
|
||||||
import info.bukova.isspst.data.SignedDocument;
|
import info.bukova.isspst.data.SignedDocument;
|
||||||
import info.bukova.isspst.data.SignedDocumentItem;
|
import info.bukova.isspst.data.SignedDocumentItem;
|
||||||
import info.bukova.isspst.services.Service;
|
import info.bukova.isspst.services.Service;
|
||||||
|
import info.bukova.isspst.ui.signeddocs.SignedDocsTreeNode;
|
||||||
|
import org.zkoss.zul.TreeModel;
|
||||||
|
import org.zkoss.zul.TreeNode;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -17,4 +21,5 @@ public interface SignedDocumentService extends Service<SignedDocument> {
|
|||||||
|
|
||||||
public List<SignedDocument> getActualList();
|
public List<SignedDocument> getActualList();
|
||||||
public List<SignedDocument> getArchiveList();
|
public List<SignedDocument> getArchiveList();
|
||||||
|
public TreeModel<TreeNode<SignedDocumentItem>> getTree();
|
||||||
}
|
}
|
||||||
|
|||||||
+200
-87
@@ -4,126 +4,239 @@ import info.bukova.isspst.DateTimeUtils;
|
|||||||
import info.bukova.isspst.Module;
|
import info.bukova.isspst.Module;
|
||||||
import info.bukova.isspst.ModuleUtils;
|
import info.bukova.isspst.ModuleUtils;
|
||||||
import info.bukova.isspst.data.DataModel;
|
import info.bukova.isspst.data.DataModel;
|
||||||
|
import info.bukova.isspst.data.Member;
|
||||||
import info.bukova.isspst.data.SignedDocument;
|
import info.bukova.isspst.data.SignedDocument;
|
||||||
import info.bukova.isspst.data.SignedDocumentItem;
|
import info.bukova.isspst.data.SignedDocumentItem;
|
||||||
import info.bukova.isspst.services.AbstractOwnedService;
|
import info.bukova.isspst.services.AbstractOwnedService;
|
||||||
import info.bukova.isspst.services.LazyLoader;
|
import info.bukova.isspst.services.LazyLoader;
|
||||||
import info.bukova.isspst.storage.ReportFileStorage;
|
import info.bukova.isspst.storage.ReportFileStorage;
|
||||||
|
|
||||||
import java.util.Calendar;
|
import java.util.*;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.servlet.ServletContext;
|
import javax.servlet.ServletContext;
|
||||||
|
|
||||||
|
import info.bukova.isspst.ui.signeddocs.SignedDocsTreeNode;
|
||||||
import org.hibernate.Hibernate;
|
import org.hibernate.Hibernate;
|
||||||
import org.hibernate.Query;
|
import org.hibernate.Query;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.zkoss.zul.DefaultTreeModel;
|
||||||
|
import org.zkoss.zul.DefaultTreeNode;
|
||||||
|
import org.zkoss.zul.TreeModel;
|
||||||
|
import org.zkoss.zul.TreeNode;
|
||||||
|
|
||||||
public class SignedDocumentServiceImpl extends AbstractOwnedService<SignedDocument> implements SignedDocumentService {
|
public class SignedDocumentServiceImpl extends AbstractOwnedService<SignedDocument> implements SignedDocumentService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ServletContext servletContext;
|
private ServletContext servletContext;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ReportFileStorage signedDocStorage;
|
private ReportFileStorage signedDocStorage;
|
||||||
|
|
||||||
@LazyLoader("grid")
|
@LazyLoader("grid")
|
||||||
@Transactional
|
@Transactional
|
||||||
public void lazyLoadItems(SignedDocument signedDocument) {
|
public void lazyLoadItems(SignedDocument signedDocument) {
|
||||||
if (signedDocument == null) {
|
if (signedDocument == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SignedDocument sd = dao.getById(signedDocument.getId());
|
SignedDocument sd = dao.getById(signedDocument.getId());
|
||||||
Hibernate.initialize(sd.getItems());
|
Hibernate.initialize(sd.getItems());
|
||||||
signedDocument.setItems(sd.getItems());
|
signedDocument.setItems(sd.getItems());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public SignedDocument getForEntity(DataModel entity) {
|
public SignedDocument getForEntity(DataModel entity) {
|
||||||
Module module = ModuleUtils.getModule(entity, servletContext);
|
Module module = ModuleUtils.getModule(entity, servletContext);
|
||||||
|
|
||||||
if (module == null) {
|
if (module == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Query q = dao.getQuery("from SignedDocument where moduleName = :module and recordId = :record");
|
Query q = dao.getQuery("from SignedDocument where moduleName = :module and recordId = :record");
|
||||||
q.setParameter("module", module.getId());
|
q.setParameter("module", module.getId());
|
||||||
q.setParameter("record", entity.getId());
|
q.setParameter("record", entity.getId());
|
||||||
|
|
||||||
return (SignedDocument) q.uniqueResult();
|
return (SignedDocument) q.uniqueResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public SignedDocumentItem getItem(DataModel entity, long reportId) {
|
public SignedDocumentItem getItem(DataModel entity, long reportId) {
|
||||||
SignedDocument doc = getForEntity(entity);
|
SignedDocument doc = getForEntity(entity);
|
||||||
|
|
||||||
if (doc == null) {
|
if (doc == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (SignedDocumentItem item : doc.getItems()) {
|
for (SignedDocumentItem item : doc.getItems()) {
|
||||||
if (item.getReportId() == reportId) {
|
if (item.getReportId() == reportId) {
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addFromApprove(SignedDocument document) {
|
public void addFromApprove(SignedDocument document) {
|
||||||
super.add(document);
|
super.add(document);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void delFromApprove(SignedDocument document) {
|
public void delFromApprove(SignedDocument document) {
|
||||||
if (document == null) {
|
if (document == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
super.delete(document);
|
super.delete(document);
|
||||||
|
|
||||||
for (SignedDocumentItem item : document.getItems()) {
|
for (SignedDocumentItem item : document.getItems()) {
|
||||||
signedDocStorage.removeFile(item);
|
signedDocStorage.removeFile(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void deleteForEntity(DataModel entity) {
|
public void deleteForEntity(DataModel entity) {
|
||||||
SignedDocument doc = getForEntity(entity);
|
SignedDocument doc = getForEntity(entity);
|
||||||
if (doc != null) {
|
if (doc != null) {
|
||||||
delFromApprove(doc);
|
delFromApprove(doc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Date getTresholdDate() {
|
private Date getTresholdDate() {
|
||||||
Date date = DateTimeUtils.getDateDelta(DateTimeUtils.getCurrDate(), Calendar.YEAR, -1);
|
Date date = DateTimeUtils.getDateDelta(DateTimeUtils.getCurrDate(), Calendar.MONTH, -6);
|
||||||
return date;
|
return date;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
@PreAuthorize("hasPermission(this, 'PERM_READ')")
|
@PreAuthorize("hasPermission(this, 'PERM_READ')")
|
||||||
public List<SignedDocument> getActualList() {
|
public List<SignedDocument> getActualList() {
|
||||||
Query q = dao.getQuery("from SignedDocument where signDate >= :refDate");
|
Query q = dao.getQuery("from SignedDocument where signDate >= :refDate");
|
||||||
q.setParameter("refDate", this.getTresholdDate());
|
q.setParameter("refDate", this.getTresholdDate());
|
||||||
return q.list();
|
return q.list();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
@PreAuthorize("hasPermission(this, 'PERM_READ')")
|
@PreAuthorize("hasPermission(this, 'PERM_READ')")
|
||||||
public List<SignedDocument> getArchiveList() {
|
public List<SignedDocument> getArchiveList() {
|
||||||
Query q = dao.getQuery("from SignedDocument where signDate < :refDate");
|
Query q = dao.getQuery("from SignedDocument where signDate < :refDate");
|
||||||
q.setParameter("refDate", this.getTresholdDate());
|
q.setParameter("refDate", this.getTresholdDate());
|
||||||
return q.list();
|
return q.list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
@PreAuthorize("hasPermission(this, 'PERM_READ')")
|
||||||
|
public TreeModel<TreeNode<SignedDocumentItem>> getTree() {
|
||||||
|
Query q = queryDao.getQuery("select item "
|
||||||
|
+ "from SignedDocumentItem as item left join item.signedDocument as rec "
|
||||||
|
+ "order by rec.moduleName, rec.signDate desc, item.reportName, item.fileName "
|
||||||
|
);
|
||||||
|
List<SignedDocumentItem> list = q.list();
|
||||||
|
|
||||||
|
SignedDocumentItem lastItem = null;
|
||||||
|
SignedDocument lastRec = null;
|
||||||
|
List<SignedDocsTreeNode> agendaNameList = new LinkedList<SignedDocsTreeNode>();
|
||||||
|
List<SignedDocsTreeNode> signYearList = new LinkedList<SignedDocsTreeNode>();
|
||||||
|
List<SignedDocsTreeNode> signDateList = new LinkedList<SignedDocsTreeNode>();
|
||||||
|
List<SignedDocsTreeNode> filesList = null;
|
||||||
|
|
||||||
|
int documentsCount = list.size() - 1;
|
||||||
|
|
||||||
|
for (int i = 0; i <= documentsCount; i++) {
|
||||||
|
SignedDocumentItem item = list.get(i);
|
||||||
|
SignedDocument rec = item.getSignedDocument();
|
||||||
|
SignedDocsTreeNode itemNode = new SignedDocsTreeNode(item);
|
||||||
|
|
||||||
|
boolean isChangedAgendaName = ((i == 0)
|
||||||
|
|| (i == documentsCount)
|
||||||
|
|| !lastRec.getAgendaName().equals(rec.getAgendaName())
|
||||||
|
);
|
||||||
|
boolean isChangedSignYear = ((i == 0)
|
||||||
|
|| (i == documentsCount)
|
||||||
|
|| isChangedAgendaName
|
||||||
|
|| !DateTimeUtils.isEqualByYear(lastRec.getSignDate(), rec.getSignDate())
|
||||||
|
);
|
||||||
|
boolean isChangedSignDate = ((i == 0)
|
||||||
|
|| (i == documentsCount)
|
||||||
|
|| isChangedSignYear
|
||||||
|
|| !DateTimeUtils.isEqualByDate(lastRec.getSignDate(), rec.getSignDate())
|
||||||
|
);
|
||||||
|
|
||||||
|
if (isChangedAgendaName || isChangedSignYear || isChangedSignDate) {
|
||||||
|
|
||||||
|
if (isChangedSignDate) {
|
||||||
|
if (i > 0) {
|
||||||
|
SignedDocsTreeNode signDateNode = new SignedDocsTreeNode((i == documentsCount ? item : lastItem), filesList);
|
||||||
|
signDateList.add(signDateNode);
|
||||||
|
}
|
||||||
|
|
||||||
|
filesList = new LinkedList<SignedDocsTreeNode>();
|
||||||
|
filesList.add(itemNode);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isChangedSignYear) {
|
||||||
|
if (i > 0) {
|
||||||
|
SignedDocsTreeNode signYearNode = new SignedDocsTreeNode((i == documentsCount ? item : lastItem), signDateList);
|
||||||
|
signYearList.add(signYearNode);
|
||||||
|
}
|
||||||
|
|
||||||
|
signDateList = new LinkedList<SignedDocsTreeNode>();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isChangedAgendaName) {
|
||||||
|
if (i > 0) {
|
||||||
|
SignedDocsTreeNode agendaNode = new SignedDocsTreeNode((i == documentsCount ? item : lastItem), signYearList);
|
||||||
|
agendaNameList.add(agendaNode);
|
||||||
|
}
|
||||||
|
|
||||||
|
signYearList = new LinkedList<SignedDocsTreeNode>();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
filesList.add(itemNode);
|
||||||
|
}
|
||||||
|
|
||||||
|
lastItem = item;
|
||||||
|
lastRec = lastItem.getSignedDocument();
|
||||||
|
}
|
||||||
|
|
||||||
|
Collections.sort(agendaNameList, new Comparator<SignedDocsTreeNode>() {
|
||||||
|
@Override
|
||||||
|
public int compare(SignedDocsTreeNode nodeL, SignedDocsTreeNode nodeR) {
|
||||||
|
if ((nodeL != null) && (nodeR != null)) {
|
||||||
|
SignedDocumentItem itemL = nodeL.getData();
|
||||||
|
SignedDocumentItem itemR = nodeR.getData();
|
||||||
|
|
||||||
|
if ((itemL != null) && (itemR != null)) {
|
||||||
|
SignedDocument recL = itemL.getSignedDocument();
|
||||||
|
SignedDocument recR = itemR.getSignedDocument();
|
||||||
|
|
||||||
|
if ((recL != null) && (recR != null)) {
|
||||||
|
String nameL = recL.getAgendaName();
|
||||||
|
String nameR = recR.getAgendaName();
|
||||||
|
|
||||||
|
if ((nameL != null) && (nameR != null)) {
|
||||||
|
return nameL.compareTo(nameR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
SignedDocsTreeNode root = new SignedDocsTreeNode(null, agendaNameList);
|
||||||
|
TreeModel<TreeNode<SignedDocumentItem>> tree = new DefaultTreeModel<SignedDocumentItem>(root);
|
||||||
|
return tree;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+23
-2
@@ -12,7 +12,10 @@ import info.bukova.isspst.services.IsspstException;
|
|||||||
import info.bukova.isspst.services.requirement.RequirementBaseServiceImpl;
|
import info.bukova.isspst.services.requirement.RequirementBaseServiceImpl;
|
||||||
import info.bukova.isspst.services.requirement.RequirementTypeService;
|
import info.bukova.isspst.services.requirement.RequirementTypeService;
|
||||||
import info.bukova.isspst.services.signeddocs.SignedDocumentService;
|
import info.bukova.isspst.services.signeddocs.SignedDocumentService;
|
||||||
|
import info.bukova.isspst.storage.StorageException;
|
||||||
import org.hibernate.Query;
|
import org.hibernate.Query;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@@ -31,6 +34,8 @@ public class TripBillApprovalServiceImpl extends RequirementBaseServiceImpl<Trip
|
|||||||
@Autowired
|
@Autowired
|
||||||
private SignedDocumentService signedDocumentService;
|
private SignedDocumentService signedDocumentService;
|
||||||
|
|
||||||
|
private final static Logger logger = LoggerFactory.getLogger(TripBillApproval.class);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TripBillApproval createApproval(TripBill bill) {
|
public TripBillApproval createApproval(TripBill bill) {
|
||||||
if (bill.getApproval() != null) {
|
if (bill.getApproval() != null) {
|
||||||
@@ -40,6 +45,7 @@ public class TripBillApprovalServiceImpl extends RequirementBaseServiceImpl<Trip
|
|||||||
TripBillApproval approval = new TripBillApproval();
|
TripBillApproval approval = new TripBillApproval();
|
||||||
approval.setCentre(bill.getRequirement().getCentre());
|
approval.setCentre(bill.getRequirement().getCentre());
|
||||||
approval.setWorkgroup(bill.getRequirement().getWorkgroup());
|
approval.setWorkgroup(bill.getRequirement().getWorkgroup());
|
||||||
|
approval.setSeason(bill.getSeason());
|
||||||
approval.setReqDate(new Date());
|
approval.setReqDate(new Date());
|
||||||
approval.setType(reqTypeService.getTypeById(Constants.REQTYPE_BUSINESSTRIP));
|
approval.setType(reqTypeService.getTypeById(Constants.REQTYPE_BUSINESSTRIP));
|
||||||
approval.setState(RequirementState.NEW);
|
approval.setState(RequirementState.NEW);
|
||||||
@@ -71,9 +77,24 @@ public class TripBillApprovalServiceImpl extends RequirementBaseServiceImpl<Trip
|
|||||||
@Transactional
|
@Transactional
|
||||||
@PreAuthorize("hasPermission(this, 'PERM_DELETE') or this.canApprove(#bill.approval)")
|
@PreAuthorize("hasPermission(this, 'PERM_DELETE') or this.canApprove(#bill.approval)")
|
||||||
public void cancelApproval(TripBill bill) {
|
public void cancelApproval(TripBill bill) {
|
||||||
|
TripBillApproval approval = bill.getApproval();
|
||||||
|
|
||||||
|
if (approval != null) {
|
||||||
|
super.delete(approval);
|
||||||
|
}
|
||||||
|
|
||||||
|
removeApproval(bill);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void removeApproval(TripBill bill) {
|
||||||
bill.setApproval(null);
|
bill.setApproval(null);
|
||||||
signedDocumentService.deleteForEntity(bill);
|
|
||||||
tripBillService.update(bill);
|
tripBillService.update(bill);
|
||||||
|
|
||||||
|
try {
|
||||||
|
signedDocumentService.deleteForEntity(bill);
|
||||||
|
} catch (StorageException e) {
|
||||||
|
logger.warn(e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -95,7 +116,7 @@ public class TripBillApprovalServiceImpl extends RequirementBaseServiceImpl<Trip
|
|||||||
|
|
||||||
if (bill != null) {
|
if (bill != null) {
|
||||||
dao.delete(entity);
|
dao.delete(entity);
|
||||||
cancelApproval(bill);
|
removeApproval(bill);
|
||||||
} else {
|
} else {
|
||||||
super.delete(entity);
|
super.delete(entity);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import info.bukova.isspst.data.TripBill;
|
|||||||
import info.bukova.isspst.data.TripBillItem;
|
import info.bukova.isspst.data.TripBillItem;
|
||||||
import info.bukova.isspst.data.TripRequirement;
|
import info.bukova.isspst.data.TripRequirement;
|
||||||
import info.bukova.isspst.services.AbstractOwnedService;
|
import info.bukova.isspst.services.AbstractOwnedService;
|
||||||
|
import info.bukova.isspst.services.HqlDataFilter;
|
||||||
import info.bukova.isspst.services.LazyLoader;
|
import info.bukova.isspst.services.LazyLoader;
|
||||||
import info.bukova.isspst.services.settings.GlobalSettingsService;
|
import info.bukova.isspst.services.settings.GlobalSettingsService;
|
||||||
import org.hibernate.Hibernate;
|
import org.hibernate.Hibernate;
|
||||||
@@ -46,6 +47,7 @@ public class TripBillServiceImpl extends AbstractOwnedService<TripBill> implemen
|
|||||||
TripBill bill = new TripBill();
|
TripBill bill = new TripBill();
|
||||||
|
|
||||||
bill.setRequirement(requirement);
|
bill.setRequirement(requirement);
|
||||||
|
bill.setSeason(requirement.getSeason());
|
||||||
|
|
||||||
if (!passengers) {
|
if (!passengers) {
|
||||||
bill.setDownPayment(requirement.getDownPayment());
|
bill.setDownPayment(requirement.getDownPayment());
|
||||||
@@ -133,7 +135,7 @@ public class TripBillServiceImpl extends AbstractOwnedService<TripBill> implemen
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (item.getBackDeparture() == null) {
|
if (item.getBackDeparture() == null) {
|
||||||
timeBack = (new LocalTime()).withHourOfDay(23).withMinuteOfHour(59);
|
timeBack = (new LocalTime()).withHourOfDay(23).withMinuteOfHour(00);
|
||||||
allDay = true;
|
allDay = true;
|
||||||
} else {
|
} else {
|
||||||
timeBack = new LocalTime(item.getBackDeparture());
|
timeBack = new LocalTime(item.getBackDeparture());
|
||||||
@@ -179,9 +181,10 @@ public class TripBillServiceImpl extends AbstractOwnedService<TripBill> implemen
|
|||||||
@Transactional
|
@Transactional
|
||||||
@PreAuthorize("hasPermission(this, 'PERM_READ')")
|
@PreAuthorize("hasPermission(this, 'PERM_READ')")
|
||||||
public List<TripBill> getMy() {
|
public List<TripBill> getMy() {
|
||||||
Query q = dao.getQuery("from TripBill where ownedBy = :owner");
|
Query q = dao.getQuery("from TripBill");
|
||||||
q.setParameter("owner", getLoggedInUser());
|
HqlDataFilter f = new HqlDataFilter("ownedBy = :owner");
|
||||||
return q.list();
|
f.setParam("owner", getLoggedInUser());
|
||||||
|
return filterQuery(q, f).list();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package info.bukova.isspst.services.workgroups;
|
package info.bukova.isspst.services.workgroups;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import info.bukova.isspst.data.JobMapping;
|
import info.bukova.isspst.data.JobMapping;
|
||||||
import info.bukova.isspst.data.Member;
|
import info.bukova.isspst.data.Member;
|
||||||
import info.bukova.isspst.data.Role;
|
import info.bukova.isspst.data.Role;
|
||||||
@@ -9,6 +7,8 @@ import info.bukova.isspst.data.User;
|
|||||||
import info.bukova.isspst.data.Workgroup;
|
import info.bukova.isspst.data.Workgroup;
|
||||||
import info.bukova.isspst.services.Service;
|
import info.bukova.isspst.services.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public interface WorkgroupService extends Service<Workgroup> {
|
public interface WorkgroupService extends Service<Workgroup> {
|
||||||
|
|
||||||
public void addMember(Workgroup workgroup, Member member, Role role);
|
public void addMember(Workgroup workgroup, Member member, Role role);
|
||||||
@@ -17,6 +17,7 @@ public interface WorkgroupService extends Service<Workgroup> {
|
|||||||
public List<Workgroup> getCentres();
|
public List<Workgroup> getCentres();
|
||||||
public boolean isMember(Workgroup workgroup, Member member);
|
public boolean isMember(Workgroup workgroup, Member member);
|
||||||
public List<Workgroup> getUserCentres(User user);
|
public List<Workgroup> getUserCentres(User user);
|
||||||
|
public List<Workgroup> getUserCentres(User user, boolean userOnly);
|
||||||
public List<Workgroup> getUserWorkgroups(User user);
|
public List<Workgroup> getUserWorkgroups(User user);
|
||||||
public List<Role> getUserWorkgroupRoles(Workgroup workgroup, User user);
|
public List<Role> getUserWorkgroupRoles(Workgroup workgroup, User user);
|
||||||
public List<Member> getMembers(Workgroup workgroup);
|
public List<Member> getMembers(Workgroup workgroup);
|
||||||
|
|||||||
@@ -8,15 +8,14 @@ import info.bukova.isspst.data.User;
|
|||||||
import info.bukova.isspst.data.Workgroup;
|
import info.bukova.isspst.data.Workgroup;
|
||||||
import info.bukova.isspst.services.AbstractOwnedService;
|
import info.bukova.isspst.services.AbstractOwnedService;
|
||||||
import info.bukova.isspst.services.LazyLoader;
|
import info.bukova.isspst.services.LazyLoader;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.hibernate.LazyInitializationException;
|
import org.hibernate.LazyInitializationException;
|
||||||
import org.hibernate.Query;
|
import org.hibernate.Query;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class WorkgroupServiceImpl extends AbstractOwnedService<Workgroup> implements WorkgroupService {
|
public class WorkgroupServiceImpl extends AbstractOwnedService<Workgroup> implements WorkgroupService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -125,7 +124,7 @@ public class WorkgroupServiceImpl extends AbstractOwnedService<Workgroup> implem
|
|||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public List<Workgroup> getUserCentres(User user) {
|
public List<Workgroup> getUserCentres(User user) {
|
||||||
if (user.equals(getLoggedInUser()) && sessionData.getUserCentres() != null) {
|
/*if (user.equals(getLoggedInUser()) && sessionData.getUserCentres() != null) {
|
||||||
return sessionData.getUserCentres();
|
return sessionData.getUserCentres();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -150,6 +149,75 @@ public class WorkgroupServiceImpl extends AbstractOwnedService<Workgroup> implem
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return centres;*/
|
||||||
|
return getUserCentres(user, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public List<Workgroup> getUserCentres(User user, boolean userOnly) {
|
||||||
|
if (!userOnly && user.equals(getLoggedInUser()) && sessionData.getUserCentres() != null) {
|
||||||
|
return sessionData.getUserCentres();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (userOnly && user.equals(getLoggedInUser()) && sessionData.getUserOnlyCentres() != null) {
|
||||||
|
return sessionData.getUserOnlyCentres();
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Workgroup> parents;
|
||||||
|
|
||||||
|
if (userOnly) {
|
||||||
|
parents = filterUserOnly(user, getParents(user));
|
||||||
|
} else {
|
||||||
|
parents = getParents(user);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (parents == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Workgroup> centres = new ArrayList<Workgroup>();
|
||||||
|
for (Workgroup w : parents) {
|
||||||
|
if (w.isCentre()) {
|
||||||
|
centres.add(w);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Workgroup> workGroups;
|
||||||
|
|
||||||
|
if (userOnly) {
|
||||||
|
workGroups = filterUserOnly(user, getUserWorkgroups(user));
|
||||||
|
} else {
|
||||||
|
workGroups = getUserWorkgroups(user);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Workgroup w : workGroups) {
|
||||||
|
loadParents(w);
|
||||||
|
for (Workgroup centre : w.getParents()) {
|
||||||
|
if (!centres.contains(centre)) {
|
||||||
|
centres.add(centre);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return centres;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Workgroup> filterUserOnly(User user, List<Workgroup> wgList) {
|
||||||
|
List<Workgroup> centres = new ArrayList<Workgroup>();
|
||||||
|
|
||||||
|
for (Workgroup wg : wgList) {
|
||||||
|
List<Role> roles = getUserWorkgroupRoles(wg, user);
|
||||||
|
if (roles == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Role r : roles) {
|
||||||
|
if (r.getAuthority().equals(Constants.ROLE_USER)) {
|
||||||
|
centres.add(wg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return centres;
|
return centres;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,170 @@
|
|||||||
package info.bukova.isspst.sort;
|
package info.bukova.isspst.sort;
|
||||||
|
|
||||||
import org.zkoss.zul.Listheader;
|
import info.bukova.isspst.StringUtils;
|
||||||
|
import org.apache.poi.hssf.usermodel.*;
|
||||||
|
import org.apache.poi.ss.usermodel.Cell;
|
||||||
|
import org.apache.poi.ss.usermodel.CellStyle;
|
||||||
|
import org.apache.poi.ss.usermodel.Row;
|
||||||
|
import org.zkoss.zk.au.AuRequest;
|
||||||
|
import org.zkoss.zk.ui.Component;
|
||||||
|
import org.zkoss.zk.ui.event.*;
|
||||||
|
import org.zkoss.zul.*;
|
||||||
|
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class CzechSortListheader extends Listheader {
|
public class CzechSortListheader extends Listheader {
|
||||||
|
static {
|
||||||
|
addClientEvent(CzechSortListheader.class, Events.ON_RIGHT_CLICK, CE_IMPORTANT | CE_NON_DEFERRABLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onRightClick() {
|
||||||
|
Menupopup popup = new Menupopup();
|
||||||
|
popup.setPage(this.getPage());
|
||||||
|
popup.setWidth("250px");
|
||||||
|
this.setContext(popup);
|
||||||
|
|
||||||
|
Menuitem item = new Menuitem();
|
||||||
|
item.setLabel(StringUtils.localize("ExportToExcel"));
|
||||||
|
item.setImage("/img/excel-032.png");
|
||||||
|
item.setParent(popup);
|
||||||
|
|
||||||
|
item.addEventListener(Events.ON_CLICK, new EventListener() {
|
||||||
|
@Override
|
||||||
|
public void onEvent(org.zkoss.zk.ui.event.Event event) throws Exception {
|
||||||
|
Listbox listBox = getListbox();
|
||||||
|
|
||||||
|
if (listBox != null) {
|
||||||
|
HSSFWorkbook workBook = new HSSFWorkbook();
|
||||||
|
HSSFSheet workSheet = workBook.createSheet("export");
|
||||||
|
int rowNumber = 0;
|
||||||
|
Row excelRow = null;
|
||||||
|
Cell excelCell = null;
|
||||||
|
|
||||||
|
HSSFCellStyle cellStyle = workBook.createCellStyle();
|
||||||
|
HSSFFont defaultFont = cellStyle.getFont(workBook);
|
||||||
|
|
||||||
|
HSSFCellStyle cellStyleNumber = workBook.createCellStyle();
|
||||||
|
cellStyleNumber.setAlignment(CellStyle.ALIGN_RIGHT);
|
||||||
|
//http://www.roseindia.net/java/poi/setdataformat.shtml
|
||||||
|
//HSSFDataFormat dataNumberFormat = workBook.createDataFormat();
|
||||||
|
//cellStyleNumber.setDataFormat(dataNumberFormat.getFormat("# ##0,00"));
|
||||||
|
cellStyleNumber.setDataFormat((short)4);
|
||||||
|
|
||||||
|
HSSFCellStyle cellStyleDate = workBook.createCellStyle();
|
||||||
|
cellStyleDate.setAlignment(CellStyle.ALIGN_RIGHT);
|
||||||
|
//http://www.roseindia.net/java/poi/setdataformat.shtml
|
||||||
|
HSSFDataFormat dataDateFormat = workBook.createDataFormat();
|
||||||
|
cellStyleDate.setDataFormat(dataDateFormat.getFormat("DD. MM. YYYY"));
|
||||||
|
//cellStyleDate.setDataFormat((short) 15);
|
||||||
|
|
||||||
|
int totalCols = 0;
|
||||||
|
|
||||||
|
Listhead listHead = listBox.getListhead();
|
||||||
|
|
||||||
|
if (listHead != null) {
|
||||||
|
HSSFCellStyle cellStyleHeader = workBook.createCellStyle();
|
||||||
|
cellStyleHeader.setAlignment(CellStyle.ALIGN_CENTER);
|
||||||
|
HSSFFont font = workBook.createFont();
|
||||||
|
font.setFontName(defaultFont.getFontName());
|
||||||
|
font.setFontHeightInPoints(defaultFont.getFontHeightInPoints());
|
||||||
|
font.setBold(true);
|
||||||
|
cellStyleHeader.setFont(font);
|
||||||
|
|
||||||
|
excelRow = workSheet.createRow(rowNumber++);
|
||||||
|
List<Listheader> headerList = listHead.getChildren();
|
||||||
|
totalCols = headerList.size();
|
||||||
|
|
||||||
|
for (int i = 0; i < totalCols; i++) {
|
||||||
|
Listheader listHeader = headerList.get(i);
|
||||||
|
String label = listHeader.getLabel();
|
||||||
|
excelCell = excelRow.createCell(i);
|
||||||
|
excelCell.setCellStyle(cellStyleHeader);
|
||||||
|
excelCell.setCellValue(label);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Listitem> itemList = listBox.getItems();
|
||||||
|
|
||||||
|
for (int i = 0; i < itemList.size(); i++) {
|
||||||
|
Listitem item = itemList.get(i);
|
||||||
|
excelRow = workSheet.createRow(rowNumber++);
|
||||||
|
|
||||||
|
List<Listcell> cellList = item.getChildren();
|
||||||
|
|
||||||
|
for (int k=0; k < cellList.size(); k++) {
|
||||||
|
Listcell cell = cellList.get(k);
|
||||||
|
String label = cell.getLabel();
|
||||||
|
|
||||||
|
HSSFCellStyle cellStyleActual = cellStyle;
|
||||||
|
excelCell = excelRow.createCell(k);
|
||||||
|
|
||||||
|
if (label != null) {
|
||||||
|
if (label.isEmpty()) {
|
||||||
|
//List<Component> componentList = cell.getChildren();
|
||||||
|
Component component = cell.getFirstChild();
|
||||||
|
|
||||||
|
if (component != null) {
|
||||||
|
if (component instanceof Textbox) {
|
||||||
|
Textbox textBox = (Textbox) component;
|
||||||
|
label = textBox.getValue();
|
||||||
|
}
|
||||||
|
else if (component instanceof Button) {
|
||||||
|
Button button = (Button) component;
|
||||||
|
label = button.getLabel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (label.matches("^[+-]?[0-9]{1,3}(,?[0-9]{3})*(\\.[0-9]+)?$")) {
|
||||||
|
// english number -1,234.56 (change browser language)
|
||||||
|
label = label.replace(",", " ");
|
||||||
|
label = label.replace(".", ",");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (label.matches("^[+-]?[0-9]{1,3}([ \\xA0][0-9]{3})*([,][0-9]+)?$")) {
|
||||||
|
// czech number -1 234,56
|
||||||
|
cellStyleActual = cellStyleNumber;
|
||||||
|
}
|
||||||
|
else if (label.matches("[0-9]{1,2}[.][ \\xA0]?[0-9]{1,2}[.][ \\xA0]?[0-9]{4}")) {
|
||||||
|
// czech date
|
||||||
|
cellStyleActual = cellStyleDate;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
excelCell.setCellStyle(cellStyleActual);
|
||||||
|
excelCell.setCellValue(label);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < totalCols; i++) {
|
||||||
|
//int width = workSheet.getColumnWidth(i);
|
||||||
|
workSheet.autoSizeColumn(i);
|
||||||
|
int width = workSheet.getColumnWidth(i);
|
||||||
|
int maxWidth = 8000;
|
||||||
|
|
||||||
|
if (width > maxWidth) {
|
||||||
|
workSheet.setColumnWidth(i, maxWidth);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ByteArrayOutputStream os = new ByteArrayOutputStream();
|
||||||
|
workBook.write(os);
|
||||||
|
Filedownload.save(os.toByteArray(), "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "temp" + Long.toString(System.nanoTime()) + ".xlsx");
|
||||||
|
// //Filedownload.save(tempFile, "application/vnd.ms-excel");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void service(AuRequest request, boolean everError) {
|
||||||
|
super.service(request, everError);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setSort(String type) {
|
public void setSort(String type) {
|
||||||
|
|
||||||
if (type.startsWith("czech"))
|
if (type.startsWith("czech"))
|
||||||
{
|
{
|
||||||
// czech(propertyName)
|
// czech(propertyName)
|
||||||
@@ -21,5 +178,4 @@ public class CzechSortListheader extends Listheader {
|
|||||||
super.setSort(type);
|
super.setSort(type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,6 +44,11 @@ public class DocumentFileStorageImpl extends AbstractFileStorage<FileMetainfo> i
|
|||||||
this.rootPath = rootPath;
|
this.rootPath = rootPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getRootPath() {
|
||||||
|
return this.rootPath;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void saveFile(byte[] data, FileMetainfo fileID) {
|
public void saveFile(byte[] data, FileMetainfo fileID) {
|
||||||
String fileName = generateFileName(fileID.getFileName());
|
String fileName = generateFileName(fileID.getFileName());
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import java.io.File;
|
|||||||
*/
|
*/
|
||||||
public interface FileStorage<T> {
|
public interface FileStorage<T> {
|
||||||
|
|
||||||
// public String getRootPath();
|
public String getRootPath();
|
||||||
public void saveFile(byte[] data, T fileID);
|
public void saveFile(byte[] data, T fileID);
|
||||||
public void saveFile(File file, T fileId);
|
public void saveFile(File file, T fileId);
|
||||||
public void removeFile(T fileID);
|
public void removeFile(T fileID);
|
||||||
|
|||||||
@@ -12,6 +12,11 @@ public class LocalFileStorage extends AbstractFileStorage<String> {
|
|||||||
this.rootPath = rootPath;
|
this.rootPath = rootPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getRootPath() {
|
||||||
|
return this.rootPath;
|
||||||
|
}
|
||||||
|
|
||||||
public void setContext(ServletContext ctx) {
|
public void setContext(ServletContext ctx) {
|
||||||
this.context = ctx;
|
this.context = ctx;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,11 @@ public class ReportFileStorageImpl extends AbstractFileStorage<SignedDocumentIte
|
|||||||
this.rootPath = rootPath;
|
this.rootPath = rootPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getRootPath() {
|
||||||
|
return this.rootPath;
|
||||||
|
}
|
||||||
|
|
||||||
private String getFilePath(String fileName) {
|
private String getFilePath(String fileName) {
|
||||||
return rootPath + "/" + fileName;
|
return rootPath + "/" + fileName;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,69 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -16,6 +16,18 @@ import org.zkoss.zul.Messagebox;
|
|||||||
|
|
||||||
public class DocumentViewModel
|
public class DocumentViewModel
|
||||||
{
|
{
|
||||||
|
protected BigDecimalFilterConverter standardBigDecimalFilterConverter;
|
||||||
|
|
||||||
|
public BigDecimalFilterConverter getStandardBigDecimalFilterConverter()
|
||||||
|
{
|
||||||
|
return standardBigDecimalFilterConverter;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStandardBigDecimalFilterConverter(BigDecimalFilterConverter standardBigDecimalFilterConverter)
|
||||||
|
{
|
||||||
|
this.standardBigDecimalFilterConverter = standardBigDecimalFilterConverter;
|
||||||
|
}
|
||||||
|
|
||||||
protected BigDecimalConverter standardBigDecimalConverter;
|
protected BigDecimalConverter standardBigDecimalConverter;
|
||||||
|
|
||||||
protected BoolConverter standardBoolConverter;
|
protected BoolConverter standardBoolConverter;
|
||||||
@@ -53,6 +65,7 @@ public class DocumentViewModel
|
|||||||
@Init
|
@Init
|
||||||
public void initDocumentViewModel()
|
public void initDocumentViewModel()
|
||||||
{
|
{
|
||||||
|
this.standardBigDecimalFilterConverter = new BigDecimalFilterConverter();
|
||||||
this.standardBigDecimalConverter = new BigDecimalConverter();
|
this.standardBigDecimalConverter = new BigDecimalConverter();
|
||||||
this.standardBoolConverter = new BoolConverter();
|
this.standardBoolConverter = new BoolConverter();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,10 +5,6 @@ import info.bukova.isspst.data.DataModel;
|
|||||||
import info.bukova.isspst.services.IsspstException;
|
import info.bukova.isspst.services.IsspstException;
|
||||||
import info.bukova.isspst.services.Service;
|
import info.bukova.isspst.services.Service;
|
||||||
import info.bukova.isspst.services.ValidationException;
|
import info.bukova.isspst.services.ValidationException;
|
||||||
|
|
||||||
import java.sql.SQLException;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import org.hibernate.exception.ConstraintViolationException;
|
import org.hibernate.exception.ConstraintViolationException;
|
||||||
import org.springframework.dao.DataIntegrityViolationException;
|
import org.springframework.dao.DataIntegrityViolationException;
|
||||||
import org.springframework.security.access.AccessDeniedException;
|
import org.springframework.security.access.AccessDeniedException;
|
||||||
@@ -20,12 +16,15 @@ import org.zkoss.bind.annotation.NotifyChange;
|
|||||||
import org.zkoss.zul.Messagebox;
|
import org.zkoss.zul.Messagebox;
|
||||||
import org.zkoss.zul.Window;
|
import org.zkoss.zul.Window;
|
||||||
|
|
||||||
|
import java.sql.SQLException;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public class FormViewModel<T extends DataModel> extends BindingViewModel<T>
|
public class FormViewModel<T extends DataModel> extends BindingViewModel<T>
|
||||||
{
|
{
|
||||||
private T dataBean;
|
private T dataBean;
|
||||||
private Map<String, String> errMessages;
|
private Map<String, String> errMessages;
|
||||||
private Service<T> service;
|
private Service<T> service;
|
||||||
private boolean newRec;
|
protected boolean newRec;
|
||||||
private ServiceConstraint<T> constraint;
|
private ServiceConstraint<T> constraint;
|
||||||
|
|
||||||
@Init
|
@Init
|
||||||
|
|||||||
@@ -2,9 +2,13 @@ package info.bukova.isspst.ui;
|
|||||||
|
|
||||||
import info.bukova.isspst.StringUtils;
|
import info.bukova.isspst.StringUtils;
|
||||||
import info.bukova.isspst.data.DataModel;
|
import info.bukova.isspst.data.DataModel;
|
||||||
|
import info.bukova.isspst.data.Season;
|
||||||
|
import info.bukova.isspst.data.SeasonsAware;
|
||||||
import info.bukova.isspst.filters.Filter;
|
import info.bukova.isspst.filters.Filter;
|
||||||
|
import info.bukova.isspst.services.HqlDataFilter;
|
||||||
import info.bukova.isspst.services.IsspstException;
|
import info.bukova.isspst.services.IsspstException;
|
||||||
import info.bukova.isspst.services.Service;
|
import info.bukova.isspst.services.Service;
|
||||||
|
import info.bukova.isspst.services.settings.SeasonService;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.dao.DataIntegrityViolationException;
|
import org.springframework.dao.DataIntegrityViolationException;
|
||||||
@@ -18,10 +22,13 @@ import org.zkoss.bind.annotation.NotifyChange;
|
|||||||
import org.zkoss.zk.ui.Executions;
|
import org.zkoss.zk.ui.Executions;
|
||||||
import org.zkoss.zk.ui.event.Event;
|
import org.zkoss.zk.ui.event.Event;
|
||||||
import org.zkoss.zk.ui.event.EventListener;
|
import org.zkoss.zk.ui.event.EventListener;
|
||||||
|
import org.zkoss.zk.ui.select.annotation.WireVariable;
|
||||||
|
import org.zkoss.zul.Listheader;
|
||||||
import org.zkoss.zul.Messagebox;
|
import org.zkoss.zul.Messagebox;
|
||||||
import org.zkoss.zul.Window;
|
import org.zkoss.zul.Window;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -43,6 +50,14 @@ public class ListViewModel<T extends DataModel> extends DocumentViewModel
|
|||||||
private boolean sortDesc = true;
|
private boolean sortDesc = true;
|
||||||
private boolean newRec = false;
|
private boolean newRec = false;
|
||||||
private boolean fullFill = false;
|
private boolean fullFill = false;
|
||||||
|
private Listheader sortHeader;
|
||||||
|
|
||||||
|
@WireVariable
|
||||||
|
private SeasonService seasonService;
|
||||||
|
private List<Season> seasons;
|
||||||
|
private Season selSeason;
|
||||||
|
@WireVariable
|
||||||
|
private HqlDataFilter hqlFilter;
|
||||||
|
|
||||||
protected Service<T> service;
|
protected Service<T> service;
|
||||||
protected Class<T> dataClass;
|
protected Class<T> dataClass;
|
||||||
@@ -53,6 +68,13 @@ public class ListViewModel<T extends DataModel> extends DocumentViewModel
|
|||||||
public void initListViewModel()
|
public void initListViewModel()
|
||||||
{
|
{
|
||||||
super.initDocumentViewModel();
|
super.initDocumentViewModel();
|
||||||
|
seasons = seasonService.getAllSeasons();
|
||||||
|
|
||||||
|
Map<String, String[]> map = Executions.getCurrent().getParameterMap();
|
||||||
|
if (map.get("select") == null) {
|
||||||
|
selSeason = seasonService.getActive();
|
||||||
|
}
|
||||||
|
setHqlFilter();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<T> getDataList() {
|
public List<T> getDataList() {
|
||||||
@@ -125,6 +147,7 @@ public class ListViewModel<T extends DataModel> extends DocumentViewModel
|
|||||||
dataList = fullList;
|
dataList = fullList;
|
||||||
dataBean = null;
|
dataBean = null;
|
||||||
selIndex = -1;
|
selIndex = -1;
|
||||||
|
restoreSort();
|
||||||
} else {
|
} else {
|
||||||
doFilter();
|
doFilter();
|
||||||
dataBean = null;
|
dataBean = null;
|
||||||
@@ -261,9 +284,10 @@ public class ListViewModel<T extends DataModel> extends DocumentViewModel
|
|||||||
dataList.set(selIndex, editBean);
|
dataList.set(selIndex, editBean);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BindUtils.postGlobalCommand(null, null, "reloadRelated", null);
|
BindUtils.postGlobalCommand(null, null, "reloadRelated", null);
|
||||||
|
|
||||||
|
restoreUserView();
|
||||||
}
|
}
|
||||||
|
|
||||||
@GlobalCommand
|
@GlobalCommand
|
||||||
@@ -271,6 +295,7 @@ public class ListViewModel<T extends DataModel> extends DocumentViewModel
|
|||||||
public void reload() {
|
public void reload() {
|
||||||
dataBean = null;
|
dataBean = null;
|
||||||
dataList.clear();
|
dataList.clear();
|
||||||
|
setHqlFilter();
|
||||||
loadFromDbSync();
|
loadFromDbSync();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -303,6 +328,9 @@ public class ListViewModel<T extends DataModel> extends DocumentViewModel
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (id > 0) {
|
if (id > 0) {
|
||||||
|
selSeason = null;
|
||||||
|
setHqlFilter();
|
||||||
|
dataList = getListFromService();
|
||||||
for (int i = 0; i < dataList.size(); i++) {
|
for (int i = 0; i < dataList.size(); i++) {
|
||||||
if (dataList.get(i).getId() == id) {
|
if (dataList.get(i).getId() == id) {
|
||||||
selIndex = i;
|
selIndex = i;
|
||||||
@@ -311,13 +339,13 @@ public class ListViewModel<T extends DataModel> extends DocumentViewModel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selIndex > -1) {
|
if (selIndex > -1) {
|
||||||
this.setDataBean(dataList.get(selIndex));
|
this.setDataBean(dataList.get(selIndex));
|
||||||
afterSelect();
|
afterSelect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void beforeSelectViaUrl() {
|
protected void beforeSelectViaUrl() {
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -327,14 +355,13 @@ public class ListViewModel<T extends DataModel> extends DocumentViewModel
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Command
|
@Command
|
||||||
@NotifyChange("dataBean")
|
@NotifyChange({"dataBean", "canApprove"})
|
||||||
public void onSort(@BindingParam("column") String column) {
|
public void onSortHeader(@BindingParam("header") Listheader header) {
|
||||||
if (sortCol == null || this.sortCol.equals(column))
|
sortHeader = header;
|
||||||
this.sortDesc = !this.sortDesc;
|
|
||||||
|
|
||||||
this.sortCol = column;
|
|
||||||
selIndex = -1;
|
selIndex = -1;
|
||||||
dataBean = null;
|
dataBean = null;
|
||||||
|
Collections.sort(dataList,
|
||||||
|
sortHeader.getSortDirection().equals("ascending") ? sortHeader.getSortDescending() : sortHeader.getSortAscending());
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getSelIndex() {
|
public int getSelIndex() {
|
||||||
@@ -389,7 +416,28 @@ public class ListViewModel<T extends DataModel> extends DocumentViewModel
|
|||||||
protected void setFullFill(boolean fullFill) {
|
protected void setFullFill(boolean fullFill) {
|
||||||
this.fullFill = fullFill;
|
this.fullFill = fullFill;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void restoreUserView() {
|
||||||
|
int sel = selIndex;
|
||||||
|
|
||||||
|
restoreFilter();
|
||||||
|
restoreSort();
|
||||||
|
selIndex = sel;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void restoreSort() {
|
||||||
|
if (sortHeader != null) {
|
||||||
|
Collections.sort(dataList,
|
||||||
|
sortHeader.getSortDirection().equals("ascending") ? sortHeader.getSortAscending() : sortHeader.getSortDescending());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void restoreFilter() {
|
||||||
|
if (filter) {
|
||||||
|
doFilter();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isRecordSelected()
|
public boolean isRecordSelected()
|
||||||
{
|
{
|
||||||
return (dataBean != null);
|
return (dataBean != null);
|
||||||
@@ -397,11 +445,61 @@ public class ListViewModel<T extends DataModel> extends DocumentViewModel
|
|||||||
|
|
||||||
public boolean isAbleToDelete()
|
public boolean isAbleToDelete()
|
||||||
{
|
{
|
||||||
|
if (isSeasonFilter()
|
||||||
|
&&(!seasonService.getActive().equals(selSeason))) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return this.isRecordSelected();
|
return this.isRecordSelected();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isAbleToAdd()
|
public boolean isAbleToAdd()
|
||||||
{
|
{
|
||||||
|
if (isSeasonFilter()
|
||||||
|
&&(!seasonService.getActive().equals(selSeason))) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<Season> getSeasons() {
|
||||||
|
return seasons;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Season getSelSeason() {
|
||||||
|
return selSeason;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSelSeason(Season selSeason) {
|
||||||
|
this.selSeason = selSeason;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setHqlFilter() {
|
||||||
|
if (selSeason == null) {
|
||||||
|
hqlFilter.reset();
|
||||||
|
} else {
|
||||||
|
hqlFilter.setWhere("SEASON_ID = :season");
|
||||||
|
hqlFilter.setParam("season", selSeason.getId());
|
||||||
|
hqlFilter.setDataClass(SeasonsAware.class);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Command
|
||||||
|
@NotifyChange({"dataList", "ableToAdd", "selIndex", "dataBean", "ableToDelete"})
|
||||||
|
public void filterSeason() {
|
||||||
|
setHqlFilter();
|
||||||
|
dataList.clear();
|
||||||
|
loadFromDbSync();
|
||||||
|
dataBean = null;
|
||||||
|
selIndex = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isSeasonFilter() {
|
||||||
|
for (Class<?> clazz : service.getEntityClasses()) {
|
||||||
|
if (SeasonsAware.class.isAssignableFrom(clazz)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public class MainMenu
|
|||||||
@Command
|
@Command
|
||||||
public void numSeries()
|
public void numSeries()
|
||||||
{
|
{
|
||||||
Window window = (Window) Executions.createComponents("/settings/numberSeries.zul", null, null);
|
Window window = (Window) Executions.createComponents("/settings/seasons.zul", null, null);
|
||||||
window.doModal();
|
window.doModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,9 +4,12 @@ import info.bukova.isspst.data.Role;
|
|||||||
import info.bukova.isspst.data.User;
|
import info.bukova.isspst.data.User;
|
||||||
import info.bukova.isspst.data.Workgroup;
|
import info.bukova.isspst.data.Workgroup;
|
||||||
import info.bukova.isspst.services.invoicing.InvoicingService;
|
import info.bukova.isspst.services.invoicing.InvoicingService;
|
||||||
|
import info.bukova.isspst.services.limits.LimitService;
|
||||||
import info.bukova.isspst.services.users.UserService;
|
import info.bukova.isspst.services.users.UserService;
|
||||||
import info.bukova.isspst.services.workgroups.WorkgroupService;
|
import info.bukova.isspst.services.workgroups.WorkgroupService;
|
||||||
import info.bukova.isspst.ui.DocumentViewModel;
|
import info.bukova.isspst.ui.DocumentViewModel;
|
||||||
|
import org.zkoss.bind.annotation.Init;
|
||||||
|
import org.zkoss.zk.ui.select.annotation.WireVariable;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -14,9 +17,6 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.zkoss.bind.annotation.Init;
|
|
||||||
import org.zkoss.zk.ui.select.annotation.WireVariable;
|
|
||||||
|
|
||||||
public class DashBoardVM extends DocumentViewModel {
|
public class DashBoardVM extends DocumentViewModel {
|
||||||
|
|
||||||
@WireVariable
|
@WireVariable
|
||||||
@@ -25,9 +25,12 @@ public class DashBoardVM extends DocumentViewModel {
|
|||||||
private UserService userService;
|
private UserService userService;
|
||||||
@WireVariable
|
@WireVariable
|
||||||
private InvoicingService invoicingService;
|
private InvoicingService invoicingService;
|
||||||
|
@WireVariable
|
||||||
|
private LimitService limitService;
|
||||||
private User user;
|
private User user;
|
||||||
private Map<Workgroup, List<Role>> groupRoles;
|
private Map<Workgroup, List<Role>> groupRoles;
|
||||||
private Map<Workgroup, BigDecimal> workgroupSpent;
|
private Map<Workgroup, BigDecimal> workgroupSpent;
|
||||||
|
private Map<Workgroup, BigDecimal> workgroupLimit;
|
||||||
|
|
||||||
@Init(superclass = true)
|
@Init(superclass = true)
|
||||||
public void init() {
|
public void init() {
|
||||||
@@ -35,6 +38,7 @@ public class DashBoardVM extends DocumentViewModel {
|
|||||||
|
|
||||||
groupRoles = new HashMap<Workgroup, List<Role>>();
|
groupRoles = new HashMap<Workgroup, List<Role>>();
|
||||||
workgroupSpent = new HashMap<Workgroup, BigDecimal>();
|
workgroupSpent = new HashMap<Workgroup, BigDecimal>();
|
||||||
|
workgroupLimit = new HashMap<Workgroup, BigDecimal>();
|
||||||
|
|
||||||
List<Workgroup> wg = new ArrayList<Workgroup>();
|
List<Workgroup> wg = new ArrayList<Workgroup>();
|
||||||
if (workgroupService.getUserCentres(user) != null) {
|
if (workgroupService.getUserCentres(user) != null) {
|
||||||
@@ -48,6 +52,9 @@ public class DashBoardVM extends DocumentViewModel {
|
|||||||
List<Role> r = workgroupService.getUserWorkgroupRoles(w, user);
|
List<Role> r = workgroupService.getUserWorkgroupRoles(w, user);
|
||||||
groupRoles.put(w, r);
|
groupRoles.put(w, r);
|
||||||
workgroupSpent.put(w, invoicingService.totalInvoicedForWorkgroup(w));
|
workgroupSpent.put(w, invoicingService.totalInvoicedForWorkgroup(w));
|
||||||
|
if (limitService.getForWorkgroup(w) != null) {
|
||||||
|
workgroupLimit.put(w, limitService.getForWorkgroup(w).getLimit());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,4 +78,8 @@ public class DashBoardVM extends DocumentViewModel {
|
|||||||
return workgroupSpent;
|
return workgroupSpent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Map<Workgroup, BigDecimal> getWorkgroupLimit() {
|
||||||
|
return workgroupLimit;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,132 @@
|
|||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -72,6 +72,7 @@ public class ApproveDialogVM {
|
|||||||
BindUtils.postNotifyChange(null, null, grid, "dataBean");
|
BindUtils.postNotifyChange(null, null, grid, "dataBean");
|
||||||
BindUtils.postNotifyChange(null, null, grid, "canApprove");
|
BindUtils.postNotifyChange(null, null, grid, "canApprove");
|
||||||
BindUtils.postGlobalCommand(null, null, "reload", null);
|
BindUtils.postGlobalCommand(null, null, "reload", null);
|
||||||
|
grid.refresh();
|
||||||
window.detach();
|
window.detach();
|
||||||
} catch (ApproveException ex) {
|
} catch (ApproveException ex) {
|
||||||
Messagebox.show(StringUtils.localize(ex.getReason()), StringUtils.localize("Error"), Messagebox.OK,
|
Messagebox.show(StringUtils.localize(ex.getReason()), StringUtils.localize("Error"), Messagebox.OK,
|
||||||
|
|||||||
@@ -6,11 +6,6 @@ import info.bukova.isspst.filters.RequirementFilter;
|
|||||||
import info.bukova.isspst.services.requirement.RequirementService;
|
import info.bukova.isspst.services.requirement.RequirementService;
|
||||||
import info.bukova.isspst.services.workgroups.WorkgroupService;
|
import info.bukova.isspst.services.workgroups.WorkgroupService;
|
||||||
import info.bukova.isspst.ui.requirement.RequirementSubpage;
|
import info.bukova.isspst.ui.requirement.RequirementSubpage;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.springframework.security.access.AccessDeniedException;
|
import org.springframework.security.access.AccessDeniedException;
|
||||||
import org.zkoss.bind.BindUtils;
|
import org.zkoss.bind.BindUtils;
|
||||||
import org.zkoss.bind.annotation.GlobalCommand;
|
import org.zkoss.bind.annotation.GlobalCommand;
|
||||||
@@ -18,6 +13,10 @@ import org.zkoss.bind.annotation.Init;
|
|||||||
import org.zkoss.bind.annotation.NotifyChange;
|
import org.zkoss.bind.annotation.NotifyChange;
|
||||||
import org.zkoss.zk.ui.select.annotation.WireVariable;
|
import org.zkoss.zk.ui.select.annotation.WireVariable;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class ReqListMyAll extends RequirementSubpage<Requirement>
|
public class ReqListMyAll extends RequirementSubpage<Requirement>
|
||||||
{
|
{
|
||||||
@WireVariable
|
@WireVariable
|
||||||
@@ -55,10 +54,11 @@ public class ReqListMyAll extends RequirementSubpage<Requirement>
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GlobalCommand
|
@GlobalCommand
|
||||||
@NotifyChange({ "dataList", "dataBean", "fullFill" })
|
@NotifyChange({ "dataList", "dataBean", "fullFill", "selIndex" })
|
||||||
public void reloadRelated()
|
public void reloadRelated()
|
||||||
{
|
{
|
||||||
this.reload();
|
this.reload();
|
||||||
|
restoreUserView();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -6,11 +6,6 @@ import info.bukova.isspst.filters.RequirementFilter;
|
|||||||
import info.bukova.isspst.services.requirement.RequirementService;
|
import info.bukova.isspst.services.requirement.RequirementService;
|
||||||
import info.bukova.isspst.services.workgroups.WorkgroupService;
|
import info.bukova.isspst.services.workgroups.WorkgroupService;
|
||||||
import info.bukova.isspst.ui.requirement.RequirementSubpage;
|
import info.bukova.isspst.ui.requirement.RequirementSubpage;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.springframework.security.access.AccessDeniedException;
|
import org.springframework.security.access.AccessDeniedException;
|
||||||
import org.zkoss.bind.BindUtils;
|
import org.zkoss.bind.BindUtils;
|
||||||
import org.zkoss.bind.annotation.GlobalCommand;
|
import org.zkoss.bind.annotation.GlobalCommand;
|
||||||
@@ -18,6 +13,10 @@ import org.zkoss.bind.annotation.Init;
|
|||||||
import org.zkoss.bind.annotation.NotifyChange;
|
import org.zkoss.bind.annotation.NotifyChange;
|
||||||
import org.zkoss.zk.ui.select.annotation.WireVariable;
|
import org.zkoss.zk.ui.select.annotation.WireVariable;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class ReqListMyCenters extends RequirementSubpage<Requirement>
|
public class ReqListMyCenters extends RequirementSubpage<Requirement>
|
||||||
{
|
{
|
||||||
@WireVariable
|
@WireVariable
|
||||||
@@ -55,10 +54,11 @@ public class ReqListMyCenters extends RequirementSubpage<Requirement>
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GlobalCommand
|
@GlobalCommand
|
||||||
@NotifyChange({ "dataList", "dataBean", "fullFill" })
|
@NotifyChange({ "dataList", "dataBean", "fullFill", "selIndex" })
|
||||||
public void reloadRelated()
|
public void reloadRelated()
|
||||||
{
|
{
|
||||||
this.reload();
|
this.reload();
|
||||||
|
restoreUserView();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+6
-6
@@ -6,11 +6,6 @@ import info.bukova.isspst.filters.RequirementFilter;
|
|||||||
import info.bukova.isspst.services.requirement.RequirementService;
|
import info.bukova.isspst.services.requirement.RequirementService;
|
||||||
import info.bukova.isspst.services.workgroups.WorkgroupService;
|
import info.bukova.isspst.services.workgroups.WorkgroupService;
|
||||||
import info.bukova.isspst.ui.requirement.RequirementSubpage;
|
import info.bukova.isspst.ui.requirement.RequirementSubpage;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.springframework.security.access.AccessDeniedException;
|
import org.springframework.security.access.AccessDeniedException;
|
||||||
import org.zkoss.bind.BindUtils;
|
import org.zkoss.bind.BindUtils;
|
||||||
import org.zkoss.bind.annotation.GlobalCommand;
|
import org.zkoss.bind.annotation.GlobalCommand;
|
||||||
@@ -18,6 +13,10 @@ import org.zkoss.bind.annotation.Init;
|
|||||||
import org.zkoss.bind.annotation.NotifyChange;
|
import org.zkoss.bind.annotation.NotifyChange;
|
||||||
import org.zkoss.zk.ui.select.annotation.WireVariable;
|
import org.zkoss.zk.ui.select.annotation.WireVariable;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class ReqListMyWorkgroups extends RequirementSubpage<Requirement>
|
public class ReqListMyWorkgroups extends RequirementSubpage<Requirement>
|
||||||
{
|
{
|
||||||
@WireVariable
|
@WireVariable
|
||||||
@@ -55,10 +54,11 @@ public class ReqListMyWorkgroups extends RequirementSubpage<Requirement>
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GlobalCommand
|
@GlobalCommand
|
||||||
@NotifyChange({ "dataList", "dataBean", "fullFill" })
|
@NotifyChange({ "dataList", "dataBean", "fullFill", "selIndex" })
|
||||||
public void reloadRelated()
|
public void reloadRelated()
|
||||||
{
|
{
|
||||||
this.reload();
|
this.reload();
|
||||||
|
restoreUserView();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -12,10 +12,6 @@ import info.bukova.isspst.services.users.UserService;
|
|||||||
import info.bukova.isspst.services.workgroups.WorkgroupService;
|
import info.bukova.isspst.services.workgroups.WorkgroupService;
|
||||||
import info.bukova.isspst.ui.FormViewModel;
|
import info.bukova.isspst.ui.FormViewModel;
|
||||||
import info.bukova.isspst.validators.RequirementFormValidator;
|
import info.bukova.isspst.validators.RequirementFormValidator;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.zkoss.bind.BindUtils;
|
import org.zkoss.bind.BindUtils;
|
||||||
@@ -29,6 +25,10 @@ import org.zkoss.zk.ui.select.annotation.WireVariable;
|
|||||||
import org.zkoss.zul.Window;
|
import org.zkoss.zul.Window;
|
||||||
import org.zkoss.zul.impl.InputElement;
|
import org.zkoss.zul.impl.InputElement;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class RequirementForm extends FormViewModel<Requirement>
|
public class RequirementForm extends FormViewModel<Requirement>
|
||||||
{
|
{
|
||||||
private final static Logger log = LoggerFactory.getLogger(RequirementForm.class.getName());
|
private final static Logger log = LoggerFactory.getLogger(RequirementForm.class.getName());
|
||||||
@@ -112,7 +112,14 @@ public class RequirementForm extends FormViewModel<Requirement>
|
|||||||
this.setRequirementFormValidator(new RequirementFormValidator());
|
this.setRequirementFormValidator(new RequirementFormValidator());
|
||||||
this.setSyncItems(this.getDataBean().getItems());
|
this.setSyncItems(this.getDataBean().getItems());
|
||||||
requirementService.loadType(getDataBean());
|
requirementService.loadType(getDataBean());
|
||||||
this.centres = reqTypeService.filterCentres(getDataBean().getType(), workgroupService.getUserCentres(userService.getCurrent()));
|
|
||||||
|
if (isEditRec()) {
|
||||||
|
List<Workgroup> current = new ArrayList<Workgroup>();
|
||||||
|
current.add(getDataBean().getCentre());
|
||||||
|
this.centres = current;
|
||||||
|
} else {
|
||||||
|
this.centres = reqTypeService.filterCentres(getDataBean().getType(), workgroupService.getUserCentres(userService.getCurrent(), true));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<RequirementItem> getSyncItems()
|
public List<RequirementItem> getSyncItems()
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
package info.bukova.isspst.ui.reporting;
|
package info.bukova.isspst.ui.reporting;
|
||||||
|
|
||||||
|
import info.bukova.isspst.Module;
|
||||||
|
import info.bukova.isspst.ModuleUtils;
|
||||||
|
import info.bukova.isspst.data.DataModel;
|
||||||
import info.bukova.isspst.reporting.Report;
|
import info.bukova.isspst.reporting.Report;
|
||||||
import info.bukova.isspst.reporting.ReportDefinition;
|
import info.bukova.isspst.reporting.ReportDefinition;
|
||||||
import info.bukova.isspst.reporting.ReportType;
|
import info.bukova.isspst.reporting.ReportType;
|
||||||
import info.bukova.isspst.services.Service;
|
import info.bukova.isspst.services.Service;
|
||||||
|
import info.bukova.isspst.sort.ReflectionTools;
|
||||||
import info.bukova.isspst.ui.DocumentViewModel;
|
import info.bukova.isspst.ui.DocumentViewModel;
|
||||||
import org.zkoss.bind.annotation.BindingParam;
|
import org.zkoss.bind.annotation.BindingParam;
|
||||||
import org.zkoss.bind.annotation.Command;
|
import org.zkoss.bind.annotation.Command;
|
||||||
@@ -11,9 +15,12 @@ import org.zkoss.bind.annotation.ExecutionArgParam;
|
|||||||
import org.zkoss.bind.annotation.Init;
|
import org.zkoss.bind.annotation.Init;
|
||||||
import org.zkoss.bind.annotation.NotifyChange;
|
import org.zkoss.bind.annotation.NotifyChange;
|
||||||
import org.zkoss.zk.ui.Executions;
|
import org.zkoss.zk.ui.Executions;
|
||||||
|
import org.zkoss.zk.ui.Sessions;
|
||||||
import org.zkoss.zk.ui.select.annotation.WireVariable;
|
import org.zkoss.zk.ui.select.annotation.WireVariable;
|
||||||
import org.zkoss.zul.Window;
|
import org.zkoss.zul.Window;
|
||||||
|
|
||||||
|
import javax.servlet.ServletContext;
|
||||||
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class ReportDialogVM extends DocumentViewModel
|
public class ReportDialogVM extends DocumentViewModel
|
||||||
@@ -24,7 +31,8 @@ public class ReportDialogVM extends DocumentViewModel
|
|||||||
@WireVariable
|
@WireVariable
|
||||||
private ReportDefinition reportDefinition;
|
private ReportDefinition reportDefinition;
|
||||||
private List<Object> dataList;
|
private List<Object> dataList;
|
||||||
private Object singleObject;
|
private Object singleObject;
|
||||||
|
private ServletContext ctx;
|
||||||
|
|
||||||
@Init(superclass = true)
|
@Init(superclass = true)
|
||||||
public void init(@ExecutionArgParam("reports") List<Report> reports,
|
public void init(@ExecutionArgParam("reports") List<Report> reports,
|
||||||
@@ -40,6 +48,8 @@ public class ReportDialogVM extends DocumentViewModel
|
|||||||
dataList = data;
|
dataList = data;
|
||||||
this.singleObject = singleObject;
|
this.singleObject = singleObject;
|
||||||
reportDefinition.setService(service);
|
reportDefinition.setService(service);
|
||||||
|
|
||||||
|
ctx = Sessions.getCurrent().getWebApp().getServletContext();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Report> getReports() {
|
public List<Report> getReports() {
|
||||||
@@ -59,11 +69,36 @@ public class ReportDialogVM extends DocumentViewModel
|
|||||||
this.selected = selected;
|
this.selected = selected;
|
||||||
reportDefinition.setReport(selected);
|
reportDefinition.setReport(selected);
|
||||||
if (selected.isSingleRecord()) {
|
if (selected.isSingleRecord()) {
|
||||||
reportDefinition.setSingleObject(singleObject);
|
setObject(selected);
|
||||||
} else {
|
} else {
|
||||||
reportDefinition.setDataSet(dataList);
|
reportDefinition.setDataSet(dataList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setObject(Report report) {
|
||||||
|
if (report.getProperty() == null) {
|
||||||
|
reportDefinition.setSingleObject(singleObject);
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
Object o = ReflectionTools.getGetterMethod(singleObject, report.getProperty()).invoke(singleObject);
|
||||||
|
reportDefinition.setSingleObject(o);
|
||||||
|
|
||||||
|
if (!(o instanceof DataModel)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Module m = ModuleUtils.getModule((DataModel)o, ctx);
|
||||||
|
|
||||||
|
if (m != null) {
|
||||||
|
reportDefinition.setService((Service<Object>) ModuleUtils.getServiceInstance(m, ctx));
|
||||||
|
}
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (InvocationTargetException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Command
|
@Command
|
||||||
public void print(@BindingParam("window") Window window) {
|
public void print(@BindingParam("window") Window window) {
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import org.zkoss.zk.ui.select.annotation.WireVariable;
|
|||||||
import org.zkoss.zul.Messagebox;
|
import org.zkoss.zul.Messagebox;
|
||||||
import org.zkoss.zul.Window;
|
import org.zkoss.zul.Window;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class TripRequirementForm extends FormWithUpload<TripRequirement> {
|
public class TripRequirementForm extends FormWithUpload<TripRequirement> {
|
||||||
@@ -73,7 +74,14 @@ public class TripRequirementForm extends FormWithUpload<TripRequirement> {
|
|||||||
@Init(superclass = true)
|
@Init(superclass = true)
|
||||||
public void init() {
|
public void init() {
|
||||||
tripRequirementService.loadType(getDataBean());
|
tripRequirementService.loadType(getDataBean());
|
||||||
centres = reqTypeService.filterCentres(getDataBean().getType(), workgroupService.getUserCentres(userService.getCurrent()));
|
if (isEditRec()) {
|
||||||
|
List<Workgroup> current = new ArrayList<Workgroup>();
|
||||||
|
current.add(getDataBean().getCentre());
|
||||||
|
this.centres = current;
|
||||||
|
} else {
|
||||||
|
this.centres = reqTypeService.filterCentres(getDataBean().getType(), workgroupService.getUserCentres(userService.getCurrent(), true));
|
||||||
|
}
|
||||||
|
|
||||||
users = userService.getUsersForCombo();
|
users = userService.getUsersForCombo();
|
||||||
passengers = getDataBean().getPassengers();
|
passengers = getDataBean().getPassengers();
|
||||||
validator = new TripRequirementFormValidator();
|
validator = new TripRequirementFormValidator();
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public class TripRequirementList extends ListViewModel<TripRequirement> {
|
|||||||
private boolean showWorkgroup;
|
private boolean showWorkgroup;
|
||||||
private boolean showAll;
|
private boolean showAll;
|
||||||
|
|
||||||
@Init
|
@Init(superclass = true)
|
||||||
public void init() {
|
public void init() {
|
||||||
service = tripRequirementService;
|
service = tripRequirementService;
|
||||||
dataClass = TripRequirement.class;
|
dataClass = TripRequirement.class;
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public class TripRequirementListAll extends RequirementSubpage<TripRequirement>
|
|||||||
private List<Workgroup> allCentres;
|
private List<Workgroup> allCentres;
|
||||||
private List<Workgroup> allWorkgroups;
|
private List<Workgroup> allWorkgroups;
|
||||||
|
|
||||||
@Init
|
@Init(superclass = true)
|
||||||
public void init() {
|
public void init() {
|
||||||
service = tripRequirementService;
|
service = tripRequirementService;
|
||||||
dataClass = TripRequirement.class;
|
dataClass = TripRequirement.class;
|
||||||
@@ -63,9 +63,10 @@ public class TripRequirementListAll extends RequirementSubpage<TripRequirement>
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GlobalCommand
|
@GlobalCommand
|
||||||
@NotifyChange({ "dataList", "dataBean", "fullFill" })
|
@NotifyChange({ "dataList", "dataBean", "fullFill", "selIndex" })
|
||||||
public void reloadRelated() {
|
public void reloadRelated() {
|
||||||
this.reload();
|
this.reload();
|
||||||
|
restoreUserView();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ public class TripRequirementListCentre extends RequirementSubpage<TripRequiremen
|
|||||||
|
|
||||||
private List<Workgroup> myCentres;
|
private List<Workgroup> myCentres;
|
||||||
|
|
||||||
@Init
|
@Init(superclass = true)
|
||||||
public void init() {
|
public void init() {
|
||||||
service = tripRequirementService;
|
service = tripRequirementService;
|
||||||
dataClass = TripRequirement.class;
|
dataClass = TripRequirement.class;
|
||||||
@@ -63,6 +63,7 @@ public class TripRequirementListCentre extends RequirementSubpage<TripRequiremen
|
|||||||
@NotifyChange({ "dataList", "dataBean", "fullFill" })
|
@NotifyChange({ "dataList", "dataBean", "fullFill" })
|
||||||
public void reloadRelated() {
|
public void reloadRelated() {
|
||||||
this.reload();
|
this.reload();
|
||||||
|
restoreUserView();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public class TripRequirementListWorkgroup extends RequirementSubpage<TripRequire
|
|||||||
|
|
||||||
private List<Workgroup> myWorkgroups;
|
private List<Workgroup> myWorkgroups;
|
||||||
|
|
||||||
@Init
|
@Init(superclass = true)
|
||||||
public void init() {
|
public void init() {
|
||||||
service = tripRequirementService;
|
service = tripRequirementService;
|
||||||
dataClass = TripRequirement.class;
|
dataClass = TripRequirement.class;
|
||||||
@@ -70,6 +70,7 @@ public class TripRequirementListWorkgroup extends RequirementSubpage<TripRequire
|
|||||||
@NotifyChange({ "dataList", "dataBean", "fullFill" })
|
@NotifyChange({ "dataList", "dataBean", "fullFill" })
|
||||||
public void reloadRelated() {
|
public void reloadRelated() {
|
||||||
this.reload();
|
this.reload();
|
||||||
|
restoreUserView();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -0,0 +1,101 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,185 @@
|
|||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -78,9 +78,9 @@ public class TripBillListBase extends RequirementSubpage<TripBillApproval> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GlobalCommand
|
@GlobalCommand
|
||||||
@NotifyChange({ "dataList", "dataBean", "fullFill" })
|
@NotifyChange({ "dataList", "dataBean", "fullFill", "selIndex" })
|
||||||
public void reloadRelated()
|
public void reloadRelated() {
|
||||||
{
|
|
||||||
this.reload();
|
this.reload();
|
||||||
|
restoreUserView();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
<?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>
|
||||||
@@ -38,5 +38,7 @@
|
|||||||
<mapping class="info.bukova.isspst.data.TripBillApproval"></mapping>
|
<mapping class="info.bukova.isspst.data.TripBillApproval"></mapping>
|
||||||
<mapping class="info.bukova.isspst.data.SignedDocument"></mapping>
|
<mapping class="info.bukova.isspst.data.SignedDocument"></mapping>
|
||||||
<mapping class="info.bukova.isspst.data.SignedDocumentItem"></mapping>
|
<mapping class="info.bukova.isspst.data.SignedDocumentItem"></mapping>
|
||||||
|
<mapping class="info.bukova.isspst.data.Season"></mapping>
|
||||||
|
<mapping class="info.bukova.isspst.data.Limit"></mapping>
|
||||||
</session-factory>
|
</session-factory>
|
||||||
</hibernate-configuration>
|
</hibernate-configuration>
|
||||||
@@ -415,13 +415,16 @@ Search=Hledat
|
|||||||
Pending = Nevyřízené
|
Pending = Nevyřízené
|
||||||
Archive = Archiv
|
Archive = Archiv
|
||||||
Completed = Vyřízeno
|
Completed = Vyřízeno
|
||||||
|
Backup = Zálohování
|
||||||
|
SigningYear = Rok podepsání
|
||||||
|
DownloadZipArchive = Stáhnout ZIP archiv...
|
||||||
|
|
||||||
GenerateBillingForPassengers = Generovat společný požadavek a vyúčtování
|
GenerateBillingForPassengers = Generovat společný požadavek a vyúčtování
|
||||||
Passenger = Pasažér
|
Passenger = Pasažér
|
||||||
ChooseThePasseger = Vyberte pasažéra
|
ChooseThePasseger = Vyberte pasažéra
|
||||||
TransportMode = Způsob dopravy
|
TransportMode = Způsob dopravy
|
||||||
ForeignPersons = Cizí osoby
|
ForeignPersons = Cizí osoby
|
||||||
TripBillResultMessageText = Zpráva z pracovní cesty
|
TripBillResultMessageText = Stručná zpráva z pracovní cesty, přínosy a podněty k dalšímu využití
|
||||||
ErrFillTripBillResultMessageText = Vyplňte zprávu z pracovní cesty.
|
ErrFillTripBillResultMessageText = Vyplňte zprávu z pracovní cesty.
|
||||||
ErrFillTripBillResultTimes = Zadejte časy odjezdu a příjezdu.
|
ErrFillTripBillResultTimes = Zadejte časy odjezdu a příjezdu.
|
||||||
|
|
||||||
@@ -429,5 +432,28 @@ ErrApproveMustBeSigned = Schválení musí být digitálně podepsané.
|
|||||||
DigitalSignature = Elektronický podpis
|
DigitalSignature = Elektronický podpis
|
||||||
ContextMenu = Volby v kontextovém menu
|
ContextMenu = Volby v kontextovém menu
|
||||||
|
|
||||||
|
ExportToExcel = Exportovat do excelu
|
||||||
ErrMaterialOrServiceDescription=Zadejte popis požadavku.
|
ErrMaterialOrServiceDescription=Zadejte popis požadavku.
|
||||||
|
|
||||||
|
SeasonsSeason = Období
|
||||||
|
SeasonsNewSeason = Nové období
|
||||||
|
SeasonsDescription = Popis
|
||||||
|
SeasonsValidFrom = Platí od
|
||||||
|
SeasonsValidTo = Platí do
|
||||||
|
SeasonsActive = Aktivní
|
||||||
|
SeasonsActivate = Aktivovat
|
||||||
|
SeasonsActiveNumSeries = Číselné řady pro aktivní období:
|
||||||
|
SeasonsAgenda = Agenda
|
||||||
|
SeasonsPrefix = Prefix
|
||||||
|
SeasonsNewSeasonDialog = Opravdu chcete založit nové období?
|
||||||
|
Active_season_not_set = Není nastaveno žádné aktivní období.
|
||||||
|
|
||||||
|
LimitsAgName = Limity komisí
|
||||||
|
LimitsLimit = Limit
|
||||||
|
LimitsWorkgroup = Komise
|
||||||
|
LimitsSpent = Vyčerpáno
|
||||||
|
LimitsChartTitle = Vyčerpané částky
|
||||||
|
LimitsAmount = Částka
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@@ -0,0 +1,260 @@
|
|||||||
|
<?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.
@@ -1,8 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!-- Created with Jaspersoft Studio version 5.6.2.final using JasperReports Library version 5.6.1 -->
|
||||||
|
<!-- 2016-03-06T21:46:27 -->
|
||||||
<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="tripBill" pageWidth="612" pageHeight="792" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="10" bottomMargin="20" uuid="f59e8277-a431-4cdc-abaa-c82c1cf193af">
|
<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="tripBill" pageWidth="612" pageHeight="792" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="10" bottomMargin="20" uuid="f59e8277-a431-4cdc-abaa-c82c1cf193af">
|
||||||
<property name="ireport.zoom" value="1.5"/>
|
<property name="ireport.zoom" value="1.5"/>
|
||||||
<property name="ireport.x" value="0"/>
|
<property name="ireport.x" value="0"/>
|
||||||
<property name="ireport.y" value="0"/>
|
<property name="ireport.y" value="3"/>
|
||||||
<parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false">
|
<parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false">
|
||||||
<defaultValueExpression><![CDATA["./"]]></defaultValueExpression>
|
<defaultValueExpression><![CDATA["./"]]></defaultValueExpression>
|
||||||
</parameter>
|
</parameter>
|
||||||
@@ -57,100 +59,98 @@
|
|||||||
<band splitType="Stretch"/>
|
<band splitType="Stretch"/>
|
||||||
</background>
|
</background>
|
||||||
<pageHeader>
|
<pageHeader>
|
||||||
<band height="275" splitType="Stretch">
|
<band height="243" splitType="Stretch">
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="6e60bd03-48b9-4555-91ab-757532d93e6a" x="10" y="61" width="143" height="20"/>
|
<reportElement x="10" y="61" width="143" height="20" uuid="6e60bd03-48b9-4555-91ab-757532d93e6a"/>
|
||||||
<textElement>
|
<textElement>
|
||||||
<font isBold="true" pdfFontName="Helvetica-Bold" isPdfEmbedded="true"/>
|
<font isBold="true" pdfFontName="Helvetica-Bold" isPdfEmbedded="true"/>
|
||||||
</textElement>
|
</textElement>
|
||||||
<text><![CDATA[Příjmení, jméno, titul:]]></text>
|
<text><![CDATA[Příjmení, jméno, titul:]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="448ba3e9-dc29-45c4-b384-3e597d036134" x="10" y="81" width="100" height="20"/>
|
<reportElement x="10" y="81" width="100" height="20" uuid="448ba3e9-dc29-45c4-b384-3e597d036134"/>
|
||||||
<textElement>
|
<textElement>
|
||||||
<font isBold="true" pdfFontName="Helvetica-Bold" isPdfEmbedded="true"/>
|
<font isBold="true" pdfFontName="Helvetica-Bold" isPdfEmbedded="true"/>
|
||||||
</textElement>
|
</textElement>
|
||||||
<text><![CDATA[Bydliště:]]></text>
|
<text><![CDATA[Bydliště:]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<textField>
|
<textField>
|
||||||
<reportElement uuid="62d493f1-c058-42e6-b2f5-1a691ac9e5db" x="196" y="61" width="181" height="20"/>
|
<reportElement x="196" y="61" width="181" height="20" uuid="62d493f1-c058-42e6-b2f5-1a691ac9e5db"/>
|
||||||
<textElement>
|
<textElement>
|
||||||
<font isBold="true" pdfFontName="Helvetica-Bold" isPdfEmbedded="true"/>
|
<font isBold="true" pdfFontName="Helvetica-Bold" isPdfEmbedded="true"/>
|
||||||
</textElement>
|
</textElement>
|
||||||
<textFieldExpression><![CDATA[$F{ownedBy}]]></textFieldExpression>
|
<textFieldExpression><![CDATA[$F{ownedBy}]]></textFieldExpression>
|
||||||
</textField>
|
</textField>
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="86395201-6c9d-4584-a8a3-eb46dd4af411" x="143" y="106" width="143" height="27"/>
|
<reportElement x="143" y="126" width="143" height="27" uuid="86395201-6c9d-4584-a8a3-eb46dd4af411"/>
|
||||||
<textElement textAlignment="Center"/>
|
<textElement textAlignment="Center"/>
|
||||||
<text><![CDATA[Místo jednání]]></text>
|
<text><![CDATA[Místo jednání]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<textField>
|
<textField>
|
||||||
<reportElement uuid="f62e3881-5a60-45ed-997b-71f5e1c25b28" x="0" y="134" width="143" height="20"/>
|
<reportElement x="0" y="154" width="143" height="20" uuid="f62e3881-5a60-45ed-997b-71f5e1c25b28"/>
|
||||||
<textElement textAlignment="Center"/>
|
<textElement textAlignment="Center"/>
|
||||||
<textFieldExpression><![CDATA[$F{requirement.from}]]></textFieldExpression>
|
<textFieldExpression><![CDATA[$F{requirement.from}]]></textFieldExpression>
|
||||||
</textField>
|
</textField>
|
||||||
<line>
|
<line>
|
||||||
<reportElement uuid="67730ab5-6550-4a51-8daa-ef3c509d44ad" x="143" y="104" width="1" height="75"/>
|
<reportElement x="143" y="124" width="1" height="75" uuid="67730ab5-6550-4a51-8daa-ef3c509d44ad"/>
|
||||||
</line>
|
</line>
|
||||||
<line>
|
<line>
|
||||||
<reportElement uuid="98195ce4-de92-4643-bd50-f63d553a6235" x="0" y="179" width="572" height="1"/>
|
<reportElement x="0" y="199" width="572" height="1" uuid="98195ce4-de92-4643-bd50-f63d553a6235"/>
|
||||||
</line>
|
</line>
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="4827d565-87ea-4648-a5b0-6473e8814bb1" x="429" y="106" width="143" height="26"/>
|
<reportElement x="429" y="126" width="143" height="26" uuid="4827d565-87ea-4648-a5b0-6473e8814bb1"/>
|
||||||
<textElement textAlignment="Center"/>
|
<textElement textAlignment="Center"/>
|
||||||
<text><![CDATA[Konec cesty (místo, datum)]]></text>
|
<text><![CDATA[Konec cesty (místo, datum)]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="76f85619-891b-44f4-8c7f-d1ceba0bef3c" x="0" y="106" width="143" height="27"/>
|
<reportElement x="0" y="126" width="143" height="27" uuid="76f85619-891b-44f4-8c7f-d1ceba0bef3c"/>
|
||||||
<textElement textAlignment="Center"/>
|
<textElement textAlignment="Center"/>
|
||||||
<text><![CDATA[Počátek cesty (místo, datum, hodina)]]></text>
|
<text><![CDATA[Počátek cesty (místo, datum, hodina)]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<line>
|
<line>
|
||||||
<reportElement uuid="e5c8f5ac-f7b5-4235-ba39-566b94bb6382" x="428" y="104" width="1" height="75"/>
|
<reportElement x="428" y="124" width="1" height="75" uuid="e5c8f5ac-f7b5-4235-ba39-566b94bb6382"/>
|
||||||
</line>
|
</line>
|
||||||
<textField pattern="dd. MM. yyyy">
|
<textField pattern="dd. MM. yyyy">
|
||||||
<reportElement uuid="f758abfe-1e97-4ac0-a7e8-293438ef1d78" x="429" y="154" width="143" height="20"/>
|
<reportElement x="429" y="174" width="143" height="20" uuid="f758abfe-1e97-4ac0-a7e8-293438ef1d78"/>
|
||||||
<textElement textAlignment="Center"/>
|
<textElement textAlignment="Center"/>
|
||||||
<textFieldExpression><![CDATA[$F{requirement.endDate}]]></textFieldExpression>
|
<textFieldExpression><![CDATA[$F{requirement.endDate}]]></textFieldExpression>
|
||||||
</textField>
|
</textField>
|
||||||
<textField pattern="HH:mm">
|
<textField pattern="HH:mm">
|
||||||
<reportElement uuid="0db3d6e2-36e3-4c66-b4a1-2cdc555b2831" x="90" y="154" width="53" height="20"/>
|
<reportElement x="90" y="174" width="53" height="20" uuid="0db3d6e2-36e3-4c66-b4a1-2cdc555b2831"/>
|
||||||
<textElement/>
|
|
||||||
<textFieldExpression><![CDATA[$F{requirement.tripDate}]]></textFieldExpression>
|
<textFieldExpression><![CDATA[$F{requirement.tripDate}]]></textFieldExpression>
|
||||||
</textField>
|
</textField>
|
||||||
<textField isBlankWhenNull="true">
|
<textField isBlankWhenNull="true">
|
||||||
<reportElement uuid="76000adf-2d9c-4c56-9471-51bc278ca433" x="286" y="134" width="143" height="40"/>
|
<reportElement x="286" y="154" width="143" height="40" uuid="76000adf-2d9c-4c56-9471-51bc278ca433"/>
|
||||||
<textElement textAlignment="Center"/>
|
<textElement textAlignment="Center"/>
|
||||||
<textFieldExpression><![CDATA[$F{requirement.description}]]></textFieldExpression>
|
<textFieldExpression><![CDATA[$F{requirement.description}]]></textFieldExpression>
|
||||||
</textField>
|
</textField>
|
||||||
<textField>
|
<textField>
|
||||||
<reportElement uuid="4b1e7687-d605-46bb-aa2b-08637cff229a" x="143" y="134" width="143" height="20"/>
|
<reportElement x="143" y="154" width="143" height="20" uuid="4b1e7687-d605-46bb-aa2b-08637cff229a"/>
|
||||||
<textElement textAlignment="Center"/>
|
<textElement textAlignment="Center"/>
|
||||||
<textFieldExpression><![CDATA[$F{requirement.to}]]></textFieldExpression>
|
<textFieldExpression><![CDATA[$F{requirement.to}]]></textFieldExpression>
|
||||||
</textField>
|
</textField>
|
||||||
<line>
|
<line>
|
||||||
<reportElement uuid="70db0a7e-650a-4324-9c62-f75bcbdcbb8d" x="285" y="104" width="1" height="75"/>
|
<reportElement x="285" y="124" width="1" height="75" uuid="70db0a7e-650a-4324-9c62-f75bcbdcbb8d"/>
|
||||||
</line>
|
</line>
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="d52c698d-07c8-4740-a791-2df4f5cb1c6e" x="286" y="105" width="143" height="27"/>
|
<reportElement x="286" y="125" width="143" height="27" uuid="d52c698d-07c8-4740-a791-2df4f5cb1c6e"/>
|
||||||
<textElement textAlignment="Center"/>
|
<textElement textAlignment="Center"/>
|
||||||
<text><![CDATA[Účel cesty]]></text>
|
<text><![CDATA[Účel cesty]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<textField pattern="dd. MM. yyyy">
|
<textField pattern="dd. MM. yyyy">
|
||||||
<reportElement uuid="88c08297-c140-410a-8980-02416ec62475" x="0" y="154" width="90" height="20"/>
|
<reportElement x="0" y="174" width="90" height="20" uuid="88c08297-c140-410a-8980-02416ec62475"/>
|
||||||
<textElement/>
|
|
||||||
<textFieldExpression><![CDATA[$F{requirement.tripDate}]]></textFieldExpression>
|
<textFieldExpression><![CDATA[$F{requirement.tripDate}]]></textFieldExpression>
|
||||||
</textField>
|
</textField>
|
||||||
<textField>
|
<textField>
|
||||||
<reportElement uuid="21724842-be95-48ba-a811-0bf7a862ae3f" x="429" y="134" width="143" height="20"/>
|
<reportElement x="429" y="154" width="143" height="20" uuid="21724842-be95-48ba-a811-0bf7a862ae3f"/>
|
||||||
<textElement textAlignment="Center"/>
|
<textElement textAlignment="Center"/>
|
||||||
<textFieldExpression><![CDATA[$F{requirement.end}]]></textFieldExpression>
|
<textFieldExpression><![CDATA[$F{requirement.end}]]></textFieldExpression>
|
||||||
</textField>
|
</textField>
|
||||||
<line>
|
<line>
|
||||||
<reportElement uuid="dd38c006-cfb4-4b8f-abf8-986222d3bd27" x="0" y="103" width="572" height="1"/>
|
<reportElement x="0" y="123" width="572" height="1" uuid="dd38c006-cfb4-4b8f-abf8-986222d3bd27"/>
|
||||||
</line>
|
</line>
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="831faf0e-2b31-47df-9ccf-4bf1c5bcdcbd" x="101" y="16" width="472" height="39"/>
|
<reportElement x="101" y="16" width="472" height="39" uuid="831faf0e-2b31-47df-9ccf-4bf1c5bcdcbd"/>
|
||||||
<textElement textAlignment="Center" verticalAlignment="Bottom">
|
<textElement textAlignment="Center" verticalAlignment="Bottom">
|
||||||
<font size="14" isBold="true" pdfFontName="Helvetica-Bold" isPdfEmbedded="true"/>
|
<font size="14" isBold="true" pdfFontName="Helvetica-Bold" isPdfEmbedded="true"/>
|
||||||
</textElement>
|
</textElement>
|
||||||
@@ -158,58 +158,41 @@
|
|||||||
tuzemské pracovní cesty]]></text>
|
tuzemské pracovní cesty]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="6990eca1-ad98-4545-b211-1892d039bc74" x="1" y="186" width="571" height="20"/>
|
<reportElement x="1" y="201" width="571" height="20" uuid="6990eca1-ad98-4545-b211-1892d039bc74"/>
|
||||||
<textElement textAlignment="Center">
|
<textElement textAlignment="Center">
|
||||||
<font size="14" isBold="true" pdfFontName="Helvetica-Bold" isPdfEmbedded="true"/>
|
<font size="14" isBold="true" pdfFontName="Helvetica-Bold" isPdfEmbedded="true"/>
|
||||||
</textElement>
|
</textElement>
|
||||||
<text><![CDATA[VYÚČTOVÁNÍ PRACOVNÍ CESTY]]></text>
|
<text><![CDATA[VYÚČTOVÁNÍ PRACOVNÍ CESTY]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="9b5868e4-5034-4141-b470-8c199e81ee4e" x="0" y="209" width="296" height="20"/>
|
<reportElement x="0" y="222" width="296" height="20" uuid="9b5868e4-5034-4141-b470-8c199e81ee4e"/>
|
||||||
<textElement>
|
<textElement>
|
||||||
<font isBold="true" pdfFontName="Helvetica-Bold"/>
|
<font isBold="true" pdfFontName="Helvetica-Bold"/>
|
||||||
</textElement>
|
</textElement>
|
||||||
<text><![CDATA[Zpráva o výsledku pracovní cesty byla podána dne:]]></text>
|
<text><![CDATA[Zpráva o výsledku pracovní cesty byla podána dne:]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<textField pattern="dd. MM. yyyy" isBlankWhenNull="true">
|
<textField pattern="dd. MM. yyyy" isBlankWhenNull="true">
|
||||||
<reportElement uuid="d7b2da96-3040-4a89-9380-0dbb55068601" x="296" y="206" width="144" height="20"/>
|
<reportElement x="296" y="221" width="144" height="20" uuid="d7b2da96-3040-4a89-9380-0dbb55068601"/>
|
||||||
<textElement textAlignment="Left"/>
|
<textElement textAlignment="Left"/>
|
||||||
<textFieldExpression><![CDATA[$F{resultMessageDate}]]></textFieldExpression>
|
<textFieldExpression><![CDATA[$F{resultMessageDate}]]></textFieldExpression>
|
||||||
</textField>
|
</textField>
|
||||||
<staticText>
|
|
||||||
<reportElement uuid="b2b60eec-df87-4385-a6d9-8d3f80cc319a" x="1" y="229" width="295" height="20"/>
|
|
||||||
<textElement>
|
|
||||||
<font isBold="true" pdfFontName="Helvetica-Bold" isPdfEmbedded="true"/>
|
|
||||||
</textElement>
|
|
||||||
<text><![CDATA[Se způsobem provedení souhlasí:]]></text>
|
|
||||||
</staticText>
|
|
||||||
<line>
|
<line>
|
||||||
<reportElement uuid="0cf99b2a-b025-4a50-bcb5-8e371536bb77" x="296" y="249" width="276" height="1"/>
|
<reportElement x="0" y="242" width="572" height="1" uuid="c67f7840-5e38-4eed-ab3f-e4907ac33b5c"/>
|
||||||
</line>
|
|
||||||
<staticText>
|
|
||||||
<reportElement uuid="17876cb8-7666-48f4-9275-f7a70cd08ff9" x="296" y="253" width="276" height="20"/>
|
|
||||||
<textElement textAlignment="Center">
|
|
||||||
<font isBold="true" pdfFontName="Helvetica-Bold" isPdfEmbedded="true"/>
|
|
||||||
</textElement>
|
|
||||||
<text><![CDATA[Datum a podpis oprávněné osoby]]></text>
|
|
||||||
</staticText>
|
|
||||||
<line>
|
|
||||||
<reportElement uuid="c67f7840-5e38-4eed-ab3f-e4907ac33b5c" x="0" y="272" width="572" height="1"/>
|
|
||||||
</line>
|
</line>
|
||||||
<line>
|
<line>
|
||||||
<reportElement uuid="e3530085-daa8-4675-bf3a-d98c775be07e" x="0" y="55" width="571" height="1"/>
|
<reportElement x="0" y="55" width="571" height="1" uuid="e3530085-daa8-4675-bf3a-d98c775be07e"/>
|
||||||
</line>
|
</line>
|
||||||
<line>
|
<line>
|
||||||
<reportElement uuid="47e4e70d-fb5f-4266-889a-4149c71efa42" x="-1" y="0" width="572" height="1"/>
|
<reportElement x="-1" y="0" width="572" height="1" uuid="47e4e70d-fb5f-4266-889a-4149c71efa42"/>
|
||||||
</line>
|
</line>
|
||||||
<line>
|
<line>
|
||||||
<reportElement uuid="d4738137-17c1-4721-b222-7187988c1b06" x="-1" y="1" width="1" height="272"/>
|
<reportElement x="-1" y="1" width="1" height="242" uuid="d4738137-17c1-4721-b222-7187988c1b06"/>
|
||||||
</line>
|
</line>
|
||||||
<line>
|
<line>
|
||||||
<reportElement uuid="bf83547c-60d9-4f95-a5f1-db0763ba17cb" x="571" y="1" width="1" height="272"/>
|
<reportElement x="571" y="1" width="1" height="242" uuid="bf83547c-60d9-4f95-a5f1-db0763ba17cb"/>
|
||||||
</line>
|
</line>
|
||||||
<textField isBlankWhenNull="true">
|
<textField isBlankWhenNull="true">
|
||||||
<reportElement uuid="8af60406-55bf-46f0-82e9-865dc9edbdb4" x="196" y="82" width="375" height="20">
|
<reportElement x="196" y="82" width="375" height="20" uuid="8af60406-55bf-46f0-82e9-865dc9edbdb4">
|
||||||
<printWhenExpression><![CDATA[$F{ownedBy.address} != null]]></printWhenExpression>
|
<printWhenExpression><![CDATA[$F{ownedBy.address} != null]]></printWhenExpression>
|
||||||
</reportElement>
|
</reportElement>
|
||||||
<textElement>
|
<textElement>
|
||||||
@@ -218,31 +201,39 @@ tuzemské pracovní cesty]]></text>
|
|||||||
<textFieldExpression><![CDATA[$F{ownedBy.address}]]></textFieldExpression>
|
<textFieldExpression><![CDATA[$F{ownedBy.address}]]></textFieldExpression>
|
||||||
</textField>
|
</textField>
|
||||||
<image onErrorType="Blank">
|
<image onErrorType="Blank">
|
||||||
<reportElement uuid="031517a3-12c1-4094-9da4-59d82aec9243" x="1" y="1" width="100" height="54">
|
<reportElement x="1" y="1" width="100" height="54" uuid="031517a3-12c1-4094-9da4-59d82aec9243">
|
||||||
<printWhenExpression><![CDATA[$P{P_LOGO} != null]]></printWhenExpression>
|
<printWhenExpression><![CDATA[$P{P_LOGO} != null]]></printWhenExpression>
|
||||||
</reportElement>
|
</reportElement>
|
||||||
<imageExpression><![CDATA[$P{P_LOGO}]]></imageExpression>
|
<imageExpression><![CDATA[$P{P_LOGO}]]></imageExpression>
|
||||||
</image>
|
</image>
|
||||||
<textField>
|
<textField>
|
||||||
<reportElement uuid="2541cdb2-9c7e-4d10-aa30-af0d1f5e0e2f" x="101" y="1" width="470" height="20"/>
|
<reportElement x="101" y="1" width="470" height="20" uuid="2541cdb2-9c7e-4d10-aa30-af0d1f5e0e2f"/>
|
||||||
<textElement textAlignment="Center">
|
<textElement textAlignment="Center">
|
||||||
<font isBold="true" pdfEncoding="Cp1250"/>
|
<font isBold="true" pdfEncoding="Cp1250"/>
|
||||||
</textElement>
|
</textElement>
|
||||||
<textFieldExpression><![CDATA[$P{P_MAIN_ADDRESS}]]></textFieldExpression>
|
<textFieldExpression><![CDATA[$P{P_MAIN_ADDRESS}]]></textFieldExpression>
|
||||||
</textField>
|
</textField>
|
||||||
|
<staticText>
|
||||||
|
<reportElement x="11" y="106" width="264" height="16" uuid="ee0d1e0f-ff31-4cce-9afd-dd03f326ff2d"/>
|
||||||
|
<text><![CDATA[Souhlasím s pracovní cestou a s jejími podmínkami]]></text>
|
||||||
|
</staticText>
|
||||||
|
<textField pattern="dd. MM. yyyy">
|
||||||
|
<reportElement x="276" y="106" width="124" height="16" uuid="0705af53-b7a9-4a9e-80df-55f9af4e5b17"/>
|
||||||
|
<textFieldExpression><![CDATA[$F{requirement.reqDate}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
</band>
|
</band>
|
||||||
</pageHeader>
|
</pageHeader>
|
||||||
<detail>
|
<detail>
|
||||||
<band height="64" splitType="Stretch">
|
<band height="64" splitType="Stretch">
|
||||||
<subreport>
|
<subreport>
|
||||||
<reportElement uuid="762b2a39-b6f6-49cf-a9d2-8e152a791daf" x="-1" y="0" width="575" height="63"/>
|
<reportElement x="-1" y="0" width="575" height="63" uuid="762b2a39-b6f6-49cf-a9d2-8e152a791daf"/>
|
||||||
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{billItems})]]></dataSourceExpression>
|
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{billItems})]]></dataSourceExpression>
|
||||||
<subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "tripBillItems.jasper"]]></subreportExpression>
|
<subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "tripBillItems.jasper"]]></subreportExpression>
|
||||||
</subreport>
|
</subreport>
|
||||||
</band>
|
</band>
|
||||||
<band height="168">
|
<band height="168">
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="791d16f6-690b-4aae-8ac1-d3c3ade837e9" x="242" y="61" width="22" height="15">
|
<reportElement x="242" y="61" width="22" height="15" uuid="791d16f6-690b-4aae-8ac1-d3c3ade837e9">
|
||||||
<printWhenExpression><![CDATA[!$F{freeHousing}]]></printWhenExpression>
|
<printWhenExpression><![CDATA[!$F{freeHousing}]]></printWhenExpression>
|
||||||
</reportElement>
|
</reportElement>
|
||||||
<textElement>
|
<textElement>
|
||||||
@@ -251,7 +242,7 @@ tuzemské pracovní cesty]]></text>
|
|||||||
<text><![CDATA[NE]]></text>
|
<text><![CDATA[NE]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="4b4103f4-082a-4cfb-bbaa-ad41f187e53a" x="241" y="2" width="23" height="20">
|
<reportElement x="241" y="2" width="23" height="20" uuid="4b4103f4-082a-4cfb-bbaa-ad41f187e53a">
|
||||||
<printWhenExpression><![CDATA[$F{freeMeals}]]></printWhenExpression>
|
<printWhenExpression><![CDATA[$F{freeMeals}]]></printWhenExpression>
|
||||||
</reportElement>
|
</reportElement>
|
||||||
<textElement>
|
<textElement>
|
||||||
@@ -260,26 +251,26 @@ tuzemské pracovní cesty]]></text>
|
|||||||
<text><![CDATA[ANO]]></text>
|
<text><![CDATA[ANO]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<textField pattern="dd. MM. yyyy" isBlankWhenNull="true">
|
<textField pattern="dd. MM. yyyy" isBlankWhenNull="true">
|
||||||
<reportElement uuid="bf1013d3-8037-4f6f-9c23-6e1d801afbeb" x="345" y="131" width="100" height="13"/>
|
<reportElement x="345" y="131" width="100" height="13" uuid="bf1013d3-8037-4f6f-9c23-6e1d801afbeb"/>
|
||||||
<textElement>
|
<textElement>
|
||||||
<font size="8"/>
|
<font size="8"/>
|
||||||
</textElement>
|
</textElement>
|
||||||
<textFieldExpression><![CDATA[$F{modified}]]></textFieldExpression>
|
<textFieldExpression><![CDATA[$F{modified}]]></textFieldExpression>
|
||||||
</textField>
|
</textField>
|
||||||
<textField pattern="###0.00;-###0.00" isBlankWhenNull="true">
|
<textField pattern="###0.00;-###0.00" isBlankWhenNull="true">
|
||||||
<reportElement uuid="d5aa48e6-f801-4633-b18b-ccc7358da1e3" x="477" y="2" width="56" height="43"/>
|
<reportElement x="477" y="2" width="56" height="43" uuid="d5aa48e6-f801-4633-b18b-ccc7358da1e3"/>
|
||||||
<textElement textAlignment="Right" verticalAlignment="Middle"/>
|
<textElement textAlignment="Right" verticalAlignment="Middle"/>
|
||||||
<textFieldExpression><![CDATA[$F{requirement.downPayment}]]></textFieldExpression>
|
<textFieldExpression><![CDATA[$F{requirement.downPayment}]]></textFieldExpression>
|
||||||
</textField>
|
</textField>
|
||||||
<textField pattern="###0.00;-###0.00">
|
<textField pattern="###0.00;-###0.00">
|
||||||
<reportElement uuid="93cba14d-18d2-4279-9a8d-86f795291879" x="477" y="46" width="56" height="44"/>
|
<reportElement x="477" y="46" width="56" height="44" uuid="93cba14d-18d2-4279-9a8d-86f795291879"/>
|
||||||
<textElement textAlignment="Right" verticalAlignment="Middle">
|
<textElement textAlignment="Right" verticalAlignment="Middle">
|
||||||
<font isBold="true" pdfFontName="Helvetica-Bold"/>
|
<font isBold="true" pdfFontName="Helvetica-Bold"/>
|
||||||
</textElement>
|
</textElement>
|
||||||
<textFieldExpression><![CDATA[$F{total}]]></textFieldExpression>
|
<textFieldExpression><![CDATA[$F{total}]]></textFieldExpression>
|
||||||
</textField>
|
</textField>
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="dae29735-a372-4c9b-86e4-43507632c08a" x="242" y="2" width="22" height="20">
|
<reportElement x="242" y="2" width="22" height="20" uuid="dae29735-a372-4c9b-86e4-43507632c08a">
|
||||||
<printWhenExpression><![CDATA[!$F{freeMeals}]]></printWhenExpression>
|
<printWhenExpression><![CDATA[!$F{freeMeals}]]></printWhenExpression>
|
||||||
</reportElement>
|
</reportElement>
|
||||||
<textElement>
|
<textElement>
|
||||||
@@ -288,14 +279,14 @@ tuzemské pracovní cesty]]></text>
|
|||||||
<text><![CDATA[NE]]></text>
|
<text><![CDATA[NE]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<subreport>
|
<subreport>
|
||||||
<reportElement uuid="b2e1d029-267f-4363-9411-716a0db9b048" x="0" y="22" width="241" height="40">
|
<reportElement x="0" y="22" width="241" height="40" uuid="b2e1d029-267f-4363-9411-716a0db9b048">
|
||||||
<printWhenExpression><![CDATA[$F{freeMeals}]]></printWhenExpression>
|
<printWhenExpression><![CDATA[$F{freeMeals}]]></printWhenExpression>
|
||||||
</reportElement>
|
</reportElement>
|
||||||
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{billItems})]]></dataSourceExpression>
|
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{billItems})]]></dataSourceExpression>
|
||||||
<subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "tripBillFreeMeals.jasper"]]></subreportExpression>
|
<subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "tripBillFreeMeals.jasper"]]></subreportExpression>
|
||||||
</subreport>
|
</subreport>
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="0be16cf4-2ad5-453b-9933-a696979331a1" x="0" y="-1" width="241" height="23"/>
|
<reportElement x="0" y="-1" width="241" height="23" uuid="0be16cf4-2ad5-453b-9933-a696979331a1"/>
|
||||||
<textElement>
|
<textElement>
|
||||||
<font size="8"/>
|
<font size="8"/>
|
||||||
</textElement>
|
</textElement>
|
||||||
@@ -303,61 +294,61 @@ tuzemské pracovní cesty]]></text>
|
|||||||
(vyberte pro každý den zvlášť počet hlavních jídel (S-O-V)]]></text>
|
(vyberte pro každý den zvlášť počet hlavních jídel (S-O-V)]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<line>
|
<line>
|
||||||
<reportElement uuid="4e40e52b-207e-404e-b4f3-f0984af588c1" x="-1" y="90" width="572" height="1"/>
|
<reportElement x="-1" y="90" width="572" height="1" uuid="4e40e52b-207e-404e-b4f3-f0984af588c1"/>
|
||||||
</line>
|
</line>
|
||||||
<line>
|
<line>
|
||||||
<reportElement uuid="620dbf9c-0990-4895-963e-bd3759e64202" x="-1" y="-1" width="1" height="168"/>
|
<reportElement x="-1" y="-1" width="1" height="168" uuid="620dbf9c-0990-4895-963e-bd3759e64202"/>
|
||||||
</line>
|
</line>
|
||||||
<line>
|
<line>
|
||||||
<reportElement uuid="db423f1f-b9c6-49ec-8336-fa06680c9dad" x="334" y="144" width="237" height="1"/>
|
<reportElement x="334" y="144" width="237" height="1" uuid="db423f1f-b9c6-49ec-8336-fa06680c9dad"/>
|
||||||
</line>
|
</line>
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="c83e0050-7bac-43fa-8182-728243f702c2" x="1" y="106" width="570" height="15"/>
|
<reportElement x="1" y="106" width="570" height="15" uuid="c83e0050-7bac-43fa-8182-728243f702c2"/>
|
||||||
<textElement textAlignment="Center">
|
<textElement textAlignment="Center">
|
||||||
<font isBold="true" pdfFontName="Helvetica-Bold"/>
|
<font isBold="true" pdfFontName="Helvetica-Bold"/>
|
||||||
</textElement>
|
</textElement>
|
||||||
<text><![CDATA[Prohlašuji, že jsem všechny údaje uvedl úplně a správně.]]></text>
|
<text><![CDATA[Prohlašuji, že jsem všechny údaje uvedl úplně a správně.]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<line>
|
<line>
|
||||||
<reportElement uuid="08b18c85-1c4f-4b8d-bc0b-ac3df196a182" x="291" y="45" width="281" height="1"/>
|
<reportElement x="291" y="45" width="281" height="1" uuid="08b18c85-1c4f-4b8d-bc0b-ac3df196a182"/>
|
||||||
</line>
|
</line>
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="55cde79e-3253-4ff8-8387-f2f5f959bc06" x="1" y="91" width="570" height="15"/>
|
<reportElement x="1" y="91" width="570" height="15" uuid="55cde79e-3253-4ff8-8387-f2f5f959bc06"/>
|
||||||
<textElement textAlignment="Center"/>
|
<textElement textAlignment="Center"/>
|
||||||
<text><![CDATA[K vyúčtování pracovní cesty připojuji počet příloh]]></text>
|
<text><![CDATA[K vyúčtování pracovní cesty připojuji počet příloh]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<line>
|
<line>
|
||||||
<reportElement uuid="452bba4b-d293-4253-92c3-5fa58f58ea53" x="-1" y="167" width="572" height="1"/>
|
<reportElement x="-1" y="167" width="572" height="1" uuid="452bba4b-d293-4253-92c3-5fa58f58ea53"/>
|
||||||
</line>
|
</line>
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="5457410d-912f-47f9-a15f-2c15dadd6c57" x="0" y="61" width="242" height="15"/>
|
<reportElement x="0" y="61" width="242" height="15" uuid="5457410d-912f-47f9-a15f-2c15dadd6c57"/>
|
||||||
<textElement>
|
<textElement>
|
||||||
<font size="8"/>
|
<font size="8"/>
|
||||||
</textElement>
|
</textElement>
|
||||||
<text><![CDATA[Ubytování poskytnuto bezplatně]]></text>
|
<text><![CDATA[Ubytování poskytnuto bezplatně]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="20f38e87-a1bd-4d02-8742-4ce3a6b357bf" x="291" y="2" width="186" height="43"/>
|
<reportElement x="291" y="2" width="186" height="43" uuid="20f38e87-a1bd-4d02-8742-4ce3a6b357bf"/>
|
||||||
<textElement textAlignment="Center" verticalAlignment="Middle"/>
|
<textElement textAlignment="Center" verticalAlignment="Middle"/>
|
||||||
<text><![CDATA[Záloha]]></text>
|
<text><![CDATA[Záloha]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<line>
|
<line>
|
||||||
<reportElement uuid="6f7577a1-edc7-491a-a803-a76f8b84b13d" x="290" y="-4" width="1" height="95"/>
|
<reportElement x="290" y="-4" width="1" height="95" uuid="6f7577a1-edc7-491a-a803-a76f8b84b13d"/>
|
||||||
</line>
|
</line>
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="eae56af6-8fd9-45e1-8463-282939b67f05" x="291" y="46" width="186" height="44"/>
|
<reportElement x="291" y="46" width="186" height="44" uuid="eae56af6-8fd9-45e1-8463-282939b67f05"/>
|
||||||
<textElement textAlignment="Center" verticalAlignment="Middle"/>
|
<textElement textAlignment="Center" verticalAlignment="Middle"/>
|
||||||
<text><![CDATA[Doplatek - přeplatek]]></text>
|
<text><![CDATA[Doplatek - přeplatek]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="c200a476-63ba-4c3d-8e17-298b5928b0dd" x="1" y="76" width="240" height="15"/>
|
<reportElement x="1" y="76" width="240" height="15" uuid="c200a476-63ba-4c3d-8e17-298b5928b0dd"/>
|
||||||
<textElement>
|
<textElement>
|
||||||
<font size="8"/>
|
<font size="8"/>
|
||||||
</textElement>
|
</textElement>
|
||||||
<text><![CDATA[Volná - zlevněná jízdenka]]></text>
|
<text><![CDATA[Volná - zlevněná jízdenka]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="aea69aee-5394-4c6e-82da-9fef6a1fe2b9" x="1" y="131" width="305" height="30"/>
|
<reportElement x="1" y="131" width="305" height="30" uuid="aea69aee-5394-4c6e-82da-9fef6a1fe2b9"/>
|
||||||
<textElement>
|
<textElement>
|
||||||
<font size="8"/>
|
<font size="8"/>
|
||||||
</textElement>
|
</textElement>
|
||||||
@@ -366,7 +357,7 @@ tuzemské pracovní cesty]]></text>
|
|||||||
3) Počet km uvádějte jen při použití vlastního dopravního prostředku.]]></text>
|
3) Počet km uvádějte jen při použití vlastního dopravního prostředku.]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="d4de606e-fad8-4216-b467-2d8446cc3747" x="243" y="76" width="21" height="15">
|
<reportElement x="243" y="76" width="21" height="15" uuid="d4de606e-fad8-4216-b467-2d8446cc3747">
|
||||||
<printWhenExpression><![CDATA[$F{freeCarfare}]]></printWhenExpression>
|
<printWhenExpression><![CDATA[$F{freeCarfare}]]></printWhenExpression>
|
||||||
</reportElement>
|
</reportElement>
|
||||||
<textElement>
|
<textElement>
|
||||||
@@ -375,15 +366,15 @@ tuzemské pracovní cesty]]></text>
|
|||||||
<text><![CDATA[ANO]]></text>
|
<text><![CDATA[ANO]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="ff356c6e-d796-4148-b20f-114dde6e9340" x="334" y="146" width="237" height="15"/>
|
<reportElement x="334" y="146" width="237" height="15" uuid="ff356c6e-d796-4148-b20f-114dde6e9340"/>
|
||||||
<textElement textAlignment="Center"/>
|
<textElement textAlignment="Center"/>
|
||||||
<text><![CDATA[Datum a podpis účtovatele ]]></text>
|
<text><![CDATA[Datum a podpis účtovatele ]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<line>
|
<line>
|
||||||
<reportElement uuid="afefe2a2-4c7b-4e62-892f-5c8fb68f8a0f" x="571" y="-1" width="1" height="169"/>
|
<reportElement x="571" y="-1" width="1" height="169" uuid="afefe2a2-4c7b-4e62-892f-5c8fb68f8a0f"/>
|
||||||
</line>
|
</line>
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="4c309095-9cbb-49e7-8fe5-7a8f231c130f" x="243" y="61" width="21" height="15">
|
<reportElement x="243" y="61" width="21" height="15" uuid="4c309095-9cbb-49e7-8fe5-7a8f231c130f">
|
||||||
<printWhenExpression><![CDATA[$F{freeHousing}]]></printWhenExpression>
|
<printWhenExpression><![CDATA[$F{freeHousing}]]></printWhenExpression>
|
||||||
</reportElement>
|
</reportElement>
|
||||||
<textElement>
|
<textElement>
|
||||||
@@ -392,7 +383,7 @@ tuzemské pracovní cesty]]></text>
|
|||||||
<text><![CDATA[ANO]]></text>
|
<text><![CDATA[ANO]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="18b2ff27-e584-4352-98c8-0c642609b5e1" x="242" y="76" width="22" height="15">
|
<reportElement x="242" y="76" width="22" height="15" uuid="18b2ff27-e584-4352-98c8-0c642609b5e1">
|
||||||
<printWhenExpression><![CDATA[!$F{freeCarfare}]]></printWhenExpression>
|
<printWhenExpression><![CDATA[!$F{freeCarfare}]]></printWhenExpression>
|
||||||
</reportElement>
|
</reportElement>
|
||||||
<textElement>
|
<textElement>
|
||||||
@@ -405,152 +396,149 @@ tuzemské pracovní cesty]]></text>
|
|||||||
<summary>
|
<summary>
|
||||||
<band height="194" splitType="Prevent">
|
<band height="194" splitType="Prevent">
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="58e4cf15-a8e1-4b4d-b491-ad4a1825f0a3" x="281" y="5" width="30" height="15"/>
|
<reportElement x="281" y="5" width="30" height="15" uuid="58e4cf15-a8e1-4b4d-b491-ad4a1825f0a3"/>
|
||||||
<textElement/>
|
|
||||||
<text><![CDATA[číslo:]]></text>
|
<text><![CDATA[číslo:]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="6609a389-adc3-4fa1-8aaa-532805d293a4" x="1" y="150" width="130" height="20"/>
|
<reportElement x="1" y="150" width="130" height="20" uuid="6609a389-adc3-4fa1-8aaa-532805d293a4"/>
|
||||||
<textElement textAlignment="Center" verticalAlignment="Middle">
|
<textElement textAlignment="Center" verticalAlignment="Middle">
|
||||||
<font size="8" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
<font size="8" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||||
</textElement>
|
</textElement>
|
||||||
<text><![CDATA[Datum a podpis příjemce]]></text>
|
<text><![CDATA[Datum a podpis příjemce]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="45ed3989-a9f1-4323-bba2-0cd2e5dc2365" x="292" y="170" width="129" height="20"/>
|
<reportElement x="292" y="170" width="129" height="20" uuid="45ed3989-a9f1-4323-bba2-0cd2e5dc2365"/>
|
||||||
<textElement textAlignment="Center" verticalAlignment="Middle">
|
<textElement textAlignment="Center" verticalAlignment="Middle">
|
||||||
<font size="8" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
<font size="8" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||||
</textElement>
|
</textElement>
|
||||||
<text><![CDATA[(datum, podpis)]]></text>
|
<text><![CDATA[(datum, podpis)]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<line>
|
<line>
|
||||||
<reportElement uuid="7a26d915-835c-48f7-ab2d-ec53b330c9fe" x="311" y="19" width="252" height="1"/>
|
<reportElement x="311" y="19" width="252" height="1" uuid="7a26d915-835c-48f7-ab2d-ec53b330c9fe"/>
|
||||||
</line>
|
</line>
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="b3c1a046-6cca-4cb7-a8e1-3c71dd3dc815" x="438" y="150" width="130" height="20"/>
|
<reportElement x="438" y="150" width="130" height="20" uuid="b3c1a046-6cca-4cb7-a8e1-3c71dd3dc815"/>
|
||||||
<textElement textAlignment="Center" verticalAlignment="Middle">
|
<textElement textAlignment="Center" verticalAlignment="Middle">
|
||||||
<font size="8" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
<font size="8" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||||
</textElement>
|
</textElement>
|
||||||
<text><![CDATA[Příkazce operací]]></text>
|
<text><![CDATA[Příkazce operací]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<line>
|
<line>
|
||||||
<reportElement uuid="65725040-d1fd-489f-86ee-b0a0082d5576" x="438" y="149" width="130" height="1"/>
|
<reportElement x="438" y="149" width="130" height="1" uuid="65725040-d1fd-489f-86ee-b0a0082d5576"/>
|
||||||
</line>
|
</line>
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="8f4864f7-b60a-4b4c-a724-451a89da1f2f" x="1" y="20" width="280" height="15"/>
|
<reportElement x="1" y="20" width="280" height="15" uuid="8f4864f7-b60a-4b4c-a724-451a89da1f2f"/>
|
||||||
<textElement>
|
<textElement>
|
||||||
<font pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
<font pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||||
</textElement>
|
</textElement>
|
||||||
<text><![CDATA[Účtovaná náhrada byla přezkoušena a upravena na Kč:]]></text>
|
<text><![CDATA[Účtovaná náhrada byla přezkoušena a upravena na Kč:]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<line>
|
<line>
|
||||||
<reportElement uuid="2665a0ca-420d-46dc-9085-522ed3950c44" x="291" y="149" width="130" height="1"/>
|
<reportElement x="291" y="149" width="130" height="1" uuid="2665a0ca-420d-46dc-9085-522ed3950c44"/>
|
||||||
</line>
|
</line>
|
||||||
<line>
|
<line>
|
||||||
<reportElement uuid="b239b59d-42f0-44d1-b753-cbe1fd0f577b" x="106" y="49" width="457" height="1"/>
|
<reportElement x="106" y="49" width="457" height="1" uuid="b239b59d-42f0-44d1-b753-cbe1fd0f577b"/>
|
||||||
</line>
|
</line>
|
||||||
<line>
|
<line>
|
||||||
<reportElement uuid="4cd4e501-5b15-48ba-ac27-766e2292d270" x="106" y="66" width="457" height="1"/>
|
<reportElement x="106" y="66" width="457" height="1" uuid="4cd4e501-5b15-48ba-ac27-766e2292d270"/>
|
||||||
</line>
|
</line>
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="970cbe95-7b9f-4769-9ab1-59a4018c84ac" x="1" y="51" width="105" height="15"/>
|
<reportElement x="1" y="51" width="105" height="15" uuid="970cbe95-7b9f-4769-9ab1-59a4018c84ac"/>
|
||||||
<textElement>
|
<textElement>
|
||||||
<font pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
<font pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||||
</textElement>
|
</textElement>
|
||||||
<text><![CDATA[Doplatek–přeplatek:]]></text>
|
<text><![CDATA[Doplatek–přeplatek:]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="e95b083f-374c-4f73-b903-b0f6bd5891b7" x="1" y="35" width="105" height="15"/>
|
<reportElement x="1" y="35" width="105" height="15" uuid="e95b083f-374c-4f73-b903-b0f6bd5891b7"/>
|
||||||
<textElement>
|
<textElement>
|
||||||
<font pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
<font pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||||
</textElement>
|
</textElement>
|
||||||
<text><![CDATA[Vyplacená záloha:]]></text>
|
<text><![CDATA[Vyplacená záloha:]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="8df04d2f-8a01-4986-9bb9-6c9cb849e6b6" x="146" y="170" width="130" height="20"/>
|
<reportElement x="146" y="170" width="130" height="20" uuid="8df04d2f-8a01-4986-9bb9-6c9cb849e6b6"/>
|
||||||
<textElement textAlignment="Center" verticalAlignment="Middle">
|
<textElement textAlignment="Center" verticalAlignment="Middle">
|
||||||
<font size="8" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
<font size="8" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||||
</textElement>
|
</textElement>
|
||||||
<text><![CDATA[(hlavní účetní)]]></text>
|
<text><![CDATA[(hlavní účetní)]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<line>
|
<line>
|
||||||
<reportElement uuid="37c5882d-8568-42d8-bbc2-68ef3ceb01c3" x="281" y="35" width="282" height="1"/>
|
<reportElement x="281" y="35" width="282" height="1" uuid="37c5882d-8568-42d8-bbc2-68ef3ceb01c3"/>
|
||||||
</line>
|
</line>
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="1a55dac0-377d-4653-85ba-dbc376f14ff1" x="1" y="170" width="130" height="20"/>
|
<reportElement x="1" y="170" width="130" height="20" uuid="1a55dac0-377d-4653-85ba-dbc376f14ff1"/>
|
||||||
<textElement textAlignment="Center" verticalAlignment="Middle">
|
<textElement textAlignment="Center" verticalAlignment="Middle">
|
||||||
<font size="8" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
<font size="8" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||||
</textElement>
|
</textElement>
|
||||||
<text><![CDATA[(průkaz totožnosti)]]></text>
|
<text><![CDATA[(průkaz totožnosti)]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="2ad403e0-6c9a-4eb6-a8fb-abca20fca185" x="1" y="5" width="237" height="15"/>
|
<reportElement x="1" y="5" width="237" height="15" uuid="2ad403e0-6c9a-4eb6-a8fb-abca20fca185"/>
|
||||||
<textElement>
|
<textElement>
|
||||||
<font isBold="true" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
<font isBold="true" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||||
</textElement>
|
</textElement>
|
||||||
<text><![CDATA[VÝDAJOVÝ–PŘÍJMOVÝ POKLADNÍ DOKLAD]]></text>
|
<text><![CDATA[VÝDAJOVÝ–PŘÍJMOVÝ POKLADNÍ DOKLAD]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<line>
|
<line>
|
||||||
<reportElement uuid="c2618aa5-76df-461b-b168-aa587ce4a7ec" x="146" y="149" width="130" height="1"/>
|
<reportElement x="146" y="149" width="130" height="1" uuid="c2618aa5-76df-461b-b168-aa587ce4a7ec"/>
|
||||||
</line>
|
</line>
|
||||||
<line>
|
<line>
|
||||||
<reportElement uuid="e583f82d-b26d-4b13-a668-5505b8783a2a" x="1" y="149" width="130" height="1"/>
|
<reportElement x="1" y="149" width="130" height="1" uuid="e583f82d-b26d-4b13-a668-5505b8783a2a"/>
|
||||||
</line>
|
</line>
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="0d64c6ec-3c2a-464e-8068-171df105af12" x="438" y="170" width="130" height="20"/>
|
<reportElement x="438" y="170" width="130" height="20" uuid="0d64c6ec-3c2a-464e-8068-171df105af12"/>
|
||||||
<textElement textAlignment="Center" verticalAlignment="Middle">
|
<textElement textAlignment="Center" verticalAlignment="Middle">
|
||||||
<font size="8" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
<font size="8" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||||
</textElement>
|
</textElement>
|
||||||
<text><![CDATA[(datum, podpis)]]></text>
|
<text><![CDATA[(datum, podpis)]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<line>
|
<line>
|
||||||
<reportElement uuid="978b5c74-4f0e-4107-b654-7eb1621cea60" x="0" y="192" width="572" height="1"/>
|
<reportElement x="0" y="192" width="572" height="1" uuid="978b5c74-4f0e-4107-b654-7eb1621cea60"/>
|
||||||
</line>
|
</line>
|
||||||
<line>
|
<line>
|
||||||
<reportElement uuid="7b4b0991-c3d9-4fa3-a080-cc3ae98c0eb1" x="243" y="102" width="320" height="1"/>
|
<reportElement x="243" y="102" width="320" height="1" uuid="7b4b0991-c3d9-4fa3-a080-cc3ae98c0eb1"/>
|
||||||
</line>
|
</line>
|
||||||
<line>
|
<line>
|
||||||
<reportElement uuid="63479d2a-ecc1-40de-a36a-89218d1f648b" x="38" y="81" width="525" height="1"/>
|
<reportElement x="38" y="81" width="525" height="1" uuid="63479d2a-ecc1-40de-a36a-89218d1f648b"/>
|
||||||
</line>
|
</line>
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="51ec3ef1-6a8c-441c-80c9-598f59077b81" x="146" y="150" width="130" height="20"/>
|
<reportElement x="146" y="150" width="130" height="20" uuid="51ec3ef1-6a8c-441c-80c9-598f59077b81"/>
|
||||||
<textElement textAlignment="Center" verticalAlignment="Middle">
|
<textElement textAlignment="Center" verticalAlignment="Middle">
|
||||||
<font size="8" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
<font size="8" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||||
</textElement>
|
</textElement>
|
||||||
<text><![CDATA[Datum a podpis pokladníka]]></text>
|
<text><![CDATA[Datum a podpis pokladníka]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="83737011-db81-4f02-9012-a9aca5561e76" x="291" y="150" width="130" height="20"/>
|
<reportElement x="291" y="150" width="130" height="20" uuid="83737011-db81-4f02-9012-a9aca5561e76"/>
|
||||||
<textElement textAlignment="Center" verticalAlignment="Middle">
|
<textElement textAlignment="Center" verticalAlignment="Middle">
|
||||||
<font size="8" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
<font size="8" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
|
||||||
</textElement>
|
</textElement>
|
||||||
<text><![CDATA[Správce rozpočtu]]></text>
|
<text><![CDATA[Správce rozpočtu]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="49fcf5bc-5910-4525-aa6d-ae1bc6ca90e0" x="1" y="66" width="37" height="15"/>
|
<reportElement x="1" y="66" width="37" height="15" uuid="49fcf5bc-5910-4525-aa6d-ae1bc6ca90e0"/>
|
||||||
<textElement/>
|
|
||||||
<text><![CDATA[Slovy:]]></text>
|
<text><![CDATA[Slovy:]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<line>
|
<line>
|
||||||
<reportElement uuid="8b83472f-9960-429e-8fab-84d1c3d1d678" x="571" y="-1" width="1" height="194"/>
|
<reportElement x="571" y="-1" width="1" height="194" uuid="8b83472f-9960-429e-8fab-84d1c3d1d678"/>
|
||||||
</line>
|
</line>
|
||||||
<line>
|
<line>
|
||||||
<reportElement uuid="5e5a7c99-962e-4c99-b3ba-dbed5315f5aa" x="-1" y="-2" width="1" height="195"/>
|
<reportElement x="-1" y="-2" width="1" height="195" uuid="5e5a7c99-962e-4c99-b3ba-dbed5315f5aa"/>
|
||||||
</line>
|
</line>
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="4aca1ec1-c2dc-47b9-a973-40ded5f52d29" x="260" y="103" width="290" height="20"/>
|
<reportElement x="260" y="103" width="290" height="20" uuid="4aca1ec1-c2dc-47b9-a973-40ded5f52d29"/>
|
||||||
<textElement/>
|
|
||||||
<text><![CDATA[Datum a podpis zaměstnance, který upravil vyúčtování]]></text>
|
<text><![CDATA[Datum a podpis zaměstnance, který upravil vyúčtování]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<genericElement>
|
<genericElement>
|
||||||
<reportElement uuid="3753147d-3c79-4377-b296-3281ab3d54b3" x="291" y="103" width="130" height="46"/>
|
<reportElement x="291" y="103" width="130" height="46" uuid="3753147d-3c79-4377-b296-3281ab3d54b3"/>
|
||||||
<genericElementType namespace="urn:sig:sig" name="signature"/>
|
<genericElementType namespace="urn:sig:sig" name="signature"/>
|
||||||
<genericElementParameter name="index">
|
<genericElementParameter name="index">
|
||||||
<valueExpression><![CDATA[2]]></valueExpression>
|
<valueExpression><![CDATA[2]]></valueExpression>
|
||||||
</genericElementParameter>
|
</genericElementParameter>
|
||||||
</genericElement>
|
</genericElement>
|
||||||
<genericElement>
|
<genericElement>
|
||||||
<reportElement uuid="14ae63ff-6be2-4419-9f39-8c9c8d2daf42" x="438" y="107" width="130" height="42"/>
|
<reportElement x="438" y="107" width="130" height="42" uuid="14ae63ff-6be2-4419-9f39-8c9c8d2daf42"/>
|
||||||
<genericElementType namespace="urn:sig:sig" name="signature"/>
|
<genericElementType namespace="urn:sig:sig" name="signature"/>
|
||||||
<genericElementParameter name="index">
|
<genericElementParameter name="index">
|
||||||
<valueExpression><![CDATA[1]]></valueExpression>
|
<valueExpression><![CDATA[1]]></valueExpression>
|
||||||
|
|||||||
Binary file not shown.
@@ -0,0 +1,251 @@
|
|||||||
|
<?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-29T14:56:06 -->
|
||||||
|
<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="tripRequirementProtocol" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="8e9e589b-57d9-476e-838c-00ead08604a1">
|
||||||
|
<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="authorization" class="java.util.List">
|
||||||
|
<fieldDescription><![CDATA[authorization]]></fieldDescription>
|
||||||
|
</field>
|
||||||
|
<field name="centre" class="info.bukova.isspst.data.Workgroup">
|
||||||
|
<fieldDescription><![CDATA[centre]]></fieldDescription>
|
||||||
|
</field>
|
||||||
|
<field name="description" class="java.lang.String">
|
||||||
|
<fieldDescription><![CDATA[description]]></fieldDescription>
|
||||||
|
</field>
|
||||||
|
<field name="from" class="java.lang.String">
|
||||||
|
<fieldDescription><![CDATA[from]]></fieldDescription>
|
||||||
|
</field>
|
||||||
|
<field name="numser" class="java.lang.String">
|
||||||
|
<fieldDescription><![CDATA[numser]]></fieldDescription>
|
||||||
|
</field>
|
||||||
|
<field name="ownedBy" class="info.bukova.isspst.data.User">
|
||||||
|
<fieldDescription><![CDATA[ownedBy]]></fieldDescription>
|
||||||
|
</field>
|
||||||
|
<field name="to" class="java.lang.String">
|
||||||
|
<fieldDescription><![CDATA[to]]></fieldDescription>
|
||||||
|
</field>
|
||||||
|
<field name="tripDate" class="java.util.Date">
|
||||||
|
<fieldDescription><![CDATA[tripDate]]></fieldDescription>
|
||||||
|
</field>
|
||||||
|
<field name="state" class="info.bukova.isspst.data.RequirementState">
|
||||||
|
<fieldDescription><![CDATA[state]]></fieldDescription>
|
||||||
|
</field>
|
||||||
|
<background>
|
||||||
|
<band splitType="Stretch"/>
|
||||||
|
</background>
|
||||||
|
<title>
|
||||||
|
<band height="59" splitType="Stretch">
|
||||||
|
<textField>
|
||||||
|
<reportElement x="113" y="0" width="689" height="46" uuid="33458c13-a1ec-4e96-ab93-60f001e32542"/>
|
||||||
|
<textElement textAlignment="Center">
|
||||||
|
<font size="16" isBold="true" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1250"/>
|
||||||
|
</textElement>
|
||||||
|
<textFieldExpression><![CDATA[$P{P_MAIN_ADDRESS}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<image onErrorType="Blank">
|
||||||
|
<reportElement x="0" y="0" width="100" height="54" uuid="159b16e8-ffa6-4ff5-956f-8807ebc11eb3">
|
||||||
|
<printWhenExpression><![CDATA[$P{P_LOGO} != null]]></printWhenExpression>
|
||||||
|
</reportElement>
|
||||||
|
<imageExpression><![CDATA[$P{P_LOGO}]]></imageExpression>
|
||||||
|
</image>
|
||||||
|
</band>
|
||||||
|
</title>
|
||||||
|
<pageHeader>
|
||||||
|
<band height="21" splitType="Stretch">
|
||||||
|
<staticText>
|
||||||
|
<reportElement x="0" y="0" width="802" height="20" uuid="4872723e-e595-428b-86ac-62cdd4cc932e"/>
|
||||||
|
<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 - služebni cesty]]></text>
|
||||||
|
</staticText>
|
||||||
|
</band>
|
||||||
|
</pageHeader>
|
||||||
|
<columnHeader>
|
||||||
|
<band height="26" splitType="Stretch">
|
||||||
|
<staticText>
|
||||||
|
<reportElement x="60" y="0" width="120" height="24" uuid="89d5a299-f284-41c9-945f-64b5be915017"/>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font isBold="true" pdfFontName="Helvetica-Bold"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[Vytvořil]]></text>
|
||||||
|
</staticText>
|
||||||
|
<staticText>
|
||||||
|
<reportElement x="181" y="1" width="56" height="24" uuid="0a7322c1-10f5-4c95-a53b-f63dee37f406">
|
||||||
|
<property name="local_mesure_unitheight" value="pixel"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.height" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<textElement>
|
||||||
|
<font isBold="true" pdfFontName="Helvetica-Bold"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[Datum cesty]]></text>
|
||||||
|
</staticText>
|
||||||
|
<staticText>
|
||||||
|
<reportElement x="238" y="0" width="120" height="24" uuid="464a2dea-c3fd-44af-8a3f-d798439fdebb">
|
||||||
|
<property name="local_mesure_unitwidth" value="pixel"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.width" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font isBold="true" pdfFontName="Helvetica-Bold"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[Odkud]]></text>
|
||||||
|
</staticText>
|
||||||
|
<staticText>
|
||||||
|
<reportElement x="360" y="1" width="120" height="24" uuid="3b0f360a-3f0d-4aa1-9d2f-595b6dbc4899">
|
||||||
|
<property name="local_mesure_unitwidth" value="pixel"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.width" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font isBold="true" pdfFontName="Helvetica-Bold"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[Kam]]></text>
|
||||||
|
</staticText>
|
||||||
|
<staticText>
|
||||||
|
<reportElement x="480" y="0" width="184" height="24" uuid="561ed640-ff43-4b10-84dc-ecb197b1b1bf"/>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font isBold="true" pdfFontName="Helvetica-Bold"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[Účel cesty]]></text>
|
||||||
|
</staticText>
|
||||||
|
<staticText>
|
||||||
|
<reportElement x="664" y="0" width="135" height="24" uuid="9ba12077-6e53-4f88-8832-e53aab38514e"/>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font isBold="true" pdfFontName="Helvetica-Bold"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[Středisko]]></text>
|
||||||
|
</staticText>
|
||||||
|
<staticText>
|
||||||
|
<reportElement x="0" y="0" width="58" height="24" uuid="31ef839b-ebf8-482b-8057-9ad06497618c"/>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font isBold="true" pdfFontName="Helvetica-Bold"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[Poř. číslo]]></text>
|
||||||
|
</staticText>
|
||||||
|
<line>
|
||||||
|
<reportElement x="0" y="25" width="802" height="1" uuid="45abdfb0-2556-477d-8ab3-2a23228bb13b"/>
|
||||||
|
</line>
|
||||||
|
<line>
|
||||||
|
<reportElement x="0" y="0" width="802" height="1" uuid="9897ab69-fd50-4636-90b4-a1222c298572"/>
|
||||||
|
</line>
|
||||||
|
<line>
|
||||||
|
<reportElement x="-1" y="0" width="1" height="26" uuid="d6dfebfe-84b5-4a13-9184-564cb9e3b8f5"/>
|
||||||
|
</line>
|
||||||
|
<line>
|
||||||
|
<reportElement x="802" y="0" width="1" height="26" uuid="00b50c00-5e63-49b3-99df-010e85d522e4"/>
|
||||||
|
</line>
|
||||||
|
</band>
|
||||||
|
</columnHeader>
|
||||||
|
<detail>
|
||||||
|
<band height="49" splitType="Stretch">
|
||||||
|
<printWhenExpression><![CDATA[$F{state} == info.bukova.isspst.data.RequirementState.APPROVED]]></printWhenExpression>
|
||||||
|
<textField>
|
||||||
|
<reportElement x="0" y="0" width="59" height="30" uuid="08dabb19-6f18-4cdc-8b99-0c083373ac66">
|
||||||
|
<property name="local_mesure_unitwidth" value="pixel"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.width" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<textFieldExpression><![CDATA[$F{numser}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField>
|
||||||
|
<reportElement x="60" y="0" width="121" height="30" uuid="4d4dd931-ead0-48b0-9690-b42a60042ec6">
|
||||||
|
<property name="local_mesure_unitwidth" value="pixel"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.width" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<textFieldExpression><![CDATA[$F{ownedBy}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField>
|
||||||
|
<reportElement x="180" y="0" width="58" height="30" uuid="83d276e3-c446-4c3f-b4d9-20f6cffa7f97">
|
||||||
|
<property name="local_mesure_unitwidth" value="pixel"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.width" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<textFieldExpression><![CDATA[$F{tripDate}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField>
|
||||||
|
<reportElement x="240" y="0" width="120" height="30" uuid="8df1e3b1-27d0-433e-a491-4d013d22a0de">
|
||||||
|
<property name="local_mesure_unitwidth" value="pixel"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.width" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<textFieldExpression><![CDATA[$F{from}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField>
|
||||||
|
<reportElement x="360" y="0" width="120" height="30" uuid="d2849222-5b8c-4a2f-988b-434f857e6064">
|
||||||
|
<property name="local_mesure_unitx" value="pixel"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.x" value="px"/>
|
||||||
|
<property name="local_mesure_unitwidth" value="pixel"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.width" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<textFieldExpression><![CDATA[$F{to}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField>
|
||||||
|
<reportElement x="482" y="0" width="182" height="30" uuid="fafb983a-da26-451c-93a0-dc448cc239b8">
|
||||||
|
<property name="local_mesure_unitx" value="pixel"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.x" value="px"/>
|
||||||
|
<property name="local_mesure_unitwidth" value="pixel"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.width" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<textFieldExpression><![CDATA[$F{description}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField>
|
||||||
|
<reportElement x="666" y="0" width="134" height="30" uuid="d1895e83-6180-459e-a227-28e3b21194ae">
|
||||||
|
<property name="local_mesure_unitx" value="pixel"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.x" value="px"/>
|
||||||
|
<property name="local_mesure_unitwidth" value="pixel"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.width" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<textFieldExpression><![CDATA[$F{centre}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<staticText>
|
||||||
|
<reportElement x="6" y="32" width="100" height="14" uuid="4852a6b8-010e-47f1-acdd-6d3952d77dc7"/>
|
||||||
|
<text><![CDATA[Příkazce operace:]]></text>
|
||||||
|
</staticText>
|
||||||
|
<textField pattern="d.M.yyyy">
|
||||||
|
<reportElement x="106" y="32" width="58" height="14" uuid="1c2d9bbe-348a-432c-ae8a-a605d8e94fe0"/>
|
||||||
|
<textFieldExpression><![CDATA[((info.bukova.isspst.data.AuthItem)$F{authorization}.get($F{authorization}.size()-2)).getAuthDate()]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField>
|
||||||
|
<reportElement x="164" y="32" width="142" height="14" uuid="7a058478-5726-446d-a915-ba6ade259c6e"/>
|
||||||
|
<textFieldExpression><![CDATA[""+((info.bukova.isspst.data.AuthItem)$F{authorization}.get($F{authorization}.size()-2)).getApprover().toString()]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<staticText>
|
||||||
|
<reportElement x="329" y="32" width="96" height="14" uuid="12d60e5d-cf2c-4b0a-aa5a-80a5c72a8ffa"/>
|
||||||
|
<text><![CDATA[Správce rozpočtu:]]></text>
|
||||||
|
</staticText>
|
||||||
|
<textField pattern="d.M.yyyy">
|
||||||
|
<reportElement x="425" y="32" width="57" height="14" uuid="6b42a8a9-3e48-46ab-b6eb-fd38207be058"/>
|
||||||
|
<textFieldExpression><![CDATA[((info.bukova.isspst.data.AuthItem)$F{authorization}.get($F{authorization}.size()-1)).getAuthDate()]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField>
|
||||||
|
<reportElement x="482" y="32" width="142" height="14" uuid="21845f04-f6a8-4ade-9cad-899d58ac382f"/>
|
||||||
|
<textFieldExpression><![CDATA[""+((info.bukova.isspst.data.AuthItem)$F{authorization}.get($F{authorization}.size()-1)).getApprover().toString()]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<line>
|
||||||
|
<reportElement x="0" y="47" width="802" height="1" uuid="0c6241ad-a868-40a2-b11a-6bf1d9cb25b4"/>
|
||||||
|
</line>
|
||||||
|
<line>
|
||||||
|
<reportElement x="-1" y="0" width="1" height="48" uuid="3f3af00d-3ccd-4531-aa9e-a80120fd803e"/>
|
||||||
|
</line>
|
||||||
|
<line>
|
||||||
|
<reportElement x="802" y="0" width="1" height="48" uuid="3e6438bd-2d8b-467f-ab8f-265aead85220"/>
|
||||||
|
</line>
|
||||||
|
<line>
|
||||||
|
<reportElement x="6" y="30" width="784" height="1" uuid="4c6a9ac9-bceb-479f-bb71-34083c6684e3"/>
|
||||||
|
<graphicElement>
|
||||||
|
<pen lineStyle="Dashed"/>
|
||||||
|
</graphicElement>
|
||||||
|
</line>
|
||||||
|
</band>
|
||||||
|
</detail>
|
||||||
|
<pageFooter>
|
||||||
|
<band height="21" splitType="Stretch">
|
||||||
|
<textField>
|
||||||
|
<reportElement x="0" y="0" width="802" height="19" uuid="44f19d5f-ad2d-49d6-a179-8a4d60def307"/>
|
||||||
|
<textElement textAlignment="Center"/>
|
||||||
|
<textFieldExpression><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
</band>
|
||||||
|
</pageFooter>
|
||||||
|
</jasperReport>
|
||||||
@@ -58,6 +58,10 @@
|
|||||||
<prop key="hibernate.search.default.directory_provider">filesystem</prop>
|
<prop key="hibernate.search.default.directory_provider">filesystem</prop>
|
||||||
<prop key="hibernate.search.default.indexBase">${storage.fulltextIndex}</prop>
|
<prop key="hibernate.search.default.indexBase">${storage.fulltextIndex}</prop>
|
||||||
<prop key="hibernate.search.analyzer">org.apache.lucene.analysis.cz.CzechAnalyzer</prop>
|
<prop key="hibernate.search.analyzer">org.apache.lucene.analysis.cz.CzechAnalyzer</prop>
|
||||||
|
<prop key="hibernate.cache.use_second_level_cache">true</prop>
|
||||||
|
<prop key="hibernate.cache.use_query_cache">true</prop>
|
||||||
|
<prop key="hibernate.generate_statistics">true</prop>
|
||||||
|
<prop key="hibernate.cache.region.factory_class">org.hibernate.cache.ehcache.EhCacheRegionFactory</prop>
|
||||||
<!-- <prop key="hibernate.enable_lazy_load_no_trans">true</prop> -->
|
<!-- <prop key="hibernate.enable_lazy_load_no_trans">true</prop> -->
|
||||||
</props>
|
</props>
|
||||||
</property>
|
</property>
|
||||||
@@ -183,7 +187,7 @@
|
|||||||
<property name="rootPath" value="${storage.root}"/>
|
<property name="rootPath" value="${storage.root}"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="signeDocStorage" class="info.bukova.isspst.storage.ReportFileStorageImpl">
|
<bean id="signedDocStorage" class="info.bukova.isspst.storage.ReportFileStorageImpl">
|
||||||
<property name="rootPath" value="${storage.signedDocuments}"/>
|
<property name="rootPath" value="${storage.signedDocuments}"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
@@ -191,6 +195,10 @@
|
|||||||
<bean id="sessionData" class="info.bukova.isspst.SessionData" scope="session">
|
<bean id="sessionData" class="info.bukova.isspst.SessionData" scope="session">
|
||||||
<aop:scoped-proxy/>
|
<aop:scoped-proxy/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
|
<bean id="hqlFilter" class="info.bukova.isspst.services.HqlDataFilter" scope="request">
|
||||||
|
<aop:scoped-proxy/>
|
||||||
|
</bean>
|
||||||
|
|
||||||
<!-- DAO -->
|
<!-- DAO -->
|
||||||
<bean id="queryDao" class="info.bukova.isspst.dao.jpa.QueryDaoJPA">
|
<bean id="queryDao" class="info.bukova.isspst.dao.jpa.QueryDaoJPA">
|
||||||
@@ -280,6 +288,14 @@
|
|||||||
<bean id="signedDocumentDao" class="info.bukova.isspst.dao.jpa.SignedDocumentDaoJPA">
|
<bean id="signedDocumentDao" class="info.bukova.isspst.dao.jpa.SignedDocumentDaoJPA">
|
||||||
<property name="sessionFactory" ref="sessionFactory"/>
|
<property name="sessionFactory" ref="sessionFactory"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
|
<bean id="seasonDao" class="info.bukova.isspst.dao.jpa.SeasonDaoJPA">
|
||||||
|
<property name="sessionFactory" ref="sessionFactory"/>
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
<bean id="limitDao" class="info.bukova.isspst.dao.jpa.LimitDaoJPA">
|
||||||
|
<property name="sessionFactory" ref="sessionFactory"/>
|
||||||
|
</bean>
|
||||||
|
|
||||||
<!-- Business logic -->
|
<!-- Business logic -->
|
||||||
<bean id="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean"/>
|
<bean id="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean"/>
|
||||||
@@ -466,4 +482,12 @@
|
|||||||
<bean id="signedDocumentService" class="info.bukova.isspst.services.signeddocs.SignedDocumentServiceImpl">
|
<bean id="signedDocumentService" class="info.bukova.isspst.services.signeddocs.SignedDocumentServiceImpl">
|
||||||
<property name="dao" ref="signedDocumentDao"/>
|
<property name="dao" ref="signedDocumentDao"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
|
<bean id="seasonService" class="info.bukova.isspst.services.settings.SeasonServiceImpl">
|
||||||
|
<property name="dao" ref="seasonDao"/>
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
<bean id="limitService" class="info.bukova.isspst.services.limits.LimitServiceImpl">
|
||||||
|
<property name="dao" ref="limitDao"/>
|
||||||
|
</bean>
|
||||||
</beans>
|
</beans>
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<?page title="${labels.LimitsAgName}" 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"?>
|
||||||
|
|
||||||
|
<zscript>
|
||||||
|
String gridZul = "limits.zul";
|
||||||
|
</zscript>
|
||||||
|
|
||||||
|
<include src="../../app/template.zhtml"/>
|
||||||
|
|
||||||
|
</zk>
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
<?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="editWin"
|
||||||
|
closable="true"
|
||||||
|
border="normal"
|
||||||
|
width="600px"
|
||||||
|
position="center"
|
||||||
|
apply="org.zkoss.bind.BindComposer"
|
||||||
|
viewModel="@id('vm') @init('info.bukova.isspst.ui.limits.LimitsForm')">
|
||||||
|
<caption
|
||||||
|
image="/img/invoicing-032.png"
|
||||||
|
zclass="form-caption"
|
||||||
|
label="${labels.LimitsLimit}" />
|
||||||
|
<grid>
|
||||||
|
<columns>
|
||||||
|
<column/>
|
||||||
|
<column/>
|
||||||
|
</columns>
|
||||||
|
<rows>
|
||||||
|
<row>
|
||||||
|
<label value="${labels.LimitsWorkgroup}"/>
|
||||||
|
<combobox
|
||||||
|
disabled="@load(not vm.newRec)"
|
||||||
|
width="150px"
|
||||||
|
model="@load(vm.workgroups)"
|
||||||
|
readonly="true"
|
||||||
|
selectedItem="@bind(vm.dataBean.workgroup)">
|
||||||
|
<template name="model">
|
||||||
|
<comboitem label="@load(each)" />
|
||||||
|
</template>
|
||||||
|
</combobox>
|
||||||
|
</row>
|
||||||
|
<row>
|
||||||
|
<label value="${labels.LimitsLimit}"/>
|
||||||
|
<textbox value="@bind(vm.dataBean.limit) @converter(vm.standardBigDecimalConverter)"/>
|
||||||
|
</row>
|
||||||
|
</rows>
|
||||||
|
</grid>
|
||||||
|
<include src="/app/formButtons.zul"/>
|
||||||
|
</window>
|
||||||
|
</zk>
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
<?page title="${labels.LimitsAgName}" 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.limits.LimitsList')">
|
||||||
|
<caption
|
||||||
|
src="/img/invoicing-032.png"
|
||||||
|
zclass="form-caption"
|
||||||
|
label="${labels.LimitsAgName}" />
|
||||||
|
|
||||||
|
<include src="/app/toolbar.zul" />
|
||||||
|
<listbox
|
||||||
|
vflex="1"
|
||||||
|
model="@load(vm.dataList)"
|
||||||
|
selectedItem="@bind(vm.dataBean)">
|
||||||
|
<listhead menupopup="auto">
|
||||||
|
<listheader
|
||||||
|
label="${labels.LimitsWorkgroup}"
|
||||||
|
sort="czech(name)"
|
||||||
|
width="30%" />
|
||||||
|
<listheader
|
||||||
|
label="${labels.LimitsLimit}"
|
||||||
|
sort="czech(description)"
|
||||||
|
align="right"
|
||||||
|
width="70%" />
|
||||||
|
<listheader
|
||||||
|
label="${labels.LimitsSpent}"
|
||||||
|
sort="czech(description)"
|
||||||
|
align="right"
|
||||||
|
width="70%" />
|
||||||
|
</listhead>
|
||||||
|
<template name="model">
|
||||||
|
<listitem>
|
||||||
|
<listcell label="@load(each.workgroup)" />
|
||||||
|
<listcell label="@load(each.limit) @converter(vm.standardBigDecimalConverter)" />
|
||||||
|
<listcell label="@load(vm.spent[each]) @converter(vm.standardBigDecimalConverter)"/>
|
||||||
|
</listitem>
|
||||||
|
</template>
|
||||||
|
</listbox>
|
||||||
|
<div align="center" vflex="1">
|
||||||
|
<image height="100%" content="@load(vm.chart)"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</window>
|
||||||
|
|
||||||
|
</zk>
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user