BrightSide Workbench Full Report + Source Code
org.turro.financials.contract.logic.ContractComposer Class Reference
Inheritance diagram for org.turro.financials.contract.logic.ContractComposer:
Collaboration diagram for org.turro.financials.contract.logic.ContractComposer:

Public Member Functions

void onImportBank ()
 
void doFinally () throws Exception
 
- Public Member Functions inherited from org.turro.jpa.composer.EntityComposer< E, ID >
final void onChange (Event event)
 
final void onSave ()
 
final void onDelete ()
 
Object getEntity ()
 
Object getWrapper ()
 
void doBeforeComposeChildren (Component comp) throws Exception
 
void doAfterCompose (Component comp) throws Exception
 

Protected Member Functions

String getAttributeName ()
 
Contract getEntityInstance (Long id)
 
DaoEntity getWrapperInstance (Component comp)
 
boolean beforeSave ()
 
void doOnDelete ()
 
boolean shouldBeSaved ()
 
boolean inSaveRole ()
 
boolean inDeleteRole ()
 
boolean canClose ()
 
- Protected Member Functions inherited from org.turro.jpa.composer.EntityComposer< E, ID >
abstract E getEntityInstance (ID id)
 
void doOnSave ()
 
void afterSave ()
 
boolean beforeDelete ()
 
void afterDelete ()
 
void doOnChange ()
 
boolean hasChanged ()
 
void retrieveEntity ()
 

Additional Inherited Members

- Protected Attributes inherited from org.turro.jpa.composer.EntityComposer< E, ID >
entity
 
DaoEntity wrapper
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 44 of file ContractComposer.java.

Member Function Documentation

◆ beforeSave()

boolean org.turro.financials.contract.logic.ContractComposer.beforeSave ( )
protected

Reimplemented from org.turro.jpa.composer.EntityComposer< E, ID >.

Definition at line 91 of file ContractComposer.java.

91  {
92  if(entity.getContractPreferences().isEmpty() &&
93  !(entity.getContractDefinition().getDefaultContractPreference().getName().contentEquals("#"))) {
94  Messages.info(I_.get("Preferences")).add(I_.get("No value")).show();
95  return false;
96  }
97 // if(entity.getNotes() != null && (entity.getNotes().contains("IVA:#") || entity.getNotes().contains("IRPF:#"))) {
98 // ZkossUtils.showMessage(I_.get("Notes"), I_.get("Notes") + ": IVA/IRPF " + I_.get("No value"));
99 // return false;
100 // }
101 // ContractWrapper w = (ContractWrapper) getWrapper();
102 // return super.beforeSave() && (acceptance == null || !acceptance.isBlocked());
103  return super.beforeSave();
104  }
Here is the call graph for this function:

◆ canClose()

boolean org.turro.financials.contract.logic.ContractComposer.canClose ( )
protected

Reimplemented from org.turro.jpa.composer.EntityComposer< E, ID >.

Definition at line 142 of file ContractComposer.java.

142  {
143  if(handshake.isMustSave()) {
144  Clients.showNotification(I_.get("Save before continue"));
145  return false;
146  } else {
147  return super.canClose();
148  }
149  }
Here is the call graph for this function:

◆ doFinally()

void org.turro.financials.contract.logic.ContractComposer.doFinally ( ) throws Exception

Reimplemented from org.turro.jpa.composer.EntityComposer< E, ID >.

Definition at line 114 of file ContractComposer.java.

114  {
115  super.doFinally();
116  if(entity.getId() == 0) {
117  acceptance.setVisible(false);
118  importBank.setVisible(false);
119  }
120  if(entity.getContractDefinition() == null ||
121  !entity.getContractDefinition().isCash()) {
122  importBank.setDisabled(true);
123  }
124  }

◆ doOnDelete()

void org.turro.financials.contract.logic.ContractComposer.doOnDelete ( )
protected

Reimplemented from org.turro.jpa.composer.EntityComposer< E, ID >.

Definition at line 107 of file ContractComposer.java.

107  {
108  Messages.confirmDeletion().show(() -> {
109  ContractComposer.super.doOnDelete();
110  });
111  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAttributeName()

String org.turro.financials.contract.logic.ContractComposer.getAttributeName ( )
protected

Reimplemented from org.turro.jpa.composer.EntityComposer< E, ID >.

Definition at line 62 of file ContractComposer.java.

62  {
63  return "contract";
64  }

◆ getEntityInstance()

Contract org.turro.financials.contract.logic.ContractComposer.getEntityInstance ( Long  id)
protected

Definition at line 67 of file ContractComposer.java.

67  {
68  if(id == null) {
69  entity = new Contract();
70  } else {
71  entity = new FinancialsPU().find(Contract.class, id);
72  }
73  return entity;
74  }

◆ getWrapperInstance()

DaoEntity org.turro.financials.contract.logic.ContractComposer.getWrapperInstance ( Component  comp)
protected

Reimplemented from org.turro.jpa.composer.EntityComposer< E, ID >.

Definition at line 77 of file ContractComposer.java.

77  {
78  ContractWrapper w = new ContractWrapper(entity);
79  Framework.getCurrent().setSelectedLabel(w.getTabLabel());
80  Framework.getCurrent().setSelectedTooltiptext(w.getTooltiptext());
81  return w;
82  }
Here is the call graph for this function:

◆ inDeleteRole()

boolean org.turro.financials.contract.logic.ContractComposer.inDeleteRole ( )
protected

Reimplemented from org.turro.jpa.composer.EntityComposer< E, ID >.

Definition at line 137 of file ContractComposer.java.

137  {
138  return Application.getApplication().isInRole("finan-contract:delete");
139  }
Here is the call graph for this function:

◆ inSaveRole()

boolean org.turro.financials.contract.logic.ContractComposer.inSaveRole ( )
protected

Reimplemented from org.turro.jpa.composer.EntityComposer< E, ID >.

Definition at line 132 of file ContractComposer.java.

132  {
133  return Application.getApplication().isInRole("finan-contract:edit");
134  }
Here is the call graph for this function:

◆ onImportBank()

void org.turro.financials.contract.logic.ContractComposer.onImportBank ( )

Definition at line 56 of file ContractComposer.java.

56  {
57  BankAccounts.importN43(entity);
58  Events.postEvent(new Event(Events.ON_CHANGE));
59  }
Here is the call graph for this function:

◆ shouldBeSaved()

boolean org.turro.financials.contract.logic.ContractComposer.shouldBeSaved ( )
protected

Reimplemented from org.turro.jpa.composer.EntityComposer< E, ID >.

Definition at line 127 of file ContractComposer.java.

127  {
128  return !entity.isEmpty() && (entity.getId() == 0) || super.shouldBeSaved();
129  }

The documentation for this class was generated from the following file: