Po refreshi gridu se obnovi puvodni trideni a filtr nastaveny pred editaci/schvalenim zaznamu.
closes #271
This commit is contained in:
@@ -129,7 +129,7 @@ public class InvoicingServiceImpl extends AbstractOwnedService<Invoicing> implem
|
|||||||
@Transactional
|
@Transactional
|
||||||
@PreAuthorize("hasPermission(this, 'PERM_READ')")
|
@PreAuthorize("hasPermission(this, 'PERM_READ')")
|
||||||
public List<Invoicing> getMaterialPendingList() {
|
public List<Invoicing> getMaterialPendingList() {
|
||||||
Query q = dao.getQuery("select inv from Invoicing as inv join fetch inv.requirement rq join fetch rq.ownedBy where (inv.completed Is Null or inv.completed = false) and (rq.kind = :kind) order by rq.numser");
|
Query q = dao.getQuery("select inv from Invoicing as inv join fetch inv.requirement rq join fetch rq.ownedBy where (inv.completed Is Null or inv.completed = false) and (rq.kind = :kind) order by rq.numser desc");
|
||||||
q.setParameter("kind", Constants.REQ_TYPE_MATERIAL);
|
q.setParameter("kind", Constants.REQ_TYPE_MATERIAL);
|
||||||
return q.list();
|
return q.list();
|
||||||
}
|
}
|
||||||
@@ -139,7 +139,7 @@ public class InvoicingServiceImpl extends AbstractOwnedService<Invoicing> implem
|
|||||||
@Transactional
|
@Transactional
|
||||||
@PreAuthorize("hasPermission(this, 'PERM_READ')")
|
@PreAuthorize("hasPermission(this, 'PERM_READ')")
|
||||||
public List<Invoicing> getMaterialArchiveList() {
|
public List<Invoicing> getMaterialArchiveList() {
|
||||||
Query q = dao.getQuery("select inv from Invoicing as inv join fetch inv.requirement rq join fetch rq.ownedBy where (inv.completed = true) and (rq.kind = :kind) order by rq.numser");
|
Query q = dao.getQuery("select inv from Invoicing as inv join fetch inv.requirement rq join fetch rq.ownedBy where (inv.completed = true) and (rq.kind = :kind) order by rq.numser desc");
|
||||||
q.setParameter("kind", Constants.REQ_TYPE_MATERIAL);
|
q.setParameter("kind", Constants.REQ_TYPE_MATERIAL);
|
||||||
return q.list();
|
return q.list();
|
||||||
}
|
}
|
||||||
@@ -149,7 +149,7 @@ public class InvoicingServiceImpl extends AbstractOwnedService<Invoicing> implem
|
|||||||
@Transactional
|
@Transactional
|
||||||
@PreAuthorize("hasPermission(this, 'PERM_READ')")
|
@PreAuthorize("hasPermission(this, 'PERM_READ')")
|
||||||
public List<Invoicing> getServicesPendingList() {
|
public List<Invoicing> getServicesPendingList() {
|
||||||
Query q = dao.getQuery("select inv from Invoicing as inv join fetch inv.requirement rq join fetch rq.ownedBy where (inv.completed Is Null or inv.completed = false) and (rq.kind = :kind) order by rq.numser");
|
Query q = dao.getQuery("select inv from Invoicing as inv join fetch inv.requirement rq join fetch rq.ownedBy where (inv.completed Is Null or inv.completed = false) and (rq.kind = :kind) order by rq.numser desc");
|
||||||
q.setParameter("kind", Constants.REQ_TYPE_SERVICES);
|
q.setParameter("kind", Constants.REQ_TYPE_SERVICES);
|
||||||
return q.list();
|
return q.list();
|
||||||
}
|
}
|
||||||
@@ -159,7 +159,7 @@ public class InvoicingServiceImpl extends AbstractOwnedService<Invoicing> implem
|
|||||||
@Transactional
|
@Transactional
|
||||||
@PreAuthorize("hasPermission(this, 'PERM_READ')")
|
@PreAuthorize("hasPermission(this, 'PERM_READ')")
|
||||||
public List<Invoicing> getServicesArchiveList() {
|
public List<Invoicing> getServicesArchiveList() {
|
||||||
Query q = dao.getQuery("select inv from Invoicing as inv join fetch inv.requirement rq join fetch rq.ownedBy where (inv.completed = true) and (rq.kind = :kind) order by rq.numser");
|
Query q = dao.getQuery("select inv from Invoicing as inv join fetch inv.requirement rq join fetch rq.ownedBy where (inv.completed = true) and (rq.kind = :kind) order by rq.numser desc");
|
||||||
q.setParameter("kind", Constants.REQ_TYPE_SERVICES);
|
q.setParameter("kind", Constants.REQ_TYPE_SERVICES);
|
||||||
return q.list();
|
return q.list();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import org.zkoss.zul.Messagebox;
|
|||||||
import org.zkoss.zul.Window;
|
import org.zkoss.zul.Window;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -146,6 +147,7 @@ public class ListViewModel<T extends DataModel> extends DocumentViewModel
|
|||||||
dataList = fullList;
|
dataList = fullList;
|
||||||
dataBean = null;
|
dataBean = null;
|
||||||
selIndex = -1;
|
selIndex = -1;
|
||||||
|
restoreSort();
|
||||||
} else {
|
} else {
|
||||||
doFilter();
|
doFilter();
|
||||||
dataBean = null;
|
dataBean = null;
|
||||||
@@ -285,10 +287,7 @@ public class ListViewModel<T extends DataModel> extends DocumentViewModel
|
|||||||
|
|
||||||
BindUtils.postGlobalCommand(null, null, "reloadRelated", null);
|
BindUtils.postGlobalCommand(null, null, "reloadRelated", null);
|
||||||
|
|
||||||
if (sortHeader != null) {
|
restoreUserView();
|
||||||
sortHeader.setSortDirection("natural");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@GlobalCommand
|
@GlobalCommand
|
||||||
@@ -355,23 +354,14 @@ public class ListViewModel<T extends DataModel> extends DocumentViewModel
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Command
|
|
||||||
@NotifyChange("dataBean")
|
|
||||||
public void onSort(@BindingParam("column") String column) {
|
|
||||||
if (sortCol == null || this.sortCol.equals(column))
|
|
||||||
this.sortDesc = !this.sortDesc;
|
|
||||||
|
|
||||||
this.sortCol = column;
|
|
||||||
selIndex = -1;
|
|
||||||
dataBean = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Command
|
@Command
|
||||||
@NotifyChange({"dataBean", "canApprove"})
|
@NotifyChange({"dataBean", "canApprove"})
|
||||||
public void onSortHeader(@BindingParam("header") Listheader header) {
|
public void onSortHeader(@BindingParam("header") Listheader header) {
|
||||||
sortHeader = header;
|
sortHeader = header;
|
||||||
selIndex = -1;
|
selIndex = -1;
|
||||||
dataBean = null;
|
dataBean = null;
|
||||||
|
Collections.sort(dataList,
|
||||||
|
sortHeader.getSortDirection().equals("ascending") ? sortHeader.getSortDescending() : sortHeader.getSortAscending());
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getSelIndex() {
|
public int getSelIndex() {
|
||||||
@@ -427,6 +417,27 @@ public class ListViewModel<T extends DataModel> extends DocumentViewModel
|
|||||||
this.fullFill = fullFill;
|
this.fullFill = fullFill;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void restoreUserView() {
|
||||||
|
int sel = selIndex;
|
||||||
|
|
||||||
|
restoreFilter();
|
||||||
|
restoreSort();
|
||||||
|
selIndex = sel;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void restoreSort() {
|
||||||
|
if (sortHeader != null) {
|
||||||
|
Collections.sort(dataList,
|
||||||
|
sortHeader.getSortDirection().equals("ascending") ? sortHeader.getSortAscending() : sortHeader.getSortDescending());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void restoreFilter() {
|
||||||
|
if (filter) {
|
||||||
|
doFilter();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isRecordSelected()
|
public boolean isRecordSelected()
|
||||||
{
|
{
|
||||||
return (dataBean != null);
|
return (dataBean != null);
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ public class ApproveDialogVM {
|
|||||||
BindUtils.postNotifyChange(null, null, grid, "dataBean");
|
BindUtils.postNotifyChange(null, null, grid, "dataBean");
|
||||||
BindUtils.postNotifyChange(null, null, grid, "canApprove");
|
BindUtils.postNotifyChange(null, null, grid, "canApprove");
|
||||||
BindUtils.postGlobalCommand(null, null, "reload", null);
|
BindUtils.postGlobalCommand(null, null, "reload", null);
|
||||||
|
grid.refresh();
|
||||||
window.detach();
|
window.detach();
|
||||||
} catch (ApproveException ex) {
|
} catch (ApproveException ex) {
|
||||||
Messagebox.show(StringUtils.localize(ex.getReason()), StringUtils.localize("Error"), Messagebox.OK,
|
Messagebox.show(StringUtils.localize(ex.getReason()), StringUtils.localize("Error"), Messagebox.OK,
|
||||||
|
|||||||
@@ -6,11 +6,6 @@ import info.bukova.isspst.filters.RequirementFilter;
|
|||||||
import info.bukova.isspst.services.requirement.RequirementService;
|
import info.bukova.isspst.services.requirement.RequirementService;
|
||||||
import info.bukova.isspst.services.workgroups.WorkgroupService;
|
import info.bukova.isspst.services.workgroups.WorkgroupService;
|
||||||
import info.bukova.isspst.ui.requirement.RequirementSubpage;
|
import info.bukova.isspst.ui.requirement.RequirementSubpage;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.springframework.security.access.AccessDeniedException;
|
import org.springframework.security.access.AccessDeniedException;
|
||||||
import org.zkoss.bind.BindUtils;
|
import org.zkoss.bind.BindUtils;
|
||||||
import org.zkoss.bind.annotation.GlobalCommand;
|
import org.zkoss.bind.annotation.GlobalCommand;
|
||||||
@@ -18,6 +13,10 @@ import org.zkoss.bind.annotation.Init;
|
|||||||
import org.zkoss.bind.annotation.NotifyChange;
|
import org.zkoss.bind.annotation.NotifyChange;
|
||||||
import org.zkoss.zk.ui.select.annotation.WireVariable;
|
import org.zkoss.zk.ui.select.annotation.WireVariable;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class ReqListMyAll extends RequirementSubpage<Requirement>
|
public class ReqListMyAll extends RequirementSubpage<Requirement>
|
||||||
{
|
{
|
||||||
@WireVariable
|
@WireVariable
|
||||||
@@ -55,10 +54,11 @@ public class ReqListMyAll extends RequirementSubpage<Requirement>
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GlobalCommand
|
@GlobalCommand
|
||||||
@NotifyChange({ "dataList", "dataBean", "fullFill" })
|
@NotifyChange({ "dataList", "dataBean", "fullFill", "selIndex" })
|
||||||
public void reloadRelated()
|
public void reloadRelated()
|
||||||
{
|
{
|
||||||
this.reload();
|
this.reload();
|
||||||
|
restoreUserView();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -6,11 +6,6 @@ import info.bukova.isspst.filters.RequirementFilter;
|
|||||||
import info.bukova.isspst.services.requirement.RequirementService;
|
import info.bukova.isspst.services.requirement.RequirementService;
|
||||||
import info.bukova.isspst.services.workgroups.WorkgroupService;
|
import info.bukova.isspst.services.workgroups.WorkgroupService;
|
||||||
import info.bukova.isspst.ui.requirement.RequirementSubpage;
|
import info.bukova.isspst.ui.requirement.RequirementSubpage;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.springframework.security.access.AccessDeniedException;
|
import org.springframework.security.access.AccessDeniedException;
|
||||||
import org.zkoss.bind.BindUtils;
|
import org.zkoss.bind.BindUtils;
|
||||||
import org.zkoss.bind.annotation.GlobalCommand;
|
import org.zkoss.bind.annotation.GlobalCommand;
|
||||||
@@ -18,6 +13,10 @@ import org.zkoss.bind.annotation.Init;
|
|||||||
import org.zkoss.bind.annotation.NotifyChange;
|
import org.zkoss.bind.annotation.NotifyChange;
|
||||||
import org.zkoss.zk.ui.select.annotation.WireVariable;
|
import org.zkoss.zk.ui.select.annotation.WireVariable;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class ReqListMyCenters extends RequirementSubpage<Requirement>
|
public class ReqListMyCenters extends RequirementSubpage<Requirement>
|
||||||
{
|
{
|
||||||
@WireVariable
|
@WireVariable
|
||||||
@@ -55,10 +54,11 @@ public class ReqListMyCenters extends RequirementSubpage<Requirement>
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GlobalCommand
|
@GlobalCommand
|
||||||
@NotifyChange({ "dataList", "dataBean", "fullFill" })
|
@NotifyChange({ "dataList", "dataBean", "fullFill", "selIndex" })
|
||||||
public void reloadRelated()
|
public void reloadRelated()
|
||||||
{
|
{
|
||||||
this.reload();
|
this.reload();
|
||||||
|
restoreUserView();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+6
-6
@@ -6,11 +6,6 @@ import info.bukova.isspst.filters.RequirementFilter;
|
|||||||
import info.bukova.isspst.services.requirement.RequirementService;
|
import info.bukova.isspst.services.requirement.RequirementService;
|
||||||
import info.bukova.isspst.services.workgroups.WorkgroupService;
|
import info.bukova.isspst.services.workgroups.WorkgroupService;
|
||||||
import info.bukova.isspst.ui.requirement.RequirementSubpage;
|
import info.bukova.isspst.ui.requirement.RequirementSubpage;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.springframework.security.access.AccessDeniedException;
|
import org.springframework.security.access.AccessDeniedException;
|
||||||
import org.zkoss.bind.BindUtils;
|
import org.zkoss.bind.BindUtils;
|
||||||
import org.zkoss.bind.annotation.GlobalCommand;
|
import org.zkoss.bind.annotation.GlobalCommand;
|
||||||
@@ -18,6 +13,10 @@ import org.zkoss.bind.annotation.Init;
|
|||||||
import org.zkoss.bind.annotation.NotifyChange;
|
import org.zkoss.bind.annotation.NotifyChange;
|
||||||
import org.zkoss.zk.ui.select.annotation.WireVariable;
|
import org.zkoss.zk.ui.select.annotation.WireVariable;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class ReqListMyWorkgroups extends RequirementSubpage<Requirement>
|
public class ReqListMyWorkgroups extends RequirementSubpage<Requirement>
|
||||||
{
|
{
|
||||||
@WireVariable
|
@WireVariable
|
||||||
@@ -55,10 +54,11 @@ public class ReqListMyWorkgroups extends RequirementSubpage<Requirement>
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GlobalCommand
|
@GlobalCommand
|
||||||
@NotifyChange({ "dataList", "dataBean", "fullFill" })
|
@NotifyChange({ "dataList", "dataBean", "fullFill", "selIndex" })
|
||||||
public void reloadRelated()
|
public void reloadRelated()
|
||||||
{
|
{
|
||||||
this.reload();
|
this.reload();
|
||||||
|
restoreUserView();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -63,9 +63,10 @@ public class TripRequirementListAll extends RequirementSubpage<TripRequirement>
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GlobalCommand
|
@GlobalCommand
|
||||||
@NotifyChange({ "dataList", "dataBean", "fullFill" })
|
@NotifyChange({ "dataList", "dataBean", "fullFill", "selIndex" })
|
||||||
public void reloadRelated() {
|
public void reloadRelated() {
|
||||||
this.reload();
|
this.reload();
|
||||||
|
restoreUserView();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ public class TripRequirementListCentre extends RequirementSubpage<TripRequiremen
|
|||||||
@NotifyChange({ "dataList", "dataBean", "fullFill" })
|
@NotifyChange({ "dataList", "dataBean", "fullFill" })
|
||||||
public void reloadRelated() {
|
public void reloadRelated() {
|
||||||
this.reload();
|
this.reload();
|
||||||
|
restoreUserView();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ public class TripRequirementListWorkgroup extends RequirementSubpage<TripRequire
|
|||||||
@NotifyChange({ "dataList", "dataBean", "fullFill" })
|
@NotifyChange({ "dataList", "dataBean", "fullFill" })
|
||||||
public void reloadRelated() {
|
public void reloadRelated() {
|
||||||
this.reload();
|
this.reload();
|
||||||
|
restoreUserView();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -78,9 +78,9 @@ public class TripBillListBase extends RequirementSubpage<TripBillApproval> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GlobalCommand
|
@GlobalCommand
|
||||||
@NotifyChange({ "dataList", "dataBean", "fullFill" })
|
@NotifyChange({ "dataList", "dataBean", "fullFill", "selIndex" })
|
||||||
public void reloadRelated()
|
public void reloadRelated() {
|
||||||
{
|
|
||||||
this.reload();
|
this.reload();
|
||||||
|
restoreUserView();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,37 +9,44 @@
|
|||||||
<listheader
|
<listheader
|
||||||
label="${labels.InvoicingRequirementNumber}"
|
label="${labels.InvoicingRequirementNumber}"
|
||||||
sort="czech(requirement.numser)"
|
sort="czech(requirement.numser)"
|
||||||
onCreate="self.sort(false)"
|
onSort="@command('onSortHeader', header=self)"
|
||||||
width="130px" />
|
width="130px" />
|
||||||
<listheader
|
<listheader
|
||||||
label="${labels.RequirementsGridReqDate}"
|
label="${labels.RequirementsGridReqDate}"
|
||||||
sort="auto(requirement.reqDate)"
|
sort="auto(requirement.reqDate)"
|
||||||
|
onSort="@command('onSortHeader', header=self)"
|
||||||
width="150px" />
|
width="150px" />
|
||||||
<listheader
|
<listheader
|
||||||
label="${labels.RequirementsGridCenter}"
|
label="${labels.RequirementsGridCenter}"
|
||||||
sort="czech(requirement.centre.fullName)"
|
sort="czech(requirement.centre.fullName)"
|
||||||
|
onSort="@command('onSortHeader', header=self)"
|
||||||
width="180px" />
|
width="180px" />
|
||||||
<listheader
|
<listheader
|
||||||
label="${labels.RequirementsGridWorkgroup}"
|
label="${labels.RequirementsGridWorkgroup}"
|
||||||
sort="czech(requirement.workgroup.fullName)"
|
sort="czech(requirement.workgroup.fullName)"
|
||||||
|
onSort="@command('onSortHeader', header=self)"
|
||||||
width="180px" />
|
width="180px" />
|
||||||
<listheader
|
<listheader
|
||||||
label="${labels.InvoicingApplicant}"
|
label="${labels.InvoicingApplicant}"
|
||||||
sort="czech(requirement.ownedBy.fullName)"
|
sort="czech(requirement.ownedBy.fullName)"
|
||||||
|
onSort="@command('onSortHeader', header=self)"
|
||||||
width="180px" />
|
width="180px" />
|
||||||
<listheader
|
<listheader
|
||||||
label="${labels.InvoicingDescription}"
|
label="${labels.InvoicingDescription}"
|
||||||
sort="czech(requirement.description)"
|
sort="czech(requirement.description)"
|
||||||
|
onSort="@command('onSortHeader', header=self)"
|
||||||
width="" />
|
width="" />
|
||||||
<listheader
|
<listheader
|
||||||
label="${labels.InvoicingRequirementPrice}"
|
label="${labels.InvoicingRequirementPrice}"
|
||||||
sort="auto(requirement.sumTotal)"
|
sort="auto(requirement.sumTotal)"
|
||||||
|
onSort="@command('onSortHeader', header=self)"
|
||||||
align="right"
|
align="right"
|
||||||
width="130px" />
|
width="130px" />
|
||||||
<listheader
|
<listheader
|
||||||
label="${labels.InvoicingInvoicedPrice}"
|
label="${labels.InvoicingInvoicedPrice}"
|
||||||
align="right"
|
align="right"
|
||||||
sort="auto(totalInvoiced)"
|
sort="auto(totalInvoiced)"
|
||||||
|
onSort="@command('onSortHeader', header=self)"
|
||||||
width="130px" />
|
width="130px" />
|
||||||
</listhead>
|
</listhead>
|
||||||
<auxhead
|
<auxhead
|
||||||
|
|||||||
Reference in New Issue
Block a user