use of com.axelor.rpc.filter.Filter in project axelor-open-suite by axelor.
the class ClientViewController method showClientMyCustomerTickets.
/* TICKETS OnClick */
public void showClientMyCustomerTickets(ActionRequest request, ActionResponse response) {
try {
ClientViewService clientViewService = Beans.get(ClientViewService.class);
User clientUser = clientViewService.getClientUser();
if (clientUser.getPartner() == null) {
response.setError(I18n.get(ITranslation.CLIENT_PORTAL_NO_PARTNER));
} else {
Filter filter = clientViewService.getTicketsOfUser(clientUser).get(0);
if (filter != null) {
response.setView(ActionView.define(I18n.get("Customer tickets")).model(Ticket.class.getName()).add("grid", "ticket-grid").add("form", "ticket-form").param("search-filters", "ticket-filters").domain(filter.getQuery()).map());
}
}
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
use of com.axelor.rpc.filter.Filter in project axelor-open-suite by axelor.
the class ClientViewController method showClientMyLateTickets.
public void showClientMyLateTickets(ActionRequest request, ActionResponse response) {
try {
ClientViewService clientViewService = Beans.get(ClientViewService.class);
User clientUser = clientViewService.getClientUser();
if (clientUser.getPartner() == null) {
response.setError(I18n.get(ITranslation.CLIENT_PORTAL_NO_PARTNER));
} else {
Filter filter = clientViewService.getLateTicketsOfUser(clientUser).get(0);
if (filter != null) {
response.setView(ActionView.define(I18n.get("Late tickets")).model(Ticket.class.getName()).add("grid", "ticket-grid").add("form", "ticket-form").param("search-filters", "ticket-filters").domain(filter.getQuery()).map());
}
}
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
use of com.axelor.rpc.filter.Filter in project axelor-open-suite by axelor.
the class ClientViewController method showClientMyNewTasks.
public void showClientMyNewTasks(ActionRequest request, ActionResponse response) {
try {
ClientViewService clientViewService = Beans.get(ClientViewService.class);
User clientUser = clientViewService.getClientUser();
if (clientUser.getPartner() == null) {
response.setError(I18n.get(ITranslation.CLIENT_PORTAL_NO_PARTNER));
} else {
Filter filter = clientViewService.getNewTasksOfUser(clientUser).get(0);
if (filter != null) {
response.setView(ActionView.define(I18n.get("New tasks")).model(ProjectTask.class.getName()).add("grid", "project-task-grid").add("form", "project-task-form").param("search-filters", "project-task-filters").domain(filter.getQuery()).map());
}
}
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
use of com.axelor.rpc.filter.Filter in project axelor-open-suite by axelor.
the class ClientViewController method showClientReversions.
public void showClientReversions(ActionRequest request, ActionResponse response) {
try {
ClientViewService clientViewService = Beans.get(ClientViewService.class);
User clientUser = clientViewService.getClientUser();
if (clientUser.getPartner() == null) {
response.setError(I18n.get(ITranslation.CLIENT_PORTAL_NO_PARTNER));
} else {
Filter filter = clientViewService.getReversionsOfUser(clientUser).get(0);
if (filter != null) {
response.setView(ActionView.define(I18n.get("My reversions")).model(StockMove.class.getName()).add("grid", "stock-move-grid").add("form", "stock-move-form").param("search-filters", "internal-stock-move-filters").domain(filter.getQuery()).map());
}
}
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
use of com.axelor.rpc.filter.Filter in project axelor-open-suite by axelor.
the class ClientViewController method showClientMyOverdueInvoices.
/* INVOICE OnClick */
public void showClientMyOverdueInvoices(ActionRequest request, ActionResponse response) {
try {
ClientViewService clientViewService = Beans.get(ClientViewService.class);
User clientUser = clientViewService.getClientUser();
if (clientUser.getPartner() == null) {
response.setError(I18n.get(ITranslation.CLIENT_PORTAL_NO_PARTNER));
} else {
Filter filter = clientViewService.getOverdueInvoicesOfUser(clientUser).get(0);
if (filter != null) {
response.setView(ActionView.define(I18n.get("Overdue invoices")).model(Invoice.class.getName()).add("grid", "invoice-grid").add("form", "invoice-form").param("search-filters", "customer-invoices-filters").domain(filter.getQuery()).map());
}
}
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
Aggregations