v0.1.0
authorelgekko <vasary@elgekko.net>
Thu, 18 May 2023 21:51:59 +0000 (23:51 +0200)
committerelgekko <vasary@elgekko.net>
Thu, 18 May 2023 21:51:59 +0000 (23:51 +0200)
30 files changed:
TODO.txt
lis-app/pom.xml
lis-db/src/main/java/hu/user/lis/db/Project.java
lis-services/src/main/java/hu/user/lis/services/data/PartnerService.java
lis-services/src/main/java/hu/user/lis/services/data/ProjectServiceImpl.java
lis-services/src/main/java/hu/user/lis/services/data/ProjectStatusServiceImpl.java
lis-services/src/main/java/hu/user/lis/services/data/ServiceRecordServiceImpl.java
lis-services/src/main/java/hu/user/lis/services/data/TreasuryServiceImpl.java
lis-ui/src/main/java/hu/user/lis/ui/Constants.java
lis-ui/src/main/java/hu/user/lis/ui/converter/DoubleToStringConverter.java
lis-ui/src/main/java/hu/user/lis/ui/converter/ProjectStatusConverter.java [new file with mode: 0644]
lis-ui/src/main/java/hu/user/lis/ui/data/ProjectStatusDataModel.java
lis-ui/src/main/java/hu/user/lis/ui/data/ServiceRecordsDataModel.java
lis-ui/src/main/java/hu/user/lis/ui/editor/ProjectEditorModel.java
lis-ui/src/main/java/hu/user/lis/ui/event/EventBus.java
lis-ui/src/main/java/hu/user/lis/ui/view/AssociatesViewModel.java
lis-ui/src/main/java/hu/user/lis/ui/view/IndexViewModel.java
lis-ui/src/main/java/hu/user/lis/ui/view/PartnersViewModel.java
lis-ui/src/main/java/hu/user/lis/ui/view/ProjectsViewModel.java
lis-ui/src/main/java/hu/user/lis/ui/view/ServiceRecordsViewModel.java
lis-ui/src/main/java/hu/user/lis/ui/view/SettingsViewModel.java
lis-ui/src/main/resources/web/associate-filter.zul [new file with mode: 0644]
lis-ui/src/main/resources/web/index.zul
lis-ui/src/main/resources/web/project-editor.zul
lis-ui/src/main/resources/web/project-filter.zul [new file with mode: 0644]
lis-ui/src/main/resources/web/projects.zul
lis-ui/src/main/resources/web/service-record-editor.zul
lis-ui/src/main/resources/web/service-records.zul
lis-ui/src/main/resources/web/settings.zul
lis-ui/src/main/resources/web/static/css/webclient.css

index d8a843b5a9f1d425dfc483c38adf8b82db9c9518..bb936d96ab6f7829748708d88d544f7fad29a6d2 100644 (file)
--- a/TODO.txt
+++ b/TODO.txt
 * Munkalaphoz: Aláírt munkalap feltöltésének lehetősége. Feltöltéskor kerüljön át a státusz "aláírt"-ba.
 * Az oszlopszélesség minden listában állítható
 * Treasury műveletek mentésénél nullpointer exception jön
-- Munkalapon: "normális" elrendezés, nézzen ki jól
-- Minden szám: legyen jobbra igazítva, oszlop fejlécek pedig középen; mindenhol két tizedes pontossággal
-- Projekt: kell egy "státusz" mező:
-    Legyen rendszerparaméter, és egy lista amiből választani lehet és a sorrend is legyen változtatható a listaban,
-    (pl.: Új, Terv, Készül az ajánlat, Ajánlat kiküldve, Megrendelve, Számlázható, Kiszámlázva, Elbuktuk) de db-ből
-- Projektekhez: Legyen kicsit normálisabb elrendezésű.
-- Nem jól kalkulálódik az "óradíj" a munkalapon
-- A projektekhez valos treasury karolytol
-- A projektben a munkalap osszesitve jelenjen meg személyenként,de navigáljon el bontott nézetbe kattintásra
-- A munkalapok lista szűrhető projektre és résztvevőre. Ezt használjuk ki, amikor a projekt összevont nézetből a munkalap
- bontást szeretnénk látni
+* A projektekhez valos treasury karolytol
+* Projekt: kell egy "státusz" mező:
+    Legyen rendszerparaméter, és egy lista amiből választani lehet; a sorrend is legyen változtatható
+    (pl.: Új, Terv, Készül az ajánlat, Ajánlat kiküldve, Megrendelve, Számlázható, Kiszámlázva, Elbuktuk)
+* Nem jól kalkulálódik az "óradíj" a munkalapon
+* Minden szám: legyen jobbra igazítva, oszlop fejlécek pedig középen; mindenhol két tizedes pontossággal last 0
+    ez az oszlop fejlécre nem jön össze
+* A résztvevők az adatok tab helyett egy külön kinyitható panelban jelenjenek meg
+* Munkalap szerkesztő: ergonómikusabb elrendezés
+* Lista fejlécre duplán kattintva NullPointerException-t dob
+* A munkalapok lista szűrhető projektre és résztvevőre. Ezt használjuk ki, amikor a projekt összevont nézetből a munkalap bontást szeretnénk látni
+* A projektben a munkalap összesitve jelenjen meg személyenként, de navigáljon el bontott nézetbe kattintásra
+* Projekt szerkesztő: ergonómikusabb elrendezés
 - A projekt szerkesztés/részletezés tetején az adatok legyenek bal oldalon bekeretezve.
     A jobb oldalon pedig legyen látható a projekt árrése.
     Az árrés annyi sorból áll ahány devizanem van a projekt számláiban. Egy adott devizanem esetén a számolás:
@@ -55,6 +57,7 @@
 
 - Számla kiegyenlítés
 
+- droppable="head" draggable="head" https://zkfiddle.org/sample/4k499d/1-Reorder-Columns-in-Listbox#source-2
 - Minden kívülről leszipkázható adat jöjjön módosítható legyen REST API-n: szla kiegyenlítés, bejövő/kimenő számlák, munkalap
     Ez emiatt kell, a szinkronizációt egy külső app végzi?
 - Autentikáció: AD és helyi
index f33aa886d37bfff07f2b5c012c74a94e7561d85f..e4b474469ed1313510056fa1ed2b5057254b3e69 100644 (file)
@@ -4,7 +4,7 @@
     <modelVersion>4.0.0</modelVersion>
     <groupId>hu.user</groupId>
     <artifactId>lis-app</artifactId>
-    <version>0.0.9-SNAPSHOT</version>
+    <version>0.1.0-SNAPSHOT</version>
     <parent>
         <groupId>hu.user</groupId>
         <artifactId>lis</artifactId>
index 222b127c63b1bdb9b47b9d442cf75ac366dc4b41..84a4a9971aa92f26f934a5c432449dd900e85253 100644 (file)
@@ -11,6 +11,7 @@ import java.util.List;
 @NoArgsConstructor
 public class Project {
     String id;
+    String projectStatusId;
     String name;
     String humanId;
     String contactName;
index 84301235b0864b2bb70cd1f43a97afa55eabe8e4..faa1783c586243b135dee752f2802800056e831d 100644 (file)
@@ -14,7 +14,7 @@ public interface PartnerService {
 
     Partner getById(String id);
 
-    Partner copy(Partner sourceEntity) throws JsonProcessingException;
+    Partner copy(Partner sourceEntity);
 
     void replace(Partner targetEntity, Partner replacementEntity);
 
index 7738e7d85e91db2a25f26f3abd4800834de52fda..cdd557eaf5f7eac8a6e35621dcb58a5d4292a13e 100644 (file)
@@ -27,6 +27,8 @@ public class ProjectServiceImpl extends DataServiceImpl<Project> implements Proj
     InvoiceService invoiceService;
     @Autowired
     TreasuryService treasuryService;
+    @Autowired
+    ProjectStatusService projectStatusService;
     private List<Project> entities;
 
     @Override
@@ -52,7 +54,9 @@ public class ProjectServiceImpl extends DataServiceImpl<Project> implements Proj
     public Project createNew() {
         String id = RandomStringUtils.random(8, "0123456789abcdef");
         String humanId = dataGeneratorService.faker().code().isbn13(true);
+        String projectStatusId = projectStatusService.getAll().get(0).getId();
         return Project.builder()
+                .projectStatusId(projectStatusId)
                 .id(id)
                 .humanId(humanId)
                 .incomingInvoices(new ArrayList<>())
@@ -84,6 +88,7 @@ public class ProjectServiceImpl extends DataServiceImpl<Project> implements Proj
         DateFormat dateFormat = new SimpleDateFormat("yyyy");
         for (int i = 0; i < 20; i++) {
             String id = RandomStringUtils.random(8, "0123456789abcdef");
+            String projectStatusId = projectStatusService.getAll().get(0).getId();
             String name = dataGeneratorService.faker().commerce().productName();
             Date dt = dataGeneratorService.faker().date().past(i + 1, TimeUnit.DAYS);
             String humanId = String.format("%s-%s", dateFormat.format(dt), String.format("%04d", i));
@@ -91,6 +96,7 @@ public class ProjectServiceImpl extends DataServiceImpl<Project> implements Proj
             Partner partner = partnerService.getRandom();
             Project entity = Project.builder()
                     .id(id)
+                    .projectStatusId(projectStatusId)
                     .active(true)
                     .humanId(humanId)
                     .name(name)
@@ -98,7 +104,7 @@ public class ProjectServiceImpl extends DataServiceImpl<Project> implements Proj
                     .partner(partner)
                     .incomingInvoices(invoiceService.getRandom(true))
                     .outgoingInvoices(invoiceService.getRandom(false))
-                    .treasuries(treasuryService.getRandom())
+                    //.treasuries(treasuryService.getRandom())
                     .build();
             result.add(entity);
         }
@@ -109,12 +115,14 @@ public class ProjectServiceImpl extends DataServiceImpl<Project> implements Proj
         List<Project> result = new ArrayList<>();
 
         String id = dataGeneratorService.faker().code().isbn10(true);
+        String projectStatusId = projectStatusService.getAll().get(0).getId();
         String name = "IBM és HP diszkek szállítása régi szerverbe";
         String humanId = "2022-0027";
         String contactName = dataGeneratorService.faker().name().fullName();
         Partner partner = partnerService.getById("002");               // 002
         Project entity = Project.builder()
                 .id(id)
+                .projectStatusId(projectStatusId)
                 .active(true)
                 .humanId(humanId)
                 .name(name)
@@ -122,7 +130,7 @@ public class ProjectServiceImpl extends DataServiceImpl<Project> implements Proj
                 .partner(partner)
                 .incomingInvoices(invoiceService.getByHumanIds(new String[]{"VSz-2023/00070-"}))   // VSz-2023/00070-
                 .outgoingInvoices(invoiceService.getByHumanIds(new String[]{"USER-2023-7"}))  // USER-2023-7
-                .treasuries(treasuryService.getRandom())
+                //.treasuries(treasuryService.getRandom())
                 .build();
         result.add(entity);
 
@@ -133,6 +141,7 @@ public class ProjectServiceImpl extends DataServiceImpl<Project> implements Proj
         partner = partnerService.getById("007");                       // 007
         entity = Project.builder()
                 .id(id)
+                .projectStatusId(projectStatusId)
                 .active(true)
                 .humanId(humanId)
                 .name(name)
@@ -140,7 +149,7 @@ public class ProjectServiceImpl extends DataServiceImpl<Project> implements Proj
                 .partner(partner)
                 .incomingInvoices(invoiceService.getByHumanIds(new String[]{"582-SPI1003006-3021", "582-SPI003118", "582-SPI003680", "582-SPI003681", "582-SPI004090", "9090010764", "VSz-2021/00091"}))   // 582-SPI1003006-3021, 582-SPI003118, 582-SPI003680, 582-SPI003681, 582-SPI004090, 9090010764, VSz-2021/00091
                 .outgoingInvoices(invoiceService.getByHumanIds(new String[]{"2021/0001", "2021/0069"}))  // 2021/0001, 2021/0069
-                .treasuries(treasuryService.getRandom())
+                //.treasuries(treasuryService.getRandom())
                 .build();
         result.add(entity);
 
@@ -151,14 +160,15 @@ public class ProjectServiceImpl extends DataServiceImpl<Project> implements Proj
         partner = partnerService.getById("017");                       // 017
         entity = Project.builder()
                 .id(id)
+                .projectStatusId(projectStatusId)
                 .active(true)
                 .humanId(humanId)
                 .name(name)
                 .contactName(contactName)
                 .partner(partner)
-                .incomingInvoices(invoiceService.getByHumanIds(new String[]{"EURSZLA0177/2022","19044","9171058452","9171058628","2022-SOV/000495","2022-SOV/000496","E-SYMPR-2022-105"}))   // EURSZLA0177/2022, 19044, 9171058452, 9171058628, V-SZ3-2022/00001, 2022-SOV/000495, 2022-SOV/000496, E-SYMPR-2022-105
-                .outgoingInvoices(invoiceService.getByHumanIds(new String[]{"E-USER-2023-12","E-USER-2023-13"}))  // E-USER-2023-12, E-USER-2023-13
-                .treasuries(treasuryService.getByHumanIds(new String[]{"001","002","003","004","005","006","007","008","009","010","011"}))
+                .incomingInvoices(invoiceService.getByHumanIds(new String[]{"EURSZLA0177/2022", "19044", "9171058452", "9171058628", "2022-SOV/000495", "2022-SOV/000496", "E-SYMPR-2022-105"}))   // EURSZLA0177/2022, 19044, 9171058452, 9171058628, V-SZ3-2022/00001, 2022-SOV/000495, 2022-SOV/000496, E-SYMPR-2022-105
+                .outgoingInvoices(invoiceService.getByHumanIds(new String[]{"E-USER-2023-12", "E-USER-2023-13"}))  // E-USER-2023-12, E-USER-2023-13
+                .treasuries(treasuryService.getByHumanIds(new String[]{"001", "002", "003", "004", "005", "006", "007", "008", "009", "010", "011"}))
                 .build();
         result.add(entity);
 
@@ -169,6 +179,7 @@ public class ProjectServiceImpl extends DataServiceImpl<Project> implements Proj
         partner = partnerService.getById("015");                       // 015
         entity = Project.builder()
                 .id(id)
+                .projectStatusId(projectStatusId)
                 .active(true)
                 .humanId(humanId)
                 .name(name)
@@ -176,7 +187,7 @@ public class ProjectServiceImpl extends DataServiceImpl<Project> implements Proj
                 .partner(partner)
                 .incomingInvoices(invoiceService.getByHumanIds(new String[]{"17356/23"}))   // 17356/23
                 .outgoingInvoices(invoiceService.getByHumanIds(new String[]{"E-USER-2023-53"}))  // E-USER-2023-53
-                .treasuries(treasuryService.getRandom())
+                //.treasuries(treasuryService.getRandom())
                 .build();
         result.add(entity);
 
@@ -187,6 +198,7 @@ public class ProjectServiceImpl extends DataServiceImpl<Project> implements Proj
         partner = partnerService.getById("016");                       // 016
         entity = Project.builder()
                 .id(id)
+                .projectStatusId(projectStatusId)
                 .active(true)
                 .humanId(humanId)
                 .name(name)
@@ -194,7 +206,7 @@ public class ProjectServiceImpl extends DataServiceImpl<Project> implements Proj
                 .partner(partner)
                 .incomingInvoices(invoiceService.getByHumanIds(new String[]{"2023-SOV/000123"}))   // 2023-SOV/000123
                 .outgoingInvoices(invoiceService.getByHumanIds(new String[]{"E-USER-2023-95"}))  // E-USER-2023-95
-                .treasuries(treasuryService.getByHumanIds(new String[]{"012","013"}))
+                .treasuries(treasuryService.getByHumanIds(new String[]{"012", "013"}))
                 .build();
         result.add(entity);
 
index 8c96ade942c4ae2f73c827ab31fbf466eb907041..2ee101c2e25682bed758f044ef1d6d90b350de3c 100644 (file)
@@ -33,7 +33,9 @@ public class ProjectStatusServiceImpl extends DataServiceImpl<ProjectStatus> imp
     @Override
     public ProjectStatus createNew() {
         String id = RandomStringUtils.random(8, "0123456789abcdef");
-        return ProjectStatus.builder().id(id).active(true).build();
+        ProjectStatus result = ProjectStatus.builder().id(id).active(true).order(entities.size() + 1).build();
+        entities.put(result.getId(), result);
+        return result;
     }
 
     @Override
@@ -55,8 +57,8 @@ public class ProjectStatusServiceImpl extends DataServiceImpl<ProjectStatus> imp
         ProjectStatus entity = ProjectStatus.builder()
                 .active(true)
                 .id(RandomStringUtils.random(8, "0123456789abcdef"))
-                .name("Új")
-                .order(entities.size())
+                .name(name)
+                .order(entities.size() + 1)
                 .build();
         entities.put(entity.getId(), entity);
     }
index 61f16e4979c1cc9ef6dc19859030477acf4c52bb..b278322ffc11dc078b46e8c5e578e3ec471daf55 100644 (file)
@@ -11,7 +11,6 @@ import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
 import java.util.Date;
-import java.util.HashMap;
 import java.util.List;
 import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
@@ -25,7 +24,6 @@ public class ServiceRecordServiceImpl extends DataServiceImpl<ServiceRecord> imp
     ProjectService projectService;
     @Autowired
     AssociateService associateService;
-    private HashMap<String, ServiceRecord> projectRecords = new HashMap<>();
     private List<ServiceRecord> entities;
 
     @Override
@@ -71,7 +69,7 @@ public class ServiceRecordServiceImpl extends DataServiceImpl<ServiceRecord> imp
     public void calculateCost(ServiceRecord entity) {
         double cost = 0;
         try {
-            cost = entity.getAssociate().getMonthlyCost() * entity.getWorkHours() / 21;
+            cost = (entity.getAssociate().getMonthlyCost() * entity.getWorkHours()) / (21 * 8);
             entity.setCost(cost);
         } catch (Exception e) {
             log.catching(e);
@@ -106,7 +104,20 @@ public class ServiceRecordServiceImpl extends DataServiceImpl<ServiceRecord> imp
                         .build();
                 calculateCost(entity);
                 result.add(entity);
-                projectRecords.put(p.getId(), entity);
+
+                id = RandomStringUtils.random(8, "0123456789abcdef");
+                entity = ServiceRecord.builder()
+                        .associate(associate)
+                        .project(p)
+                        .workDay(workDay)
+                        .workHours(workHours)
+                        .description(description)
+                        .id(id)
+                        .build();
+                calculateCost(entity);
+                result.add(entity);
+
+
             }
 
         });
index 221a6bc07d74edf674fd48476188daa8800cefcf..70fc5c3c7b9841493188ec685d48a123d807de10 100644 (file)
@@ -2,7 +2,6 @@ package hu.user.lis.services.data;
 
 import com.fasterxml.jackson.databind.ObjectMapper;
 import hu.user.lis.db.Currency;
-import hu.user.lis.db.Invoice;
 import hu.user.lis.db.Treasury;
 import lombok.extern.log4j.Log4j2;
 import org.apache.commons.lang3.RandomStringUtils;
@@ -84,25 +83,25 @@ public class TreasuryServiceImpl extends DataServiceImpl<Treasury> implements Tr
         List<Treasury> result = new ArrayList<>();
         SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
 
-            String id = RandomStringUtils.random(8, "0123456789abcdef");
-            String humanId = "001";
-            Date transactionDate = formatter.parse("2023-01-09");
-            Date valueDate = formatter.parse("2023-01-09");
-            Currency buyCurrency = Currency.EUR;
-            Currency sellCurrency = Currency.EUR;
-            double buyAmount = 12065.0;
-            double sellAmount = 0.0;
-            Treasury entity = Treasury.builder()
-                    .id(id)
-                    .humanId(humanId)
-                    .buyCurrency(buyCurrency)
-                    .sellCurrency(sellCurrency)
-                    .transactionDate(transactionDate)
-                    .valueDate(valueDate)
-                    .buyAmount(buyAmount)
-                    .sellAmount(sellAmount)
-                    .build();
-            result.add(entity);
+        String id = RandomStringUtils.random(8, "0123456789abcdef");
+        String humanId = "001";
+        Date transactionDate = formatter.parse("2023-01-09");
+        Date valueDate = formatter.parse("2023-01-09");
+        Currency buyCurrency = Currency.EUR;
+        Currency sellCurrency = Currency.EUR;
+        double buyAmount = 12065.0;
+        double sellAmount = 0.0;
+        Treasury entity = Treasury.builder()
+                .id(id)
+                .humanId(humanId)
+                .buyCurrency(buyCurrency)
+                .sellCurrency(sellCurrency)
+                .transactionDate(transactionDate)
+                .valueDate(valueDate)
+                .buyAmount(buyAmount)
+                .sellAmount(sellAmount)
+                .build();
+        result.add(entity);
 
         id = RandomStringUtils.random(8, "0123456789abcdef");
         humanId = "002";
@@ -355,7 +354,7 @@ public class TreasuryServiceImpl extends DataServiceImpl<Treasury> implements Tr
         for (int i = 0; i < count; i++) {
             int index = RandomUtils.nextInt(0, getAll().size());
             result.add(getAll().get(index));
-            getAll().remove(index);
+            //getAll().remove(index);
         }
         return result;
     }
index 4294b189a22472c8d5a26371aec7ddef662b40ad..0b44f1e56181a16effd684f1965abe2ccb189135 100644 (file)
@@ -3,6 +3,8 @@ package hu.user.lis.ui;
 public class Constants {
     public static final String SHOW_PROJECT_EDITOR = "SHOW_PROJECT_EDITOR";
     public static final String SHOW_PROJECTS_LIST = "SHOW_PROJECTS_LIST";
+    public static final String SHOW_SERVICE_RECORDS_LIST = "SHOW_SERVICE_RECORDS_LIST";
+    public static final String SET_SERVICE_RECORDS_LIST_DATA = "SET_SERVICE_RECORDS_LIST_DATA";
     public static final String SET_PROJECT_EDITOR_DATA = "SET_PROJECT_EDITOR_DATA";
     public static final String SET_PROJECTS_LIST_DATA = "SET_PROJECTS_LIST_DATA";
     public static final String PROJECT_EDITOR_QUEUE = "PROJECT_EDITOR_QUEUE";
index 1656f1350b50408c8e612eb96561aae20ec0222c..dd5a98ceafe99af0060469e487496893bf7f4108 100644 (file)
@@ -13,6 +13,7 @@ public class DoubleToStringConverter implements Converter<String, Double, Listce
 
     static {
         nf.setMaximumFractionDigits(2);
+        nf.setMinimumFractionDigits(2);
         nf.setRoundingMode(RoundingMode.CEILING);
     }
 
diff --git a/lis-ui/src/main/java/hu/user/lis/ui/converter/ProjectStatusConverter.java b/lis-ui/src/main/java/hu/user/lis/ui/converter/ProjectStatusConverter.java
new file mode 100644 (file)
index 0000000..c5bba74
--- /dev/null
@@ -0,0 +1,36 @@
+package hu.user.lis.ui.converter;
+
+import hu.user.lis.db.ProjectStatus;
+import hu.user.lis.services.data.ProjectStatusService;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.zkoss.bind.BindContext;
+import org.zkoss.bind.Converter;
+import org.zkoss.zul.ListModel;
+import org.zkoss.zul.Selectbox;
+import org.zkoss.zul.ext.Selectable;
+
+@Component
+public class ProjectStatusConverter implements Converter<Object, String, Selectbox> {
+    @Autowired
+    ProjectStatusService projectStatusService;
+
+    @Override
+    public Object coerceToUi(String id, Selectbox box, BindContext bindContext) {
+        if (StringUtils.isBlank(id)) {
+            return IGNORED_VALUE;
+        }
+        ProjectStatus projectStatus = projectStatusService.getById(id);
+        final ListModel<?> model = box.getModel();
+        ((Selectable<Object>) model).clearSelection();
+        ((Selectable<Object>) model).addToSelection(projectStatus);
+        return IGNORED_VALUE;
+    }
+
+    @Override
+    public String coerceToBean(Object order, Selectbox bandbox, BindContext bindContext) {
+        ProjectStatus projectStatus = projectStatusService.getAll().get((Integer) order);
+        return projectStatus.getId();
+    }
+}
\ No newline at end of file
index fdaa832c465f45f713929e8ee82c69f5177e112f..745337ed7f9a8d5f8af67779163cc23464eef35f 100644 (file)
@@ -36,4 +36,29 @@ public class ProjectStatusDataModel extends CachedDataModel<ProjectStatus> {
         BindUtils.postNotifyChange(null, null, this, "*");
     }
 
+    public void moveUp(ProjectStatus entity) {
+        projectStatusService.getAll().stream().anyMatch(s -> {
+            if (s.getOrder() == entity.getOrder() + 1) {
+                s.setOrder(s.getOrder() - 1);
+                entity.setOrder(entity.getOrder() + 1);
+                return true;
+            }
+            return false;
+        });
+    }
+
+    public void moveDown(ProjectStatus entity) {
+        projectStatusService.getAll().stream().anyMatch(s -> {
+            if (s.getOrder() == entity.getOrder() - 1) {
+                s.setOrder(s.getOrder() + 1);
+                entity.setOrder(entity.getOrder() - 1);
+                return true;
+            }
+            return false;
+        });
+    }
+
+    public void append() {
+        projectStatusService.createNew();
+    }
 }
index 4063d5b6c96c57a10031a4567d502df832b4d325..f5d437774326afc67efc631e593ebffee0a9e430 100644 (file)
@@ -1,10 +1,11 @@
 package hu.user.lis.ui.data;
 
+import hu.user.lis.db.Associate;
+import hu.user.lis.db.Project;
 import hu.user.lis.db.ServiceRecord;
 import hu.user.lis.services.data.ServiceRecordService;
 import lombok.Getter;
 import lombok.extern.log4j.Log4j2;
-import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.config.ConfigurableBeanFactory;
 import org.springframework.context.annotation.Scope;
@@ -14,8 +15,10 @@ import org.zkoss.bind.annotation.Init;
 import org.zkoss.zk.ui.util.Clients;
 import org.zkoss.zul.FieldComparator;
 
-import java.util.Comparator;
-import java.util.List;
+import java.util.*;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Function;
+import java.util.function.Predicate;
 import java.util.stream.Collectors;
 
 @Component
@@ -26,7 +29,14 @@ public class ServiceRecordsDataModel extends CachedDataModel<ServiceRecord> {
     @Autowired
     ServiceRecordService serviceRecordService;
     private boolean listAll;
-    private String projectId;
+    private Project filterProject;
+    private Associate filterAssociate;
+    private boolean groupByAssociate;
+
+    public static <T> Predicate<T> distinctByKey(Function<? super T, Object> keyExtractor) {
+        Map<Object, Boolean> map = new ConcurrentHashMap<>();
+        return t -> map.putIfAbsent(keyExtractor.apply(t), Boolean.TRUE) == null;
+    }
 
     @Init
     public void init() {
@@ -35,7 +45,7 @@ public class ServiceRecordsDataModel extends CachedDataModel<ServiceRecord> {
     }
 
     private boolean canExecuteSearch() {
-        boolean result = listAll || !StringUtils.isBlank(projectId);
+        boolean result = listAll || Objects.nonNull(filterProject) || Objects.nonNull(filterAssociate);
         log.info("Can execute search: {}", result);
         return result;
     }
@@ -45,10 +55,16 @@ public class ServiceRecordsDataModel extends CachedDataModel<ServiceRecord> {
             return true;
         }
         boolean result = true;
-        if (!entity.getProject().getId().equals(projectId)) {
-            result = false;
+        if (Objects.nonNull(filterProject)) {
+            if (!entity.getProject().getId().equals(filterProject.getId())) {
+                result = false;
+            }
+        }
+        if (Objects.nonNull(filterAssociate)) {
+            if (!entity.getAssociate().getId().equals(filterAssociate.getId())) {
+                result = false;
+            }
         }
-
         return result;
     }
 
@@ -56,21 +72,48 @@ public class ServiceRecordsDataModel extends CachedDataModel<ServiceRecord> {
     protected List<ServiceRecord> getResultSet(long offset, int limit, FieldComparator sortComparator) {
         List<ServiceRecord> result = null;
         if (canExecuteSearch()) {
-            result = serviceRecordService.getAll().stream()
-                    .filter(s -> filter(s))
-                    .sorted(Comparator.comparing(ServiceRecord::getWorkDay))
-                    .collect(Collectors.toList());
+            if (groupByAssociate) {
+                result = getGroupedServiceRecords().values().stream().collect(Collectors.toList());
+            } else {
+                result = serviceRecordService.getAll().stream()
+                        .filter(s -> filter(s))
+                        .sorted(Comparator.comparing(ServiceRecord::getWorkDay))
+                        .collect(Collectors.toList());
+            }
         }
         return result;
     }
 
+    Map<String, ServiceRecord> getGroupedServiceRecords() {
+        Map<String, ServiceRecord> grouped = new HashMap<>();
+
+        serviceRecordService.getAll().stream().filter(s -> filter(s)).forEach(s -> {
+            if (grouped.containsKey(s.getAssociate().getId())) {
+                ServiceRecord serviceRecord = grouped.get(s.getAssociate().getId());
+                serviceRecord.setCost(serviceRecord.getCost() + s.getCost());
+                serviceRecord.setWorkHours(serviceRecord.getWorkHours() + s.getWorkHours());
+            } else {
+                ServiceRecord serviceRecord = serviceRecordService.copy(s);
+                serviceRecord.setWorkDay(null);
+                grouped.put(serviceRecord.getAssociate().getId(), serviceRecord);
+            }
+        });
+        return grouped;
+    }
+
     @Override
     public int getResultSetCount() {
         int result = 0;
         if (canExecuteSearch()) {
-            result = (int) serviceRecordService.getAll().stream()
-                    .filter(s -> filter(s))
-                    .count();
+
+            if (groupByAssociate) {
+                Map<String, ServiceRecord> grouped = getGroupedServiceRecords();
+                result = grouped.size();
+            } else {
+                result = (int) serviceRecordService.getAll().stream()
+                        .filter(s -> filter(s))
+                        .count();
+            }
         }
         return result;
     }
@@ -82,9 +125,19 @@ public class ServiceRecordsDataModel extends CachedDataModel<ServiceRecord> {
         BindUtils.postNotifyChange(null, null, this, "*");
     }
 
-    public void search(String projectId) {
-        log.info("Searching project using filter {}", projectId);
-        this.projectId = projectId;
+    public void search(Project project, boolean groupByAssociate) {
+        log.info("Searching project using filter {} grouping {}", project, groupByAssociate);
+        this.groupByAssociate = groupByAssociate;
+        this.filterProject = project;
+        listAll = false;
+        super.reset();
+        BindUtils.postNotifyChange(null, null, this, "*");
+    }
+
+    public void search(Project project, Associate associate) {
+        log.info("Searching project using filter {} {}", project, associate);
+        this.filterAssociate = associate;
+        this.filterProject = project;
         listAll = false;
         super.reset();
         BindUtils.postNotifyChange(null, null, this, "*");
index df6b8f15a71f3eab30f58cf8a672db5c2a23b34e..e89a529a83256638f351807cd8d0ced599ef75d4 100644 (file)
@@ -8,8 +8,10 @@ import hu.user.lis.db.Project;
 import hu.user.lis.db.Treasury;
 import hu.user.lis.services.data.*;
 import hu.user.lis.ui.Constants;
+import hu.user.lis.ui.converter.ProjectStatusConverter;
 import hu.user.lis.ui.data.AssociatesDataModel;
 import hu.user.lis.ui.data.PartnerSelectorDataModel;
+import hu.user.lis.ui.data.ProjectStatusDataModel;
 import hu.user.lis.ui.data.ServiceRecordsDataModel;
 import hu.user.lis.ui.event.EventBus;
 import lombok.Getter;
@@ -57,24 +59,26 @@ public class ProjectEditorModel extends AbstractValidator implements EventListen
     private InvoiceService invoiceServiceImpl;
     @WireVariable
     private ProjectService projectServiceImpl;
-
     @WireVariable
     private TreasuryService treasuryServiceImpl;
-
     @WireVariable
     private ServiceRecordsDataModel serviceRecordsDataModel;
     @WireVariable
+    private ProjectStatusDataModel projectStatusDataModel;
+    @WireVariable
+    private ProjectStatusConverter projectStatusConverter;
+    @WireVariable
     private EventBus eventBus;
     private boolean formInvalid = true;
     private Invoice selectedIncomingInvoice;
     private Invoice selectedOutgoingInvoice;
-
     private Treasury selectedTreasury;
     private String partialAssociateName;
 
     @Init
     public void init() {
         eventBus.register(this);
+        projectStatusDataModel.listAll();
         log.info("Initialized");
     }
 
@@ -344,16 +348,15 @@ public class ProjectEditorModel extends AbstractValidator implements EventListen
             Map<String, Object> data = (Map<String, Object>) evt.getData();
             origDocument = (Project) data.get("origDocument");
             formDocument = (Project) data.get("formDocument");
-            BindUtils.postNotifyChange(this, "formDocument");
+            serviceRecordsDataModel.search(formDocument, true);
             associatesDataModel.listAll();
-
-            serviceRecordsDataModel.search(formDocument.getId());
+            BindUtils.postNotifyChange(this, "formDocument");
         }
     }
 
     @Destroy
     public void onDestroy() {
-        log.info("Destroy {}");
+        log.info("Destroy {}", getClass().getSimpleName());
         eventBus.unregister(this);
     }
 
@@ -370,6 +373,12 @@ public class ProjectEditorModel extends AbstractValidator implements EventListen
         parentPanel.invalidate();
     }
 
+    @Command
+    public void showServiceRecords(@BindingParam("associate") Associate associate) {
+        log.info("showServiceRecords");
+        eventBus.showServiceRecordsList(ImmutableMap.of("filterAssociate", associate, "filterProject", formDocument));
+    }
+
     @Command
     @NotifyChange("formAssociates")
     public void onAfterRenderAssociates() {
index 52b22d207c7e392910e1f75d07f059ec1bd4e055..f09e70430f7df583c9e4c441f281d59a551a4b76 100644 (file)
@@ -31,6 +31,14 @@ public class EventBus {
         queue.publish(new Event(Constants.SHOW_PROJECT_EDITOR, null, data));
     }
 
+    public void showServiceRecordsList(Object data) {
+        queue.publish(new Event(Constants.SHOW_SERVICE_RECORDS_LIST, null, data));
+    }
+
+    public void setServiceRecordsListData(Object data) {
+        queue.publish(new Event(Constants.SET_SERVICE_RECORDS_LIST_DATA, null, data));
+    }
+
     public void setProjectEditorData(Object data) {
         queue.publish(new Event(Constants.SET_PROJECT_EDITOR_DATA, null, data));
     }
index a8abd65ca7105bd71284f55a8d42d626ec9326e0..91565310860e6f000ba78ff3263e1ac850cf6f47 100644 (file)
@@ -1,6 +1,5 @@
 package hu.user.lis.ui.view;
 
-import com.fasterxml.jackson.core.JsonProcessingException;
 import hu.user.lis.db.Associate;
 import hu.user.lis.ui.data.AssociatesDataModel;
 import lombok.Getter;
@@ -15,10 +14,7 @@ import org.zkoss.zk.ui.util.Clients;
 import org.zkoss.zkplus.spring.DelegatingVariableResolver;
 import org.zkoss.zul.Window;
 
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
 
 @Log4j2
 @VariableResolver(DelegatingVariableResolver.class)
@@ -95,7 +91,10 @@ public class AssociatesViewModel {
     }
 
     @Command
-    public void onEdit() throws JsonProcessingException {
+    public void onEdit() {
+        if (Objects.isNull(selectedEntity)) {
+            return;
+        }
         String page = "~./associate-editor.zul";
         Associate editEntity = associatesDataModel.getAssociateService().copy(selectedEntity);
         Map<String, Object> arg = new HashMap<>();
index 96c02c7bb98793c71f6ea2f1e84772596e8a90e1..912df2bbb7c3f0cb68a4d10fafafc1ee57d03081 100644 (file)
@@ -72,6 +72,10 @@ public class IndexViewModel implements EventListener {
 
     @Override
     public void onEvent(Event event) {
+        if (Constants.SHOW_SERVICE_RECORDS_LIST.equals(event.getName())) {
+            selectPage(SERVICE_RECORDS_LIST);
+            eventBus.setServiceRecordsListData(event.getData());
+        }
         if (Constants.SHOW_PROJECT_EDITOR.equals(event.getName())) {
             selectPage(PROJECT_EDITOR);
             eventBus.setProjectEditorData(event.getData());
index f96ced4204b015b0064233d1353ca4b57d6ebfce..35864f3faae1f3bdfe4812bee3f5e21fd8f07bd3 100644 (file)
@@ -1,6 +1,5 @@
 package hu.user.lis.ui.view;
 
-import com.fasterxml.jackson.core.JsonProcessingException;
 import hu.user.lis.db.Partner;
 import hu.user.lis.ui.data.PartnersDataModel;
 import lombok.Getter;
@@ -17,10 +16,7 @@ import org.zkoss.zkplus.spring.DelegatingVariableResolver;
 import org.zkoss.zul.Listbox;
 import org.zkoss.zul.Window;
 
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
 
 @Log4j2
 @VariableResolver(DelegatingVariableResolver.class)
@@ -108,7 +104,10 @@ public class PartnersViewModel extends AsyncBaseModel {
     }
 
     @Command
-    public void onEdit() throws JsonProcessingException {
+    public void onEdit() {
+        if (Objects.isNull(selectedPartner)) {
+            return;
+        }
         String page = "~./partner-editor.zul";
         Partner editEntity = partnersDataModel.getPartnerService().copy(selectedPartner);
         Map<String, Object> arg = new HashMap<>();
index ca3a44930fd75dbca2fcef58c2a710ca1debddbb..3a1afb3ac1f33b3c7687da81a9413f10c50f0179 100644 (file)
@@ -2,6 +2,8 @@ package hu.user.lis.ui.view;
 
 import com.google.common.collect.ImmutableMap;
 import hu.user.lis.db.Project;
+import hu.user.lis.db.ProjectStatus;
+import hu.user.lis.services.data.ProjectStatusService;
 import hu.user.lis.ui.Constants;
 import hu.user.lis.ui.data.ProjectsDataModel;
 import hu.user.lis.ui.event.EventBus;
@@ -18,6 +20,7 @@ import org.zkoss.zk.ui.util.Clients;
 import org.zkoss.zkplus.spring.DelegatingVariableResolver;
 
 import java.util.Map;
+import java.util.Objects;
 import java.util.Set;
 
 
@@ -29,6 +32,8 @@ public class ProjectsViewModel extends AsyncBaseModel implements EventListener {
     ProjectsDataModel projectsDataModel;
     @WireVariable
     EventBus eventBus;
+    @WireVariable
+    private ProjectStatusService projectStatusServiceImpl;
     @Getter
     private Project selectedProject;
     private boolean filterShowInActive;
@@ -49,6 +54,10 @@ public class ProjectsViewModel extends AsyncBaseModel implements EventListener {
         log.info("Initialized");
     }
 
+    public ProjectStatus getProjectStatus(String id) {
+        return projectStatusServiceImpl.getById(id);
+    }
+
     private void refresh() {
         projectsDataModel.clearSelection();
         selectedProject = null;
@@ -83,6 +92,9 @@ public class ProjectsViewModel extends AsyncBaseModel implements EventListener {
 
     @Command
     public void onEdit() {
+        if (Objects.isNull(selectedProject)) {
+            return;
+        }
         Project editEntity = projectsDataModel.getProjectService().copy(selectedProject);
         eventBus.showProjectEditor(ImmutableMap.of("origDocument", selectedProject, "formDocument", editEntity));
     }
index ac36317d22d7a5f943420ca493048626564912a4..06cefa5398b45bbb568a3e437f827173f1266a09 100644 (file)
@@ -1,15 +1,24 @@
 package hu.user.lis.ui.view;
 
 import com.google.common.collect.ImmutableMap;
+import hu.user.lis.db.Associate;
+import hu.user.lis.db.Project;
 import hu.user.lis.db.ServiceRecord;
+import hu.user.lis.ui.Constants;
+import hu.user.lis.ui.data.AssociateSelectorDataModel;
+import hu.user.lis.ui.data.ProjectSelectorDataModel;
 import hu.user.lis.ui.data.ServiceRecordsDataModel;
 import hu.user.lis.ui.event.EventBus;
 import lombok.Getter;
 import lombok.extern.log4j.Log4j2;
+import org.zkoss.bind.BindContext;
+import org.zkoss.bind.BindUtils;
 import org.zkoss.bind.annotation.*;
-import org.zkoss.zk.ui.Component;
 import org.zkoss.zk.ui.Executions;
-import org.zkoss.zk.ui.select.Selectors;
+import org.zkoss.zk.ui.event.Event;
+import org.zkoss.zk.ui.event.EventListener;
+import org.zkoss.zk.ui.event.InputEvent;
+import org.zkoss.zk.ui.event.OpenEvent;
 import org.zkoss.zk.ui.select.annotation.VariableResolver;
 import org.zkoss.zk.ui.select.annotation.WireVariable;
 import org.zkoss.zk.ui.util.Clients;
@@ -18,33 +27,67 @@ import org.zkoss.zul.Window;
 
 import java.util.Collections;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Set;
 
 
 @Log4j2
 @VariableResolver(DelegatingVariableResolver.class)
-public class ServiceRecordsViewModel {
+public class ServiceRecordsViewModel implements EventListener {
     @WireVariable
     @Getter
     ServiceRecordsDataModel serviceRecordsDataModel;
     @WireVariable
-    EventBus eventBus;
+    @Getter
+    private AssociateSelectorDataModel associateSelectorDataModel;
+    @WireVariable
+    @Getter
+    private ProjectSelectorDataModel projectSelectorDataModel;
     @Getter
     private ServiceRecord selectedEntity;
-
-    @AfterCompose
-    public void onAfterCompose(@ContextParam(ContextType.VIEW) Component view) {
-        Selectors.wireComponents(view, this, false);
-        Selectors.wireEventListeners(view, this);
-    }
+    @Getter
+    private Project filterProject;
+    @Getter
+    private Associate filterAssociate;
+    @WireVariable
+    private EventBus eventBus;
 
     @Init
     public void init() {
         Clients.evalJavaScript("pushNav('/service-records')");
+        eventBus.register(this);
         refresh();
         log.info("Initialized");
     }
 
+    @Command
+    public void onProjectFilterBandChanging(@ContextParam(ContextType.BIND_CONTEXT) BindContext ctx) {
+        InputEvent event = (InputEvent) ctx.getTriggerEvent();
+        log.info("onProjectFilterBandChanging: {}", event.getValue());
+        projectSelectorDataModel.search(event.getValue());
+    }
+
+    @Command
+    public void onProjectFilterBandOpen(@ContextParam(ContextType.BIND_CONTEXT) BindContext ctx) {
+        OpenEvent event = (OpenEvent) ctx.getTriggerEvent();
+        log.info("onProjectFilterBandOpen: {}", event.isOpen());
+        projectSelectorDataModel.search(null);
+    }
+
+    @Command
+    public void onAssociateFilterBandChanging(@ContextParam(ContextType.BIND_CONTEXT) BindContext ctx) {
+        InputEvent event = (InputEvent) ctx.getTriggerEvent();
+        log.info("onAssociateFilterBandChanging: {}", event.getValue());
+        associateSelectorDataModel.search(event.getValue());
+    }
+
+    @Command
+    public void onAssociateFilterBandOpen(@ContextParam(ContextType.BIND_CONTEXT) BindContext ctx) {
+        OpenEvent event = (OpenEvent) ctx.getTriggerEvent();
+        log.info("onAssociateFilterBandOpen: {}", event.isOpen());
+        associateSelectorDataModel.search(null);
+    }
+
     private void refresh() {
         serviceRecordsDataModel.clearSelection();
         selectedEntity = null;
@@ -88,6 +131,9 @@ public class ServiceRecordsViewModel {
 
     @Command
     public void onEdit() {
+        if (Objects.isNull(selectedEntity)) {
+            return;
+        }
         String page = "~./service-record-editor.zul";
         ServiceRecord editEntity = serviceRecordsDataModel.getServiceRecordService().copy(selectedEntity);
         Map<String, Object> arg = ImmutableMap.of("origDocument", selectedEntity, "formDocument", editEntity);
@@ -106,5 +152,38 @@ public class ServiceRecordsViewModel {
         editorWindow.doModal();
     }
 
+    public void setFilterProject(Project filterProject) {
+        this.filterProject = filterProject;
+        serviceRecordsDataModel.search(filterProject, filterAssociate);
+    }
+
+    public void setFilterAssociate(Associate filterAssociate) {
+        this.filterAssociate = filterAssociate;
+        serviceRecordsDataModel.search(filterProject, filterAssociate);
+    }
+
+    @Command
+    @NotifyChange({"filterProject", "filterAssociate"})
+    public void onClearFilters() {
+        filterAssociate = null;
+        filterProject = null;
+        serviceRecordsDataModel.listAll();
+    }
+
+    @Override
+    public void onEvent(Event evt) throws Exception {
+        if (Constants.SET_SERVICE_RECORDS_LIST_DATA.equals(evt.getName())) {
+            Map<String, Object> data = (Map<String, Object>) evt.getData();
+            filterAssociate = (Associate) data.get("filterAssociate");
+            filterProject = (Project) data.get("filterProject");
+            serviceRecordsDataModel.search(filterProject, filterAssociate);
+            BindUtils.postNotifyChange(this, "filterProject", "filterAssociate");
+        }
+    }
 
+    @Destroy
+    public void onDestroy() {
+        log.info("Destroy {}", getClass().getSimpleName());
+        eventBus.unregister(this);
+    }
 }
index 3c6472b5d5246443bfb745c5521a51d8a112fe13..f29e80f3398ec33c22634dd03ba762e7f0671226 100644 (file)
 package hu.user.lis.ui.view;
 
 import com.fasterxml.jackson.core.JsonProcessingException;
-import hu.user.lis.db.Partner;
-import hu.user.lis.ui.data.PartnersDataModel;
+import hu.user.lis.db.ProjectStatus;
+import hu.user.lis.ui.data.ProjectStatusDataModel;
 import lombok.Getter;
+import lombok.Setter;
 import lombok.extern.log4j.Log4j2;
-import org.zkoss.bind.annotation.*;
-import org.zkoss.zk.ui.Component;
-import org.zkoss.zk.ui.Executions;
-import org.zkoss.zk.ui.select.Selectors;
+import org.zkoss.bind.annotation.Command;
+import org.zkoss.bind.annotation.Init;
 import org.zkoss.zk.ui.select.annotation.VariableResolver;
-import org.zkoss.zk.ui.select.annotation.Wire;
 import org.zkoss.zk.ui.select.annotation.WireVariable;
 import org.zkoss.zk.ui.util.Clients;
 import org.zkoss.zkplus.spring.DelegatingVariableResolver;
-import org.zkoss.zul.Listbox;
-import org.zkoss.zul.Window;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
 
 @Log4j2
 @VariableResolver(DelegatingVariableResolver.class)
 public class SettingsViewModel extends AsyncBaseModel {
     @WireVariable
     @Getter
-    PartnersDataModel partnersDataModel;
-    @Wire
-    Listbox partnersList;
+    ProjectStatusDataModel projectStatusDataModel;
     @Getter
-    private Partner selectedPartner;
-    private boolean filterShowInActive;
-    private boolean filterShowActive;
-    private boolean filterShowBoth;
-
-    @AfterCompose
-    public void onAfterCompose(@ContextParam(ContextType.VIEW) Component view) {
-        Selectors.wireComponents(view, this, false);
-        Selectors.wireEventListeners(view, this);
-    }
+    @Setter
+    private ProjectStatus selectedProjectStatus;
 
     @Init
     public void init() {
-        setFilterShowActive(true);
         Clients.evalJavaScript("pushNav('/settings')");
+        projectStatusDataModel.listAll();
         log.info("Initialized");
     }
 
-    private void refresh() {
-        partnersDataModel.clearSelection();
-        selectedPartner = null;
-        if (filterShowBoth) {
-            partnersDataModel.search(true, true);
-        } else {
-            partnersDataModel.search(filterShowActive, filterShowInActive);
-        }
-    }
+//    @Command
+//    @NotifyChange("selectedProjectStatus")
+//    public void onListSelection() {
+//        selectedProjectStatus = null;
+//        Set<ProjectStatus> selections = projectStatusDataModel.getSelection();
+//        if (selections.size() == 1) {
+//            selectedProjectStatus = selections.iterator().next();
+//            log.info("Selected {}", selectedProjectStatus);
+//        }
+//    }
 
     @Command
-    @NotifyChange("selectedPartner")
-    public void search() {
+    public void onMoveUp() {
+        projectStatusDataModel.moveUp(selectedProjectStatus);
+        projectStatusDataModel.listAll();
     }
 
     @Command
-    @NotifyChange("selectedPartner")
-    public void onListSelection() {
-        selectedPartner = null;
-        Set<Partner> selections = partnersDataModel.getSelection();
-        if (selections.size() == 1) {
-            selectedPartner = selections.iterator().next();
-            log.info("Selected {}", selectedPartner);
-        }
-    }
-
-    @Command
-    public void onAfterRenderPartners() {
-    }
-
-    @Command
-    public void onAdd() {
-        String page = "~./partner-editor.zul";
-        Partner newEntity = partnersDataModel.getPartnerService().createNew();
-        Window editorWindow = (Window) Executions.createComponents(page, null,
-                Collections.singletonMap("formDocument", newEntity));
-        editorWindow.addEventListener("onClose", e -> {
-            if (e.getData() != null) {
-                log.info("Partner popup result {}", e.getData());
-                partnersDataModel.getPartnerService().add(newEntity);
-                partnersDataModel.clearSelection();
-                refresh();
-                partnersDataModel.addToSelection(newEntity);
-                selectedPartner = newEntity;
-
-//                Optional<Listitem> listItem = partnersList.getItems().stream()
-//                        .filter(li -> ((Partner) li.getValue()).getId().equals(newEntity.getId()))
-//                        .findFirst();
-//                if (listItem.isPresent()) {
-//                    Clients.scrollIntoView(listItem.get());
-//                }
-//                registerTask(() -> {
-//                });
-            }
-        });
-        editorWindow.doModal();
+    public void onMoveDown() {
+        projectStatusDataModel.moveDown(selectedProjectStatus);
+        projectStatusDataModel.listAll();
     }
 
     @Command
-    public void onEdit() throws JsonProcessingException {
-        String page = "~./partner-editor.zul";
-        Partner editEntity = partnersDataModel.getPartnerService().copy(selectedPartner);
-        Map<String, Object> arg = new HashMap<>();
-        arg.put("origDocument", selectedPartner);
-        arg.put("formDocument", editEntity);
-        Window editorWindow = (Window) Executions.createComponents(page, null, arg);
-        editorWindow.addEventListener("onClose", e -> {
-            if (e.getData() != null) {
-                log.info("Partner popup result {}", e.getData());
-                Partner modifiedEntity = (Partner) e.getData();
-                partnersDataModel.clearSelection();
-                partnersDataModel.getPartnerService().replace(selectedPartner, modifiedEntity);
-                refresh();
-                partnersDataModel.addToSelection(modifiedEntity);
-                selectedPartner = modifiedEntity;
-            }
-        });
-        editorWindow.doModal();
+    public void onAppend() throws JsonProcessingException {
+        projectStatusDataModel.append();
+        projectStatusDataModel.listAll();
     }
 
 
-    public boolean isFilterShowInActive() {
-        return filterShowInActive;
-    }
-
-    @NotifyChange({"filterShowActive", "filterShowInActive", "filterShowBoth"})
-    public void setFilterShowInActive(boolean filterShowInActive) {
-        this.filterShowBoth = false;
-        this.filterShowActive = false;
-        this.filterShowInActive = filterShowInActive;
-        refresh();
-    }
-
-    public boolean isFilterShowActive() {
-        return filterShowActive;
-    }
-
-    @NotifyChange({"filterShowActive", "filterShowInActive", "filterShowBoth"})
-    public void setFilterShowActive(boolean filterShowActive) {
-        this.filterShowBoth = false;
-        this.filterShowInActive = false;
-        this.filterShowActive = filterShowActive;
-        refresh();
-    }
-
-    public boolean isFilterShowBoth() {
-        return this.filterShowBoth;
-    }
-
-    @NotifyChange({"filterShowActive", "filterShowInActive", "filterShowBoth"})
-    public void setFilterShowBoth(boolean filterShowBoth) {
-        this.filterShowActive = false;
-        this.filterShowInActive = false;
-        this.filterShowBoth = filterShowBoth;
-        refresh();
-    }
 }
diff --git a/lis-ui/src/main/resources/web/associate-filter.zul b/lis-ui/src/main/resources/web/associate-filter.zul
new file mode 100644 (file)
index 0000000..4e9fea4
--- /dev/null
@@ -0,0 +1,50 @@
+<zk xmlns:c="client">
+    <bandbox id="associateFilterBandBox" autodrop="true" iconSclass="z-icon-sort-down"
+             value="@load(vm.filterAssociate) @converter('hu.user.lis.ui.converter.AssociateToNameConverter')"
+             onChanging="@command('onAssociateFilterBandChanging')" onOpen="@command('onAssociateFilterBandOpen')"
+             forward="onOK=submit.onClick, onCancel=cancel.onClick">
+        <attribute c:name="_doKeyDown">
+            <![CDATA[
+                            function (evt) {
+                                var keyCode = evt.keyCode;
+                                console.log(keyCode);
+                                if (keyCode == 13){
+                                    zk.$("$associateFilterBandBox").close();
+                                    zk.$("$associateFilterBandBox").focus();
+                                    return;
+                                }
+                                if (keyCode == 40){
+                                    if (!zk.$("$associateFilterBandBox").isOpen()) {
+                                        zk.$("$associateFilterBandBox").open();
+                                        zAu.send(new zk.Event(zk.Widget.$('$associateFilterBandBox'), "onOpen", {'open': true}, {toServer:true}));
+                                    }
+                                    zk.$("$associateFilterList").focus();
+                                    return;
+                                }
+                                if (keyCode == 27){
+                                    zk.$("$associateFilterBandBox").close()
+                                    zk.$("$associateFilterBandBox").focus();
+                                    return;
+                                }
+                            }
+                        ]]>
+        </attribute>
+        <bandpopup>
+            <listbox id="associateFilterList" height="250px" width="450px"
+                     model="@bind(vm.associateSelectorDataModel)"
+                     selectedItem="@bind(vm.filterAssociate)"
+                     onClick="associateFilterBandBox.close()"
+                     onDoubleClick="associateFilterBandBox.close()">
+                <listhead visible="false">
+                    <listheader label="name" vflex="max"/>
+                </listhead>
+                <template name="model">
+                    <listitem>
+                        <listcell label="@load(each.name)"/>
+                    </listitem>
+                </template>
+            </listbox>
+        </bandpopup>
+    </bandbox>
+
+</zk>
\ No newline at end of file
index afa7f49d9e8b0d684396716cbdd9bdcfe56f45f1..a9935a82f4d7cb5bb73320673ce020a0b7486fba 100644 (file)
         -moz-user-select: none;
         -webkit-user-select: none;
         }
+        .z-toolbarbutton-content {
+        -moz-user-select: none;
+        -webkit-user-select: none;
+        }
     </style>
     <script>
         function pushNav(nav) {
index 4f6ed2e35f275cbd1ac3c41d29e34033dc2b1d74..f42d6918bcd2eabfeb893440ab385a1f2a03e815 100644 (file)
@@ -6,68 +6,83 @@
         <borderlayout>
             <center id="centerPanel" border="none" vflex="true" hflex="true" autoscroll="true">
                 <vlayout hflex="true" vflex="min">
+                    <hbox spacing="0" width="100%">
+                        <window border="none" hflex="true" vflex="true">
+                            <tabbox height="250px">
+                                <tabs>
+                                    <tab label="Adatok" selected="true"/>
+                                </tabs>
+                                <tabpanels>
+                                    <tabpanel>
+                                        <vlayout hflex="true">
+                                            <hlayout>
+                                                <vlayout>
+                                                    <label value="Azonosító"/>
+                                                    <textbox instant="true" width="180px"
+                                                             value="@bind(vm.formDocument.humanId) @validator(vm)"
+                                                             readonly="true"
+                                                             forward="onOK=submit.onClick, onCancel=cancel.onClick"/>
+                                                </vlayout>
+                                                <vlayout hflex="true">
+                                                    <label value="Megnevezés"/>
+                                                    <textbox instant="true" hflex="true"
+                                                             value="@bind(vm.formDocument.name) @validator(vm)"
+                                                             forward="onOK=submit.onClick, onCancel=cancel.onClick"/>
+                                                </vlayout>
+                                            </hlayout>
+                                            <hlayout>
+                                                <vlayout>
+                                                    <label value="Ügyfél"/>
+                                                    <partner-selector/>
+                                                </vlayout>
+                                                <vlayout hflex="true">
+                                                    <label value="Kapcsolattartó"/>
+                                                    <textbox instant="true" hflex="true"
+                                                             value="@bind(vm.formDocument.contactName) @validator(vm)"
+                                                             forward="onOK=submit.onClick, onCancel=cancel.onClick"/>
+                                                </vlayout>
+                                            </hlayout>
+                                            <hlayout>
+                                                <vlayout>
+                                                    <label value="Státusz"/>
+                                                    <selectbox model="@load(vm.projectStatusDataModel)" width="180px"
+                                                               selectedIndex="@bind(vm.formDocument.projectStatusId) @converter(vm.projectStatusConverter) @validator(vm)"
+                                                               forward="onOK=submit.onClick, onCancel=cancel.onClick">
+                                                        <template name="model">
+                                                            ${each.name}
+                                                        </template>
+                                                    </selectbox>
+
+                                                </vlayout>
+                                                <vlayout>
+                                                    <label value="Aktív"/>
+                                                    <checkbox mold="switch" checked="@bind(vm.formDocument.active)"/>
+
+                                                </vlayout>
+
+                                            </hlayout>
+                                        </vlayout>
+                                    </tabpanel>
+                                </tabpanels>
+                            </tabbox>
+                        </window>
+
+                        <window border="none" hflex="true" vflex="true">
+                            <tabbox height="250px">
+                                <tabs>
+                                    <tab label="Árrés" selected="true"/>
+                                </tabs>
+                                <tabpanels>
+                                    <tabpanel>
+                                        <vlayout hflex="true">
+                                        </vlayout>
+                                    </tabpanel>
+                                </tabpanels>
+                            </tabbox>
+                        </window>
+                    </hbox>
+
 
-                    <tabbox height="300px">
-                        <tabs>
-                            <tab label="Adatok" selected="true"/>
-                            <tab label="Résztvevők"/>
-                        </tabs>
-                        <tabpanels>
-                            <tabpanel>
-                                <vlayout>
-                                    <label value="Azonosító"/>
-                                    <textbox hflex="true" instant="true"
-                                             value="@bind(vm.formDocument.humanId) @validator(vm)"
-                                             readonly="true"
-                                             forward="onOK=submit.onClick, onCancel=cancel.onClick"/>
-                                    <label value="Ügyfél"/>
-                                    <partner-selector/>
-                                    <label value="Megnevezés"/>
-                                    <textbox hflex="true" instant="true"
-                                             value="@bind(vm.formDocument.name) @validator(vm)"
-                                             forward="onOK=submit.onClick, onCancel=cancel.onClick"/>
-                                    <label value="Kapcsolattartó"/>
-                                    <textbox hflex="true" instant="true"
-                                             value="@bind(vm.formDocument.contactName) @validator(vm)"
-                                             forward="onOK=submit.onClick, onCancel=cancel.onClick"/>
-                                    <label value="Aktív"/>
-                                    <checkbox mold="switch" checked="@bind(vm.formDocument.active)"/>
-                                </vlayout>
-                            </tabpanel>
-                            <tabpanel>
-                                <borderlayout>
-                                    <!--                                    <north flex="true">-->
-                                    <!--                                        <toolbar>-->
-                                    <!--                                            <textbox instant="true" value="@bind(vm.partialAssociateName)"/>-->
-                                    <!--                                            <toolbarbutton iconSclass="z-icon-remove"-->
-                                    <!--                                                           onClick="@command('onResetAssociateFilter')"/>-->
-                                    <!--                                        </toolbar>-->
-                                    <!--                                    </north>-->
-                                    <center border="none" flex="true">
-                                        <listbox model="@load(vm.associatesDataModel)"
-                                                 multiple="false" vflex="true"
-                                                 onAfterRender="@command('onAfterRenderAssociates')">
-                                            <listhead sizable="true">
-                                                <listheader hflex="min" label="Tag" align="left"/>
-                                                <listheader label="Név" align="left"/>
-                                                <listheader label="Login" align="left"/>
-                                            </listhead>
-                                            <template name="model">
-                                                <listitem>
-                                                    <listcell>
-                                                        <checkbox checked="@bind(vm.formAssociates[each.id])"
-                                                                  onCheck="@command('onAssociateChecked')"/>
-                                                    </listcell>
-                                                    <listcell label="@load(each.name)"/>
-                                                    <listcell label="@load(each.login)"/>
-                                                </listitem>
-                                            </template>
-                                        </listbox>
-                                    </center>
-                                </borderlayout>
-                            </tabpanel>
-                        </tabpanels>
-                    </tabbox>
                     <panel collapsible="true" open="false" border="rounded"
                            onOpen="@command('onOpenFormPanel', parentPanel=centerPanel)">
                         <caption label="Kimenő számlák"
                                         <listheader label="Vevő" align="left"/>
                                         <listheader label="Sorszám" align="left"/>
                                         <listheader label="Megnevezés" align="left"/>
-                                        <listheader label="Nettó összeg" align="left"/>
+                                        <listheader label="Nettó összeg" align="right"/>
                                         <listheader label="Pénznem" align="left"/>
                                         <listheader label="Teljesítés" align="left"/>
                                         <listheader label="Fizetési határidő" align="left"/>
                                         <listheader label="Szállító" align="left"/>
                                         <listheader label="Sorszám" align="left"/>
                                         <listheader label="Megnevezés" align="left"/>
-                                        <listheader label="Nettó összeg" align="left"/>
+                                        <listheader label="Nettó összeg" align="right"/>
                                         <listheader label="Pénznem" align="left"/>
                                         <listheader label="Teljesítés" align="left"/>
                                         <listheader label="Fizetési határidő" align="left"/>
                                         <auxheader label="Vétel" colspan="2"/>
                                         <auxheader colspan="2"/>
                                     </auxhead>
+
                                     <listhead sizable="true">
-                                        <listheader label="Összeg" align="left"/>
+                                        <listheader label="Összeg" align="right"/>
                                         <listheader label="Pénznem" align="left"/>
-                                        <listheader label="Összeg" align="left"/>
+                                        <listheader label="Összeg" align="right"/>
                                         <listheader label="Pénznem" align="left"/>
-                                        <listheader label="Üzletkötés dátuma" align="left"/>
+                                        <listheader label="Üzletkötés dátuma"
+                                                    align="left"/>
                                         <listheader label="Értéknap" align="left"/>
                                     </listhead>
                                     <template name="model">
 
                     <panel collapsible="true" open="false" border="rounded"
                            onOpen="@command('onOpenFormPanel', parentPanel=centerPanel)">
-                        <caption label="Munkalapok"
+                        <caption label="Munkalap összesítő"
                                  onClick="@command('onClickFormPanel', parentPanel=centerPanel, panel=self.parent)"/>
                         <panelchildren>
                             <listbox model="@load(vm.serviceRecordsDataModel)"
                                      forward="onOK=submit.onClick, onCancel=cancel.onClick">
                                 <listhead sizable="true">
-                                    <listheader label="Projekt" align="left"/>
                                     <listheader label="Munkatárs" align="left"/>
-                                    <listheader label="Munkanap" align="left"/>
-                                    <listheader label="Óraszám" align="left"/>
-                                    <listheader label="Ráfordítás" align="left"/>
+                                    <listheader label="Óraszám" align="right"/>
+                                    <listheader label="Ráfordítás" align="right"/>
                                 </listhead>
                                 <template name="model">
                                     <listitem>
-                                        <listcell label="@load(each.project.humanId)"/>
-                                        <listcell label="@load(each.associate.name)"/>
-                                        <listcell
-                                                label="@load(each.workDay) @converter('hu.user.lis.ui.converter.DateToStringConverter')"/>
+                                        <listcell>
+                                            <a onClick="@command('showServiceRecords', associate=each.associate)"
+                                               label="@load(each.associate.name)"/>
+                                        </listcell>
                                         <listcell label="@load(each.workHours)"/>
                                         <listcell
                                                 label="@load(each.cost) @converter('hu.user.lis.ui.converter.DoubleToStringConverter')"/>
                         </panelchildren>
                     </panel>
 
+
+                    <panel collapsible="true" open="false" border="rounded"
+                           onOpen="@command('onOpenFormPanel', parentPanel=centerPanel)">
+                        <caption label="Résztvevők"
+                                 onClick="@command('onClickFormPanel', parentPanel=centerPanel, panel=self.parent)"/>
+                        <!--                                    <north flex="true">-->
+                        <!--                                        <toolbar>-->
+                        <!--                                            <textbox instant="true" value="@bind(vm.partialAssociateName)"/>-->
+                        <!--                                            <toolbarbutton iconSclass="z-icon-remove"-->
+                        <!--                                                           onClick="@command('onResetAssociateFilter')"/>-->
+                        <!--                                        </toolbar>-->
+                        <!--                                    </north>-->
+                        <panelchildren>
+                            <listbox model="@load(vm.associatesDataModel)"
+                                     multiple="false"
+                                     onAfterRender="@command('onAfterRenderAssociates')">
+                                <listhead sizable="true">
+                                    <listheader hflex="min" label="Tag" align="left"/>
+                                    <listheader label="Név" align="left"/>
+                                    <listheader label="Login" align="left"/>
+                                </listhead>
+                                <template name="model">
+                                    <listitem>
+                                        <listcell>
+                                            <checkbox checked="@bind(vm.formAssociates[each.id])"
+                                                      onCheck="@command('onAssociateChecked')"/>
+                                        </listcell>
+                                        <listcell label="@load(each.name)"/>
+                                        <listcell label="@load(each.login)"/>
+                                    </listitem>
+                                </template>
+                            </listbox>
+                        </panelchildren>
+                    </panel>
+
                 </vlayout>
             </center>
             <south border="none" flex="true" style="text-align: right; padding: 10px;">
diff --git a/lis-ui/src/main/resources/web/project-filter.zul b/lis-ui/src/main/resources/web/project-filter.zul
new file mode 100644 (file)
index 0000000..ae38c72
--- /dev/null
@@ -0,0 +1,49 @@
+<zk xmlns:c="client">
+    <bandbox id="projectFilterBandBox" autodrop="true" iconSclass="z-icon-sort-down"
+             value="@load(vm.filterProject) @converter('hu.user.lis.ui.converter.ProjectToNameConverter')"
+             onChanging="@command('onProjectFilterBandChanging')" onOpen="@command('onProjectFilterBandOpen')"
+             forward="onOK=submit.onClick, onCancel=cancel.onClick">
+        <attribute c:name="_doKeyDown">
+            <![CDATA[
+                            function (evt) {
+                                var keyCode = evt.keyCode;
+                                console.log(keyCode);
+                                if (keyCode == 13){
+                                    zk.$("$projectFilterBandBox").close();
+                                    zk.$("$projectFilterBandBox").focus();
+                                    return;
+                                }
+                                if (keyCode == 40){
+                                    if (!zk.$("$projectFilterBandBox").isOpen()) {
+                                        zk.$("$projectFilterBandBox").open();
+                                        zAu.send(new zk.Event(zk.Widget.$('$projectFilterBandBox'), "onOpen", {'open': true}, {toServer:true}));
+                                    }
+                                    zk.$("$projectFilterList").focus();
+                                    return;
+                                }
+                                if (keyCode == 27){
+                                    zk.$("$projectFilterBandBox").close()
+                                    zk.$("$projectFilterBandBox").focus();
+                                    return;
+                                }
+                            }
+                        ]]>
+        </attribute>
+        <bandpopup>
+            <listbox id="projectFilterList" height="250px" width="450px"
+                     model="@bind(vm.projectSelectorDataModel)"
+                     selectedItem="@bind(vm.filterProject)"
+                     onClick="projectFilterBandBox.close()"
+                     onDoubleClick="projectFilterBandBox.close()">
+                <listhead visible="false">
+                    <listheader label="name" vflex="max"/>
+                </listhead>
+                <template name="model">
+                    <listitem>
+                        <listcell label="@load(each.humanId)"/>
+                    </listitem>
+                </template>
+            </listbox>
+        </bandpopup>
+    </bandbox>
+</zk>
\ No newline at end of file
index a77efb560387e18bb32ef2cd84936397248379e9..699c05c0b10265139dcaddd12b95d3951ab7c02f 100644 (file)
@@ -23,6 +23,7 @@
                     <listhead sizable="true">
                         <listheader label="Azonosító" align="left"/>
                         <listheader label="Ügyfél" align="left"/>
+                        <listheader label="Státusz" align="left"/>
                         <listheader label="Megnevezés" align="left"/>
                         <listheader label="Kapcsolattartó" align="left"/>
                         <listheader label="Aktív" align="left"/>
@@ -31,6 +32,7 @@
                         <listitem>
                             <listcell label="@load(each.humanId)"/>
                             <listcell label="@load(each.partner.name)"/>
+                            <listcell label="@load(vm.getProjectStatus(each.projectStatusId).name)"/>
                             <listcell label="@load(each.name)"/>
                             <listcell label="@load(each.contactName)"/>
                             <listcell>
index 695d42dade406a10dd19458605393f6316823246..a51c2e7a7034e1b76c8c918f02a7240a0dc53c1a 100644 (file)
@@ -1,7 +1,7 @@
 <?component name="associate-selector" inline="true" macroURI="~./associate-selector.zul"?>
 <?component name="project-selector" inline="true" macroURI="~./project-selector.zul"?>
 <zk>
-    <window id="serviceRecordPopup" width="60%" height="500px" closable="true"
+    <window id="serviceRecordPopup" width="50%" height="400px" closable="true"
             viewModel="@id('vm') @init('hu.user.lis.ui.editor.ServiceRecordEditorModel')">
         <caption label="Munkalap szerkesztés"/>
         <borderlayout>
                     </tabs>
                     <tabpanels>
                         <tabpanel>
-                            <vlayout hflex="true">
-                                <label value="Projekt"/>
-                                <project-selector/>
-                                <label value="Munkatárs"/>
-                                <associate-selector/>
-                                <label value="Munkanap"/>
-                                <datebox instant="true" format="yyyy. MM. dd."
-                                         value="@bind(vm.formDocument.workDay) @validator(vm)"
-                                         forward="onOK=submit.onClick, onCancel=cancel.onClick"/>
+                            <vlayout>
+                                <hlayout>
+                                    <vlayout>
+                                        <label value="Projekt"/>
+                                        <project-selector/>
+                                    </vlayout>
+                                    <vlayout>
+                                        <label value="Munkatárs"/>
+                                        <associate-selector/>
+                                    </vlayout>
+                                    <vlayout>
+                                        <label value="Munkanap"/>
+                                        <datebox instant="true" format="yyyy. MM. dd."
+                                                 value="@bind(vm.formDocument.workDay) @validator(vm)"
+                                                 forward="onOK=submit.onClick, onCancel=cancel.onClick"/>
+                                    </vlayout>
+                                    <vlayout>
+                                        <label value="Óraszám"/>
+                                        <intbox value="@bind(vm.formDocument.workHours) @validator(vm)"
+                                                format="locale:hu-HU" instant="true"
+                                                forward="onOK=submit.onClick, onCancel=cancel.onClick"/>
+                                    </vlayout>
+                                </hlayout>
                                 <label value="Leírás"/>
                                 <textbox instant="true" hflex="true"
                                          value="@bind(vm.formDocument.description) @validator(vm)"
                                          forward="onOK=submit.onClick, onCancel=cancel.onClick"/>
-                                <label value="Óraszám"/>
-                                <intbox value="@bind(vm.formDocument.workHours) @validator(vm)"
-                                        format="locale:hu-HU" instant="true"
-                                        forward="onOK=submit.onClick, onCancel=cancel.onClick"/>
                                 <label value="Részletek"/>
-                                <textbox instant="true" multiline="true" inplace="false" rows="5"
+                                <textbox instant="true" multiline="true" inplace="false" rows="9"
                                          hflex="true"
                                          value="@bind(vm.formDocument.details) @validator(vm)"
                                          forward="onOK=submit.onClick, onCancel=cancel.onClick"/>
index d0392f274e92fd1b88bd783d137f9f87644726ab..0467b2a03e38f04f2e38bcbb2d550715c0adde5f 100644 (file)
@@ -1,3 +1,5 @@
+<?component name="associate-filter" inline="true" macroURI="~./associate-filter.zul"?>
+<?component name="project-filter" inline="true" macroURI="~./project-filter.zul"?>
 <zk>
     <window vflex="true" viewModel="@id('vm') @init('hu.user.lis.ui.view.ServiceRecordsViewModel')">
         <caption label="Munkalapok"/>
@@ -7,6 +9,15 @@
                     <toolbarbutton label="Hozzáadás" iconSclass="z-icon-plus" onClick="@command('onAdd')"/>
                     <toolbarbutton label="Szerkesztés" iconSclass="z-icon-edit" onClick="@command('onEdit')"
                                    disabled="@load(empty vm.selectedEntity)"/>
+                    <separator orient="vertical"/>
+                    <label value="Projekt"/>
+                    <separator orient="vertical"/>
+                    <project-filter/>
+                    <separator orient="vertical"/>
+                    <label value="Munkatárs"/>
+                    <separator orient="vertical"/>
+                    <associate-filter/>
+                    <toolbarbutton label="Nincs szűrés" iconSclass="z-icon-ban" onClick="@command('onClearFilters')"/>
                 </toolbar>
             </north>
             <center border="none" flex="true">
@@ -18,7 +29,7 @@
                         <listheader label="Munkatárs" align="left"/>
                         <listheader label="Munkanap" align="left"/>
                         <listheader label="Leírás" align="left"/>
-                        <listheader label="Óraszám" align="center"/>
+                        <listheader label="Óraszám" align="right"/>
                         <listheader label="ALáírt" align="left"/>
                     </listhead>
                     <template name="model">
@@ -29,7 +40,7 @@
                                     label="@load(each.workDay) @converter('hu.user.lis.ui.converter.DateToStringConverter')"/>
                             <listcell label="@load(each.description)"/>
                             <listcell>
-                                <label value="@load(each.workHours)" sclass="right-aligned"/>
+                                <label value="@load(each.workHours)"/>
                             </listcell>
                             <listcell>
                                 <a iconSclass="z-icon-check" visible="@load(not empty each.file)"/>
index c74badca85caa8913e214725eea8e02837f8333e..851acab9880f6097b1cd326d70dd9a4ff226eb9d 100644 (file)
@@ -1,44 +1,42 @@
 <zk>
     <window vflex="true" viewModel="@id('vm') @init('hu.user.lis.ui.view.SettingsViewModel')">
-        <caption label="Partnerek"/>
+        <caption label="Beállítások"/>
         <borderlayout>
             <north flex="true">
                 <toolbar>
-                    <toolbarbutton label="Hozzáadás" iconSclass="z-icon-plus" onClick="@command('onAdd')"/>
-                    <toolbarbutton label="Szerkesztés" iconSclass="z-icon-edit" onClick="@command('onEdit')"
-                                   disabled="@load(empty vm.selectedPartner)"/>
+
+                    <toolbarbutton label="Fel mozgat" iconSclass="z-icon-arrow-up" onClick="@command('onMoveDown')"
+                                   disabled="@load(empty vm.selectedProjectStatus)"/>
+                    <toolbarbutton label="Le mozgat" iconSclass="z-icon-arrow-down" onClick="@command('onMoveUp')"
+                                   disabled="@load(empty vm.selectedProjectStatus)"/>
                     <separator orient="vertical"/>
-                    <toolbarbutton mode="toggle" iconSclass="z-icon-check" label="Aktív"
-                                   checked="@bind(vm.filterShowActive)"/>
-                    <toolbarbutton mode="toggle" iconSclass="z-icon-ban" label="Inaktív"
-                                   checked="@bind(vm.filterShowInActive)"/>
-                    <toolbarbutton mode="toggle" iconSclass="z-icon-adjust" label="Mind"
-                                   checked="@bind(vm.filterShowBoth)"/>
+                    <toolbarbutton label="Hozzáadás" iconSclass="z-icon-plus" onClick="@command('onAppend')"/>
                 </toolbar>
             </north>
             <center border="none" flex="true">
-                <listbox id="partnersList" vflex="true" model="@load(vm.partnersDataModel)"
+                <listbox vflex="true" model="@load(vm.projectStatusDataModel)"
                          autopaging="true" pagingPosition="top" multiple="false"
-                         onSelect="@command('onListSelection')" onDoubleClick="@command('onEdit')"
-                         onAfterRender="@command('onAfterRenderPartners')">
+                         selectedItem="@bind(vm.selectedProjectStatus)">
                     <listhead sizable="true">
+                        <listheader label="Sorrend" align="left"/>
                         <listheader label="Név" align="left"/>
-                        <listheader label="Adószám" align="left"/>
-                        <listheader label="Cím" align="left"/>
                         <listheader label="Aktív" align="left"/>
                     </listhead>
                     <template name="model">
                         <listitem>
-                            <listcell label="@load(each.name)"/>
-                            <listcell label="@load(each.vatNr)"/>
-                            <listcell label="@load(each.address)"/>
                             <listcell>
-                                <a iconSclass="z-icon-check" visible="@load(each.active)"/>
-                                <a iconSclass="z-icon-ban" visible="@load(!each.active)"/>
+                                <label value="@load(each.order)"/>
+                            </listcell>
+                            <listcell>
+                                <textbox inplace="true" instant="true" width="100%" value="@bind(each.name)"/>
+                            </listcell>
+                            <listcell>
+                                <checkbox checked="@bind(each.active)"/>
                             </listcell>
                         </listitem>
                     </template>
                 </listbox>
+
             </center>
         </borderlayout>
 
index 6e431f4ea1a98910f29daa0b62f320d8f2b87a87..2ca71e8fe4ddac83a5d999163c22c8d7b634710a 100644 (file)
 }
 
 .right-aligned {
+/*
     display: inline-block;
     text-align: right;
     width: 100%;
+*/
 }
 
 textarea {