Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6ac6d783fb | |||
| 67ff54d3f1 | |||
| 275e120021 | |||
| d20a72b336 | |||
| e24684bbd0 | |||
| 21bf006c19 | |||
| 970928bb4e | |||
| 369184940b | |||
| cc374a3bf1 | |||
| 66e0c427ac | |||
| 095089d020 | |||
| 84154ccbff | |||
| 1230959854 | |||
| 96154a6b98 | |||
| 14242fa41a | |||
| 67a99d8d78 | |||
| 768d3ee874 |
@@ -24,7 +24,7 @@
|
||||
<repository>
|
||||
<id>fdvsolution.public</id>
|
||||
<name>Dynamic Jasper</name>
|
||||
<url>http://archiva.fdvs.com.ar/repository/public1/</url>
|
||||
<url>http://nexus.fdvs.com.ar/content/groups/public/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
@@ -407,6 +407,23 @@
|
||||
</configuration>
|
||||
</plugin>
|
||||
</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>
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
|
||||
@@ -116,6 +116,7 @@ public class Constants {
|
||||
public final static String PERM_EDIT_OWN = "PERM_EDIT_OWN";
|
||||
public final static String PERM_DELETE_NEW = "PERM_DELETE_NEW";
|
||||
public final static String PERM_SEARCH = "PERM_SEARCH";
|
||||
public final static String PERM_PAY_BILL = "PERM_PAY_BILL";
|
||||
|
||||
public final static Permission SPECIAL_PERMISSIONS[] = {
|
||||
new Permission(PERM_EDIT_NEW, "Upravit neschválené", MOD_REQUIREMENTS, PermissionType.GLOBAL),
|
||||
@@ -133,7 +134,9 @@ public class Constants {
|
||||
new Permission(PERM_APPROVE, "Schválení", MOD_TRIPREQUIREMENTS, PermissionType.WORKGROUP),
|
||||
|
||||
new Permission(PERM_SEARCH, "Vyhledávat", MOD_SEARCH, PermissionType.GLOBAL),
|
||||
new Permission(PERM_READ, "Číst", MOD_SIGNEDDOCS, PermissionType.GLOBAL)
|
||||
new Permission(PERM_READ, "Číst", MOD_SIGNEDDOCS, PermissionType.GLOBAL),
|
||||
|
||||
new Permission(PERM_PAY_BILL, "Vyplacení SC", MOD_TRIPBILL, PermissionType.GLOBAL)
|
||||
};
|
||||
|
||||
public final static String DYNAMIC_REPORT_NAME = "Tabulková sestava";
|
||||
@@ -162,7 +165,7 @@ public class Constants {
|
||||
public final static Map<Class<?>, String> URL_MAP = Collections.unmodifiableMap(new HashMap<Class<?>, String>() {{
|
||||
put(Requirement.class, "/main/orders/");
|
||||
put(TripRequirement.class, "/main/trips/requirements/");
|
||||
put(TripBillApproval.class, "/main/trips/requirements/");
|
||||
put(TripBillApproval.class, "/main/trips/bill/");
|
||||
put(Order.class, "/main/orders/created/");
|
||||
put(TripBill.class, "/main/trips/bill/");
|
||||
}} );
|
||||
|
||||
@@ -2,6 +2,7 @@ package info.bukova.isspst;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
|
||||
import org.apache.commons.lang.time.DateUtils;
|
||||
|
||||
@@ -54,4 +55,31 @@ public class DateTimeUtils
|
||||
{
|
||||
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) {
|
||||
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";
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
package info.bukova.isspst.data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import org.hibernate.annotations.Cascade;
|
||||
import org.hibernate.annotations.LazyCollection;
|
||||
import org.hibernate.annotations.LazyCollectionOption;
|
||||
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Column;
|
||||
@@ -11,17 +12,17 @@ import javax.persistence.JoinColumn;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.OneToOne;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import org.hibernate.annotations.LazyCollection;
|
||||
import org.hibernate.annotations.LazyCollectionOption;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Entity
|
||||
@Table(name = "INVOICING")
|
||||
public class Invoicing extends BaseData implements Cloneable
|
||||
{
|
||||
|
||||
@OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
|
||||
@OneToOne(fetch = FetchType.EAGER)
|
||||
@JoinColumn(name = "REQUIREMENT_ID")
|
||||
@Cascade(org.hibernate.annotations.CascadeType.SAVE_UPDATE)
|
||||
private Requirement requirement;
|
||||
|
||||
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true)
|
||||
|
||||
@@ -60,11 +60,15 @@ public class TripBill extends BaseData implements EntityWithAttachment {
|
||||
@LazyCollection(LazyCollectionOption.TRUE)
|
||||
@IndexedEmbedded
|
||||
private List<FileMetainfo> attachedFiles;
|
||||
@OneToOne(fetch = FetchType.EAGER)
|
||||
@OneToOne(fetch = FetchType.EAGER, orphanRemoval = true)
|
||||
@JoinColumn(name = "APPROVAL_ID")
|
||||
private TripBillApproval approval;
|
||||
@Column(name = "SAVED")
|
||||
private Boolean saved; // Nastaveno na true, pokud uživatel udělá změnu- nepřenáší se pak částky od žadatele
|
||||
@Column(name = "PAID")
|
||||
private Boolean paid;
|
||||
@Column(name = "PAID_DATE")
|
||||
private Date paidDate;
|
||||
|
||||
public TripBill() {
|
||||
billItems = new ArrayList<TripBillItem>();
|
||||
@@ -186,4 +190,20 @@ public class TripBill extends BaseData implements EntityWithAttachment {
|
||||
public void setSaved(Boolean saved) {
|
||||
this.saved = saved;
|
||||
}
|
||||
|
||||
public Boolean getPaid() {
|
||||
return paid;
|
||||
}
|
||||
|
||||
public void setPaid(Boolean paid) {
|
||||
this.paid = paid;
|
||||
}
|
||||
|
||||
public Date getPaidDate() {
|
||||
return paidDate;
|
||||
}
|
||||
|
||||
public void setPaidDate(Date paidDate) {
|
||||
this.paidDate = paidDate;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
package info.bukova.isspst.filters;
|
||||
|
||||
import info.bukova.isspst.BooleanUtils;
|
||||
import info.bukova.isspst.DateTimeUtils;
|
||||
import info.bukova.isspst.StringUtils;
|
||||
import info.bukova.isspst.data.TripBillApproval;
|
||||
import info.bukova.isspst.data.User;
|
||||
import org.hamcrest.Description;
|
||||
import org.hamcrest.Factory;
|
||||
import org.hamcrest.Matcher;
|
||||
import org.hamcrest.TypeSafeMatcher;
|
||||
|
||||
public class TripBillApprovalFilter implements Filter<TripBillApproval>
|
||||
{
|
||||
|
||||
private TripBillApproval condition;
|
||||
|
||||
public TripBillApprovalFilter(TripBillApproval cond)
|
||||
{
|
||||
this.condition = cond;
|
||||
}
|
||||
|
||||
private static class TripBillApprovalMatcher extends TypeSafeMatcher<TripBillApproval>
|
||||
{
|
||||
|
||||
private TripBillApproval condition;
|
||||
|
||||
public TripBillApprovalMatcher(TripBillApproval cond)
|
||||
{
|
||||
this.condition = cond;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void describeTo(Description desc)
|
||||
{
|
||||
desc.appendText("requirement matches");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matchesSafely(TripBillApproval item)
|
||||
{
|
||||
if (item.getBill() == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean foundNumser = StringUtils.isEqualForFilter(item.getNumser(), condition.getNumser());
|
||||
boolean foundReqDate = DateTimeUtils.isEqualByDateForFilter(item.getBill().getRequirement().getReqDate(), condition.getBill().getRequirement().getReqDate());
|
||||
boolean foundDescription = StringUtils.isEqualForFilter(item.getDescription(), condition.getDescription());
|
||||
boolean foundFrom = StringUtils.isEqualForFilter(item.getBill().getRequirement().getFrom(), condition.getBill().getRequirement().getFrom());
|
||||
boolean foundTo = StringUtils.isEqualForFilter(item.getBill().getRequirement().getTo(), condition.getBill().getRequirement().getTo());
|
||||
boolean foundWorkgroup = (condition.getWorkgroup() == null ||(item.getWorkgroup() != null && item.getWorkgroup().equals(condition.getWorkgroup())));
|
||||
boolean foundCentre = (condition.getCentre() == null || (item.getCentre() != null && item.getCentre().equals(condition.getCentre())));
|
||||
boolean foundOwner = User.isEqualByUserForFilter(item.getBill().getOwnedBy(), condition.getBill().getOwnedBy());
|
||||
boolean foundPaid = BooleanUtils.isEqualByBooleanValue(item.getBill().getPaid(), condition.getBill().getPaid());
|
||||
boolean foundPaidDate = DateTimeUtils.isEqualByDateForFilter(item.getBill().getPaidDate(), condition.getBill().getPaidDate());
|
||||
return foundNumser && foundReqDate && foundDescription && foundFrom && foundTo && foundWorkgroup && foundCentre && foundOwner && foundPaid && foundPaidDate;
|
||||
}
|
||||
|
||||
@Factory
|
||||
public static Matcher<TripBillApproval> matchTripRequirement(TripBillApproval building)
|
||||
{
|
||||
return new TripBillApprovalMatcher(building);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TripBillApprovalMatcher matcher()
|
||||
{
|
||||
return new TripBillApprovalMatcher(condition);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String queryString()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
package info.bukova.isspst.reporting;
|
||||
|
||||
import com.lowagie.text.Rectangle;
|
||||
import com.lowagie.text.pdf.PdfAnnotation;
|
||||
import com.lowagie.text.pdf.PdfFormField;
|
||||
import com.lowagie.text.pdf.PdfName;
|
||||
import net.sf.jasperreports.engine.JRGenericPrintElement;
|
||||
@@ -27,7 +26,8 @@ public class SignaturePdfHandler implements GenericElementPdfHandler, GenericEle
|
||||
|
||||
@Override
|
||||
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");
|
||||
String index = param != null ? String.valueOf(param) : null;
|
||||
|
||||
@@ -37,7 +37,9 @@ public class SignaturePdfHandler implements GenericElementPdfHandler, GenericEle
|
||||
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(),
|
||||
exporterContext.getExportedReport().getPageHeight() - element.getY(),
|
||||
element.getX() + element.getWidth(),
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package info.bukova.isspst.services.invoicing;
|
||||
|
||||
import info.bukova.isspst.data.Invoicing;
|
||||
import info.bukova.isspst.data.Requirement;
|
||||
import info.bukova.isspst.data.Workgroup;
|
||||
import info.bukova.isspst.services.Service;
|
||||
|
||||
@@ -20,4 +21,14 @@ public interface InvoicingService extends Service<Invoicing> {
|
||||
public List<Invoicing> getPendingList();
|
||||
|
||||
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;
|
||||
|
||||
import info.bukova.isspst.Constants;
|
||||
import info.bukova.isspst.data.Invoicing;
|
||||
import info.bukova.isspst.data.InvoicingItem;
|
||||
import info.bukova.isspst.data.Requirement;
|
||||
import info.bukova.isspst.data.Workgroup;
|
||||
import info.bukova.isspst.services.AbstractOwnedService;
|
||||
import info.bukova.isspst.services.LazyLoader;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import org.hibernate.Hibernate;
|
||||
import org.hibernate.Query;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
public class InvoicingServiceImpl extends AbstractOwnedService<Invoicing> implements
|
||||
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");
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
+13
-7
@@ -131,7 +131,8 @@ public abstract class RequirementBaseServiceImpl<T extends RequirementBase> exte
|
||||
}
|
||||
|
||||
protected void postAdd(T entity) {
|
||||
if (canApprove(entity)) {
|
||||
Workflow wf = getNextWorkflow(entity);
|
||||
if (canApprove(entity) && (wf.getSignature() == null || !wf.getSignature())) {
|
||||
approve(entity);
|
||||
} else {
|
||||
this.sendToApprovers(entity);
|
||||
@@ -280,7 +281,7 @@ public abstract class RequirementBaseServiceImpl<T extends RequirementBase> exte
|
||||
|
||||
if (signedPdf != null) {
|
||||
saveSignedDoc(e, signedPdf);
|
||||
} else if (wf.getSignature() != null && wf.getSignature()) {
|
||||
} else if (wf.getSignature() != null && wf.getSignature() && !signatureNotRequired(wf)) {
|
||||
throw new ApproveException("ErrApproveMustBeSigned");
|
||||
}
|
||||
|
||||
@@ -310,6 +311,15 @@ public abstract class RequirementBaseServiceImpl<T extends RequirementBase> exte
|
||||
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) {
|
||||
approve(entity, user, new Date(), null);
|
||||
}
|
||||
@@ -549,11 +559,7 @@ public abstract class RequirementBaseServiceImpl<T extends RequirementBase> exte
|
||||
public void update(T entity) {
|
||||
entity.getAuthorization().clear();
|
||||
entity.setState(RequirementState.NEW);
|
||||
|
||||
SignedDocument doc = signedDocumentService.getForEntity(entity);
|
||||
if (doc != null) {
|
||||
signedDocumentService.delFromApprove(doc);
|
||||
}
|
||||
signedDocumentService.deleteForEntity(entity);
|
||||
|
||||
super.update(entity);
|
||||
sendToApprovers(entity);
|
||||
|
||||
@@ -11,8 +11,8 @@ import info.bukova.isspst.data.Workflow;
|
||||
import info.bukova.isspst.services.LazyLoader;
|
||||
import info.bukova.isspst.services.invoicing.InvoicingService;
|
||||
import org.hibernate.Hibernate;
|
||||
import org.hibernate.Query;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@@ -67,6 +67,16 @@ public class RequirementServiceImpl extends RequirementBaseServiceImpl<Requireme
|
||||
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
|
||||
protected boolean canAdd(Requirement entity)
|
||||
{
|
||||
@@ -244,11 +254,19 @@ public class RequirementServiceImpl extends RequirementBaseServiceImpl<Requireme
|
||||
@Override
|
||||
@Transactional
|
||||
public BigDecimal getInvoicedAmount(Requirement req) {
|
||||
Query query = dao.getQuery("select invoice from Invoicing invoice join invoice.requirement rq where rq.id = :reqId");
|
||||
query.setParameter("reqId", req.getId());
|
||||
|
||||
Invoicing inv = (Invoicing) query.uniqueResult();
|
||||
|
||||
Invoicing inv = invoicingService.getForRequirement(req);
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+40
-12
@@ -57,8 +57,6 @@ public class TripRequirementServiceImpl extends RequirementBaseServiceImpl<TripR
|
||||
@Transactional
|
||||
@PreAuthorize("hasPermission(this, 'PERM_EDIT') or hasPermission(#entity, this.getUpdateEntityPermission())")
|
||||
public void update(TripRequirement entity) {
|
||||
super.update(entity);
|
||||
|
||||
if (entity.getState() == RequirementState.APPROVED) {
|
||||
for (TripBill bill : getBills(entity)) {
|
||||
TripBill newBill = tripBillService.createTripBill(entity);
|
||||
@@ -75,6 +73,8 @@ public class TripRequirementServiceImpl extends RequirementBaseServiceImpl<TripR
|
||||
tripBillService.update(bill);
|
||||
}
|
||||
}
|
||||
|
||||
super.update(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -141,25 +141,53 @@ public class TripRequirementServiceImpl extends RequirementBaseServiceImpl<TripR
|
||||
|
||||
@Override
|
||||
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);
|
||||
tripBillService.add(bill);
|
||||
bill.setOwnedBy(entity.getOwnedBy());
|
||||
tripBillService.update(bill);
|
||||
}
|
||||
|
||||
if (entity.getBillForPassengers() != null && entity.getBillForPassengers()) {
|
||||
for (User u : entity.getPassengers()) {
|
||||
if (!u.equals(entity.getOwnedBy())) {
|
||||
TripBill passBill = tripBillService.createPassengersBill(entity);
|
||||
tripBillService.add(passBill);
|
||||
passBill.setOwnedBy(u);
|
||||
tripBillService.update(passBill);
|
||||
}
|
||||
if (entity.getBillForPassengers() != null && entity.getBillForPassengers()) {
|
||||
for (User u : entity.getPassengers()) {
|
||||
if (canCreateBill(entity, u, billList)) {
|
||||
TripBill passBill = tripBillService.createPassengersBill(entity);
|
||||
tripBillService.add(passBill);
|
||||
passBill.setOwnedBy(u);
|
||||
tripBillService.update(passBill);
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
@@ -5,11 +5,16 @@ import info.bukova.isspst.data.SignedDocument;
|
||||
import info.bukova.isspst.data.SignedDocumentItem;
|
||||
import info.bukova.isspst.services.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SignedDocumentService extends Service<SignedDocument> {
|
||||
|
||||
SignedDocument getForEntity(DataModel entity);
|
||||
SignedDocumentItem getItem(DataModel entity, long reportId);
|
||||
void addFromApprove(SignedDocument document);
|
||||
void delFromApprove(SignedDocument document);
|
||||
void deleteForEntity(DataModel entity);
|
||||
|
||||
public List<SignedDocument> getActualList();
|
||||
public List<SignedDocument> getArchiveList();
|
||||
}
|
||||
|
||||
+45
-3
@@ -1,5 +1,6 @@
|
||||
package info.bukova.isspst.services.signeddocs;
|
||||
|
||||
import info.bukova.isspst.DateTimeUtils;
|
||||
import info.bukova.isspst.Module;
|
||||
import info.bukova.isspst.ModuleUtils;
|
||||
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.services.AbstractOwnedService;
|
||||
import info.bukova.isspst.services.LazyLoader;
|
||||
|
||||
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.Query;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
|
||||
public class SignedDocumentServiceImpl extends AbstractOwnedService<SignedDocument> implements SignedDocumentService {
|
||||
|
||||
@Autowired
|
||||
@@ -76,6 +82,10 @@ public class SignedDocumentServiceImpl extends AbstractOwnedService<SignedDocume
|
||||
|
||||
@Override
|
||||
public void delFromApprove(SignedDocument document) {
|
||||
if (document == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
super.delete(document);
|
||||
|
||||
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 TripBillApproval createApproval(TripBill bill);
|
||||
public void cancelApproval(TripBill bill);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package info.bukova.isspst.services.tripbill;
|
||||
|
||||
import info.bukova.isspst.Constants;
|
||||
import info.bukova.isspst.Module;
|
||||
import info.bukova.isspst.ModuleUtils;
|
||||
import info.bukova.isspst.StringUtils;
|
||||
import info.bukova.isspst.data.DataModel;
|
||||
import info.bukova.isspst.data.RequirementState;
|
||||
@@ -9,6 +11,8 @@ import info.bukova.isspst.data.TripBillApproval;
|
||||
import info.bukova.isspst.services.IsspstException;
|
||||
import info.bukova.isspst.services.requirement.RequirementBaseServiceImpl;
|
||||
import info.bukova.isspst.services.requirement.RequirementTypeService;
|
||||
import info.bukova.isspst.services.signeddocs.SignedDocumentService;
|
||||
import org.hibernate.Query;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -22,6 +26,10 @@ public class TripBillApprovalServiceImpl extends RequirementBaseServiceImpl<Trip
|
||||
|
||||
@Autowired
|
||||
private RequirementTypeService reqTypeService;
|
||||
@Autowired
|
||||
private TripBillService tripBillService;
|
||||
@Autowired
|
||||
private SignedDocumentService signedDocumentService;
|
||||
|
||||
@Override
|
||||
public TripBillApproval createApproval(TripBill bill) {
|
||||
@@ -58,4 +66,38 @@ public class TripBillApprovalServiceImpl extends RequirementBaseServiceImpl<Trip
|
||||
protected DataModel entityForSignReport(TripBillApproval entity) {
|
||||
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.services.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public interface TripBillService extends Service<TripBill> {
|
||||
@@ -15,6 +16,7 @@ public interface TripBillService extends Service<TripBill> {
|
||||
public List<TripBill> getMy();
|
||||
public void loadOwner(TripBill bill);
|
||||
public void loadPassengers(TripBill bill);
|
||||
public void setPaid(TripBill bill, Date date);
|
||||
|
||||
/**
|
||||
* Uloží vyúčtování a nastaví příznak přenosu vyúčtování od žadatele
|
||||
|
||||
@@ -23,6 +23,7 @@ import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class TripBillServiceImpl extends AbstractOwnedService<TripBill> implements
|
||||
@@ -212,6 +213,19 @@ public class TripBillServiceImpl extends AbstractOwnedService<TripBill> implemen
|
||||
bill.getRequirement().setPassengers(tr.getPassengers());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
@PreAuthorize("hasPermission(this, 'PERM_PAY_BILL')")
|
||||
public void setPaid(TripBill bill, Date date) {
|
||||
if (bill.getApproval() == null || bill.getApproval().getState() != RequirementState.APPROVED) {
|
||||
throw new PayException("BillNotApproved");
|
||||
}
|
||||
|
||||
bill.setPaid(true);
|
||||
bill.setPaidDate(date);
|
||||
super.update(bill);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
@PreAuthorize("hasPermission(this, 'PERM_EDIT') or hasPermission(#entity, this.getUpdateEntityPermission())")
|
||||
@@ -252,7 +266,9 @@ public class TripBillServiceImpl extends AbstractOwnedService<TripBill> implemen
|
||||
|
||||
@Override
|
||||
public boolean canPrintRecord(TripBill entity) {
|
||||
if (entity.getApproval() != null && entity.getApproval().getState() == RequirementState.APPROVED) {
|
||||
if (entity.getApproval() != null
|
||||
&& entity.getApproval().getState() == RequirementState.APPROVED
|
||||
&& (entity.getPaid() == null || !entity.getPaid())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -234,7 +234,7 @@ public class UserServiceImpl extends AbstractService<User> implements UserServic
|
||||
@Override
|
||||
@Transactional
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
@@ -5,12 +5,6 @@ import info.bukova.isspst.data.DataModel;
|
||||
import info.bukova.isspst.filters.Filter;
|
||||
import info.bukova.isspst.services.IsspstException;
|
||||
import info.bukova.isspst.services.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.dao.DataIntegrityViolationException;
|
||||
@@ -27,6 +21,11 @@ import org.zkoss.zk.ui.event.EventListener;
|
||||
import org.zkoss.zul.Messagebox;
|
||||
import org.zkoss.zul.Window;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class ListViewModel<T extends DataModel> extends DocumentViewModel
|
||||
{
|
||||
|
||||
@@ -185,7 +184,6 @@ public class ListViewModel<T extends DataModel> extends DocumentViewModel
|
||||
}
|
||||
|
||||
@Command
|
||||
@NotifyChange({ "dataList", "dataBean" })
|
||||
public void delete() {
|
||||
Messagebox.show(StringUtils.localize("DbReallyDelete"), StringUtils.localize("DbDeleteRecord"), Messagebox.YES
|
||||
| Messagebox.NO, Messagebox.QUESTION,
|
||||
@@ -277,7 +275,7 @@ public class ListViewModel<T extends DataModel> extends DocumentViewModel
|
||||
}
|
||||
|
||||
@Command
|
||||
@NotifyChange({"selIndex", "dataBean"})
|
||||
@NotifyChange({"selIndex", "dataBean", "ableToDelete"})
|
||||
public void afterRender() {
|
||||
if (editBean != null && !editBean.isValid()) {
|
||||
return;
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
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.Member;
|
||||
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.users.UserService;
|
||||
import info.bukova.isspst.ui.DocumentViewModel;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.security.access.AccessDeniedException;
|
||||
import org.zkoss.bind.annotation.BindingParam;
|
||||
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.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
|
||||
{
|
||||
|
||||
@@ -69,7 +69,7 @@ public class MailForm extends DocumentViewModel
|
||||
addressbook = new ArrayList<Address>();
|
||||
}
|
||||
|
||||
users = userService.getAll();
|
||||
users = userService.getUsersForCombo();
|
||||
|
||||
selectedAddresses = new ArrayList<Address>();
|
||||
selectedUsers = new ArrayList<User>();
|
||||
|
||||
@@ -29,7 +29,6 @@ public class InvoicingList extends ListViewModel<Invoicing> {
|
||||
public void initInvoicing() {
|
||||
service = invoicingService;
|
||||
dataClass = Invoicing.class;
|
||||
formZul = "invoicingForm.zul";
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -50,7 +50,7 @@ public class RequirementSubpage<T extends RequirementBase> extends ListViewModel
|
||||
this.requirementsItemRenderer = new RequirementsItemRenderer();
|
||||
}
|
||||
|
||||
private RequirementBaseService<T> getReqService()
|
||||
protected RequirementBaseService<T> getReqService()
|
||||
{
|
||||
return (RequirementBaseService<T>) service;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,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.TripBillService;
|
||||
import info.bukova.isspst.ui.FormWithUpload;
|
||||
import org.zkoss.bind.BindUtils;
|
||||
import org.zkoss.bind.annotation.BindingParam;
|
||||
import org.zkoss.bind.annotation.Command;
|
||||
import org.zkoss.bind.annotation.Init;
|
||||
@@ -82,6 +83,7 @@ public class TripBillForm extends FormWithUpload<TripBill> {
|
||||
TripBillApproval approval = tripBillApprovalService.createApproval(getDataBean());
|
||||
tripBillApprovalService.add(approval);
|
||||
TripBillForm.super.save(editWin);
|
||||
BindUtils.postGlobalCommand(null, null, "refresh", null);
|
||||
} else {
|
||||
TripBillForm.super.save(editWin);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package info.bukova.isspst.ui.tripbill;
|
||||
|
||||
import info.bukova.isspst.data.TripBillApproval;
|
||||
import org.springframework.security.access.AccessDeniedException;
|
||||
import org.zkoss.bind.BindUtils;
|
||||
import org.zkoss.bind.annotation.Init;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Pepa Rokos
|
||||
*/
|
||||
public class TripBillListAll extends TripBillListBase {
|
||||
|
||||
@Init(superclass = true)
|
||||
public void initAllList() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<TripBillApproval> getListFromService() {
|
||||
try {
|
||||
return getReqService().getAll();
|
||||
} catch (AccessDeniedException e) {
|
||||
BindUtils.postGlobalCommand(null, null, "disableAll", null);
|
||||
return new ArrayList<TripBillApproval>();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void beforeSelectViaUrl() {
|
||||
BindUtils.postGlobalCommand(null, null, "selectAll", null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package info.bukova.isspst.ui.tripbill;
|
||||
|
||||
import info.bukova.isspst.data.TripBill;
|
||||
import info.bukova.isspst.data.TripBillApproval;
|
||||
import info.bukova.isspst.data.TripRequirement;
|
||||
import info.bukova.isspst.data.User;
|
||||
import info.bukova.isspst.filters.TripBillApprovalFilter;
|
||||
import info.bukova.isspst.services.tripbill.TripBillApprovalService;
|
||||
import info.bukova.isspst.services.tripbill.TripBillService;
|
||||
import info.bukova.isspst.services.users.UserService;
|
||||
import info.bukova.isspst.ui.renderers.TripBillApprovalItemRenderer;
|
||||
import info.bukova.isspst.ui.requirement.RequirementSubpage;
|
||||
import org.zkoss.bind.annotation.Command;
|
||||
import org.zkoss.bind.annotation.GlobalCommand;
|
||||
import org.zkoss.bind.annotation.Init;
|
||||
import org.zkoss.bind.annotation.NotifyChange;
|
||||
import org.zkoss.zk.ui.Executions;
|
||||
import org.zkoss.zk.ui.select.annotation.WireVariable;
|
||||
import org.zkoss.zul.Window;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Pepa Rokos
|
||||
*/
|
||||
public class TripBillListBase extends RequirementSubpage<TripBillApproval> {
|
||||
|
||||
@WireVariable
|
||||
private TripBillApprovalService tripBillApprovalService;
|
||||
private TripBillApprovalItemRenderer itemRenderer;
|
||||
@WireVariable
|
||||
private TripBillService tripBillService;
|
||||
@WireVariable
|
||||
private UserService userService;
|
||||
private List<User> allUsers;
|
||||
|
||||
@Init(superclass = true)
|
||||
public void initListBase() {
|
||||
service = tripBillApprovalService;
|
||||
itemRenderer = new TripBillApprovalItemRenderer();
|
||||
dataClass = TripBillApproval.class;
|
||||
TripBillApproval filter = getFilterTemplate();
|
||||
TripBill tb = new TripBill();
|
||||
tb.setRequirement(new TripRequirement());
|
||||
filter.setBill(tb);
|
||||
dataFilter = new TripBillApprovalFilter(filter);
|
||||
allUsers = userService.getUsersForCombo();
|
||||
}
|
||||
|
||||
public TripBillApprovalItemRenderer getItemRenderer() {
|
||||
return itemRenderer;
|
||||
}
|
||||
|
||||
@Command
|
||||
public void pay() {
|
||||
Map<String, Object> params = new HashMap<String, Object>();
|
||||
params.put("bill", getDataBean().getBill());
|
||||
params.put("grid", this);
|
||||
Window payDialog = (Window) Executions.createComponents("payDialog.zul", null, params);
|
||||
payDialog.doModal();
|
||||
}
|
||||
|
||||
@Command
|
||||
@Override
|
||||
public void edit() {
|
||||
Map<String, Object> params = new HashMap<String, Object>();
|
||||
params.put("selected", getDataBean().getBill());
|
||||
tripBillService.loadLazyData(getDataBean().getBill());
|
||||
Window win = (Window) Executions.createComponents("../requirements/tripBill.zul", null, params);
|
||||
win.doModal();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<User> getAllUsers() {
|
||||
return allUsers;
|
||||
}
|
||||
|
||||
@GlobalCommand
|
||||
@NotifyChange({ "dataList", "dataBean", "fullFill" })
|
||||
public void reloadRelated()
|
||||
{
|
||||
this.reload();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package info.bukova.isspst.ui.tripbill;
|
||||
|
||||
import info.bukova.isspst.data.TripBillApproval;
|
||||
import org.springframework.security.access.AccessDeniedException;
|
||||
import org.zkoss.bind.BindUtils;
|
||||
import org.zkoss.bind.annotation.Init;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Pepa Rokos
|
||||
*/
|
||||
public class TripBillListCentre extends TripBillListBase {
|
||||
|
||||
@Init(superclass = true)
|
||||
public void initListCentre() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<TripBillApproval> getListFromService() {
|
||||
try {
|
||||
return getReqService().getCentreReq();
|
||||
} catch (AccessDeniedException e) {
|
||||
BindUtils.postGlobalCommand(null, null, "disableCentre", null);
|
||||
return new ArrayList<TripBillApproval>();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void beforeSelectViaUrl() {
|
||||
BindUtils.postGlobalCommand(null, null, "selectCentre", null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package info.bukova.isspst.ui.tripbill;
|
||||
|
||||
import info.bukova.isspst.data.TripBillApproval;
|
||||
import org.springframework.security.access.AccessDeniedException;
|
||||
import org.zkoss.bind.BindUtils;
|
||||
import org.zkoss.bind.annotation.Init;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Pepa Rokos
|
||||
*/
|
||||
public class TripBillListWorkgroup extends TripBillListBase {
|
||||
|
||||
@Init(superclass = true)
|
||||
public void initWorkgroupList() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<TripBillApproval> getListFromService() {
|
||||
try {
|
||||
return getReqService().getWorkgroupReq();
|
||||
} catch (AccessDeniedException e) {
|
||||
BindUtils.postGlobalCommand(null, null, "disableWorkgroup", null);
|
||||
return new ArrayList<TripBillApproval>();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void beforeSelectViaUrl() {
|
||||
BindUtils.postGlobalCommand(null, null, "selectWorkgroup", null);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package info.bukova.isspst.ui.tripbill;
|
||||
|
||||
import info.bukova.isspst.StringUtils;
|
||||
import info.bukova.isspst.data.RequirementState;
|
||||
import info.bukova.isspst.data.TripBill;
|
||||
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.users.UserService;
|
||||
import info.bukova.isspst.ui.requirement.RequirementSubpage;
|
||||
import org.zkoss.bind.BindUtils;
|
||||
import org.zkoss.bind.annotation.BindingParam;
|
||||
import org.zkoss.bind.annotation.Command;
|
||||
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.NotifyChange;
|
||||
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.zul.Messagebox;
|
||||
import org.zkoss.zul.Window;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -121,10 +126,29 @@ public class TripBillSummaryVM extends RequirementSubpage<TripBillApproval> {
|
||||
@GlobalCommand
|
||||
@NotifyChange("dataBean")
|
||||
public void reload() {
|
||||
setDataBean(tripBillApprovalService.getById(bill.getApproval().getId()));
|
||||
if (bill.getApproval() != null) {
|
||||
setDataBean(tripBillApprovalService.getById(bill.getApproval().getId()));
|
||||
}
|
||||
}
|
||||
|
||||
public Map<Integer, Boolean> getSelTab() {
|
||||
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.services.users.UserService;
|
||||
import info.bukova.isspst.ui.ListViewModel;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import info.bukova.isspst.ui.renderers.UserItemRenderer;
|
||||
import org.zkoss.bind.annotation.GlobalCommand;
|
||||
import org.zkoss.bind.annotation.Init;
|
||||
import org.zkoss.bind.annotation.NotifyChange;
|
||||
import org.zkoss.zk.ui.select.annotation.WireVariable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class UsersList extends ListViewModel<User> {
|
||||
|
||||
@WireVariable
|
||||
private UserService userService;
|
||||
private UserItemRenderer itemRenderer;
|
||||
|
||||
@Init
|
||||
public void init() {
|
||||
@@ -29,6 +30,7 @@ public class UsersList extends ListViewModel<User> {
|
||||
dataClass = User.class;
|
||||
formZul = "userForm.zul";
|
||||
dataFilter = new UserFilter(getFilterTemplate());
|
||||
itemRenderer = new UserItemRenderer();
|
||||
}
|
||||
|
||||
public List<Module> getModules() {
|
||||
@@ -88,5 +90,7 @@ public class UsersList extends ListViewModel<User> {
|
||||
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.ui.BigDecimalConverter;
|
||||
import info.bukova.isspst.ui.FormViewModel;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import info.bukova.isspst.ui.renderers.JobMappingItemRenderer;
|
||||
import info.bukova.isspst.ui.renderers.UserItemRenderer;
|
||||
import org.zkoss.bind.annotation.BindingParam;
|
||||
import org.zkoss.bind.annotation.Command;
|
||||
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.Messagebox;
|
||||
|
||||
import static ch.lambdaj.Lambda.*;
|
||||
import static org.hamcrest.Matchers.*;
|
||||
import java.util.ArrayList;
|
||||
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> {
|
||||
|
||||
@@ -42,6 +45,8 @@ public class WorkgroupForm extends FormViewModel<Workgroup> {
|
||||
private String findUser;
|
||||
private List<Member> selectedUsers;
|
||||
private BigDecimalConverter bdConverter;
|
||||
private JobMappingItemRenderer itemRenderer;
|
||||
private UserItemRenderer userItemRenderer;
|
||||
|
||||
@Init(superclass = true)
|
||||
public void init() {
|
||||
@@ -49,6 +54,8 @@ public class WorkgroupForm extends FormViewModel<Workgroup> {
|
||||
users.addAll(userService.getAll());
|
||||
selectedUsers = new ArrayList<Member>();
|
||||
bdConverter = new BigDecimalConverter();
|
||||
itemRenderer = new JobMappingItemRenderer();
|
||||
userItemRenderer = new UserItemRenderer();
|
||||
}
|
||||
|
||||
public List<Member> getUsers() {
|
||||
@@ -239,4 +246,11 @@ public class WorkgroupForm extends FormViewModel<Workgroup> {
|
||||
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)
|
||||
{
|
||||
Property propertyCentre = ctx.getProperties("centre")[0];
|
||||
Workgroup workgroup = (Workgroup) propertyCentre.getValue();
|
||||
|
||||
if (workgroup == null)
|
||||
{
|
||||
this.errorMsg(ctx, StringUtils.localize("RequirementCenterIsEmpty"), "idReqCenter");
|
||||
return;
|
||||
if (propertyCentre != null) {
|
||||
Workgroup workgroup = (Workgroup) propertyCentre.getValue();
|
||||
|
||||
if (workgroup == null) {
|
||||
this.errorMsg(ctx, StringUtils.localize("RequirementCenterIsEmpty"), "idReqCenter");
|
||||
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
|
||||
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í?
|
||||
TripBillCancelApproval=Zrušit schválení a povolit úpravy
|
||||
TripBillCancelApprovalQuestion=Opravdu zrušít schválení tohoto vyúčtování?
|
||||
TripBillCancelApprovalTitle=Zrušit schválení
|
||||
TripBillPaid=Proplaceno
|
||||
TripBillPaidDate=Datum proplacení
|
||||
TripBillPay=Proplatit
|
||||
|
||||
TripBillSummaryDetail=Detail
|
||||
|
||||
TripBilling=Proplacení vyúčtování
|
||||
BillNotApproved=Vyúčtování není schválené, nelze proplatit.
|
||||
|
||||
TripRequirement=Požadavek na služební cestu
|
||||
ShowTripBill=Zobrazit vyúčtování
|
||||
|
||||
@@ -348,8 +357,8 @@ SelectGroup=Vybrat skupinu...
|
||||
RemoveItem=Smazat
|
||||
Confirm=Potvrdit
|
||||
|
||||
StudentProject = Studentský projekt
|
||||
StudentProjectAbr = St. projekt
|
||||
StudentProject = Zajistím sám
|
||||
StudentProjectAbr = Zaj. sám
|
||||
|
||||
Amount=Částka
|
||||
Owner=Vlastník
|
||||
@@ -383,6 +392,9 @@ InvoicingDescription=Popis
|
||||
InvoicingInvoiced=Fakturováno
|
||||
InvoicingApplicant=Žadatel
|
||||
|
||||
InvoicingMaterial=Fakturace požadavků na materiál
|
||||
InvoicingServices=Fakturace požadavků na servis
|
||||
|
||||
HandleComboKeyFilter=#del
|
||||
HandleComboKey=$#del
|
||||
|
||||
@@ -416,3 +428,6 @@ ErrFillTripBillResultTimes = Zadejte časy odjezdu a příjezdu.
|
||||
ErrApproveMustBeSigned = Schválení musí být digitálně podepsané.
|
||||
DigitalSignature = Elektronický podpis
|
||||
ContextMenu = Volby v kontextovém menu
|
||||
|
||||
ErrMaterialOrServiceDescription=Zadejte popis požadavku.
|
||||
|
||||
|
||||
Binary file not shown.
@@ -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">
|
||||
<property name="ireport.zoom" value="1.5"/>
|
||||
<property name="ireport.x" value="0"/>
|
||||
<property name="ireport.y" value="396"/>
|
||||
<property name="ireport.y" value="0"/>
|
||||
<parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false">
|
||||
<defaultValueExpression><![CDATA["./"]]></defaultValueExpression>
|
||||
</parameter>
|
||||
@@ -230,13 +230,6 @@ tuzemské pracovní cesty]]></text>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$P{P_MAIN_ADDRESS}]]></textFieldExpression>
|
||||
</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>
|
||||
</pageHeader>
|
||||
<detail>
|
||||
@@ -356,12 +349,6 @@ tuzemské pracovní cesty]]></text>
|
||||
<textElement textAlignment="Center" verticalAlignment="Middle"/>
|
||||
<text><![CDATA[Doplatek - přeplatek]]></text>
|
||||
</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>
|
||||
<reportElement uuid="c200a476-63ba-4c3d-8e17-298b5928b0dd" x="1" y="76" width="240" height="15"/>
|
||||
<textElement>
|
||||
@@ -417,12 +404,6 @@ tuzemské pracovní cesty]]></text>
|
||||
</detail>
|
||||
<summary>
|
||||
<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>
|
||||
<reportElement uuid="58e4cf15-a8e1-4b4d-b491-ad4a1825f0a3" x="281" y="5" width="30" height="15"/>
|
||||
<textElement/>
|
||||
@@ -556,13 +537,6 @@ tuzemské pracovní cesty]]></text>
|
||||
<line>
|
||||
<reportElement uuid="5e5a7c99-962e-4c99-b3ba-dbed5315f5aa" x="-1" y="-2" width="1" height="195"/>
|
||||
</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>
|
||||
<reportElement uuid="4aca1ec1-c2dc-47b9-a973-40ded5f52d29" x="260" y="103" width="290" height="20"/>
|
||||
<textElement/>
|
||||
@@ -575,6 +549,13 @@ tuzemské pracovní cesty]]></text>
|
||||
<valueExpression><![CDATA[2]]></valueExpression>
|
||||
</genericElementParameter>
|
||||
</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>
|
||||
</summary>
|
||||
</jasperReport>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,3 +1,3 @@
|
||||
storage.root=/home/pepa/tmp/isspst
|
||||
storage.fulltextIndex=/home/pepa/tmp/isspst
|
||||
storage.signedDocuments=/home/pepa/tmp/isspst/signedDoc
|
||||
storage.root=~/tmp/isspst
|
||||
storage.fulltextIndex=~/tmp/isspst
|
||||
storage.signedDocuments=~/tmp/isspst/signedDoc
|
||||
@@ -11,6 +11,7 @@
|
||||
<hbox width="100%" vflex="1">
|
||||
<listbox model="@load(vm.dataList)"
|
||||
selectedItem="@bind(vm.dataBean)"
|
||||
itemRenderer="@load(vm.itemRenderer)"
|
||||
width="650px"
|
||||
vflex="1">
|
||||
<listhead menupopup="auto">
|
||||
|
||||
@@ -59,7 +59,8 @@
|
||||
maxlength="@load(vm.lengthText)"
|
||||
width="300px" />
|
||||
<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)"
|
||||
itemRenderer="@load(vm.userItemRenderer)">
|
||||
<listhead>
|
||||
<listheader label="Uživatelé" sort="czech(fullName)"/>
|
||||
</listhead>
|
||||
@@ -82,6 +83,7 @@
|
||||
<listbox id="@load(each.authority)"
|
||||
model="@bind(vm.dataBean.members)" height="200px" width="290px"
|
||||
multiple="true" droppable="true"
|
||||
itemRenderer="@load(vm.itemRenderer)"
|
||||
onDrop="@command('addMember', event=event)">
|
||||
<!-- <listhead>
|
||||
<listheader label="@load(each.description)" sort="czech(fullName)"/>
|
||||
|
||||
@@ -38,8 +38,14 @@
|
||||
<menuseparator/>
|
||||
<menuitem
|
||||
image="/img/invoicing-016.png"
|
||||
label="${labels.Invoicing}"
|
||||
href="/main/invoicing/"
|
||||
label="${labels.InvoicingMaterial}"
|
||||
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')}"
|
||||
visible="${module:isActive('INVOICING') }" />
|
||||
</menupopup>
|
||||
|
||||
@@ -51,6 +51,6 @@
|
||||
<div id="mainData">
|
||||
<u:include src="${gridZul}" />
|
||||
</div>
|
||||
<div id="footer"> Verze 2.0 </div>
|
||||
<div id="footer"> Verze 3.1 </div>
|
||||
</div>
|
||||
</html>
|
||||
@@ -89,3 +89,7 @@
|
||||
.req-select-approved-project {
|
||||
background-color: #87cefa !important;
|
||||
}
|
||||
|
||||
.user-disabled {
|
||||
background-color: #fff2dd !important;
|
||||
}
|
||||
|
||||
@@ -1,216 +1,129 @@
|
||||
<?page 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.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
|
||||
vflex="1"
|
||||
hflex="60"
|
||||
selectedItem="@bind(vm.dataBean)"
|
||||
onSelect="@command('onChangeSelectSignedDocs', ctrl=self)"
|
||||
model="@load(vm.dataList)">
|
||||
<listhead menupopup="auto">
|
||||
<listheader
|
||||
hflex="7"
|
||||
sort="czech(agendaName)"
|
||||
label="${labels.AgendaName}" />
|
||||
<listheader
|
||||
hflex="4"
|
||||
sort="czech(numser)"
|
||||
label="${labels.number}" />
|
||||
<listheader
|
||||
hflex="20"
|
||||
sort="czech(description)"
|
||||
label="${labels.OrderFormDescription}" />
|
||||
<listheader
|
||||
hflex="5"
|
||||
onCreate="self.sort(false)"
|
||||
sort="auto(signDate)"
|
||||
label="${labels.SigningDate}" />
|
||||
</listhead>
|
||||
<auxhead visible="@load(vm.filter)">
|
||||
<auxheader>
|
||||
<div sclass="find-grid-cell">
|
||||
<div sclass="find-grid-divtextbox">
|
||||
<textbox
|
||||
value="@bind(vm.filterTemplate.agendaName)"
|
||||
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.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">
|
||||
<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>
|
||||
<auxheader>
|
||||
<div sclass="find-grid-cell">
|
||||
<div sclass="find-grid-divtextbox">
|
||||
<datebox
|
||||
value="@bind(vm.filterTemplate.signDate)"
|
||||
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.agendaName)" />
|
||||
<listcell label="@load(each.numser)" />
|
||||
<listcell label="@load(each.description)" />
|
||||
<listcell label="@load(each.signDate) @converter('formatedDate', format=labels.DateFormat)" />
|
||||
</listitem>
|
||||
</template>
|
||||
</listbox>
|
||||
<listbox
|
||||
vflex="1"
|
||||
hflex="40"
|
||||
selectedItem="@bind(vm.signedDocumentItem)"
|
||||
model="@load(vm.signedDocumentItems)">
|
||||
<listhead menupopup="auto">
|
||||
<listheader
|
||||
hflex="2"
|
||||
sort="czech(actualReportName)"
|
||||
label="${labels.PrintReports}" />
|
||||
<listheader
|
||||
hflex="3"
|
||||
sort="czech(fileName)"
|
||||
label="${labels.FileName}" />
|
||||
<listheader
|
||||
hflex="1"/>
|
||||
</listhead>
|
||||
<template name="model">
|
||||
<listitem>
|
||||
<listcell label="@load(each.actualReportName)" />
|
||||
<listcell label="@load(each.fileName)" />
|
||||
<listcell>
|
||||
<button label="Otevřít" onClick="@command('onOpen', item = each)" sclass="nicebutton"/>
|
||||
</listcell>
|
||||
</listitem>
|
||||
</template>
|
||||
</listbox>
|
||||
</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>
|
||||
|
||||
<hlayout vflex="1">
|
||||
<listbox
|
||||
vflex="1"
|
||||
hflex="60"
|
||||
selectedItem="@bind(vm.dataBean)"
|
||||
onSelect="@command('onChangeSelectSignedDocs', ctrl=self)"
|
||||
model="@load(vm.dataList)">
|
||||
<listhead menupopup="auto">
|
||||
<listheader
|
||||
hflex="7"
|
||||
sort="czech(agendaName)"
|
||||
label="${labels.AgendaName}" />
|
||||
<listheader
|
||||
hflex="4"
|
||||
sort="czech(numser)"
|
||||
label="${labels.number}" />
|
||||
<listheader
|
||||
hflex="20"
|
||||
sort="czech(description)"
|
||||
label="${labels.OrderFormDescription}" />
|
||||
<listheader
|
||||
hflex="5"
|
||||
onCreate="self.sort(false)"
|
||||
sort="auto(signDate)"
|
||||
label="${labels.SigningDate}" />
|
||||
</listhead>
|
||||
<auxhead visible="@load(vm.filter)">
|
||||
<auxheader>
|
||||
<div sclass="find-grid-cell">
|
||||
<div sclass="find-grid-divtextbox">
|
||||
<textbox
|
||||
value="@bind(vm.filterTemplate.agendaName)"
|
||||
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.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">
|
||||
<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>
|
||||
<auxheader>
|
||||
<div sclass="find-grid-cell">
|
||||
<div sclass="find-grid-divtextbox">
|
||||
<datebox
|
||||
value="@bind(vm.filterTemplate.signDate)"
|
||||
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.agendaName)" />
|
||||
<listcell label="@load(each.numser)" />
|
||||
<listcell label="@load(each.description)" />
|
||||
<listcell label="@load(each.signDate) @converter('formatedDate', format=labels.DateFormat)" />
|
||||
</listitem>
|
||||
</template>
|
||||
</listbox>
|
||||
<listbox
|
||||
vflex="1"
|
||||
hflex="40"
|
||||
selectedItem="@bind(vm.signedDocumentItem)"
|
||||
model="@load(vm.signedDocumentItems)">
|
||||
<listhead menupopup="auto">
|
||||
<listheader
|
||||
hflex="2"
|
||||
sort="czech(actualReportName)"
|
||||
label="${labels.PrintReports}" />
|
||||
<listheader
|
||||
hflex="3"
|
||||
sort="czech(fileName)"
|
||||
label="${labels.FileName}" />
|
||||
<listheader hflex="1" />
|
||||
</listhead>
|
||||
<template name="model">
|
||||
<listitem>
|
||||
<listcell label="@load(each.actualReportName)" />
|
||||
<listcell label="@load(each.fileName)" />
|
||||
<listcell>
|
||||
<button
|
||||
label="Otevřít"
|
||||
onClick="@command('onOpen', item = each)"
|
||||
sclass="nicebutton" />
|
||||
</listcell>
|
||||
</listitem>
|
||||
</template>
|
||||
</listbox>
|
||||
</hlayout>
|
||||
|
||||
@@ -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>
|
||||
@@ -2,7 +2,7 @@
|
||||
<zk>
|
||||
|
||||
<zscript>
|
||||
String gridZul = "grid.zul";
|
||||
String gridZul = "setup.zul";
|
||||
</zscript>
|
||||
|
||||
<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
-1
@@ -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>
|
||||
|
||||
<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>
|
||||
+2
-2
@@ -4,10 +4,10 @@
|
||||
vflex="1"
|
||||
border="none"
|
||||
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
|
||||
vflex="1"
|
||||
src="/main/invoicing/invoicingGrid.zul" />
|
||||
src="/main/invoicing/shared/invoicingGrid.zul" />
|
||||
</window>
|
||||
</zk>
|
||||
+2
-2
@@ -4,10 +4,10 @@
|
||||
vflex="1"
|
||||
border="none"
|
||||
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
|
||||
vflex="1"
|
||||
src="/main/invoicing/invoicingGrid.zul" />
|
||||
src="/main/invoicing/shared/invoicingGrid.zul" />
|
||||
</window>
|
||||
</zk>
|
||||
+4
-4
@@ -2,8 +2,8 @@
|
||||
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
|
||||
<zk>
|
||||
<zscript>
|
||||
String gridPending = "/main/invoicing/invHeadListPending.zul";
|
||||
String gridArchive = "/main/invoicing/invHeadListArchive.zul";
|
||||
String gridPending = "/main/invoicing/material/invHeadListPending.zul";
|
||||
String gridArchive = "/main/invoicing/material/invHeadListArchive.zul";
|
||||
</zscript>
|
||||
<window
|
||||
vflex="1"
|
||||
@@ -11,9 +11,9 @@
|
||||
<caption
|
||||
src="/img/invoicing-032.png"
|
||||
zclass="form-caption"
|
||||
label="${labels.Invoicing}" />
|
||||
label="${labels.InvoicingMaterial}" />
|
||||
<include
|
||||
vflex="1"
|
||||
src="/main/invoicing/tabPanels.zul" />
|
||||
src="/main/invoicing/shared/tabPanels.zul" />
|
||||
</window>
|
||||
</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>
|
||||
<textbox
|
||||
id="description"
|
||||
id="idDescription"
|
||||
width="400px"
|
||||
rows="5"
|
||||
maxlength="@load(vm.lengthDescription)"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<zk>
|
||||
|
||||
<zscript>
|
||||
String gridZul = "tripBillGrid.zul";
|
||||
String gridZul = "setup.zul";
|
||||
</zscript>
|
||||
|
||||
<include src="/app/template.zhtml"/>
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<?page title="${labels.TravelOrdersFormTitle}" contentType="text/html;charset=UTF-8"?>
|
||||
|
||||
<zk xmlns="http://www.zkoss.org/2005/zul"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd">
|
||||
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
|
||||
|
||||
<window id="payWin" border="normal" apply="org.zkoss.bind.BindComposer"
|
||||
viewModel="@id('vm') @init('info.bukova.isspst.ui.tripbill.PayDialogVM')" width="320px" closable="true">
|
||||
<caption
|
||||
image="/img/invoicing-032.png"
|
||||
zclass="form-caption"
|
||||
label="${labels.TripBilling}" />
|
||||
|
||||
<vbox hflex="1">
|
||||
<hbox>
|
||||
<label value="${labels.TripBillPaidDate}:"/>
|
||||
<datebox
|
||||
instant="true"
|
||||
value="@bind(vm.payDate)"
|
||||
format="${labels.DateFormat}"/>
|
||||
</hbox>
|
||||
<separator bar="true" hflex="1"/>
|
||||
<hbox>
|
||||
<button image="/img/approve-016.png" label="${labels.Confirm}" onClick="@command('pay', window=payWin)" sclass="nicebutton" disabled="@load(empty vm.payDate)"/>
|
||||
<button image="~./zul/img/misc/drag-disallow.png" label="${labels.ButtonStorno}" onClick="payWin.detach()" sclass="nicebutton"/>
|
||||
</hbox>
|
||||
</vbox>
|
||||
|
||||
</window>
|
||||
|
||||
</zk>
|
||||
@@ -0,0 +1,21 @@
|
||||
<?page title="new page title" contentType="text/html;charset=UTF-8"?>
|
||||
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
|
||||
<zk>
|
||||
<zscript>
|
||||
String gridMy = "/main/trips/bill/tripBillGridMy.zul";
|
||||
String gridMyCenters = "/main/trips/bill/tripBillGridCenters.zul";
|
||||
String gridMyWorkgroups = "/main/trips/bill/tripBillGridWorkgroups.zul";
|
||||
String gridAll = "/main/trips/bill/tripBillGridAll.zul";
|
||||
</zscript>
|
||||
<window
|
||||
vflex="1"
|
||||
border="normal">
|
||||
<caption
|
||||
src="/img/pickup-032.png"
|
||||
zclass="form-caption"
|
||||
label="${labels.TravelOrders}" />
|
||||
<include
|
||||
vflex="1"
|
||||
src="/main/tabPanels.zul" />
|
||||
</window>
|
||||
</zk>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?page title="${labels.TravelOrders}" contentType="text/html;charset=UTF-8"?>
|
||||
<zk xmlns="http://www.zkoss.org/2005/zul"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd">
|
||||
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
|
||||
<window
|
||||
vflex="1"
|
||||
border="normal"
|
||||
apply="org.zkoss.bind.BindComposer"
|
||||
viewModel="@id('vm') @init('info.bukova.isspst.ui.tripbill.TripBillListAll')">
|
||||
<include src="../../toolbar.zul" />
|
||||
<include vflex="1" src="tripBillGridInt.zul"/>
|
||||
</window>
|
||||
</zk>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?page title="${labels.TravelOrders}" contentType="text/html;charset=UTF-8"?>
|
||||
<zk xmlns="http://www.zkoss.org/2005/zul"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd">
|
||||
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
|
||||
<window
|
||||
vflex="1"
|
||||
border="normal"
|
||||
apply="org.zkoss.bind.BindComposer"
|
||||
viewModel="@id('vm') @init('info.bukova.isspst.ui.tripbill.TripBillListCentre')">
|
||||
<include src="../../toolbar.zul" />
|
||||
<include vflex="1" src="tripBillGridInt.zul"/>
|
||||
</window>
|
||||
</zk>
|
||||
@@ -0,0 +1,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.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"/>
|
||||
<include src="../../approveStatus.zul" vflex="1"/>
|
||||
<button label="${labels.TripBillCancelApproval}" onClick="@command('cancelApproval')" sclass="nicebutton" disabled="@load(empty vm.dataBean)"/>
|
||||
</vbox>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user