Distinguish planned invoices in lists
authorVásáry Dániel <vasary@elgekko.net>
Tue, 12 Dec 2023 10:49:29 +0000 (11:49 +0100)
committerVásáry Dániel <vasary@elgekko.net>
Tue, 12 Dec 2023 10:49:29 +0000 (11:49 +0100)
lis-ui/src/main/java/hu/user/lis/ui/view/InvoicesViewModel.java
lis-ui/src/main/resources/web/editor/project/incoming-invoices.zul
lis-ui/src/main/resources/web/editor/project/outgoing-invoices.zul
lis-ui/src/main/resources/web/invoices.zul

index 6dda1b3279a3fb3a3770513d1bbf7de32ace2ced..71d13e2e0a9411c4f97f584fc141ccb7b7794022 100644 (file)
@@ -60,6 +60,7 @@ public class InvoicesViewModel extends EntityViewModel<Invoice> implements Event
         eventBus.register(this);
         eventBus.registerForBinding(this);
         addColumns(ImmutableMap.of(
+                "planned", NATURAL,
                 "partner.humanId", NATURAL,
                 "partner.name", NATURAL,
                 "project.humanId", NATURAL,
index 10c62096f5fd95ae782a5e9476dc31229a0cab29..375cdb40f756945b80e23c4bd3fc5985e760cf80 100644 (file)
@@ -20,6 +20,7 @@
                          onDoubleClick="@command('onEditIncoming')"
                          forward="onOK=submit.onClick, onCancel=cancel.onClick">
                     <listhead sizable="true">
+                        <listheader width="30px" label="Terv" sort="auto(planned)" align="left"/>
                         <listheader label="Szállító" sort="auto(partner.name)" align="left"/>
                         <listheader label="Sorszám" sort="auto(humanId)" align="left"/>
                         <listheader label="Megnevezés" sort="auto(title)" align="left"/>
                     </listhead>
                     <template name="model">
                         <listitem>
-                            <listcell label="@load(each.partner.name)"/>
-                            <listcell label="@load(each.humanId)"/>
-                            <listcell label="@load(each.title)"/>
+                            <listcell>
+                                <a iconSclass="z-icon-map-marker" visible="@load(each.planned)"
+                                   style="@load(each.planned ? 'color: gray' : 'color: black')"/>
+                            </listcell>
+                            <listcell label="@load(each.partner.name)"
+                                      style="@load(each.planned ? 'color: gray' : 'color: black')"/>
+                            <listcell label="@load(each.humanId)"
+                                      style="@load(each.planned ? 'color: gray' : 'color: black')"/>
+                            <listcell label="@load(each.title)"
+                                      style="@load(each.planned ? 'color: gray' : 'color: black')"/>
                             <listcell
-                                    label="@load(each.netAmount) @converter('hu.user.lis.ui.converter.DoubleToStringConverter')"/>
-                            <listcell label="@load(each.currency)"/>
+                                    label="@load(each.netAmount) @converter('hu.user.lis.ui.converter.DoubleToStringConverter')"
+                                    style="@load(each.planned ? 'color: gray' : 'color: black')"/>
+                            <listcell label="@load(each.currency)"
+                                      style="@load(each.planned ? 'color: gray' : 'color: black')"/>
                             <listcell
-                                    label="@load(each.completionDate) @converter('hu.user.lis.ui.converter.DateToStringConverter')"/>
+                                    label="@load(each.completionDate) @converter('hu.user.lis.ui.converter.DateToStringConverter')"
+                                    style="@load(each.planned ? 'color: gray' : 'color: black')"/>
                             <listcell
-                                    label="@load(each.paymentDeadline) @converter('hu.user.lis.ui.converter.DateToStringConverter')"/>
+                                    label="@load(each.paymentDeadline) @converter('hu.user.lis.ui.converter.DateToStringConverter')"
+                                    style="@load(each.planned ? 'color: gray' : 'color: black')"/>
                         </listitem>
                     </template>
                 </listbox>
index 91ddd68efaba0a9cce82e05f3f3a545429aa07c2..2a48afd41d751d1308d000a1ab930114ea74adce 100644 (file)
@@ -20,6 +20,7 @@
                          onDoubleClick="@command('onEditOutgoing')"
                          forward="onOK=submit.onClick, onCancel=cancel.onClick">
                     <listhead sizable="true">
+                        <listheader width="30px" label="Terv" sort="auto(planned)" align="left"/>
                         <listheader label="Vevő" sort="auto(partner.name)" align="left"/>
                         <listheader label="Sorszám" sort="auto(humanId)" align="left"/>
                         <listheader label="Megnevezés" sort="auto(title)" align="left"/>
                     </listhead>
                     <template name="model">
                         <listitem>
-                            <listcell label="@load(each.partner.name)"/>
-                            <listcell label="@load(each.humanId)"/>
-                            <listcell label="@load(each.title)"/>
+                            <listcell>
+                                <a iconSclass="z-icon-map-marker" visible="@load(each.planned)"
+                                   style="@load(each.planned ? 'color: gray' : 'color: black')"/>
+                            </listcell>
+                            <listcell label="@load(each.partner.name)"
+                                      style="@load(each.planned ? 'color: gray' : 'color: black')"/>
+                            <listcell label="@load(each.humanId)"
+                                      style="@load(each.planned ? 'color: gray' : 'color: black')"/>
+                            <listcell label="@load(each.title)"
+                                      style="@load(each.planned ? 'color: gray' : 'color: black')"/>
                             <listcell
-                                    label="@load(each.netAmount) @converter('hu.user.lis.ui.converter.DoubleToStringConverter')"/>
-                            <listcell label="@load(each.currency)"/>
+                                    label="@load(each.netAmount) @converter('hu.user.lis.ui.converter.DoubleToStringConverter')"
+                                    style="@load(each.planned ? 'color: gray' : 'color: black')"/>
+                            <listcell label="@load(each.currency)"
+                                      style="@load(each.planned ? 'color: gray' : 'color: black')"/>
                             <listcell
-                                    label="@load(each.completionDate) @converter('hu.user.lis.ui.converter.DateToStringConverter')"/>
+                                    label="@load(each.completionDate) @converter('hu.user.lis.ui.converter.DateToStringConverter')"
+                                    style="@load(each.planned ? 'color: gray' : 'color: black')"/>
                             <listcell
-                                    label="@load(each.paymentDeadline) @converter('hu.user.lis.ui.converter.DateToStringConverter')"/>
+                                    label="@load(each.paymentDeadline) @converter('hu.user.lis.ui.converter.DateToStringConverter')"
+                                    style="@load(each.planned ? 'color: gray' : 'color: black')"/>
                         </listitem>
                     </template>
                 </listbox>
index d07b27f2c626e1bc293277e4632679231c8c4d1f..c7dbb7336b29a0744c6abb1eb7b92237b6c8a4c3 100644 (file)
@@ -79,6 +79,8 @@
                          autopaging="true" mold="paging" pagingPosition="top" multiple="false"
                          onSelect="@command('onListSelection')" onDoubleClick="@command('onEdit')">
                     <listhead sizable="true">
+                        <listheader width="30px" label="Terv" sort="auto(planned)" align="left"
+                                    sortDirection="@load(vm.cols['planned'].sortDirection)"/>
                         <listheader label="Sorszám" sort="auto(partner.humanId)" align="left"
                                     sortDirection="@load(vm.cols['partner.name'].sortDirection)"/>
                         <listheader label="Partner név" sort="auto(partner.name)" align="left"
                     </listhead>
                     <template name="model">
                         <listitem>
-                            <listcell label="@load(each.humanId)"/>
-                            <listcell label="@load(each.partner.name)"/>
-                            <listcell label="@load(each.project.humanId)"/>
-                            <listcell label="@load(each.project.name)"/>
+                            <listcell>
+                                <a iconSclass="z-icon-map-marker" visible="@load(each.planned)"
+                                   style="@load(each.planned ? 'color: gray' : 'color: black')"/>
+                            </listcell>
+                            <listcell label="@load(each.humanId)"
+                                      style="@load(each.planned ? 'color: gray' : 'color: black')"/>
+                            <listcell label="@load(each.partner.name)"
+                                      style="@load(each.planned ? 'color: gray' : 'color: black')"/>
+                            <listcell label="@load(each.project.humanId)"
+                                      style="@load(each.planned ? 'color: gray' : 'color: black')"/>
+                            <listcell label="@load(each.project.name)"
+                                      style="@load(each.planned ? 'color: gray' : 'color: black')"/>
                             <listcell
-                                    label="@load(each.paymentDeadline) @converter('hu.user.lis.ui.converter.DateToStringConverter')"/>
+                                    label="@load(each.paymentDeadline) @converter('hu.user.lis.ui.converter.DateToStringConverter')"
+                                    style="@load(each.planned ? 'color: gray' : 'color: black')"/>
                             <listcell
-                                    label="@load(each.grossAmount) @converter('hu.user.lis.ui.converter.DoubleToStringConverter')"/>
-                            <listcell label="@load(each.currency)"/>
+                                    label="@load(each.grossAmount) @converter('hu.user.lis.ui.converter.DoubleToStringConverter')"
+                                    style="@load(each.planned ? 'color: gray' : 'color: black')"/>
+                            <listcell label="@load(each.currency)"
+                                      style="@load(each.planned ? 'color: gray' : 'color: black')"/>
                             <listcell>
-                                <a iconSclass="z-icon-external-link" visible="@load(each.incoming)"/>
-                                <a iconSclass="z-icon-sign-in" visible="@load(!each.incoming)"/>
+                                <a iconSclass="z-icon-external-link" visible="@load(each.incoming)"
+                                   style="@load(each.planned ? 'color: gray' : 'color: black')"/>
+                                <a iconSclass="z-icon-sign-in" visible="@load(!each.incoming)"
+                                   style="@load(each.planned ? 'color: gray' : 'color: black')"/>
                             </listcell>
                         </listitem>
                     </template>