New menu items added, invoices view is partially implemented
authorelgekko <vasary@elgekko.net>
Mon, 16 Oct 2023 13:59:18 +0000 (15:59 +0200)
committerelgekko <vasary@elgekko.net>
Mon, 16 Oct 2023 13:59:18 +0000 (15:59 +0200)
17 files changed:
TODO.txt
lis-db/migrations/README
lis-db/migrations/scripts/004_create_test_data.sql
lis-db/migrations/scripts/009_add_partner_for_invoice_import_test.sql
lis-db/src/main/java/hu/user/lis/db/repository/InvoiceRepository.java
lis-db/src/main/java/hu/user/lis/db/repository/InvoiceRepositorySearch.java [new file with mode: 0644]
lis-db/src/main/java/hu/user/lis/db/repository/InvoiceRepositorySearchImpl.java [new file with mode: 0644]
lis-db/src/main/java/hu/user/lis/db/repository/filter/InvoiceFilter.java [new file with mode: 0644]
lis-db/src/main/java/hu/user/lis/db/repository/filter/PageableFilter.java [new file with mode: 0644]
lis-ui/src/main/java/hu/user/lis/ui/Constants.java
lis-ui/src/main/java/hu/user/lis/ui/config/ResourceConfigurer.java
lis-ui/src/main/java/hu/user/lis/ui/data/InvoicesDataModel.java [new file with mode: 0644]
lis-ui/src/main/java/hu/user/lis/ui/view/IndexViewModel.java
lis-ui/src/main/java/hu/user/lis/ui/view/InvoicesViewModel.java [new file with mode: 0644]
lis-ui/src/main/resources/web/index.zul
lis-ui/src/main/resources/web/invoice-settle.zul [new file with mode: 0644]
lis-ui/src/main/resources/web/invoices.zul [new file with mode: 0644]

index 1b0e9a5071541b4b49d9b4555eddf081b439a951..741d1718fe1ef2c7d06b8ba7ff717cf31e6c325a 100644 (file)
--- a/TODO.txt
+++ b/TODO.txt
@@ -1,17 +1,24 @@
+0.1.9
+-banki integráció
+-távlati: utalás előkészítése
+
 0.1.8
+- A "Számla kiegyenlítés" számla sorszám alapú kereséssel indul, találat esetén megjelenik egy űrlap:
+    - számla részletek megejelenítése: határidő, összeg, devizanem
+    - mekkora pénzmozgás volt, milyen devizanemben, illetve felvehető új néznmozgás
+    - az űrlapon a csatolt számlakép megjelenítése
+    - mivel tartozhat egy sorszám több számlához is, ezt kezelni kell
+- A "Szállítói követelés követés" funkció a számlák listáját mutatja szűrve, azokat tartalmazza amik még nincsenek kiegyenlítve (külön a bejövö külön a kimenő)
 - munkalap hiba javítása
-- ömlesztve: kimenő számlák: mi nem lett kifizetve, partner
-- számla ki lett e fizetve (bejövő, kimenő)
-
 - projekt ID-t regexp-el ki kell szedni, ha több van egy listát feldobni
     invoiceHead/invoiceDetail/additionalInvoiceData
     invoiceHead/invoiceDetail/conventionalInvoiceInfo/orderNumbers
     invoiceHead/invoiceDetail/conventionalInvoiceInfo/contractNumbers
     invoiceHead/invoiceDetail/conventionalInvoiceInfo/customerCompanyCodes
     invoiceHead/invoiceDetail/conventionalInvoiceInfo/projectNumbers
-- számla lekérdezés folytatólagossága (meg kell jegyezni, mi volt az utolsó elem), a kezdő dátum (napok száma) konfigurálható legyen?
-- autorizáció
-- dokumentum kezelés szétválasztása
+- NAV számla lekérdezés folytatólagossága (meg kell jegyezni, mi volt az utolsó elem), a kezdő dátum (napok száma) konfigurálható legyen?
+- távlati: autorizáció
+- távlati: dokumentum kezelés szétválasztása
 
 0.1.7
 * A számla importhoz tartozó menüpontok jelezzék, ha van feladat
index c1cb4870bb784edded97f8312b660bbf30c162a3..c145ce603fc876f46f60facd63a5e24dbb42b959 100644 (file)
@@ -48,7 +48,8 @@ Enjoy.
 
 
 DOCKER
-docker run -itd --name lis --privileged=true -p 50000:50000 -e LICENSE=accept -e DB2INSTANCE=db2admin -e DB2INST1_PASSWORD=password -e DBNAME=lis -e PERSISTENT_HOME=false -v /Docker:/database ibmcom/db2
+docker pull ibmcom/db2
+docker run -itd --name ibmdb2 --privileged=true -p 50000:50000 -e LICENSE=accept -e DB2INSTANCE=db2admin -e DB2INST1_PASSWORD=password -e DBNAME=lis -e PERSISTENT_HOME=false -v /docker/ibmdb2:/database ibmcom/db2
 docker logs -f lis
 docker exec -it lis bash
 docker stop lis
@@ -60,4 +61,7 @@ migrate up --env=prod
 
 Move data
 ----------
-https://community.ibm.com/community/user/datamanagement/discussion/db2-docker-persistent-volume
\ No newline at end of file
+https://community.ibm.com/community/user/datamanagement/discussion/db2-docker-persistent-volume
+
+DB2 SQL
+ALTER TABLE "tableName" ALTER COLUMN "columnName" RESTART WITH <new index value>
index ba552bc0b221390b3863f3524874fb062793dfb7..b8e4926435a4549bab028d3b457b952ee370df04 100644 (file)
@@ -10,7 +10,7 @@ INSERT INTO PARTNER
     (id, name, vat_nr, active)
 VALUES
     (1, 'NYÍRŐ', '00000000-00-0', 1),
-    (2, 'KOLOS', '00000000-00-0', 1);
+    (2, 'KOLOS', '00000001-00-0', 1);
 
 
 INSERT INTO PROJECT_STATUS
index b9e04354566b07ed9d2ad6a92f2412cb8d1714d6..bcf7c076fb89861e83f218da8a20c355b0f12bae 100644 (file)
@@ -1,8 +1,8 @@
 -- // add partner for invoice import test
 -- Migration SQL that makes the change goes here.
 
-INSERT INTO PARTNER(name, vat_nr, address, active)
-VALUES('Értékesítő Kft', '99999999-2-41', '1234 Budapest, Hármas utca 1', 1);
+INSERT INTO PARTNER(id, name, vat_nr, address, active)
+VALUES(3, 'Értékesítő Kft', '99999999-2-41', '1234 Budapest, Hármas utca 1', 1);
 
 -- //@UNDO
 -- SQL to undo the change goes here.
index e25f16c7e1f80ff1bc9a17bfb339338e6032f0cc..da74be71e3bf1ae1f05d12fcda3e65bf271999ec 100644 (file)
@@ -3,6 +3,6 @@ package hu.user.lis.db.repository;
 import hu.user.lis.db.Invoice;
 import org.springframework.data.jpa.repository.JpaRepository;
 
-public interface InvoiceRepository extends JpaRepository<Invoice, Long> {
+public interface InvoiceRepository extends JpaRepository<Invoice, Long>, InvoiceRepositorySearch {
 
 }
diff --git a/lis-db/src/main/java/hu/user/lis/db/repository/InvoiceRepositorySearch.java b/lis-db/src/main/java/hu/user/lis/db/repository/InvoiceRepositorySearch.java
new file mode 100644 (file)
index 0000000..cc55b83
--- /dev/null
@@ -0,0 +1,12 @@
+package hu.user.lis.db.repository;
+
+import hu.user.lis.db.Invoice;
+import hu.user.lis.db.repository.filter.InvoiceFilter;
+
+import java.util.List;
+
+public interface InvoiceRepositorySearch {
+    List<Invoice> search(InvoiceFilter filter);
+
+    long count(InvoiceFilter filter);
+}
diff --git a/lis-db/src/main/java/hu/user/lis/db/repository/InvoiceRepositorySearchImpl.java b/lis-db/src/main/java/hu/user/lis/db/repository/InvoiceRepositorySearchImpl.java
new file mode 100644 (file)
index 0000000..d60affd
--- /dev/null
@@ -0,0 +1,77 @@
+package hu.user.lis.db.repository;
+
+import hu.user.lis.db.Invoice;
+import hu.user.lis.db.repository.filter.InvoiceFilter;
+import org.springframework.data.jpa.repository.query.QueryUtils;
+import org.springframework.stereotype.Repository;
+
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.TypedQuery;
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.Predicate;
+import javax.persistence.criteria.Root;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+
+@Repository
+public class InvoiceRepositorySearchImpl implements InvoiceRepositorySearch {
+    @PersistenceContext
+    EntityManager entityManager;
+
+    Predicate[] getPredicates(CriteriaBuilder cb, Root<Invoice> root, InvoiceFilter filter) {
+        List<Predicate> predicates = new ArrayList<>();
+
+
+        if (Objects.nonNull(filter.getPartner())) {
+            predicates.add(cb.equal(root.get("partner"), filter.getPartner()));
+        }
+
+        if (Objects.nonNull(filter.getProject())) {
+            predicates.add(cb.equal(root.get("project"), filter.getProject()));
+        }
+
+        if (filter.isIncoming()) {
+            predicates.add(cb.isTrue(root.get("incoming")));
+        }
+
+        if (filter.isSettled()) {
+            //TODO add field
+            predicates.add(cb.isTrue(root.get("settled")));
+        }
+
+        if (Objects.nonNull(filter.getPaymentDeadLineFrom()) || Objects.nonNull(filter.getPaymentDeadLineTo())) {
+            //TODO check
+            predicates.add(cb.between(root.get("deadline"), filter.getPaymentDeadLineFrom(), filter.getPaymentDeadLineTo()));
+        }
+
+        return predicates.toArray(new Predicate[]{});
+    }
+
+    @Override
+    public List<Invoice> search(InvoiceFilter filter) {
+        CriteriaBuilder cb = entityManager.getCriteriaBuilder();
+        CriteriaQuery<Invoice> cq = cb.createQuery(Invoice.class);
+        Root<Invoice> root = cq.from(Invoice.class);
+
+        cq.where(getPredicates(cb, root, filter));
+        cq.orderBy(QueryUtils.toOrders(filter.getPageable().getSort(), root, cb));
+        TypedQuery<Invoice> query = entityManager.createQuery(cq);
+        query.setMaxResults(filter.getPageable().getPageSize());
+        query.setFirstResult(filter.getPageable().getPageSize() * filter.getPageable().getPageNumber());
+        return query.getResultList();
+    }
+
+    @Override
+    public long count(InvoiceFilter filter) {
+        CriteriaBuilder cb = entityManager.getCriteriaBuilder();
+        CriteriaQuery<Long> cq = cb.createQuery(Long.class);
+        Root<Invoice> root = cq.from(Invoice.class);
+
+        cq.select(cb.count(root));
+        cq.where(getPredicates(cb, root, filter));
+        return entityManager.createQuery(cq).getSingleResult();
+    }
+}
diff --git a/lis-db/src/main/java/hu/user/lis/db/repository/filter/InvoiceFilter.java b/lis-db/src/main/java/hu/user/lis/db/repository/filter/InvoiceFilter.java
new file mode 100644 (file)
index 0000000..beaeae4
--- /dev/null
@@ -0,0 +1,28 @@
+package hu.user.lis.db.repository.filter;
+
+import hu.user.lis.db.Partner;
+import hu.user.lis.db.Project;
+import lombok.*;
+
+import java.util.Date;
+
+@Getter
+@Setter
+@Builder
+@NoArgsConstructor
+@ToString
+public class InvoiceFilter extends PageableFilter {
+
+    private Partner partner;
+
+    private Project project;
+
+    private boolean isIncoming;
+
+    private boolean isSettled;
+
+    private Date paymentDeadLineFrom;
+
+    private Date paymentDeadLineTo;
+
+}
diff --git a/lis-db/src/main/java/hu/user/lis/db/repository/filter/PageableFilter.java b/lis-db/src/main/java/hu/user/lis/db/repository/filter/PageableFilter.java
new file mode 100644 (file)
index 0000000..43a2dbc
--- /dev/null
@@ -0,0 +1,11 @@
+package hu.user.lis.db.repository.filter;
+
+import lombok.Getter;
+import lombok.Setter;
+import org.springframework.data.domain.Pageable;
+
+@Getter
+@Setter
+public class PageableFilter {
+    private Pageable pageable;
+}
index 336eaa031ef309acd9b9996f36e76e9286b02686..b8e7a0bb5cbdd2fc3a42cea3f662823efc9d8316 100644 (file)
@@ -12,6 +12,9 @@ public class Constants {
     public static final String SET_PROJECTS_LIST_DATA = "SET_PROJECTS_LIST_DATA";
     public static final String REFRESH_INVOICE_IMPORT_TASKS = "REFRESH_INVOICE_IMPORT_TASKS";
     public static final String NAV_PARTNERS = "/partners";
+    public static final String NAV_INVOICES = "/invoices";
+
+    public static final String NAV_INVOICE_SETTLE = "/invoice-settle";
     public static final String NAV_PROJECTS = "/projects";
     public static final String NAV_PROJECT = "/project";
     public static final String NAV_PROJECT_WILD_CARD = "/project/**";
index 3cca4dd98a96f479f0faaa7642a65e8c83f1621e..4e9a79b85240e88a15f179c0ce5d55bac5a1838d 100644 (file)
@@ -24,6 +24,8 @@ public class ResourceConfigurer {
             Constants.NAV_SERVICE_RECORDS,
             Constants.NAV_IMPORT_INVOICES_ASSIGN,
             Constants.NAV_IMPORT_INVOICES_APPROVE,
+            Constants.NAV_INVOICES,
+            Constants.NAV_INVOICE_SETTLE,
             Constants.NAV_SETTINGS,
             Constants.NAV_PROJECT_WILD_CARD
     })
diff --git a/lis-ui/src/main/java/hu/user/lis/ui/data/InvoicesDataModel.java b/lis-ui/src/main/java/hu/user/lis/ui/data/InvoicesDataModel.java
new file mode 100644 (file)
index 0000000..aa7f712
--- /dev/null
@@ -0,0 +1,52 @@
+package hu.user.lis.ui.data;
+
+import hu.user.lis.db.Invoice;
+import hu.user.lis.db.repository.InvoiceRepository;
+import hu.user.lis.db.repository.filter.InvoiceFilter;
+import hu.user.lis.ui.data.common.CachedSpringDataModel;
+import lombok.extern.log4j.Log4j2;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.config.ConfigurableBeanFactory;
+import org.springframework.context.annotation.Scope;
+import org.springframework.data.domain.Pageable;
+import org.springframework.stereotype.Component;
+import org.zkoss.zul.FieldComparator;
+
+import java.util.List;
+import java.util.Objects;
+import java.util.Optional;
+
+@Component
+@Log4j2
+@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
+public class InvoicesDataModel extends CachedSpringDataModel<Invoice> {
+    @Autowired
+    InvoiceRepository invoiceRepository;
+
+    private InvoiceFilter filter;
+
+    @Override
+    public List<Invoice> getResultSet(int page, int pageSize, FieldComparator sortComparator) {
+        Pageable pageable = createPageable(page, pageSize, sortComparator);
+        Optional.ofNullable(filter).ifPresent(f -> f.setPageable(pageable));
+        return Objects.isNull(filter) ? invoiceRepository.findAll(pageable).getContent() : invoiceRepository.search(filter);
+    }
+
+    @Override
+    public int getResultSetCount() {
+        long result = Objects.isNull(filter) ? invoiceRepository.count() : invoiceRepository.count(filter);
+        return (int) result;
+    }
+
+    public void search(InvoiceFilter filter) {
+        log.info("Searching invoices using filter: {}", filter);
+        this.filter = filter;
+        super.reset();
+    }
+
+    public void listAll() {
+        log.info("List all invoices");
+        this.filter = null;
+        super.reset();
+    }
+}
index 6681f3aa7092a12e1723552bf9286470b3abf100..f25ebaa86cc3b7827de76be5a0474f1839a9feca 100644 (file)
@@ -180,4 +180,9 @@ public class IndexViewModel implements EventListener<Event> {
     public void onCancelImportInvoiceProcess() {
         workflowManagerService.cancelInvoiceImportProcess();
     }
+
+    @Command
+    public void onInvoiceDues() {
+
+    }
 }
diff --git a/lis-ui/src/main/java/hu/user/lis/ui/view/InvoicesViewModel.java b/lis-ui/src/main/java/hu/user/lis/ui/view/InvoicesViewModel.java
new file mode 100644 (file)
index 0000000..f9f529a
--- /dev/null
@@ -0,0 +1,53 @@
+package hu.user.lis.ui.view;
+
+import com.google.common.collect.ImmutableMap;
+import hu.user.lis.db.Invoice;
+import hu.user.lis.ui.Constants;
+import hu.user.lis.ui.data.InvoicesDataModel;
+import hu.user.lis.ui.data.common.CachedSpringDataModel;
+import hu.user.lis.ui.view.common.EntityViewModel;
+import lombok.Getter;
+import lombok.extern.log4j.Log4j2;
+import org.zkoss.bind.annotation.Init;
+import org.zkoss.zk.ui.select.annotation.WireVariable;
+
+import static hu.user.lis.ui.data.common.CachedDataModel.ASCENDING;
+import static hu.user.lis.ui.data.common.CachedDataModel.NATURAL;
+
+@Log4j2
+public class InvoicesViewModel extends EntityViewModel<Invoice> {
+    @Getter
+    @WireVariable
+    InvoicesDataModel invoicesDataModel;
+
+    @Override
+    protected CachedSpringDataModel<Invoice> getDataModel() {
+        return invoicesDataModel;
+    }
+
+    @Override
+    protected String getNavigation() {
+        return Constants.NAV_INVOICES;
+    }
+
+    @Init
+    public void init() {
+        super.init();
+        addColumns(ImmutableMap.of(
+                "partner.name", ASCENDING,
+                "partner.vatNr", NATURAL,
+                "project.name", NATURAL,
+                "dueDate", NATURAL,
+                "paymentDate", NATURAL,
+                "grossAmount", NATURAL,
+                "currency", NATURAL,
+                "income", NATURAL
+        ));
+    }
+
+    protected void refresh() {
+        invoicesDataModel.clearSelection();
+        invoicesDataModel.listAll();
+    }
+
+}
index cef68a7983607ff0cf5e641f4476f91bfbfb4db5..97d900cb6784eb3a34e31ed9b9f34b062a0f0657 100644 (file)
                             <menu iconSclass="z-icon-euro" label="Számlák"
                                   sclass="@bind(vm.importInvoiceMenuClassName)">
                                 <menupopup>
+                                    <menuitem iconSclass="z-icon-money" label="Összes számla"
+                                              onClick="@command(vm.selectPage('~./invoices.zul'))"/>
+                                    <menuitem iconSclass="z-icon-credit-card" label="Számla kiegyenlítés"
+                                              onClick="@command(vm.selectPage('~./invoice-settle.zul'))"/>
+                                    <menuitem iconSclass="z-icon-exchange" label="Követelés követés"
+                                              onClick="@command('onInvoiceDues')"/>
+                                    <menuseparator/>
                                     <menu iconSclass="z-icon-tasks" label="Számla iktatás"
                                           sclass="@bind(vm.importInvoiceMenuClassName)">
                                         <menupopup>
diff --git a/lis-ui/src/main/resources/web/invoice-settle.zul b/lis-ui/src/main/resources/web/invoice-settle.zul
new file mode 100644 (file)
index 0000000..36e170c
--- /dev/null
@@ -0,0 +1,51 @@
+<zk>
+    <window vflex="true" viewModel="@id('vm') @init('hu.user.lis.ui.view.InvoicesViewModel')">
+        <caption label="Számla kiegyenlítés"/>
+        <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.selectedEntity)"/>
+                    <toolbarbutton label="Törlés" iconSclass="z-icon-remove" onClick="@command('onDelete')"
+                                   disabled="@load(empty vm.selectedEntity)"/>
+                    <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)"/>
+                </toolbar>
+            </north>
+            <center border="none" flex="true">
+                <listbox id="partnersList" vflex="true" model="@load(vm.partnersDataModel)"
+                         autopaging="true" mold="paging" pagingPosition="top" multiple="false"
+                         onSelect="@command('onListSelection')" onDoubleClick="@command('onEdit')">
+                    <listhead sizable="true">
+                        <listheader label="Név" sort="auto(name)" align="left"
+                                    sortDirection="@load(vm.cols['name'].sortDirection)"/>
+                        <listheader label="Adószám" sort="auto(vatNr)" align="left"
+                                    sortDirection="@load(vm.cols['vatNr'].sortDirection)"/>
+                        <listheader label="Cím" sort="auto(address)" align="left"
+                                    sortDirection="@load(vm.cols['address'].sortDirection)"/>
+                        <listheader label="Aktív" sort="auto(active)" align="left"
+                                    sortDirection="@load(vm.cols['active'].sortDirection)"/>
+
+                    </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)"/>
+                            </listcell>
+                        </listitem>
+                    </template>
+                </listbox>
+            </center>
+        </borderlayout>
+    </window>
+</zk>
\ No newline at end of file
diff --git a/lis-ui/src/main/resources/web/invoices.zul b/lis-ui/src/main/resources/web/invoices.zul
new file mode 100644 (file)
index 0000000..4589531
--- /dev/null
@@ -0,0 +1,51 @@
+<zk>
+    <window vflex="true" viewModel="@id('vm') @init('hu.user.lis.ui.view.InvoicesViewModel')">
+        <caption label="Számlák"/>
+        <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.selectedEntity)"/>
+                    <toolbarbutton label="Törlés" iconSclass="z-icon-remove" onClick="@command('onDelete')"
+                                   disabled="@load(empty vm.selectedEntity)"/>
+                    <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)"/>
+                </toolbar>
+            </north>
+            <center border="none" flex="true">
+                <listbox id="partnersList" vflex="true" model="@load(vm.partnersDataModel)"
+                         autopaging="true" mold="paging" pagingPosition="top" multiple="false"
+                         onSelect="@command('onListSelection')" onDoubleClick="@command('onEdit')">
+                    <listhead sizable="true">
+                        <listheader label="Név" sort="auto(name)" align="left"
+                                    sortDirection="@load(vm.cols['name'].sortDirection)"/>
+                        <listheader label="Adószám" sort="auto(vatNr)" align="left"
+                                    sortDirection="@load(vm.cols['vatNr'].sortDirection)"/>
+                        <listheader label="Cím" sort="auto(address)" align="left"
+                                    sortDirection="@load(vm.cols['address'].sortDirection)"/>
+                        <listheader label="Aktív" sort="auto(active)" align="left"
+                                    sortDirection="@load(vm.cols['active'].sortDirection)"/>
+
+                    </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)"/>
+                            </listcell>
+                        </listitem>
+                    </template>
+                </listbox>
+            </center>
+        </borderlayout>
+    </window>
+</zk>
\ No newline at end of file