* 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:
- 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
<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>
@NoArgsConstructor
public class Project {
String id;
+ String projectStatusId;
String name;
String humanId;
String contactName;
Partner getById(String id);
- Partner copy(Partner sourceEntity) throws JsonProcessingException;
+ Partner copy(Partner sourceEntity);
void replace(Partner targetEntity, Partner replacementEntity);
InvoiceService invoiceService;
@Autowired
TreasuryService treasuryService;
+ @Autowired
+ ProjectStatusService projectStatusService;
private List<Project> entities;
@Override
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<>())
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));
Partner partner = partnerService.getRandom();
Project entity = Project.builder()
.id(id)
+ .projectStatusId(projectStatusId)
.active(true)
.humanId(humanId)
.name(name)
.partner(partner)
.incomingInvoices(invoiceService.getRandom(true))
.outgoingInvoices(invoiceService.getRandom(false))
- .treasuries(treasuryService.getRandom())
+ //.treasuries(treasuryService.getRandom())
.build();
result.add(entity);
}
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)
.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);
partner = partnerService.getById("007"); // 007
entity = Project.builder()
.id(id)
+ .projectStatusId(projectStatusId)
.active(true)
.humanId(humanId)
.name(name)
.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);
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);
partner = partnerService.getById("015"); // 015
entity = Project.builder()
.id(id)
+ .projectStatusId(projectStatusId)
.active(true)
.humanId(humanId)
.name(name)
.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);
partner = partnerService.getById("016"); // 016
entity = Project.builder()
.id(id)
+ .projectStatusId(projectStatusId)
.active(true)
.humanId(humanId)
.name(name)
.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);
@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
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);
}
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;
ProjectService projectService;
@Autowired
AssociateService associateService;
- private HashMap<String, ServiceRecord> projectRecords = new HashMap<>();
private List<ServiceRecord> entities;
@Override
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);
.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);
+
+
}
});
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;
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";
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;
}
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";
static {
nf.setMaximumFractionDigits(2);
+ nf.setMinimumFractionDigits(2);
nf.setRoundingMode(RoundingMode.CEILING);
}
--- /dev/null
+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
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();
+ }
}
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;
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
@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() {
}
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;
}
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;
}
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;
}
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, "*");
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;
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");
}
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);
}
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() {
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));
}
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;
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)
}
@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<>();
@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());
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;
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)
}
@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<>();
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;
import org.zkoss.zkplus.spring.DelegatingVariableResolver;
import java.util.Map;
+import java.util.Objects;
import java.util.Set;
ProjectsDataModel projectsDataModel;
@WireVariable
EventBus eventBus;
+ @WireVariable
+ private ProjectStatusService projectStatusServiceImpl;
@Getter
private Project selectedProject;
private boolean filterShowInActive;
log.info("Initialized");
}
+ public ProjectStatus getProjectStatus(String id) {
+ return projectStatusServiceImpl.getById(id);
+ }
+
private void refresh() {
projectsDataModel.clearSelection();
selectedProject = null;
@Command
public void onEdit() {
+ if (Objects.isNull(selectedProject)) {
+ return;
+ }
Project editEntity = projectsDataModel.getProjectService().copy(selectedProject);
eventBus.showProjectEditor(ImmutableMap.of("origDocument", selectedProject, "formDocument", editEntity));
}
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;
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;
@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);
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);
+ }
}
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();
- }
}
--- /dev/null
+<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
-moz-user-select: none;
-webkit-user-select: none;
}
+ .z-toolbarbutton-content {
+ -moz-user-select: none;
+ -webkit-user-select: none;
+ }
</style>
<script>
function pushNav(nav) {
<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;">
--- /dev/null
+<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
<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"/>
<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>
<?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"/>
+<?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"/>
<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">
<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">
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)"/>
<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>
}
.right-aligned {
+/*
display: inline-block;
text-align: right;
width: 100%;
+*/
}
textarea {