19 package org.turro.financials.contract.logic;
21 import org.turro.elephant.context.Application;
22 import org.turro.elephant.util.Messages;
23 import org.turro.financials.account.logic.BankAccounts;
24 import org.turro.financials.db.FinancialsPU;
25 import org.turro.financials.entity.Contract;
26 import org.turro.financials.handshake.HandshakeControl;
27 import org.turro.i18n.I_;
28 import org.turro.jpa.composer.EntityComposer;
29 import org.turro.jpa.entity.DaoEntity;
30 import org.turro.zul.acceptance.AcceptanceButton;
31 import org.turro.zul.frame.Framework;
32 import org.zkoss.zk.ui.Component;
33 import org.zkoss.zk.ui.event.Event;
34 import org.zkoss.zk.ui.event.Events;
35 import org.zkoss.zk.ui.select.annotation.Listen;
36 import org.zkoss.zk.ui.select.annotation.Wire;
37 import org.zkoss.zk.ui.util.Clients;
38 import org.zkoss.zul.Toolbarbutton;
53 private Toolbarbutton importBank;
55 @Listen(
"onClick = #importBank")
58 Events.postEvent(
new Event(Events.ON_CHANGE));
92 if(
entity.getContractPreferences().isEmpty() &&
93 !(
entity.getContractDefinition().getDefaultContractPreference().getName().contentEquals(
"#"))) {
103 return super.beforeSave();
117 acceptance.setVisible(
false);
118 importBank.setVisible(
false);
120 if(
entity.getContractDefinition() ==
null ||
121 !
entity.getContractDefinition().isCash()) {
122 importBank.setDisabled(
true);
128 return !
entity.isEmpty() && (
entity.getId() == 0) || super.shouldBeSaved();
144 Clients.showNotification(
I_.
get(
"Save before continue"));
147 return super.canClose();
boolean isInRole(String role)
static Application getApplication()
static Messages confirmDeletion()
Messages add(String word)
static void importN43(final Contract contract)
String getAttributeName()
DaoEntity getWrapperInstance(Component comp)
Contract getEntityInstance(Long id)
static String get(String msg)
static Framework getCurrent()
void setSelectedLabel(String text)
void setSelectedTooltiptext(String text)