21 Commits

Author SHA1 Message Date
pepa d2aa1cbd9a Opraveno vyhodnocení sestavy pro podpis, pokud je v agendě více sestav s podpisem. 2016-01-06 11:55:28 +01:00
pepa 52cf63414b Oprevena sestava Žádost o SC- tisk z agend Cestovní příkazy a Požadavky na SC odkazuje na stejnou sestavu.
Byla přidána možnost použít property hlavní entity jako zdroje dat pro sestavu- rozšířen constructor třídy Report o parametr property.
2015-11-27 15:11:23 +01:00
pepa f904e89946 Opraveno filtrování podle čísla požadavku v agendě Cestovní příkazy. 2015-11-27 14:22:05 +01:00
pepa 5cae516cb6 Na sestavě Vyúčtování SC bylo odstraněno pole pro podpis "S provedením pracovní cesty souhlasí".
closes #259
2015-11-27 13:57:25 +01:00
pepa 6ac6d783fb - Opravena kontrola práv při ružení schválení vyúčtování SC.
- Opraven refresh gridů při mazání záznamů.
- Zrušeno výchozí třídění v agendě Cestovní příkazy.
- Opraven pom.xml.
2015-10-19 10:24:53 +02:00
pepa 67ff54d3f1 Merge branch 'master' of https://git.bukova.info/repos/git/isspst 2015-10-18 16:28:30 +02:00
pepa 275e120021 Opraveno ukládání záznamu v agendě Fakturace požadavků. Příznak Fakturováno se již ukládá správně. 2015-10-16 10:03:34 +02:00
franta d20a72b336 Kvůli přechodu na IntelliJ IDEA upravena konfigurace Maven.
Fakturace rozděleny na fakturace materiálu a služeb.

closes #249
2015-10-14 10:06:41 +02:00
pepa e24684bbd0 Přesunut podpis příkazce operace na vyúčtování služební cesty.
closes #258
2015-10-12 15:26:25 +02:00
pepa 21bf006c19 Aktualizace podepisovací komponenty. 2015-10-11 22:08:30 +02:00
pepa 970928bb4e Merge branch 'master' of https://git.bukova.info/repos/git/isspst 2015-10-11 21:53:33 +02:00
pepa 369184940b Do agendy Cestovní příkazy byly přidány záložky "Má střediska", "Mé komise" a "Vše", kde se zobrazují vyúčtování služebních ke schválení. V záložkách lze vyúčtování označit jako proplacené. Do e-mailu se generuje odkaz do těchto záložek.
closes #253
closes #250
2015-10-11 21:52:50 +02:00
franta cc374a3bf1 Podepsané dokumenty se nyní zobrazují ve dvou záložkách - Aktuální
dokumenty a Archiv.
V Archivu se zobrazují dokumenty starší než rok.

closes #225
2015-10-05 13:09:20 +02:00
franta 66e0c427ac Popisek změněn na "Zajistím sám", případně ve sloupci na "Zaj. sám"
closes #247
2015-10-05 08:57:26 +02:00
franta 095089d020 U požadavků na nákup je nyní pole Popis povinné.
closes #248
2015-10-05 08:32:42 +02:00
pepa 84154ccbff Neaktivní uživatelé se nenabízí v seznamech pro výběr uživatele (spolucestující...). V agendě Uživatelé a Střediska/komise jsou barevně odlišeni.
closes #239
2015-10-02 14:58:51 +02:00
pepa 1230959854 Opraveno duplikování vyúčtování SC, když se na požadavku provede úprava a znovu se schválí.
closes #255
2015-10-02 13:27:24 +02:00
pepa 96154a6b98 Opraveno mazání záznamů z požadavků
closes #257
2015-10-02 09:41:16 +02:00
pepa 14242fa41a Vyúčtování služebních cest u spolucestujících lze nyní zrušit u každého zvlášť. Lze tak provést dodatečnou opravu vyúčtování.
closes #251
2015-10-02 09:32:09 +02:00
pepa 67a99d8d78 Na sestavách se pro viditelný dig. podpis vytváří klasické read only formulářové pole, které se podpisem nahradí za obrázek podpisu.
Změna podepisovací komponenty- na windows se spouští stejná jak na linuxu, macos...
closes #244
2015-10-01 16:00:49 +02:00
pepa 768d3ee874 Opraveno duplicitní vkládání záznamů do agendy Fakturace požadavků, v případě, že se požadavek upraví a znovu schválí.
closes #252
2015-09-08 22:22:23 +02:00
88 changed files with 2026 additions and 624 deletions
+18 -1
View File
@@ -24,7 +24,7 @@
<repository> <repository>
<id>fdvsolution.public</id> <id>fdvsolution.public</id>
<name>Dynamic Jasper</name> <name>Dynamic Jasper</name>
<url>http://archiva.fdvs.com.ar/repository/public1/</url> <url>http://nexus.fdvs.com.ar/content/groups/public/</url>
</repository> </repository>
</repositories> </repositories>
@@ -407,6 +407,23 @@
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
<include>**/*.js</include>
<include>**/*.wpd</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.xml</include>
<include>**/*.properties</include>
</includes>
</resource>
</resources>
</build> </build>
<dependencyManagement> <dependencyManagement>
<dependencies> <dependencies>
@@ -116,6 +116,7 @@ public class Constants {
public final static String PERM_EDIT_OWN = "PERM_EDIT_OWN"; public final static String PERM_EDIT_OWN = "PERM_EDIT_OWN";
public final static String PERM_DELETE_NEW = "PERM_DELETE_NEW"; public final static String PERM_DELETE_NEW = "PERM_DELETE_NEW";
public final static String PERM_SEARCH = "PERM_SEARCH"; public final static String PERM_SEARCH = "PERM_SEARCH";
public final static String PERM_PAY_BILL = "PERM_PAY_BILL";
public final static Permission SPECIAL_PERMISSIONS[] = { public final static Permission SPECIAL_PERMISSIONS[] = {
new Permission(PERM_EDIT_NEW, "Upravit neschválené", MOD_REQUIREMENTS, PermissionType.GLOBAL), new Permission(PERM_EDIT_NEW, "Upravit neschválené", MOD_REQUIREMENTS, PermissionType.GLOBAL),
@@ -133,14 +134,16 @@ public class Constants {
new Permission(PERM_APPROVE, "Schválení", MOD_TRIPREQUIREMENTS, PermissionType.WORKGROUP), new Permission(PERM_APPROVE, "Schválení", MOD_TRIPREQUIREMENTS, PermissionType.WORKGROUP),
new Permission(PERM_SEARCH, "Vyhledávat", MOD_SEARCH, PermissionType.GLOBAL), new Permission(PERM_SEARCH, "Vyhledávat", MOD_SEARCH, PermissionType.GLOBAL),
new Permission(PERM_READ, "Číst", MOD_SIGNEDDOCS, PermissionType.GLOBAL) new Permission(PERM_READ, "Číst", MOD_SIGNEDDOCS, PermissionType.GLOBAL),
new Permission(PERM_PAY_BILL, "Vyplacení SC", MOD_TRIPBILL, PermissionType.GLOBAL)
}; };
public final static String DYNAMIC_REPORT_NAME = "Tabulková sestava"; public final static String DYNAMIC_REPORT_NAME = "Tabulková sestava";
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")),
@@ -148,6 +151,11 @@ public class Constants {
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))
}; };
public final static Map<Class<?>, Integer> SIGN_REPORT_MAP = Collections.unmodifiableMap(new HashMap<Class<?>, Integer>() {{
put(TripBillApproval.class, 4);
put(TripRequirement.class, 7);
}});
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";
public final static RequirementType REQTYPES[] = { public final static RequirementType REQTYPES[] = {
@@ -162,7 +170,7 @@ public class Constants {
public final static Map<Class<?>, String> URL_MAP = Collections.unmodifiableMap(new HashMap<Class<?>, String>() {{ public final static Map<Class<?>, String> URL_MAP = Collections.unmodifiableMap(new HashMap<Class<?>, String>() {{
put(Requirement.class, "/main/orders/"); put(Requirement.class, "/main/orders/");
put(TripRequirement.class, "/main/trips/requirements/"); put(TripRequirement.class, "/main/trips/requirements/");
put(TripBillApproval.class, "/main/trips/requirements/"); put(TripBillApproval.class, "/main/trips/bill/");
put(Order.class, "/main/orders/created/"); put(Order.class, "/main/orders/created/");
put(TripBill.class, "/main/trips/bill/"); put(TripBill.class, "/main/trips/bill/");
}} ); }} );
@@ -2,6 +2,7 @@ package info.bukova.isspst;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.GregorianCalendar;
import org.apache.commons.lang.time.DateUtils; import org.apache.commons.lang.time.DateUtils;
@@ -54,4 +55,31 @@ public class DateTimeUtils
{ {
return DateTimeUtils.getDate(DateTimeUtils.getCurrDateTime()); 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();
}
} }
@@ -21,7 +21,7 @@ public class TripBillAprovalUrlResolver implements EntityUrlResolver {
if (entity instanceof TripBillApproval) { if (entity instanceof TripBillApproval) {
String url = Constants.URL_MAP.get(entity.getClass()); String url = Constants.URL_MAP.get(entity.getClass());
return defUrl + url + "?select=" + String.valueOf(((TripBillApproval)entity).getBill().getRequirement().getId()); return defUrl + url + "?select=" + String.valueOf(((TripBillApproval)entity).getId());
} }
return defUrl + "/app"; return defUrl + "/app";
@@ -1,7 +1,8 @@
package info.bukova.isspst.data; package info.bukova.isspst.data;
import java.math.BigDecimal; import org.hibernate.annotations.Cascade;
import java.util.List; import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;
import javax.persistence.CascadeType; import javax.persistence.CascadeType;
import javax.persistence.Column; import javax.persistence.Column;
@@ -11,17 +12,17 @@ import javax.persistence.JoinColumn;
import javax.persistence.OneToMany; import javax.persistence.OneToMany;
import javax.persistence.OneToOne; import javax.persistence.OneToOne;
import javax.persistence.Table; import javax.persistence.Table;
import java.math.BigDecimal;
import org.hibernate.annotations.LazyCollection; import java.util.List;
import org.hibernate.annotations.LazyCollectionOption;
@Entity @Entity
@Table(name = "INVOICING") @Table(name = "INVOICING")
public class Invoicing extends BaseData implements Cloneable public class Invoicing extends BaseData implements Cloneable
{ {
@OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL) @OneToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "REQUIREMENT_ID") @JoinColumn(name = "REQUIREMENT_ID")
@Cascade(org.hibernate.annotations.CascadeType.SAVE_UPDATE)
private Requirement requirement; private Requirement requirement;
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true) @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true)
@@ -60,11 +60,15 @@ public class TripBill extends BaseData implements EntityWithAttachment {
@LazyCollection(LazyCollectionOption.TRUE) @LazyCollection(LazyCollectionOption.TRUE)
@IndexedEmbedded @IndexedEmbedded
private List<FileMetainfo> attachedFiles; private List<FileMetainfo> attachedFiles;
@OneToOne(fetch = FetchType.EAGER) @OneToOne(fetch = FetchType.EAGER, orphanRemoval = true)
@JoinColumn(name = "APPROVAL_ID") @JoinColumn(name = "APPROVAL_ID")
private TripBillApproval approval; private TripBillApproval approval;
@Column(name = "SAVED") @Column(name = "SAVED")
private Boolean saved; // Nastaveno na true, pokud uživatel udělá změnu- nepřenáší se pak částky od žadatele private Boolean saved; // Nastaveno na true, pokud uživatel udělá změnu- nepřenáší se pak částky od žadatele
@Column(name = "PAID")
private Boolean paid;
@Column(name = "PAID_DATE")
private Date paidDate;
public TripBill() { public TripBill() {
billItems = new ArrayList<TripBillItem>(); billItems = new ArrayList<TripBillItem>();
@@ -186,4 +190,20 @@ public class TripBill extends BaseData implements EntityWithAttachment {
public void setSaved(Boolean saved) { public void setSaved(Boolean saved) {
this.saved = saved; this.saved = saved;
} }
public Boolean getPaid() {
return paid;
}
public void setPaid(Boolean paid) {
this.paid = paid;
}
public Date getPaidDate() {
return paidDate;
}
public void setPaidDate(Date paidDate) {
this.paidDate = paidDate;
}
} }
@@ -0,0 +1,78 @@
package info.bukova.isspst.filters;
import info.bukova.isspst.BooleanUtils;
import info.bukova.isspst.DateTimeUtils;
import info.bukova.isspst.StringUtils;
import info.bukova.isspst.data.TripBillApproval;
import info.bukova.isspst.data.User;
import org.hamcrest.Description;
import org.hamcrest.Factory;
import org.hamcrest.Matcher;
import org.hamcrest.TypeSafeMatcher;
public class TripBillApprovalFilter implements Filter<TripBillApproval>
{
private TripBillApproval condition;
public TripBillApprovalFilter(TripBillApproval cond)
{
this.condition = cond;
}
private static class TripBillApprovalMatcher extends TypeSafeMatcher<TripBillApproval>
{
private TripBillApproval condition;
public TripBillApprovalMatcher(TripBillApproval cond)
{
this.condition = cond;
}
@Override
public void describeTo(Description desc)
{
desc.appendText("requirement matches");
}
@Override
public boolean matchesSafely(TripBillApproval item)
{
if (item.getBill() == null) {
return false;
}
boolean foundNumser = StringUtils.isEqualForFilter(item.getNumser(), condition.getNumser());
boolean foundReqDate = DateTimeUtils.isEqualByDateForFilter(item.getBill().getRequirement().getReqDate(), condition.getBill().getRequirement().getReqDate());
boolean foundDescription = StringUtils.isEqualForFilter(item.getDescription(), condition.getDescription());
boolean foundFrom = StringUtils.isEqualForFilter(item.getBill().getRequirement().getFrom(), condition.getBill().getRequirement().getFrom());
boolean foundTo = StringUtils.isEqualForFilter(item.getBill().getRequirement().getTo(), condition.getBill().getRequirement().getTo());
boolean foundWorkgroup = (condition.getWorkgroup() == null ||(item.getWorkgroup() != null && item.getWorkgroup().equals(condition.getWorkgroup())));
boolean foundCentre = (condition.getCentre() == null || (item.getCentre() != null && item.getCentre().equals(condition.getCentre())));
boolean foundOwner = User.isEqualByUserForFilter(item.getBill().getOwnedBy(), condition.getBill().getOwnedBy());
boolean foundPaid = BooleanUtils.isEqualByBooleanValue(item.getBill().getPaid(), condition.getBill().getPaid());
boolean foundPaidDate = DateTimeUtils.isEqualByDateForFilter(item.getBill().getPaidDate(), condition.getBill().getPaidDate());
return foundNumser && foundReqDate && foundDescription && foundFrom && foundTo && foundWorkgroup && foundCentre && foundOwner && foundPaid && foundPaidDate;
}
@Factory
public static Matcher<TripBillApproval> matchTripRequirement(TripBillApproval building)
{
return new TripBillApprovalMatcher(building);
}
}
@Override
public TripBillApprovalMatcher matcher()
{
return new TripBillApprovalMatcher(condition);
}
@Override
public String queryString()
{
return "";
}
}
@@ -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;
}
} }
@@ -1,7 +1,6 @@
package info.bukova.isspst.reporting; package info.bukova.isspst.reporting;
import com.lowagie.text.Rectangle; import com.lowagie.text.Rectangle;
import com.lowagie.text.pdf.PdfAnnotation;
import com.lowagie.text.pdf.PdfFormField; import com.lowagie.text.pdf.PdfFormField;
import com.lowagie.text.pdf.PdfName; import com.lowagie.text.pdf.PdfName;
import net.sf.jasperreports.engine.JRGenericPrintElement; import net.sf.jasperreports.engine.JRGenericPrintElement;
@@ -27,7 +26,8 @@ public class SignaturePdfHandler implements GenericElementPdfHandler, GenericEle
@Override @Override
public void exportElement(JRPdfExporterContext exporterContext, JRGenericPrintElement element) { public void exportElement(JRPdfExporterContext exporterContext, JRGenericPrintElement element) {
PdfFormField field = PdfFormField.createSignature(exporterContext.getPdfWriter()); //PdfFormField field = PdfFormField.createSignature(exporterContext.getPdfWriter());
PdfFormField field = PdfFormField.createTextField(exporterContext.getPdfWriter(), true, false, 255);
Object param = element.getParameterValue("index"); Object param = element.getParameterValue("index");
String index = param != null ? String.valueOf(param) : null; String index = param != null ? String.valueOf(param) : null;
@@ -37,7 +37,9 @@ public class SignaturePdfHandler implements GenericElementPdfHandler, GenericEle
field.setFieldName("signature"); field.setFieldName("signature");
} }
field.setFieldFlags(PdfAnnotation.FLAGS_PRINT | PdfAnnotation.FLAGS_LOCKED); field.put(PdfName.V, exporterContext.getPdfWriter().getPdfIndirectReference());
field.setFieldFlags(PdfFormField.FF_READ_ONLY);
field.setWidget(new Rectangle(element.getX(), field.setWidget(new Rectangle(element.getX(),
exporterContext.getExportedReport().getPageHeight() - element.getY(), exporterContext.getExportedReport().getPageHeight() - element.getY(),
element.getX() + element.getWidth(), element.getX() + element.getWidth(),
@@ -1,6 +1,7 @@
package info.bukova.isspst.services.invoicing; 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.Workgroup; import info.bukova.isspst.data.Workgroup;
import info.bukova.isspst.services.Service; import info.bukova.isspst.services.Service;
@@ -20,4 +21,14 @@ public interface InvoicingService extends Service<Invoicing> {
public List<Invoicing> getPendingList(); public List<Invoicing> getPendingList();
public List<Invoicing> getArchiveList(); public List<Invoicing> getArchiveList();
public Invoicing getForRequirement(Requirement req);
public List<Invoicing> getMaterialPendingList();
public List<Invoicing> getMaterialArchiveList();
public List<Invoicing> getServicesPendingList();
public List<Invoicing> getServicesArchiveList();
} }
@@ -1,19 +1,20 @@
package info.bukova.isspst.services.invoicing; package info.bukova.isspst.services.invoicing;
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.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.math.BigDecimal;
import java.util.List;
import org.hibernate.Hibernate; import org.hibernate.Hibernate;
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.math.BigDecimal;
import java.util.List;
public class InvoicingServiceImpl extends AbstractOwnedService<Invoicing> implements public class InvoicingServiceImpl extends AbstractOwnedService<Invoicing> implements
InvoicingService { InvoicingService {
@@ -92,4 +93,53 @@ public class InvoicingServiceImpl extends AbstractOwnedService<Invoicing> implem
Query q = dao.getQuery("select inv from Invoicing as inv join fetch inv.requirement rq join fetch rq.ownedBy where inv.completed = true 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 order by rq.numser");
return q.list(); return q.list();
} }
@Override
@Transactional
public Invoicing getForRequirement(Requirement req) {
Query query = dao.getQuery("select invoice from Invoicing invoice join invoice.requirement rq where rq.id = :reqId");
query.setParameter("reqId", req.getId());
return (Invoicing) query.uniqueResult();
}
@SuppressWarnings("unchecked")
@Override
@Transactional
@PreAuthorize("hasPermission(this, 'PERM_READ')")
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");
q.setParameter("kind", Constants.REQ_TYPE_MATERIAL);
return q.list();
}
@SuppressWarnings("unchecked")
@Override
@Transactional
@PreAuthorize("hasPermission(this, 'PERM_READ')")
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");
q.setParameter("kind", Constants.REQ_TYPE_MATERIAL);
return q.list();
}
@SuppressWarnings("unchecked")
@Override
@Transactional
@PreAuthorize("hasPermission(this, 'PERM_READ')")
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");
q.setParameter("kind", Constants.REQ_TYPE_SERVICES);
return q.list();
}
@SuppressWarnings("unchecked")
@Override
@Transactional
@PreAuthorize("hasPermission(this, 'PERM_READ')")
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");
q.setParameter("kind", Constants.REQ_TYPE_SERVICES);
return q.list();
}
} }
@@ -131,7 +131,8 @@ public abstract class RequirementBaseServiceImpl<T extends RequirementBase> exte
} }
protected void postAdd(T entity) { protected void postAdd(T entity) {
if (canApprove(entity)) { Workflow wf = getNextWorkflow(entity);
if (canApprove(entity) && (wf.getSignature() == null || !wf.getSignature())) {
approve(entity); approve(entity);
} else { } else {
this.sendToApprovers(entity); this.sendToApprovers(entity);
@@ -280,7 +281,7 @@ public abstract class RequirementBaseServiceImpl<T extends RequirementBase> exte
if (signedPdf != null) { if (signedPdf != null) {
saveSignedDoc(e, signedPdf); saveSignedDoc(e, signedPdf);
} else if (wf.getSignature() != null && wf.getSignature()) { } else if (wf.getSignature() != null && wf.getSignature() && !signatureNotRequired(wf)) {
throw new ApproveException("ErrApproveMustBeSigned"); throw new ApproveException("ErrApproveMustBeSigned");
} }
@@ -310,6 +311,15 @@ public abstract class RequirementBaseServiceImpl<T extends RequirementBase> exte
postApprove(e); postApprove(e);
} }
/**
* Check pro automatické schválení, kdy není třeba podepisovat- nadlimitní nákupy se neautorizují...
* @param wf Další krok schválení
* @return true pokud není potřeba podepisovat. Zde vrací vždy false, v případě potřeby nutno překrýt.
*/
protected boolean signatureNotRequired(Workflow wf) {
return false;
}
protected void approve(T entity, User user) { protected void approve(T entity, User user) {
approve(entity, user, new Date(), null); approve(entity, user, new Date(), null);
} }
@@ -532,11 +542,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()) {
if (reportId == 0) {
report = r; report = r;
break; break;
} else if (reportId == r.getReportId()) {
report = r;
break;
}
} }
} }
@@ -549,11 +565,7 @@ 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);
SignedDocument doc = signedDocumentService.getForEntity(entity);
if (doc != null) {
signedDocumentService.delFromApprove(doc);
}
super.update(entity); super.update(entity);
sendToApprovers(entity); sendToApprovers(entity);
@@ -11,8 +11,8 @@ 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 org.hibernate.Hibernate; import org.hibernate.Hibernate;
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.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal; import java.math.BigDecimal;
@@ -67,6 +67,16 @@ public class RequirementServiceImpl extends RequirementBaseServiceImpl<Requireme
return false; return false;
} }
/**
* Nadlimitní autorizovat bez podpisu
* @param wf Další krok schválení
* @return true, pokud má role nastavený limit- automatické schválení podlimitního požadavku
*/
@Override
protected boolean signatureNotRequired(Workflow wf) {
return wf.getLimit() != null;
}
@Override @Override
protected boolean canAdd(Requirement entity) protected boolean canAdd(Requirement entity)
{ {
@@ -244,11 +254,19 @@ public class RequirementServiceImpl extends RequirementBaseServiceImpl<Requireme
@Override @Override
@Transactional @Transactional
public BigDecimal getInvoicedAmount(Requirement req) { public BigDecimal getInvoicedAmount(Requirement req) {
Query query = dao.getQuery("select invoice from Invoicing invoice join invoice.requirement rq where rq.id = :reqId"); Invoicing inv = invoicingService.getForRequirement(req);
query.setParameter("reqId", req.getId());
Invoicing inv = (Invoicing) query.uniqueResult();
return inv != null ? inv.getTotalInvoiced() : null; return inv != null ? inv.getTotalInvoiced() : null;
} }
@Override
@Transactional
@PreAuthorize("hasPermission(this, 'PERM_EDIT') or hasPermission(#entity, this.getUpdateEntityPermission())")
public void update(Requirement entity) {
super.update(entity);
Invoicing inv = invoicingService.getForRequirement(entity);
if (inv != null) {
invoicingService.delete(inv);
}
}
} }
@@ -57,8 +57,6 @@ public class TripRequirementServiceImpl extends RequirementBaseServiceImpl<TripR
@Transactional @Transactional
@PreAuthorize("hasPermission(this, 'PERM_EDIT') or hasPermission(#entity, this.getUpdateEntityPermission())") @PreAuthorize("hasPermission(this, 'PERM_EDIT') or hasPermission(#entity, this.getUpdateEntityPermission())")
public void update(TripRequirement entity) { public void update(TripRequirement entity) {
super.update(entity);
if (entity.getState() == RequirementState.APPROVED) { if (entity.getState() == RequirementState.APPROVED) {
for (TripBill bill : getBills(entity)) { for (TripBill bill : getBills(entity)) {
TripBill newBill = tripBillService.createTripBill(entity); TripBill newBill = tripBillService.createTripBill(entity);
@@ -75,6 +73,8 @@ public class TripRequirementServiceImpl extends RequirementBaseServiceImpl<TripR
tripBillService.update(bill); tripBillService.update(bill);
} }
} }
super.update(entity);
} }
@Override @Override
@@ -141,15 +141,30 @@ public class TripRequirementServiceImpl extends RequirementBaseServiceImpl<TripR
@Override @Override
protected void postApprove(TripRequirement entity) { protected void postApprove(TripRequirement entity) {
if (entity.getState() == RequirementState.APPROVED) { if (entity.getState() != RequirementState.APPROVED) {
return;
}
List<TripBill> billList = getBills(entity);
boolean hasOwned = false;
for (TripBill tb : billList) {
if (tb.getOwnedBy().equals(entity.getOwnedBy())) {
hasOwned = true;
break;
}
}
if (!hasOwned) {
TripBill bill = tripBillService.createTripBill(entity); TripBill bill = tripBillService.createTripBill(entity);
tripBillService.add(bill); tripBillService.add(bill);
bill.setOwnedBy(entity.getOwnedBy()); bill.setOwnedBy(entity.getOwnedBy());
tripBillService.update(bill); tripBillService.update(bill);
}
if (entity.getBillForPassengers() != null && entity.getBillForPassengers()) { if (entity.getBillForPassengers() != null && entity.getBillForPassengers()) {
for (User u : entity.getPassengers()) { for (User u : entity.getPassengers()) {
if (!u.equals(entity.getOwnedBy())) { if (canCreateBill(entity, u, billList)) {
TripBill passBill = tripBillService.createPassengersBill(entity); TripBill passBill = tripBillService.createPassengersBill(entity);
tripBillService.add(passBill); tripBillService.add(passBill);
passBill.setOwnedBy(u); passBill.setOwnedBy(u);
@@ -160,6 +175,19 @@ public class TripRequirementServiceImpl extends RequirementBaseServiceImpl<TripR
sendMailToPassengers(entity, settingsService.getSettings().getConfReqTripPassenger()); sendMailToPassengers(entity, settingsService.getSettings().getConfReqTripPassenger());
} }
} }
private boolean canCreateBill(TripRequirement req, User owner, List<TripBill> bills) {
if (owner.equals(req.getOwnedBy())) {
return false;
}
for (TripBill tb : bills) {
if (tb.getOwnedBy().equals(owner)) {
return false;
}
}
return true;
} }
@Override @Override
@@ -5,11 +5,16 @@ 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 java.util.List;
public interface SignedDocumentService extends Service<SignedDocument> { public interface SignedDocumentService extends Service<SignedDocument> {
SignedDocument getForEntity(DataModel entity); SignedDocument getForEntity(DataModel entity);
SignedDocumentItem getItem(DataModel entity, long reportId); SignedDocumentItem getItem(DataModel entity, long reportId);
void addFromApprove(SignedDocument document); void addFromApprove(SignedDocument document);
void delFromApprove(SignedDocument document); void delFromApprove(SignedDocument document);
void deleteForEntity(DataModel entity);
public List<SignedDocument> getActualList();
public List<SignedDocument> getArchiveList();
} }
@@ -1,5 +1,6 @@
package info.bukova.isspst.services.signeddocs; package info.bukova.isspst.services.signeddocs;
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;
@@ -7,15 +8,20 @@ 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.Date;
import java.util.List;
import javax.servlet.ServletContext;
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.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.servlet.ServletContext;
public class SignedDocumentServiceImpl extends AbstractOwnedService<SignedDocument> implements SignedDocumentService { public class SignedDocumentServiceImpl extends AbstractOwnedService<SignedDocument> implements SignedDocumentService {
@Autowired @Autowired
@@ -76,6 +82,10 @@ public class SignedDocumentServiceImpl extends AbstractOwnedService<SignedDocume
@Override @Override
public void delFromApprove(SignedDocument document) { public void delFromApprove(SignedDocument document) {
if (document == null) {
return;
}
super.delete(document); super.delete(document);
for (SignedDocumentItem item : document.getItems()) { for (SignedDocumentItem item : document.getItems()) {
@@ -83,5 +93,37 @@ public class SignedDocumentServiceImpl extends AbstractOwnedService<SignedDocume
} }
} }
@Override
@Transactional
public void deleteForEntity(DataModel entity) {
SignedDocument doc = getForEntity(entity);
if (doc != null) {
delFromApprove(doc);
}
}
private Date getTresholdDate() {
Date date = DateTimeUtils.getDateDelta(DateTimeUtils.getCurrDate(), Calendar.YEAR, -1);
return date;
}
@SuppressWarnings("unchecked")
@Override
@Transactional
@PreAuthorize("hasPermission(this, 'PERM_READ')")
public List<SignedDocument> getActualList() {
Query q = dao.getQuery("from SignedDocument where signDate >= :refDate");
q.setParameter("refDate", this.getTresholdDate());
return q.list();
}
@SuppressWarnings("unchecked")
@Override
@Transactional
@PreAuthorize("hasPermission(this, 'PERM_READ')")
public List<SignedDocument> getArchiveList() {
Query q = dao.getQuery("from SignedDocument where signDate < :refDate");
q.setParameter("refDate", this.getTresholdDate());
return q.list();
}
} }
@@ -0,0 +1,18 @@
package info.bukova.isspst.services.tripbill;
import info.bukova.isspst.services.IsspstException;
/**
* @author Pepa Rokos
*/
public class PayException extends IsspstException {
public PayException() {
super();
}
public PayException(String message) {
super(message);
setReason(message);
}
}
@@ -10,5 +10,6 @@ import info.bukova.isspst.services.requirement.RequirementBaseService;
public interface TripBillApprovalService extends RequirementBaseService<TripBillApproval> { public interface TripBillApprovalService extends RequirementBaseService<TripBillApproval> {
public TripBillApproval createApproval(TripBill bill); public TripBillApproval createApproval(TripBill bill);
public void cancelApproval(TripBill bill);
} }
@@ -1,6 +1,8 @@
package info.bukova.isspst.services.tripbill; package info.bukova.isspst.services.tripbill;
import info.bukova.isspst.Constants; import info.bukova.isspst.Constants;
import info.bukova.isspst.Module;
import info.bukova.isspst.ModuleUtils;
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.RequirementState; import info.bukova.isspst.data.RequirementState;
@@ -9,6 +11,8 @@ import info.bukova.isspst.data.TripBillApproval;
import info.bukova.isspst.services.IsspstException; 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 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;
@@ -22,6 +26,10 @@ public class TripBillApprovalServiceImpl extends RequirementBaseServiceImpl<Trip
@Autowired @Autowired
private RequirementTypeService reqTypeService; private RequirementTypeService reqTypeService;
@Autowired
private TripBillService tripBillService;
@Autowired
private SignedDocumentService signedDocumentService;
@Override @Override
public TripBillApproval createApproval(TripBill bill) { public TripBillApproval createApproval(TripBill bill) {
@@ -58,4 +66,38 @@ public class TripBillApprovalServiceImpl extends RequirementBaseServiceImpl<Trip
protected DataModel entityForSignReport(TripBillApproval entity) { protected DataModel entityForSignReport(TripBillApproval entity) {
return entity.getBill(); return entity.getBill();
} }
@Override
@Transactional
@PreAuthorize("hasPermission(this, 'PERM_DELETE') or this.canApprove(#bill.approval)")
public void cancelApproval(TripBill bill) {
bill.setApproval(null);
signedDocumentService.deleteForEntity(bill);
tripBillService.update(bill);
}
@Override
public Module getModule() {
return ModuleUtils.getModule(Constants.MOD_TRIPREQUIREMENTS);
}
@Override
@Transactional
@PreAuthorize("hasPermission(this, 'PERM_DELETE') or hasPermission(#entity, this.getDeleteEntityPermission())")
public void delete(TripBillApproval entity) {
TripBill bill = entity.getBill();
if (bill == null) {
Query q = queryDao.getQuery("FROM TripBill WHERE APPROVAL_ID = :appId");
q.setInteger("appId", entity.getId());
bill = (TripBill) q.uniqueResult();
}
if (bill != null) {
dao.delete(entity);
cancelApproval(bill);
} else {
super.delete(entity);
}
}
} }
@@ -4,6 +4,7 @@ import info.bukova.isspst.data.TripBill;
import info.bukova.isspst.data.TripRequirement; import info.bukova.isspst.data.TripRequirement;
import info.bukova.isspst.services.Service; import info.bukova.isspst.services.Service;
import java.util.Date;
import java.util.List; import java.util.List;
public interface TripBillService extends Service<TripBill> { public interface TripBillService extends Service<TripBill> {
@@ -15,6 +16,7 @@ public interface TripBillService extends Service<TripBill> {
public List<TripBill> getMy(); public List<TripBill> getMy();
public void loadOwner(TripBill bill); public void loadOwner(TripBill bill);
public void loadPassengers(TripBill bill); public void loadPassengers(TripBill bill);
public void setPaid(TripBill bill, Date date);
/** /**
* Uloží vyúčtování a nastaví příznak přenosu vyúčtování od žadatele * Uloží vyúčtování a nastaví příznak přenosu vyúčtování od žadatele
@@ -23,6 +23,7 @@ import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.Collections; import java.util.Collections;
import java.util.Date;
import java.util.List; import java.util.List;
public class TripBillServiceImpl extends AbstractOwnedService<TripBill> implements public class TripBillServiceImpl extends AbstractOwnedService<TripBill> implements
@@ -212,6 +213,19 @@ public class TripBillServiceImpl extends AbstractOwnedService<TripBill> implemen
bill.getRequirement().setPassengers(tr.getPassengers()); bill.getRequirement().setPassengers(tr.getPassengers());
} }
@Override
@Transactional
@PreAuthorize("hasPermission(this, 'PERM_PAY_BILL')")
public void setPaid(TripBill bill, Date date) {
if (bill.getApproval() == null || bill.getApproval().getState() != RequirementState.APPROVED) {
throw new PayException("BillNotApproved");
}
bill.setPaid(true);
bill.setPaidDate(date);
super.update(bill);
}
@Override @Override
@Transactional @Transactional
@PreAuthorize("hasPermission(this, 'PERM_EDIT') or hasPermission(#entity, this.getUpdateEntityPermission())") @PreAuthorize("hasPermission(this, 'PERM_EDIT') or hasPermission(#entity, this.getUpdateEntityPermission())")
@@ -252,7 +266,9 @@ public class TripBillServiceImpl extends AbstractOwnedService<TripBill> implemen
@Override @Override
public boolean canPrintRecord(TripBill entity) { public boolean canPrintRecord(TripBill entity) {
if (entity.getApproval() != null && entity.getApproval().getState() == RequirementState.APPROVED) { if (entity.getApproval() != null
&& entity.getApproval().getState() == RequirementState.APPROVED
&& (entity.getPaid() == null || !entity.getPaid())) {
return true; return true;
} }
@@ -234,7 +234,7 @@ public class UserServiceImpl extends AbstractService<User> implements UserServic
@Override @Override
@Transactional @Transactional
public List<User> getUsersForCombo() { public List<User> getUsersForCombo() {
Query q = dao.getQuery("from User u order by u.lastName"); Query q = dao.getQuery("from User u where u.enabled = true order by u.lastName");
return q.list(); return q.list();
} }
@@ -5,12 +5,6 @@ import info.bukova.isspst.data.DataModel;
import info.bukova.isspst.filters.Filter; import info.bukova.isspst.filters.Filter;
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 java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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;
@@ -27,6 +21,11 @@ import org.zkoss.zk.ui.event.EventListener;
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.HashMap;
import java.util.List;
import java.util.Map;
public class ListViewModel<T extends DataModel> extends DocumentViewModel public class ListViewModel<T extends DataModel> extends DocumentViewModel
{ {
@@ -185,7 +184,6 @@ public class ListViewModel<T extends DataModel> extends DocumentViewModel
} }
@Command @Command
@NotifyChange({ "dataList", "dataBean" })
public void delete() { public void delete() {
Messagebox.show(StringUtils.localize("DbReallyDelete"), StringUtils.localize("DbDeleteRecord"), Messagebox.YES Messagebox.show(StringUtils.localize("DbReallyDelete"), StringUtils.localize("DbDeleteRecord"), Messagebox.YES
| Messagebox.NO, Messagebox.QUESTION, | Messagebox.NO, Messagebox.QUESTION,
@@ -277,7 +275,7 @@ public class ListViewModel<T extends DataModel> extends DocumentViewModel
} }
@Command @Command
@NotifyChange({"selIndex", "dataBean"}) @NotifyChange({"selIndex", "dataBean", "ableToDelete"})
public void afterRender() { public void afterRender() {
if (editBean != null && !editBean.isValid()) { if (editBean != null && !editBean.isValid()) {
return; return;
@@ -1,9 +1,5 @@
package info.bukova.isspst.ui.mail; package info.bukova.isspst.ui.mail;
import static ch.lambdaj.Lambda.filter;
import static ch.lambdaj.Lambda.having;
import static ch.lambdaj.Lambda.on;
import static org.hamcrest.Matchers.startsWith;
import info.bukova.isspst.data.Address; import info.bukova.isspst.data.Address;
import info.bukova.isspst.data.Member; import info.bukova.isspst.data.Member;
import info.bukova.isspst.data.User; import info.bukova.isspst.data.User;
@@ -15,10 +11,6 @@ import info.bukova.isspst.reporting.ReportDefinition;
import info.bukova.isspst.services.addressbook.AdbService; import info.bukova.isspst.services.addressbook.AdbService;
import info.bukova.isspst.services.users.UserService; import info.bukova.isspst.services.users.UserService;
import info.bukova.isspst.ui.DocumentViewModel; import info.bukova.isspst.ui.DocumentViewModel;
import java.util.ArrayList;
import java.util.List;
import org.springframework.security.access.AccessDeniedException; import org.springframework.security.access.AccessDeniedException;
import org.zkoss.bind.annotation.BindingParam; import org.zkoss.bind.annotation.BindingParam;
import org.zkoss.bind.annotation.Command; import org.zkoss.bind.annotation.Command;
@@ -28,6 +20,14 @@ import org.zkoss.bind.annotation.NotifyChange;
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 java.util.ArrayList;
import java.util.List;
import static ch.lambdaj.Lambda.filter;
import static ch.lambdaj.Lambda.having;
import static ch.lambdaj.Lambda.on;
import static org.hamcrest.Matchers.startsWith;
public class MailForm extends DocumentViewModel public class MailForm extends DocumentViewModel
{ {
@@ -69,7 +69,7 @@ public class MailForm extends DocumentViewModel
addressbook = new ArrayList<Address>(); addressbook = new ArrayList<Address>();
} }
users = userService.getAll(); users = userService.getUsersForCombo();
selectedAddresses = new ArrayList<Address>(); selectedAddresses = new ArrayList<Address>();
selectedUsers = new ArrayList<User>(); selectedUsers = new ArrayList<User>();
@@ -29,7 +29,6 @@ public class InvoicingList extends ListViewModel<Invoicing> {
public void initInvoicing() { public void initInvoicing() {
service = invoicingService; service = invoicingService;
dataClass = Invoicing.class; dataClass = Invoicing.class;
formZul = "invoicingForm.zul";
dataFilter = new InvoicingFilter(getFilterTemplate()); dataFilter = new InvoicingFilter(getFilterTemplate());
} }
@@ -0,0 +1,30 @@
package info.bukova.isspst.ui.main.invoicing;
import info.bukova.isspst.data.Invoicing;
import org.springframework.security.access.AccessDeniedException;
import org.zkoss.bind.annotation.Init;
import java.util.ArrayList;
import java.util.List;
public class InvoicingMaterialArchiveList extends InvoicingList {
@Init(superclass = true)
public void initInvoicingMaterialArchiveList()
{
formZul = "/main/invoicing/material/invHeadForm.zul";
}
@Override
protected List<Invoicing> getListFromService() {
try
{
return invoicingService.getMaterialArchiveList();
}
catch (AccessDeniedException e)
{
e.printStackTrace();
return new ArrayList<Invoicing>();
}
}
}
@@ -0,0 +1,30 @@
package info.bukova.isspst.ui.main.invoicing;
import info.bukova.isspst.data.Invoicing;
import org.springframework.security.access.AccessDeniedException;
import org.zkoss.bind.annotation.Init;
import java.util.ArrayList;
import java.util.List;
public class InvoicingMaterialPendingList extends InvoicingList {
@Init(superclass = true)
public void initInvoicingMaterialPendingList()
{
formZul = "/main/invoicing/material/invHeadForm.zul";
}
@Override
protected List<Invoicing> getListFromService() {
try
{
return invoicingService.getMaterialPendingList();
}
catch (AccessDeniedException e)
{
e.printStackTrace();
return new ArrayList<Invoicing>();
}
}
}
@@ -1,32 +0,0 @@
package info.bukova.isspst.ui.main.invoicing;
import info.bukova.isspst.data.Invoicing;
import java.util.ArrayList;
import java.util.List;
import org.springframework.security.access.AccessDeniedException;
import org.zkoss.bind.annotation.Init;
public class InvoicingPendingList extends InvoicingList
{
@Init(superclass = true)
public void initInvoicingPendingList()
{
}
@Override
protected List<Invoicing> getListFromService()
{
try
{
return invoicingService.getPendingList();
}
catch (AccessDeniedException e)
{
// BindUtils.postGlobalCommand(null, null, "disableCentre", null);
// e.printStackTrace();
return new ArrayList<Invoicing>();
}
}
}
@@ -0,0 +1,30 @@
package info.bukova.isspst.ui.main.invoicing;
import info.bukova.isspst.data.Invoicing;
import org.springframework.security.access.AccessDeniedException;
import org.zkoss.bind.annotation.Init;
import java.util.ArrayList;
import java.util.List;
public class InvoicingServicesArchiveList extends InvoicingList {
@Init(superclass = true)
public void initInvoicingServicesArchiveList()
{
formZul = "/main/invoicing/services/invHeadForm.zul";
}
@Override
protected List<Invoicing> getListFromService() {
try
{
return invoicingService.getServicesArchiveList();
}
catch (AccessDeniedException e)
{
e.printStackTrace();
return new ArrayList<Invoicing>();
}
}
}
@@ -0,0 +1,30 @@
package info.bukova.isspst.ui.main.invoicing;
import info.bukova.isspst.data.Invoicing;
import org.springframework.security.access.AccessDeniedException;
import org.zkoss.bind.annotation.Init;
import java.util.ArrayList;
import java.util.List;
public class InvoicingServicesPendingList extends InvoicingList {
@Init(superclass = true)
public void initInvoicingServicesPendingList()
{
formZul = "/main/invoicing/services/invHeadForm.zul";
}
@Override
protected List<Invoicing> getListFromService() {
try
{
return invoicingService.getServicesPendingList();
}
catch (AccessDeniedException e)
{
e.printStackTrace();
return new ArrayList<Invoicing>();
}
}
}
@@ -0,0 +1,22 @@
package info.bukova.isspst.ui.renderers;
import info.bukova.isspst.data.JobMapping;
import info.bukova.isspst.data.User;
import org.zkoss.zul.Listbox;
import org.zkoss.zul.Listitem;
/**
* @author Pepa Rokos
*/
public class JobMappingItemRenderer extends GenericListitemRenderer<JobMapping> {
@Override
protected void changeProperties(Listbox lb, Listitem li, int index, String varnm) {
JobMapping jm = getObjectOfStates();
if (jm.getMember() instanceof User && !((User)jm.getMember()).isEnabled()) {
li.setSclass("user-disabled");
}
}
}
@@ -0,0 +1,40 @@
package info.bukova.isspst.ui.renderers;
import info.bukova.isspst.data.RequirementState;
import info.bukova.isspst.data.TripBillApproval;
import org.zkoss.zul.Listbox;
import org.zkoss.zul.Listitem;
/**
* @author Pepa Rokos
*/
public class TripBillApprovalItemRenderer extends GenericListitemRenderer<TripBillApproval> {
@Override
protected void changeProperties(Listbox lb, Listitem li, int index, String varnm) {
RequirementState state = getObjectOfStates().getState();
if (state != null) {
if (state == RequirementState.PARTIALLY) {
li.setSclass("req-select-partially");
}
else if (state == RequirementState.APPROVED) {
Boolean isPaid;
if (getObjectOfStates().getBill() == null) {
isPaid = false;
} else {
isPaid = getObjectOfStates().getBill().getPaid();
}
if ((isPaid != null) && (isPaid.booleanValue() == true)) {
li.setSclass("req-select-approved-project");
}
else {
li.setSclass("req-select-approved");
}
}
}
}
}
@@ -0,0 +1,20 @@
package info.bukova.isspst.ui.renderers;
import info.bukova.isspst.data.User;
import org.zkoss.zul.Listbox;
import org.zkoss.zul.Listitem;
/**
* @author Pepa Rokos
*/
public class UserItemRenderer extends GenericListitemRenderer<User> {
@Override
protected void changeProperties(Listbox lb, Listitem li, int index, String varnm) {
User u = getObjectOfStates();
if (!u.isEnabled()) {
li.setSclass("user-disabled");
}
}
}
@@ -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
@@ -25,6 +32,7 @@ public class ReportDialogVM extends DocumentViewModel
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,12 +69,37 @@ 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) {
if (window != null) { if (window != null) {
@@ -50,7 +50,7 @@ public class RequirementSubpage<T extends RequirementBase> extends ListViewModel
this.requirementsItemRenderer = new RequirementsItemRenderer(); this.requirementsItemRenderer = new RequirementsItemRenderer();
} }
private RequirementBaseService<T> getReqService() protected RequirementBaseService<T> getReqService()
{ {
return (RequirementBaseService<T>) service; return (RequirementBaseService<T>) service;
} }
@@ -0,0 +1,29 @@
package info.bukova.isspst.ui.signeddocs;
import info.bukova.isspst.data.SignedDocument;
import java.util.ArrayList;
import java.util.List;
import org.springframework.security.access.AccessDeniedException;
import org.zkoss.bind.annotation.Init;
public class SignedDocsActualList extends SignedDocsList {
@Init(superclass = true)
public void SignedDocsActualListInit() {
}
@Override
protected List<SignedDocument> getListFromService() {
try {
return signedDocumentService.getActualList();
}
catch (AccessDeniedException e) {
// BindUtils.postGlobalCommand(null, null, "disableCentre", null);
// e.printStackTrace();
return new ArrayList<SignedDocument>();
}
}
}
@@ -0,0 +1,30 @@
package info.bukova.isspst.ui.signeddocs;
import info.bukova.isspst.data.SignedDocument;
import java.util.ArrayList;
import java.util.List;
import org.springframework.security.access.AccessDeniedException;
import org.zkoss.bind.annotation.Init;
public class SignedDocsArchiveList extends SignedDocsList {
@Init(superclass = true)
public void SignedDocsArchiveListInit() {
}
@Override
protected List<SignedDocument> getListFromService() {
try {
return signedDocumentService.getArchiveList();
}
catch (AccessDeniedException e) {
// BindUtils.postGlobalCommand(null, null, "disableCentre", null);
// e.printStackTrace();
return new ArrayList<SignedDocument>();
}
}
}
@@ -0,0 +1,60 @@
package info.bukova.isspst.ui.tripbill;
import info.bukova.isspst.StringUtils;
import info.bukova.isspst.data.TripBill;
import info.bukova.isspst.services.tripbill.PayException;
import info.bukova.isspst.services.tripbill.TripBillService;
import info.bukova.isspst.ui.ListViewModel;
import org.springframework.security.access.AccessDeniedException;
import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.BindingParam;
import org.zkoss.bind.annotation.Command;
import org.zkoss.bind.annotation.ExecutionArgParam;
import org.zkoss.bind.annotation.Init;
import org.zkoss.zk.ui.select.annotation.WireVariable;
import org.zkoss.zul.Messagebox;
import org.zkoss.zul.Window;
import java.util.Date;
/**
* @author Pepa Rokos
*/
public class PayDialogVM {
@WireVariable
private TripBillService tripBillService;
private TripBill bill;
private ListViewModel grid;
private Date payDate;
@Init
public void init(@ExecutionArgParam("bill") TripBill bill,
@ExecutionArgParam("grid") ListViewModel grid) {
this.bill = bill;
this.grid = grid;
}
@Command
public void pay(@BindingParam("window") Window window) {
try {
tripBillService.setPaid(bill, payDate);
BindUtils.postNotifyChange(null, null, grid, "dataBean");
BindUtils.postGlobalCommand(null, null, "reload", null);
window.detach();
} catch (PayException ex) {
Messagebox.show(StringUtils.localize(ex.getReason()), StringUtils.localize("Error"), Messagebox.OK,
Messagebox.ERROR);
} catch (AccessDeniedException ex) {
Messagebox.show(StringUtils.localize("ErrorRights"), StringUtils.localize("Error"), Messagebox.OK, Messagebox.ERROR);
}
}
public Date getPayDate() {
return payDate;
}
public void setPayDate(Date payDate) {
this.payDate = payDate;
}
}
@@ -9,6 +9,7 @@ import info.bukova.isspst.services.settings.GlobalSettingsService;
import info.bukova.isspst.services.tripbill.TripBillApprovalService; import info.bukova.isspst.services.tripbill.TripBillApprovalService;
import info.bukova.isspst.services.tripbill.TripBillService; import info.bukova.isspst.services.tripbill.TripBillService;
import info.bukova.isspst.ui.FormWithUpload; import info.bukova.isspst.ui.FormWithUpload;
import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.BindingParam; import org.zkoss.bind.annotation.BindingParam;
import org.zkoss.bind.annotation.Command; import org.zkoss.bind.annotation.Command;
import org.zkoss.bind.annotation.Init; import org.zkoss.bind.annotation.Init;
@@ -82,6 +83,7 @@ public class TripBillForm extends FormWithUpload<TripBill> {
TripBillApproval approval = tripBillApprovalService.createApproval(getDataBean()); TripBillApproval approval = tripBillApprovalService.createApproval(getDataBean());
tripBillApprovalService.add(approval); tripBillApprovalService.add(approval);
TripBillForm.super.save(editWin); TripBillForm.super.save(editWin);
BindUtils.postGlobalCommand(null, null, "refresh", null);
} else { } else {
TripBillForm.super.save(editWin); TripBillForm.super.save(editWin);
} }
@@ -0,0 +1,34 @@
package info.bukova.isspst.ui.tripbill;
import info.bukova.isspst.data.TripBillApproval;
import org.springframework.security.access.AccessDeniedException;
import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.Init;
import java.util.ArrayList;
import java.util.List;
/**
* @author Pepa Rokos
*/
public class TripBillListAll extends TripBillListBase {
@Init(superclass = true)
public void initAllList() {
}
@Override
protected List<TripBillApproval> getListFromService() {
try {
return getReqService().getAll();
} catch (AccessDeniedException e) {
BindUtils.postGlobalCommand(null, null, "disableAll", null);
return new ArrayList<TripBillApproval>();
}
}
@Override
protected void beforeSelectViaUrl() {
BindUtils.postGlobalCommand(null, null, "selectAll", null);
}
}
@@ -0,0 +1,86 @@
package info.bukova.isspst.ui.tripbill;
import info.bukova.isspst.data.TripBill;
import info.bukova.isspst.data.TripBillApproval;
import info.bukova.isspst.data.TripRequirement;
import info.bukova.isspst.data.User;
import info.bukova.isspst.filters.TripBillApprovalFilter;
import info.bukova.isspst.services.tripbill.TripBillApprovalService;
import info.bukova.isspst.services.tripbill.TripBillService;
import info.bukova.isspst.services.users.UserService;
import info.bukova.isspst.ui.renderers.TripBillApprovalItemRenderer;
import info.bukova.isspst.ui.requirement.RequirementSubpage;
import org.zkoss.bind.annotation.Command;
import org.zkoss.bind.annotation.GlobalCommand;
import org.zkoss.bind.annotation.Init;
import org.zkoss.bind.annotation.NotifyChange;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.select.annotation.WireVariable;
import org.zkoss.zul.Window;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author Pepa Rokos
*/
public class TripBillListBase extends RequirementSubpage<TripBillApproval> {
@WireVariable
private TripBillApprovalService tripBillApprovalService;
private TripBillApprovalItemRenderer itemRenderer;
@WireVariable
private TripBillService tripBillService;
@WireVariable
private UserService userService;
private List<User> allUsers;
@Init(superclass = true)
public void initListBase() {
service = tripBillApprovalService;
itemRenderer = new TripBillApprovalItemRenderer();
dataClass = TripBillApproval.class;
TripBillApproval filter = getFilterTemplate();
TripBill tb = new TripBill();
tb.setRequirement(new TripRequirement());
filter.setBill(tb);
dataFilter = new TripBillApprovalFilter(filter);
allUsers = userService.getUsersForCombo();
}
public TripBillApprovalItemRenderer getItemRenderer() {
return itemRenderer;
}
@Command
public void pay() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("bill", getDataBean().getBill());
params.put("grid", this);
Window payDialog = (Window) Executions.createComponents("payDialog.zul", null, params);
payDialog.doModal();
}
@Command
@Override
public void edit() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("selected", getDataBean().getBill());
tripBillService.loadLazyData(getDataBean().getBill());
Window win = (Window) Executions.createComponents("../requirements/tripBill.zul", null, params);
win.doModal();
}
@Override
public List<User> getAllUsers() {
return allUsers;
}
@GlobalCommand
@NotifyChange({ "dataList", "dataBean", "fullFill" })
public void reloadRelated()
{
this.reload();
}
}
@@ -0,0 +1,34 @@
package info.bukova.isspst.ui.tripbill;
import info.bukova.isspst.data.TripBillApproval;
import org.springframework.security.access.AccessDeniedException;
import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.Init;
import java.util.ArrayList;
import java.util.List;
/**
* @author Pepa Rokos
*/
public class TripBillListCentre extends TripBillListBase {
@Init(superclass = true)
public void initListCentre() {
}
@Override
protected List<TripBillApproval> getListFromService() {
try {
return getReqService().getCentreReq();
} catch (AccessDeniedException e) {
BindUtils.postGlobalCommand(null, null, "disableCentre", null);
return new ArrayList<TripBillApproval>();
}
}
@Override
protected void beforeSelectViaUrl() {
BindUtils.postGlobalCommand(null, null, "selectCentre", null);
}
}
@@ -0,0 +1,35 @@
package info.bukova.isspst.ui.tripbill;
import info.bukova.isspst.data.TripBillApproval;
import org.springframework.security.access.AccessDeniedException;
import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.Init;
import java.util.ArrayList;
import java.util.List;
/**
* @author Pepa Rokos
*/
public class TripBillListWorkgroup extends TripBillListBase {
@Init(superclass = true)
public void initWorkgroupList() {
}
@Override
protected List<TripBillApproval> getListFromService() {
try {
return getReqService().getWorkgroupReq();
} catch (AccessDeniedException e) {
BindUtils.postGlobalCommand(null, null, "disableWorkgroup", null);
return new ArrayList<TripBillApproval>();
}
}
@Override
protected void beforeSelectViaUrl() {
BindUtils.postGlobalCommand(null, null, "selectWorkgroup", null);
}
}
@@ -1,5 +1,6 @@
package info.bukova.isspst.ui.tripbill; package info.bukova.isspst.ui.tripbill;
import info.bukova.isspst.StringUtils;
import info.bukova.isspst.data.RequirementState; import info.bukova.isspst.data.RequirementState;
import info.bukova.isspst.data.TripBill; import info.bukova.isspst.data.TripBill;
import info.bukova.isspst.data.TripBillApproval; import info.bukova.isspst.data.TripBillApproval;
@@ -8,6 +9,7 @@ import info.bukova.isspst.services.tripbill.TripBillApprovalService;
import info.bukova.isspst.services.tripbill.TripBillService; import info.bukova.isspst.services.tripbill.TripBillService;
import info.bukova.isspst.services.users.UserService; import info.bukova.isspst.services.users.UserService;
import info.bukova.isspst.ui.requirement.RequirementSubpage; import info.bukova.isspst.ui.requirement.RequirementSubpage;
import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.BindingParam; import org.zkoss.bind.annotation.BindingParam;
import org.zkoss.bind.annotation.Command; import org.zkoss.bind.annotation.Command;
import org.zkoss.bind.annotation.ExecutionArgParam; import org.zkoss.bind.annotation.ExecutionArgParam;
@@ -15,7 +17,10 @@ import org.zkoss.bind.annotation.GlobalCommand;
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.event.Event;
import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zk.ui.select.annotation.WireVariable; import org.zkoss.zk.ui.select.annotation.WireVariable;
import org.zkoss.zul.Messagebox;
import org.zkoss.zul.Window; import org.zkoss.zul.Window;
import java.util.ArrayList; import java.util.ArrayList;
@@ -121,10 +126,29 @@ public class TripBillSummaryVM extends RequirementSubpage<TripBillApproval> {
@GlobalCommand @GlobalCommand
@NotifyChange("dataBean") @NotifyChange("dataBean")
public void reload() { public void reload() {
if (bill.getApproval() != null) {
setDataBean(tripBillApprovalService.getById(bill.getApproval().getId())); setDataBean(tripBillApprovalService.getById(bill.getApproval().getId()));
} }
}
public Map<Integer, Boolean> getSelTab() { public Map<Integer, Boolean> getSelTab() {
return selTab; return selTab;
} }
@Command
public void cancelApproval() {
Messagebox.show(StringUtils.localize("TripBillCancelApprovalQuestion"), StringUtils.localize("TripBillCancelApprovalTitle"), Messagebox.YES
| Messagebox.NO, Messagebox.QUESTION, new EventListener<Event>() {
@Override
public void onEvent(Event event) throws Exception {
if (((Integer) event.getData()).intValue() == Messagebox.YES) {
tripBillApprovalService.cancelApproval(bill);
setDataBean(null);
BindUtils.postNotifyChange(null, null, TripBillSummaryVM.this, "bill");
BindUtils.postNotifyChange(null, null, TripBillSummaryVM.this, "dataBean");
BindUtils.postNotifyChange(null, null, TripBillSummaryVM.this, "canApprove");
}
}
});
}
} }
@@ -9,19 +9,20 @@ import info.bukova.isspst.data.User;
import info.bukova.isspst.filters.UserFilter; import info.bukova.isspst.filters.UserFilter;
import info.bukova.isspst.services.users.UserService; import info.bukova.isspst.services.users.UserService;
import info.bukova.isspst.ui.ListViewModel; import info.bukova.isspst.ui.ListViewModel;
import info.bukova.isspst.ui.renderers.UserItemRenderer;
import java.util.ArrayList;
import java.util.List;
import org.zkoss.bind.annotation.GlobalCommand; import org.zkoss.bind.annotation.GlobalCommand;
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.select.annotation.WireVariable; import org.zkoss.zk.ui.select.annotation.WireVariable;
import java.util.ArrayList;
import java.util.List;
public class UsersList extends ListViewModel<User> { public class UsersList extends ListViewModel<User> {
@WireVariable @WireVariable
private UserService userService; private UserService userService;
private UserItemRenderer itemRenderer;
@Init @Init
public void init() { public void init() {
@@ -29,6 +30,7 @@ public class UsersList extends ListViewModel<User> {
dataClass = User.class; dataClass = User.class;
formZul = "userForm.zul"; formZul = "userForm.zul";
dataFilter = new UserFilter(getFilterTemplate()); dataFilter = new UserFilter(getFilterTemplate());
itemRenderer = new UserItemRenderer();
} }
public List<Module> getModules() { public List<Module> getModules() {
@@ -88,5 +90,7 @@ public class UsersList extends ListViewModel<User> {
return true; return true;
} }
public UserItemRenderer getItemRenderer() {
return itemRenderer;
}
} }
@@ -13,11 +13,8 @@ import info.bukova.isspst.services.workgroups.WorkgroupException;
import info.bukova.isspst.services.workgroups.WorkgroupService; import info.bukova.isspst.services.workgroups.WorkgroupService;
import info.bukova.isspst.ui.BigDecimalConverter; import info.bukova.isspst.ui.BigDecimalConverter;
import info.bukova.isspst.ui.FormViewModel; import info.bukova.isspst.ui.FormViewModel;
import info.bukova.isspst.ui.renderers.JobMappingItemRenderer;
import java.util.ArrayList; import info.bukova.isspst.ui.renderers.UserItemRenderer;
import java.util.List;
import java.util.Set;
import org.zkoss.bind.annotation.BindingParam; import org.zkoss.bind.annotation.BindingParam;
import org.zkoss.bind.annotation.Command; import org.zkoss.bind.annotation.Command;
import org.zkoss.bind.annotation.Init; import org.zkoss.bind.annotation.Init;
@@ -27,8 +24,14 @@ import org.zkoss.zk.ui.select.annotation.WireVariable;
import org.zkoss.zul.Listitem; import org.zkoss.zul.Listitem;
import org.zkoss.zul.Messagebox; import org.zkoss.zul.Messagebox;
import static ch.lambdaj.Lambda.*; import java.util.ArrayList;
import static org.hamcrest.Matchers.*; import java.util.List;
import java.util.Set;
import static ch.lambdaj.Lambda.filter;
import static ch.lambdaj.Lambda.having;
import static ch.lambdaj.Lambda.on;
import static org.hamcrest.Matchers.startsWith;
public class WorkgroupForm extends FormViewModel<Workgroup> { public class WorkgroupForm extends FormViewModel<Workgroup> {
@@ -42,6 +45,8 @@ public class WorkgroupForm extends FormViewModel<Workgroup> {
private String findUser; private String findUser;
private List<Member> selectedUsers; private List<Member> selectedUsers;
private BigDecimalConverter bdConverter; private BigDecimalConverter bdConverter;
private JobMappingItemRenderer itemRenderer;
private UserItemRenderer userItemRenderer;
@Init(superclass = true) @Init(superclass = true)
public void init() { public void init() {
@@ -49,6 +54,8 @@ public class WorkgroupForm extends FormViewModel<Workgroup> {
users.addAll(userService.getAll()); users.addAll(userService.getAll());
selectedUsers = new ArrayList<Member>(); selectedUsers = new ArrayList<Member>();
bdConverter = new BigDecimalConverter(); bdConverter = new BigDecimalConverter();
itemRenderer = new JobMappingItemRenderer();
userItemRenderer = new UserItemRenderer();
} }
public List<Member> getUsers() { public List<Member> getUsers() {
@@ -239,4 +246,11 @@ public class WorkgroupForm extends FormViewModel<Workgroup> {
return bdConverter; return bdConverter;
} }
public JobMappingItemRenderer getItemRenderer() {
return itemRenderer;
}
public UserItemRenderer getUserItemRenderer() {
return userItemRenderer;
}
} }
@@ -22,12 +22,25 @@ public class RequirementFormValidator extends BaseValidator
public void validate(ValidationContext ctx) public void validate(ValidationContext ctx)
{ {
Property propertyCentre = ctx.getProperties("centre")[0]; Property propertyCentre = ctx.getProperties("centre")[0];
if (propertyCentre != null) {
Workgroup workgroup = (Workgroup) propertyCentre.getValue(); Workgroup workgroup = (Workgroup) propertyCentre.getValue();
if (workgroup == null) if (workgroup == null) {
{
this.errorMsg(ctx, StringUtils.localize("RequirementCenterIsEmpty"), "idReqCenter"); this.errorMsg(ctx, StringUtils.localize("RequirementCenterIsEmpty"), "idReqCenter");
return; return;
} }
} }
Property propertyDescription = ctx.getProperties("description")[0];
if (propertyDescription != null) {
String description = (String) propertyDescription.getValue();
if (StringUtils.isNullOrTrimmedEmpty(description)) {
this.errorMsg(ctx, StringUtils.localize("ErrMaterialOrServiceDescription"), "idDescription");
return;
}
}
}
} }
@@ -241,9 +241,18 @@ TripBillBack=Zpět
TripBillTotal=Celkem TripBillTotal=Celkem
TripBillSaveApprove=Jestliže máte vše vyplněno, pošlete vyúčtování ke schválení. Vyúčtování zaslané ke schválení už nelze dále upravovat. Odeslat ke schválení? TripBillSaveApprove=Jestliže máte vše vyplněno, pošlete vyúčtování ke schválení. Vyúčtování zaslané ke schválení už nelze dále upravovat. Odeslat ke schválení?
TripBillSave=Odeslat ke schválení? TripBillSave=Odeslat ke schválení?
TripBillCancelApproval=Zrušit schválení a povolit úpravy
TripBillCancelApprovalQuestion=Opravdu zrušít schválení tohoto vyúčtování?
TripBillCancelApprovalTitle=Zrušit schválení
TripBillPaid=Proplaceno
TripBillPaidDate=Datum proplacení
TripBillPay=Proplatit
TripBillSummaryDetail=Detail TripBillSummaryDetail=Detail
TripBilling=Proplacení vyúčtování
BillNotApproved=Vyúčtování není schválené, nelze proplatit.
TripRequirement=Požadavek na služební cestu TripRequirement=Požadavek na služební cestu
ShowTripBill=Zobrazit vyúčtování ShowTripBill=Zobrazit vyúčtování
@@ -348,8 +357,8 @@ SelectGroup=Vybrat skupinu...
RemoveItem=Smazat RemoveItem=Smazat
Confirm=Potvrdit Confirm=Potvrdit
StudentProject = Studentský projekt StudentProject = Zajistím sám
StudentProjectAbr = St. projekt StudentProjectAbr = Zaj. sám
Amount=Částka Amount=Částka
Owner=Vlastník Owner=Vlastník
@@ -383,6 +392,9 @@ InvoicingDescription=Popis
InvoicingInvoiced=Fakturováno InvoicingInvoiced=Fakturováno
InvoicingApplicant=Žadatel InvoicingApplicant=Žadatel
InvoicingMaterial=Fakturace požadavků na materiál
InvoicingServices=Fakturace požadavků na servis
HandleComboKeyFilter=#del HandleComboKeyFilter=#del
HandleComboKey=$#del HandleComboKey=$#del
@@ -416,3 +428,6 @@ ErrFillTripBillResultTimes = Zadejte časy odjezdu a příjezdu.
ErrApproveMustBeSigned = Schválení musí být digitálně podepsané. 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
ErrMaterialOrServiceDescription=Zadejte popis požadavku.
Binary file not shown.
+12 -48
View File
@@ -2,7 +2,7 @@
<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="396"/> <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,7 +57,7 @@
<band splitType="Stretch"/> <band splitType="Stretch"/>
</background> </background>
<pageHeader> <pageHeader>
<band height="275" splitType="Stretch"> <band height="237" splitType="Stretch">
<staticText> <staticText>
<reportElement uuid="6e60bd03-48b9-4555-91ab-757532d93e6a" x="10" y="61" width="143" height="20"/> <reportElement uuid="6e60bd03-48b9-4555-91ab-757532d93e6a" x="10" y="61" width="143" height="20"/>
<textElement> <textElement>
@@ -176,25 +176,8 @@ tuzemské pracovní cesty]]></text>
<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 uuid="c67f7840-5e38-4eed-ab3f-e4907ac33b5c" x="0" y="236" width="572" height="1"/>
</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 uuid="e3530085-daa8-4675-bf3a-d98c775be07e" x="0" y="55" width="571" height="1"/>
@@ -203,10 +186,10 @@ tuzemské pracovní cesty]]></text>
<reportElement uuid="47e4e70d-fb5f-4266-889a-4149c71efa42" x="-1" y="0" width="572" height="1"/> <reportElement uuid="47e4e70d-fb5f-4266-889a-4149c71efa42" x="-1" y="0" width="572" height="1"/>
</line> </line>
<line> <line>
<reportElement uuid="d4738137-17c1-4721-b222-7187988c1b06" x="-1" y="1" width="1" height="272"/> <reportElement uuid="d4738137-17c1-4721-b222-7187988c1b06" x="-1" y="1" width="1" height="236"/>
</line> </line>
<line> <line>
<reportElement uuid="bf83547c-60d9-4f95-a5f1-db0763ba17cb" x="571" y="1" width="1" height="272"/> <reportElement uuid="bf83547c-60d9-4f95-a5f1-db0763ba17cb" x="571" y="1" width="1" height="236"/>
</line> </line>
<textField isBlankWhenNull="true"> <textField isBlankWhenNull="true">
<reportElement uuid="8af60406-55bf-46f0-82e9-865dc9edbdb4" x="196" y="82" width="375" height="20"> <reportElement uuid="8af60406-55bf-46f0-82e9-865dc9edbdb4" x="196" y="82" width="375" height="20">
@@ -230,13 +213,6 @@ tuzemské pracovní cesty]]></text>
</textElement> </textElement>
<textFieldExpression><![CDATA[$P{P_MAIN_ADDRESS}]]></textFieldExpression> <textFieldExpression><![CDATA[$P{P_MAIN_ADDRESS}]]></textFieldExpression>
</textField> </textField>
<genericElement>
<reportElement uuid="14ae63ff-6be2-4419-9f39-8c9c8d2daf42" x="382" y="206" width="162" height="42"/>
<genericElementType namespace="urn:sig:sig" name="signature"/>
<genericElementParameter name="index">
<valueExpression><![CDATA[1]]></valueExpression>
</genericElementParameter>
</genericElement>
</band> </band>
</pageHeader> </pageHeader>
<detail> <detail>
@@ -356,12 +332,6 @@ tuzemské pracovní cesty]]></text>
<textElement textAlignment="Center" verticalAlignment="Middle"/> <textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[Doplatek - přeplatek]]></text> <text><![CDATA[Doplatek - přeplatek]]></text>
</staticText> </staticText>
<image onErrorType="Blank">
<reportElement uuid="0a136d64-9565-4ed7-9baa-3b68aa98eada" x="450" y="106" width="113" height="36">
<printWhenExpression><![CDATA[$P{P_USER_SIGNATURE} != null]]></printWhenExpression>
</reportElement>
<imageExpression><![CDATA[$P{P_USER_SIGNATURE}]]></imageExpression>
</image>
<staticText> <staticText>
<reportElement uuid="c200a476-63ba-4c3d-8e17-298b5928b0dd" x="1" y="76" width="240" height="15"/> <reportElement uuid="c200a476-63ba-4c3d-8e17-298b5928b0dd" x="1" y="76" width="240" height="15"/>
<textElement> <textElement>
@@ -417,12 +387,6 @@ tuzemské pracovní cesty]]></text>
</detail> </detail>
<summary> <summary>
<band height="194" splitType="Prevent"> <band height="194" splitType="Prevent">
<image onErrorType="Blank">
<reportElement uuid="4c553957-3ab2-4f19-af01-577f5d3cef40" x="438" y="103" width="130" height="46">
<printWhenExpression><![CDATA[$P{P_PREV_APPROVER_SIGNATURE} != null]]></printWhenExpression>
</reportElement>
<imageExpression><![CDATA[$P{P_PREV_APPROVER_SIGNATURE}]]></imageExpression>
</image>
<staticText> <staticText>
<reportElement uuid="58e4cf15-a8e1-4b4d-b491-ad4a1825f0a3" x="281" y="5" width="30" height="15"/> <reportElement uuid="58e4cf15-a8e1-4b4d-b491-ad4a1825f0a3" x="281" y="5" width="30" height="15"/>
<textElement/> <textElement/>
@@ -556,13 +520,6 @@ tuzemské pracovní cesty]]></text>
<line> <line>
<reportElement uuid="5e5a7c99-962e-4c99-b3ba-dbed5315f5aa" x="-1" y="-2" width="1" height="195"/> <reportElement uuid="5e5a7c99-962e-4c99-b3ba-dbed5315f5aa" x="-1" y="-2" width="1" height="195"/>
</line> </line>
<textField pattern="dd. MM. yyyy">
<reportElement uuid="8f8ad8d2-dc49-46cc-8732-914951931569" x="440" y="135" width="100" height="15"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$P{P_PREV_APPROVE_DATE}]]></textFieldExpression>
</textField>
<staticText> <staticText>
<reportElement uuid="4aca1ec1-c2dc-47b9-a973-40ded5f52d29" x="260" y="103" width="290" height="20"/> <reportElement uuid="4aca1ec1-c2dc-47b9-a973-40ded5f52d29" x="260" y="103" width="290" height="20"/>
<textElement/> <textElement/>
@@ -575,6 +532,13 @@ tuzemské pracovní cesty]]></text>
<valueExpression><![CDATA[2]]></valueExpression> <valueExpression><![CDATA[2]]></valueExpression>
</genericElementParameter> </genericElementParameter>
</genericElement> </genericElement>
<genericElement>
<reportElement uuid="14ae63ff-6be2-4419-9f39-8c9c8d2daf42" x="438" y="107" width="130" height="42"/>
<genericElementType namespace="urn:sig:sig" name="signature"/>
<genericElementParameter name="index">
<valueExpression><![CDATA[1]]></valueExpression>
</genericElementParameter>
</genericElement>
</band> </band>
</summary> </summary>
</jasperReport> </jasperReport>
Binary file not shown.
Binary file not shown.
+3 -3
View File
@@ -1,3 +1,3 @@
storage.root=/home/pepa/tmp/isspst storage.root=~/tmp/isspst
storage.fulltextIndex=/home/pepa/tmp/isspst storage.fulltextIndex=~/tmp/isspst
storage.signedDocuments=/home/pepa/tmp/isspst/signedDoc storage.signedDocuments=~/tmp/isspst/signedDoc
+1
View File
@@ -11,6 +11,7 @@
<hbox width="100%" vflex="1"> <hbox width="100%" vflex="1">
<listbox model="@load(vm.dataList)" <listbox model="@load(vm.dataList)"
selectedItem="@bind(vm.dataBean)" selectedItem="@bind(vm.dataBean)"
itemRenderer="@load(vm.itemRenderer)"
width="650px" width="650px"
vflex="1"> vflex="1">
<listhead menupopup="auto"> <listhead menupopup="auto">
@@ -59,7 +59,8 @@
maxlength="@load(vm.lengthText)" maxlength="@load(vm.lengthText)"
width="300px" /> width="300px" />
<listbox id="users" model="@bind(vm.users)" height="380px" width="300px" multiple="true" <listbox id="users" model="@bind(vm.users)" height="380px" width="300px" multiple="true"
droppable="true" onDrop="@command('addMember', event=event)" selectedItems="@bind(vm.selectedUsers)"> droppable="true" onDrop="@command('addMember', event=event)" selectedItems="@bind(vm.selectedUsers)"
>
<listhead> <listhead>
<listheader label="Uživatelé" sort="czech(fullName)"/> <listheader label="Uživatelé" sort="czech(fullName)"/>
</listhead> </listhead>
@@ -82,6 +83,7 @@
<listbox id="@load(each.authority)" <listbox id="@load(each.authority)"
model="@bind(vm.dataBean.members)" height="200px" width="290px" model="@bind(vm.dataBean.members)" height="200px" width="290px"
multiple="true" droppable="true" multiple="true" droppable="true"
itemRenderer="@load(vm.itemRenderer)"
onDrop="@command('addMember', event=event)"> onDrop="@command('addMember', event=event)">
<!-- <listhead> <!-- <listhead>
<listheader label="@load(each.description)" sort="czech(fullName)"/> <listheader label="@load(each.description)" sort="czech(fullName)"/>
+8 -2
View File
@@ -38,8 +38,14 @@
<menuseparator/> <menuseparator/>
<menuitem <menuitem
image="/img/invoicing-016.png" image="/img/invoicing-016.png"
label="${labels.Invoicing}" label="${labels.InvoicingMaterial}"
href="/main/invoicing/" href="/main/invoicing/material/"
disabled="${not sec:isAllGranted('PERM_READ_INVOICING')}"
visible="${module:isActive('INVOICING') }" />
<menuitem
image="/img/invoicing-016.png"
label="${labels.InvoicingServices}"
href="/main/invoicing/services/"
disabled="${not sec:isAllGranted('PERM_READ_INVOICING')}" disabled="${not sec:isAllGranted('PERM_READ_INVOICING')}"
visible="${module:isActive('INVOICING') }" /> visible="${module:isActive('INVOICING') }" />
</menupopup> </menupopup>
+1 -1
View File
@@ -51,6 +51,6 @@
<div id="mainData"> <div id="mainData">
<u:include src="${gridZul}" /> <u:include src="${gridZul}" />
</div> </div>
<div id="footer"> Verze 2.0 </div> <div id="footer"> Verze 3.1 </div>
</div> </div>
</html> </html>
+4
View File
@@ -89,3 +89,7 @@
.req-select-approved-project { .req-select-approved-project {
background-color: #87cefa !important; background-color: #87cefa !important;
} }
.user-disabled {
background-color: #fff2dd !important;
}
+8 -95
View File
@@ -1,28 +1,5 @@
<?page contentType="text/html;charset=UTF-8"?>
<zk xmlns="http://www.zkoss.org/2005/zul" <hlayout vflex="1">
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.signeddocs.SignedDocsList')">
<caption
image="/img/adobe-032.png"
zclass="form-caption"
label="${labels.AgendaSignedDocuments}" />
<tabbox
vflex="1"
orient="top">
<tabs width="500px">
<tab label="${labels.ActualDocuments}" />
<!-- tab label="${labels.Archive}" /-->
</tabs>
<tabpanels>
<tabpanel>
<include src="toolbar.zul" />
<hlayout vflex="1">
<listbox <listbox
vflex="1" vflex="1"
hflex="60" hflex="60"
@@ -134,83 +111,19 @@
hflex="3" hflex="3"
sort="czech(fileName)" sort="czech(fileName)"
label="${labels.FileName}" /> label="${labels.FileName}" />
<listheader <listheader hflex="1" />
hflex="1"/>
</listhead> </listhead>
<template name="model"> <template name="model">
<listitem> <listitem>
<listcell label="@load(each.actualReportName)" /> <listcell label="@load(each.actualReportName)" />
<listcell label="@load(each.fileName)" /> <listcell label="@load(each.fileName)" />
<listcell> <listcell>
<button label="Otevřít" onClick="@command('onOpen', item = each)" sclass="nicebutton"/> <button
label="Otevřít"
onClick="@command('onOpen', item = each)"
sclass="nicebutton" />
</listcell> </listcell>
</listitem> </listitem>
</template> </template>
</listbox> </listbox>
</hlayout> </hlayout>
</tabpanel>
<tabpanel>
<!-- listbox
vflex="1"
selectedItem="@bind(vm.selectedOrderItem)"
model="@load(vm.orderItems)">
<listhead menupopup="auto">
<listheader
hflex="7"
sort="czech(code)"
label="${labels.RequirementItemCode}" />
<listheader
hflex="15"
sort="czech(name)"
label="${labels.RequirementItemName}" />
<listheader
hflex="20"
sort="czech(textItem)"
label="${labels.RequirementItemText}" />
<listheader
hflex="5"
sort="auto(quantity)"
align="right"
label="${labels.RequirementItemQuantity}" />
<listheader
hflex="5"
sort="auto(munit.name)"
label="${labels.RequirementItemMUnit}" />
<listheader
hflex="7"
align="right"
sort="auto(unitPrice)"
label="${labels.RequirementItemUnitPrice}" />
<listheader
hflex="7"
align="right"
sort="auto(total)"
label="${labels.RequirementItemTotal}" />
<listheader
hflex="15"
sort="czech(description)"
label="${labels.RequirementItemDescription}" />
<listheader
hflex="5"
sort="auto(reqItem.orderNum)"
label="${labels.OrderAbr}" />
</listhead>
<template name="model">
<listitem>
<listcell label="@load(each.code)" />
<listcell label="@load(each.name)" />
<listcell label="@load(each.textItem)" />
<listcell label="@load(each.quantity) @converter(vm.standardBigDecimalConverter)" />
<listcell label="@load(each.munit.name)" />
<listcell label="@load(each.unitPrice) @converter(vm.standardBigDecimalConverter)" />
<listcell label="@load(each.total) @converter(vm.standardBigDecimalConverter)" />
<listcell label="@load(each.description)" />
<listcell label="@load(each.reqItem.orderNum)" />
</listitem>
</template>
</listbox-->
</tabpanel>
</tabpanels>
</tabbox>
</window>
</zk>
@@ -0,0 +1,13 @@
<zk>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<window
vflex="1"
border="none"
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.signeddocs.SignedDocsActualList')">
<include src="/lists/signeddocs/toolbar.zul" />
<include
vflex="1"
src="/lists/signeddocs/grid.zul" />
</window>
</zk>
@@ -0,0 +1,13 @@
<zk>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<window
vflex="1"
border="none"
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.signeddocs.SignedDocsArchiveList')">
<include src="/lists/signeddocs/toolbar.zul" />
<include
vflex="1"
src="/lists/signeddocs/grid.zul" />
</window>
</zk>
+1 -1
View File
@@ -2,7 +2,7 @@
<zk> <zk>
<zscript> <zscript>
String gridZul = "grid.zul"; String gridZul = "setup.zul";
</zscript> </zscript>
<include src="/app/template.zhtml"/> <include src="/app/template.zhtml"/>
@@ -0,0 +1,19 @@
<?page contentType="text/html;charset=UTF-8"?>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<zk>
<zscript>
String gridActual = "/lists/signeddocs/headListActual.zul";
String gridArchive = "/lists/signeddocs/headListArchive.zul";
</zscript>
<window
vflex="1"
border="normal">
<caption
src="/img/adobe-032.png"
zclass="form-caption"
label="${labels.AgendaSignedDocuments}" />
<include
vflex="1"
src="/lists/signeddocs/tabPanels.zul" />
</window>
</zk>
@@ -0,0 +1,17 @@
<tabbox
apply="org.zkoss.bind.BindComposer"
orient="top"
vflex="1">
<tabs>
<tab label="${labels.ActualDocuments}" />
<tab label="${labels.Archive}" />
</tabs>
<tabpanels>
<tabpanel>
<include src="${gridActual}" />
</tabpanel>
<tabpanel>
<include src="${gridArchive}" />
</tabpanel>
</tabpanels>
</tabbox>
@@ -1,215 +0,0 @@
<?page contentType="text/html;charset=UTF-8"?>
<zk>
<window
id="editWin"
closable="true"
width="95%"
height="95%"
border="normal"
position="center"
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.main.invoicing.InvoicingForm')">
<caption
src="/img/invoicing-032.png"
zclass="form-caption"
label="${labels.InvoicingFormTitle}" />
<vlayout vflex="1">
<hbox
vflex="min"
hflex="1">
<div hflex="1">
<button
image="/img/item-add.png"
label="${labels.InvoicingAdd}"
sclass="nicebutton"
onClick="@command('addItem')" />
</div>
<div hflex="1"></div>
<div
hflex="1"
align="right">
<checkbox
label="${labels.Completed}"
checked="@bind(vm.dataBean.completed)" />
</div>
</hbox>
<hbox vflex="1">
<vbox vflex="1">
<listbox
model="@load(vm.dataBean.items)"
vflex="1"
selectedItem="@bind(vm.selectedItem)"
selectedIndex="@bind(vm.selectedIndex)">
<listhead>
<listheader
label="${labels.InvoicingDate}"
width="150px" />
<listheader label="${labels.InvoicingInvoiceNumber}" />
<listheader
label="${labels.InvoicingAmount}"
align="right"
width="90px" />
<listheader />
</listhead>
<template name="model">
<listitem>
<listcell>
<datebox
value="@bind(each.invoiceDate)"
format="${labels.DateFormat}"
inplace="true"
onFocus="@command('onFocus', item=each)" />
</listcell>
<listcell>
<textbox
value="@bind(each.invoiceNumber)"
sclass="grid-textbox-max"
inplace="true"
maxlength="@load(vm.lengthText)"
onFocus="@command('onFocus', item=each)" />
</listcell>
<listcell>
<textbox
value="@bind(each.amount) @converter(vm.standardBigDecimalConverter)"
sclass="grid-textbox-max"
inplace="true"
onFocus="@command('onFocus', item=each)"
maxlength="@load(vm.lengthText)"
onChange="@command('calculate')" />
</listcell>
<listcell>
<button
label="${labels.RemoveItem}"
sclass="nicebutton"
onClick="@command('removeItem', item=each)" />
</listcell>
</listitem>
</template>
</listbox>
</vbox>
<grid hflex="min">
<columns>
<column
align="right"
hflex="min" />
<column />
</columns>
<rows>
<row>
<cell sclass="row-title">${labels.InvoicingRequirementNumber} :</cell>
<cell>
<textbox
width="200px"
value="@bind(vm.dataBean.requirement.numser)"
style="font-weight: bold;"
maxlength="@load(vm.lengthText)"
readonly="true" />
</cell>
</row>
<row>
<cell sclass="row-title">${labels.InvoicingDescription} :</cell>
<cell>
<textbox
width="350px"
rows="5"
value="@bind(vm.dataBean.requirement.description)"
maxlength="@load(vm.lengthDescription)"
readonly="true" />
</cell>
</row>
<row>
<cell sclass="row-title">${labels.InvoicingRequirementPrice} :</cell>
<cell>
<textbox
width="150px"
value="@bind(vm.dataBean.requirement.sumTotal) @converter(vm.standardBigDecimalConverter)"
maxlength="@load(vm.lengthText)"
readonly="true" />
</cell>
</row>
<row>
<cell sclass="row-title">${labels.InvoicingInvoicedPrice} :</cell>
<cell>
<textbox
width="150px"
value="@bind(vm.dataBean.totalInvoiced) @converter(vm.standardBigDecimalConverter)"
readonly="true"
maxlength="@load(vm.lengthText)"
style="@load(vm.dataBean.totalInvoiced gt vm.dataBean.requirement.sumTotal ? ' color: red;' : '' )" />
</cell>
</row>
</rows>
</grid>
</hbox>
<listbox
vflex="1"
model="@load(vm.dataBean.requirement.items)">
<listhead>
<listheader
hflex="10"
label="${labels.RequirementItemCode}" />
<listheader
hflex="15"
label="${labels.RequirementItemName}" />
<listheader
hflex="30"
label="${labels.RequirementItemText}" />
<listheader
hflex="10"
align="right"
label="${labels.RequirementItemQuantity}" />
<listheader
hflex="10"
label="${labels.RequirementItemMUnit}" />
<listheader
hflex="10"
align="right"
label="${labels.RequirementItemUnitPrice}" />
<listheader
hflex="10"
align="right"
label="${labels.RequirementItemTotal}" />
<listheader
hflex="10"
align="right"
label="${labels.InvoicingInvoiced}" />
<listheader
hflex="15"
label="${labels.RequirementItemDescription}" />
</listhead>
<template name="model">
<listitem>
<listcell>
<label value="@load(each.code)" />
</listcell>
<listcell>
<label value="@load(each.name)" />
</listcell>
<listcell>
<label value="@load(each.textItem)" />
</listcell>
<listcell>
<label value="@bind(each.quantity) @converter(vm.standardBigDecimalConverter)" />
</listcell>
<listcell>
<label value="@bind(each.munit.name)" />
</listcell>
<listcell>
<label value="@bind(each.unitPrice) @converter(vm.standardBigDecimalConverter)" />
</listcell>
<listcell>
<label value="@bind(each.total) @converter(vm.standardBigDecimalConverter)" />
</listcell>
<listcell>
<checkbox checked="@bind(each.paid)" />
</listcell>
<listcell>
<label value="@bind(each.description)" />
</listcell>
</listitem>
</template>
</listbox>
<include src="/app/formButtons.zul" />
</vlayout>
</window>
</zk>
@@ -1,4 +1,4 @@
<?page title="${labels.Invoicing}" contentType="text/html;charset=UTF-8"?> <?page title="${labels.InvoicingMaterial}" contentType="text/html;charset=UTF-8"?>
<zk> <zk>
<zscript> <zscript>
@@ -0,0 +1,20 @@
<?page title="${labels.InvoicingMaterial}" contentType="text/html;charset=UTF-8"?>
<zk>
<window
id="editWin"
width="95%"
height="95%"
closable="true"
border="normal"
position="center"
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.main.invoicing.InvoicingForm')">
<caption
image="/img/invoicing-032.png"
zclass="form-caption"
label="${labels.InvoicingMaterial}" />
<include
vflex="1"
src="/main/invoicing/shared/invoicingForm.zul" />
</window>
</zk>
@@ -4,10 +4,10 @@
vflex="1" vflex="1"
border="none" border="none"
apply="org.zkoss.bind.BindComposer" apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.main.invoicing.InvoicingArchiveList')"> viewModel="@id('vm') @init('info.bukova.isspst.ui.main.invoicing.InvoicingMaterialArchiveList')">
<include src="/app/toolbar.zul" /> <include src="/app/toolbar.zul" />
<include <include
vflex="1" vflex="1"
src="/main/invoicing/invoicingGrid.zul" /> src="/main/invoicing/shared/invoicingGrid.zul" />
</window> </window>
</zk> </zk>
@@ -4,10 +4,10 @@
vflex="1" vflex="1"
border="none" border="none"
apply="org.zkoss.bind.BindComposer" apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.main.invoicing.InvoicingPendingList')"> viewModel="@id('vm') @init('info.bukova.isspst.ui.main.invoicing.InvoicingMaterialPendingList')">
<include src="/app/toolbar.zul" /> <include src="/app/toolbar.zul" />
<include <include
vflex="1" vflex="1"
src="/main/invoicing/invoicingGrid.zul" /> src="/main/invoicing/shared/invoicingGrid.zul" />
</window> </window>
</zk> </zk>
@@ -2,8 +2,8 @@
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?> <?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<zk> <zk>
<zscript> <zscript>
String gridPending = "/main/invoicing/invHeadListPending.zul"; String gridPending = "/main/invoicing/material/invHeadListPending.zul";
String gridArchive = "/main/invoicing/invHeadListArchive.zul"; String gridArchive = "/main/invoicing/material/invHeadListArchive.zul";
</zscript> </zscript>
<window <window
vflex="1" vflex="1"
@@ -11,9 +11,9 @@
<caption <caption
src="/img/invoicing-032.png" src="/img/invoicing-032.png"
zclass="form-caption" zclass="form-caption"
label="${labels.Invoicing}" /> label="${labels.InvoicingMaterial}" />
<include <include
vflex="1" vflex="1"
src="/main/invoicing/tabPanels.zul" /> src="/main/invoicing/shared/tabPanels.zul" />
</window> </window>
</zk> </zk>
@@ -0,0 +1,10 @@
<?page title="${labels.InvoicingServices}" contentType="text/html;charset=UTF-8"?>
<zk>
<zscript>
String gridZul = "setup.zul";
</zscript>
<include src="/app/template.zhtml"/>
</zk>
@@ -0,0 +1,20 @@
<?page title="${labels.InvoicingServices}" contentType="text/html;charset=UTF-8"?>
<zk>
<window
id="editWin"
width="95%"
height="95%"
closable="true"
border="normal"
position="center"
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.main.invoicing.InvoicingForm')">
<caption
image="/img/invoicing-032.png"
zclass="form-caption"
label="${labels.InvoicingServices}" />
<include
vflex="1"
src="/main/invoicing/shared/invoicingForm.zul" />
</window>
</zk>
@@ -0,0 +1,13 @@
<zk>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<window
vflex="1"
border="none"
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.main.invoicing.InvoicingServicesArchiveList')">
<include src="/app/toolbar.zul" />
<include
vflex="1"
src="/main/invoicing/shared/invoicingGrid.zul" />
</window>
</zk>
@@ -0,0 +1,13 @@
<zk>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<window
vflex="1"
border="none"
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.main.invoicing.InvoicingServicesPendingList')">
<include src="/app/toolbar.zul" />
<include
vflex="1"
src="/main/invoicing/shared/invoicingGrid.zul" />
</window>
</zk>
@@ -0,0 +1,19 @@
<?page contentType="text/html;charset=UTF-8"?>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<zk>
<zscript>
String gridPending = "/main/invoicing/services/invHeadListPending.zul";
String gridArchive = "/main/invoicing/services/invHeadListArchive.zul";
</zscript>
<window
vflex="1"
border="normal">
<caption
src="/img/invoicing-032.png"
zclass="form-caption"
label="${labels.InvoicingServices}" />
<include
vflex="1"
src="/main/invoicing/shared/tabPanels.zul" />
</window>
</zk>
@@ -0,0 +1,198 @@
<vlayout vflex="1">
<hbox
vflex="min"
hflex="1">
<div hflex="1">
<button
image="/img/item-add.png"
label="${labels.InvoicingAdd}"
sclass="nicebutton"
onClick="@command('addItem')"/>
</div>
<div hflex="1"></div>
<div
hflex="1"
align="right">
<checkbox
label="${labels.Completed}"
checked="@bind(vm.dataBean.completed)"/>
</div>
</hbox>
<hbox vflex="1">
<vbox vflex="1">
<listbox
model="@load(vm.dataBean.items)"
vflex="1"
selectedItem="@bind(vm.selectedItem)"
selectedIndex="@bind(vm.selectedIndex)">
<listhead>
<listheader
label="${labels.InvoicingDate}"
width="150px"/>
<listheader label="${labels.InvoicingInvoiceNumber}"/>
<listheader
label="${labels.InvoicingAmount}"
align="right"
width="90px"/>
<listheader/>
</listhead>
<template name="model">
<listitem>
<listcell>
<datebox
value="@bind(each.invoiceDate)"
format="${labels.DateFormat}"
inplace="true"
onFocus="@command('onFocus', item=each)"/>
</listcell>
<listcell>
<textbox
value="@bind(each.invoiceNumber)"
sclass="grid-textbox-max"
inplace="true"
maxlength="@load(vm.lengthText)"
onFocus="@command('onFocus', item=each)"/>
</listcell>
<listcell>
<textbox
value="@bind(each.amount) @converter(vm.standardBigDecimalConverter)"
sclass="grid-textbox-max"
inplace="true"
onFocus="@command('onFocus', item=each)"
maxlength="@load(vm.lengthText)"
onChange="@command('calculate')"/>
</listcell>
<listcell>
<button
label="${labels.RemoveItem}"
sclass="nicebutton"
onClick="@command('removeItem', item=each)"/>
</listcell>
</listitem>
</template>
</listbox>
</vbox>
<grid hflex="min">
<columns>
<column
align="right"
hflex="min"/>
<column/>
</columns>
<rows>
<row>
<cell sclass="row-title">${labels.InvoicingRequirementNumber} :</cell>
<cell>
<textbox
width="200px"
value="@bind(vm.dataBean.requirement.numser)"
style="font-weight: bold;"
maxlength="@load(vm.lengthText)"
readonly="true"/>
</cell>
</row>
<row>
<cell sclass="row-title">${labels.InvoicingDescription} :</cell>
<cell>
<textbox
width="350px"
rows="5"
value="@bind(vm.dataBean.requirement.description)"
maxlength="@load(vm.lengthDescription)"
readonly="true"/>
</cell>
</row>
<row>
<cell sclass="row-title">${labels.InvoicingRequirementPrice} :</cell>
<cell>
<textbox
width="150px"
value="@bind(vm.dataBean.requirement.sumTotal) @converter(vm.standardBigDecimalConverter)"
maxlength="@load(vm.lengthText)"
readonly="true"/>
</cell>
</row>
<row>
<cell sclass="row-title">${labels.InvoicingInvoicedPrice} :</cell>
<cell>
<textbox
width="150px"
value="@bind(vm.dataBean.totalInvoiced) @converter(vm.standardBigDecimalConverter)"
readonly="true"
maxlength="@load(vm.lengthText)"
style="@load(vm.dataBean.totalInvoiced gt vm.dataBean.requirement.sumTotal ? ' color: red;' : '' )"/>
</cell>
</row>
</rows>
</grid>
</hbox>
<listbox
vflex="1"
model="@load(vm.dataBean.requirement.items)">
<listhead>
<listheader
hflex="10"
label="${labels.RequirementItemCode}"/>
<listheader
hflex="15"
label="${labels.RequirementItemName}"/>
<listheader
hflex="30"
label="${labels.RequirementItemText}"/>
<listheader
hflex="10"
align="right"
label="${labels.RequirementItemQuantity}"/>
<listheader
hflex="10"
label="${labels.RequirementItemMUnit}"/>
<listheader
hflex="10"
align="right"
label="${labels.RequirementItemUnitPrice}"/>
<listheader
hflex="10"
align="right"
label="${labels.RequirementItemTotal}"/>
<listheader
hflex="10"
align="right"
label="${labels.InvoicingInvoiced}"/>
<listheader
hflex="15"
label="${labels.RequirementItemDescription}"/>
</listhead>
<template name="model">
<listitem>
<listcell>
<label value="@load(each.code)"/>
</listcell>
<listcell>
<label value="@load(each.name)"/>
</listcell>
<listcell>
<label value="@load(each.textItem)"/>
</listcell>
<listcell>
<label value="@bind(each.quantity) @converter(vm.standardBigDecimalConverter)"/>
</listcell>
<listcell>
<label value="@bind(each.munit.name)"/>
</listcell>
<listcell>
<label value="@bind(each.unitPrice) @converter(vm.standardBigDecimalConverter)"/>
</listcell>
<listcell>
<label value="@bind(each.total) @converter(vm.standardBigDecimalConverter)"/>
</listcell>
<listcell>
<checkbox checked="@bind(each.paid)"/>
</listcell>
<listcell>
<label value="@bind(each.description)"/>
</listcell>
</listitem>
</template>
</listbox>
<include src="/app/formButtons.zul"/>
</vlayout>
@@ -81,7 +81,7 @@
<cell sclass="row-title">${labels.RequirementsFormDescription} :</cell> <cell sclass="row-title">${labels.RequirementsFormDescription} :</cell>
<cell> <cell>
<textbox <textbox
id="description" id="idDescription"
width="400px" width="400px"
rows="5" rows="5"
maxlength="@load(vm.lengthDescription)" maxlength="@load(vm.lengthDescription)"
+1 -1
View File
@@ -2,7 +2,7 @@
<zk> <zk>
<zscript> <zscript>
String gridZul = "tripBillGrid.zul"; String gridZul = "setup.zul";
</zscript> </zscript>
<include src="/app/template.zhtml"/> <include src="/app/template.zhtml"/>
@@ -0,0 +1,32 @@
<?page title="${labels.TravelOrdersFormTitle}" contentType="text/html;charset=UTF-8"?>
<zk xmlns="http://www.zkoss.org/2005/zul"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd">
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<window id="payWin" border="normal" apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.tripbill.PayDialogVM')" width="320px" closable="true">
<caption
image="/img/invoicing-032.png"
zclass="form-caption"
label="${labels.TripBilling}" />
<vbox hflex="1">
<hbox>
<label value="${labels.TripBillPaidDate}:"/>
<datebox
instant="true"
value="@bind(vm.payDate)"
format="${labels.DateFormat}"/>
</hbox>
<separator bar="true" hflex="1"/>
<hbox>
<button image="/img/approve-016.png" label="${labels.Confirm}" onClick="@command('pay', window=payWin)" sclass="nicebutton" disabled="@load(empty vm.payDate)"/>
<button image="~./zul/img/misc/drag-disallow.png" label="${labels.ButtonStorno}" onClick="payWin.detach()" sclass="nicebutton"/>
</hbox>
</vbox>
</window>
</zk>
+21
View File
@@ -0,0 +1,21 @@
<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<zk>
<zscript>
String gridMy = "/main/trips/bill/tripBillGridMy.zul";
String gridMyCenters = "/main/trips/bill/tripBillGridCenters.zul";
String gridMyWorkgroups = "/main/trips/bill/tripBillGridWorkgroups.zul";
String gridAll = "/main/trips/bill/tripBillGridAll.zul";
</zscript>
<window
vflex="1"
border="normal">
<caption
src="/img/pickup-032.png"
zclass="form-caption"
label="${labels.TravelOrders}" />
<include
vflex="1"
src="/main/tabPanels.zul" />
</window>
</zk>
@@ -0,0 +1,14 @@
<?page title="${labels.TravelOrders}" contentType="text/html;charset=UTF-8"?>
<zk xmlns="http://www.zkoss.org/2005/zul"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd">
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<window
vflex="1"
border="normal"
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.tripbill.TripBillListAll')">
<include src="../../toolbar.zul" />
<include vflex="1" src="tripBillGridInt.zul"/>
</window>
</zk>
@@ -0,0 +1,14 @@
<?page title="${labels.TravelOrders}" contentType="text/html;charset=UTF-8"?>
<zk xmlns="http://www.zkoss.org/2005/zul"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd">
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<window
vflex="1"
border="normal"
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.tripbill.TripBillListCentre')">
<include src="../../toolbar.zul" />
<include vflex="1" src="tripBillGridInt.zul"/>
</window>
</zk>
@@ -0,0 +1,197 @@
<?page title="${labels.TravelOrdersFormTitle}" contentType="text/html;charset=UTF-8"?>
<zk xmlns="http://www.zkoss.org/2005/zul"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd">
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<hbox vflex="1">
<listbox
vflex="1"
hflex="7"
model="@load(vm.dataList)"
selectedItem="@bind(vm.dataBean)"
itemRenderer="@load(vm.itemRenderer)"
onAfterRender="@command('afterRender')"
selectedIndex="@bind(vm.selIndex)">
<listhead menupopup="auto">
<listheader
label="${labels.TravelOrdersGridNumser}"
sort="czech(bill.requirement.numser)"
width="30%" />
<listheader
label="${labels.TravelOrdersGridReqDate}"
sort="auto(bill.requirement.reqDate)"
width="70%" />
<listheader
label="${labels.TravelOrdersGridFrom}"
sort="czech(bill.requirement.from)"
width="70%" />
<listheader
label="${labels.TravelOrdersGridTo}"
sort="czech(bill.requirement.to)"
width="70%" />
<listheader
label="${labels.TravelOrdersGridTotal}"
sort="auto(bill.total)"
align="right"
width="70%" />
<listheader
label="${labels.ownedBy}"
width="50%"/>
<listheader
label="${labels.TripBillPaid}"
width="10%"/>
<listheader
label="${labels.TripBillPaidDate}"
width="20%"/>
</listhead>
<auxhead
sclass="category-center"
visible="@load(vm.filter)">
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox
value="@bind(vm.filterTemplate.bill.requirement.numser)"
instant="true"
onChange="@command('doFilter')"
maxlength="@load(vm.lengthText)"
sclass="find-grid-textbox" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<datebox
value="@bind(vm.filterTemplate.bill.requirement.reqDate)"
format="${labels.DateFormat}"
instant="true"
onChange="@command('doFilter')"
sclass="find-grid-textbox"
width="100%" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox
value="@bind(vm.filterTemplate.bill.requirement.from)"
instant="true"
onChange="@command('doFilter')"
maxlength="@load(vm.lengthDescription)"
sclass="find-grid-textbox" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox
value="@bind(vm.filterTemplate.bill.requirement.to)"
instant="true"
onChange="@command('doFilter')"
maxlength="@load(vm.lengthDescription)"
sclass="find-grid-textbox" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox
value="@bind(vm.filterTemplate.bill.total) @converter(vm.bigDecimalConverter)"
instant="true"
onChange="@command('doFilter')"
maxlength="@load(vm.lengthText)"
sclass="find-grid-textbox" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</auxheader>
<auxheader>
<div zclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<combobox
ctrlKeys="${labels.HandleComboKeyFilter}"
onCtrlKey="@command('handleComboKeyFilter', ctrl=self, keyEvent=event)"
onChange="@command('doFilter')"
width="100%"
selectedItem="@bind(vm.filterTemplate.bill.ownedBy)"
model="@load(vm.allUsers)"
readonly="true">
<template name="model">
<comboitem label="@load(each.fullName)" />
</template>
</combobox>
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<checkbox
checked="@bind(vm.filterTemplate.bill.paid)"
onClick="@command('doFilter')" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<datebox
value="@bind(vm.filterTemplate.bill.paidDate)"
format="${labels.DateFormat}"
instant="true"
onChange="@command('doFilter')"
sclass="find-grid-textbox"
width="100%" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</auxheader>
</auxhead>
<template name="model">
<listitem>
<listcell label="@load(each.bill.requirement.numser)" />
<listcell label="@load(each.bill.requirement.reqDate) @converter('formatedDate', format=labels.DateFormat)" />
<listcell label="@load(each.bill.requirement.from)" />
<listcell label="@load(each.bill.requirement.to)" />
<listcell label="@load(each.bill.total) @converter(vm.standardBigDecimalConverter)"/>
<listcell label="@load(each.bill.ownedBy)"/>
<listcell label="@load(each.bill.paid) @converter(vm.standardBoolConverter)"/>
<listcell label="@load(each.bill.paidDate) @converter('formatedDate', format=labels.DateFormat)"/>
</listitem>
</template>
</listbox>
<vbox hflex="3">
<include hflex="1" src="/main/approveStatus.zul"/>
<button label="${labels.TripBillPay}" image="/img/invoicing-016.png" onClick="@command('pay')" sclass="nicebutton" disabled="@load(not(vm.dataBean.state eq 'APPROVED'))"/>
</vbox>
</hbox>
</zk>
@@ -0,0 +1,84 @@
<?page title="${labels.TravelOrders}" contentType="text/html;charset=UTF-8"?>
<zk xmlns="http://www.zkoss.org/2005/zul"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd">
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<window
vflex="1"
border="normal"
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.tripbill.TripBillList')">
<include src="/app/toolbar.zul" />
<listbox
vflex="1"
model="@load(vm.dataList)"
selectedItem="@bind(vm.dataBean)">
<listhead menupopup="auto">
<listheader
label="${labels.TravelOrdersGridNumser}"
sort="czech(numser)"
width="30%" />
<listheader
label="${labels.TravelOrdersGridReqDate}"
sort="auto(requirement.reqDate)"
width="70%" />
<listheader
label="${labels.TravelOrdersGridFrom}"
sort="czech(requirement.from)"
width="70%" />
<listheader
label="${labels.TravelOrdersGridTo}"
sort="czech(requirement.to)"
width="70%" />
<listheader
label="${labels.TravelOrdersGridTotal}"
sort="auto(total)"
align="right"
width="70%" />
</listhead>
<!-- <auxhead
sclass="category-center"
visible="@load(vm.filter)">
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox
value="@bind(vm.filterTemplate.name)"
instant="true"
onChange="@command('doFilter')"
maxlength="@load(vm.lengthText)"
sclass="find-grid-textbox" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox
value="@bind(vm.filterTemplate.description)"
instant="true"
onChange="@command('doFilter')"
maxlength="@load(vm.lengthDescription)"
sclass="find-grid-textbox" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</auxheader>
</auxhead> -->
<template name="model">
<listitem style="@load((empty each.approval ? '' : (each.approval.state eq 'PARTIALLY') ? 'background-color: #fffb90' : ((each.approval.state eq 'APPROVED') ? 'background-color: #afffb5' : 'background-color: #fdfbca') ))">
<listcell label="@load(each.requirement.numser)" />
<listcell label="@load(each.requirement.reqDate) @converter('formatedDate', format=labels.DateFormat)" />
<listcell label="@load(each.requirement.from)" />
<listcell label="@load(each.requirement.to)" />
<listcell label="@load(each.total) @converter(vm.standardBigDecimalConverter)"/>
</listitem>
</template>
</listbox>
</window>
</zk>
@@ -0,0 +1,14 @@
<?page title="${labels.TravelOrders}" contentType="text/html;charset=UTF-8"?>
<zk xmlns="http://www.zkoss.org/2005/zul"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd">
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<window
vflex="1"
border="normal"
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.tripbill.TripBillListWorkgroup')">
<include src="../../toolbar.zul" />
<include vflex="1" src="tripBillGridInt.zul"/>
</window>
</zk>
@@ -35,6 +35,7 @@
<separator bar="true" hflex="1"/> <separator bar="true" hflex="1"/>
<include src="../../approveStatus.zul" vflex="1"/> <include src="../../approveStatus.zul" vflex="1"/>
<button label="${labels.TripBillCancelApproval}" onClick="@command('cancelApproval')" sclass="nicebutton" disabled="@load(empty vm.dataBean)"/>
</vbox> </vbox>
</div> </div>