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

Public Member Functions

 ContractWrapper (Contract contract)
 
String getTabLabel ()
 
String getSelfLabel ()
 
String getTooltiptext ()
 
void assignDefinition (ContractDefinition contractDefinition)
 
Contract save ()
 
void generateRegisters (final DocumentDefinition docDef, final int year)
 
HtmlBasedComponent getTaxCtrl ()
 
HtmlBasedComponent getReqCtrl ()
 
HtmlBasedComponent getRetentionCtrl ()
 
void checkAllContractor ()
 
- Public Member Functions inherited from org.turro.financials.model.contract.ContractWrapper
Collection< DocumentDefinitiongetExpiryDefinitions (DocumentDefinition source)
 
boolean canDelete ()
 
Collection< DocumentgetDocuments (DocumentDefinition docDef, int year)
 
double getAdvance (RegisterView view)
 
void addAdvanceIfNeeded (RegisterView view, Collection< Contract > contracts)
 
IDossier getDossier ()
 
- Public Member Functions inherited from org.turro.jpa.entity.DaoEntity< T extends IDaoEntity, ID extends Serializable >
 DaoEntity ()
 
 DaoEntity (Class< T > persistentClass)
 
 DaoEntity (T entity)
 
Dao getDao ()
 
getEntity ()
 
IElephantEntity getIee ()
 
find (ID id)
 
boolean delete ()
 
ID getId ()
 
List< String > getMessages ()
 
boolean canSave ()
 
boolean equals (Object obj)
 
int hashCode ()
 

Additional Inherited Members

- Static Public Member Functions inherited from org.turro.financials.model.contract.ContractWrapper
static Collection< ContractgetContracts (ContractDefinition contractDefinition)
 
static Collection< ContractgetContracts (Long contractDefinitionId)
 
static void clearActives (Collection< Contract > contracts)
 
static void clearInactives (Collection< Contract > contracts)
 
static boolean isActive (Date now, Contract contract)
 
static Collection< ContractgetContracts (IContact contact)
 
static Collection< DocumentDefinitiongetExpiryDefinitions (ContractDefinition contractDefinition, DocumentDefinition documentDefinition)
 
- Static Public Member Functions inherited from org.turro.jpa.entity.DaoEntity< T extends IDaoEntity, ID extends Serializable >
static Object getEntityId (Object entity)
 
static boolean isNewId (Object id)
 
- Protected Member Functions inherited from org.turro.financials.model.contract.ContractWrapper
Dao createDao ()
 
boolean shouldLog ()
 
- Protected Member Functions inherited from org.turro.jpa.entity.DaoEntity< T extends IDaoEntity, ID extends Serializable >
void logEntity (SystemLogType logType, Object entity, String action, String data)
 
String dataEntity (Object entity)
 
void initOperation ()
 
void addMessage (String message)
 
- Protected Attributes inherited from org.turro.jpa.entity.DaoEntity< T extends IDaoEntity, ID extends Serializable >
entity
 
ID id
 
List< String > messages = new ArrayList<>()
 

Detailed Description

Constructor & Destructor Documentation

◆ ContractWrapper()

org.turro.financials.contract.logic.ContractWrapper.ContractWrapper ( Contract  contract)

Member Function Documentation

◆ assignDefinition()

void org.turro.financials.contract.logic.ContractWrapper.assignDefinition ( ContractDefinition  contractDefinition)

Definition at line 63 of file bsfinancials-www/src/main/java/org/turro/financials/contract/logic/ContractWrapper.java.

63  {
64  entity.setContractDefinition(contractDefinition);
65  entity.setCash(contractDefinition.isCash());
66  entity.setStock(contractDefinition.isStock());
67  entity.setUseContractorCode(contractDefinition.isUseContractorCode());
68  }
Here is the call graph for this function:

◆ checkAllContractor()

void org.turro.financials.contract.logic.ContractWrapper.checkAllContractor ( )

Definition at line 216 of file bsfinancials-www/src/main/java/org/turro/financials/contract/logic/ContractWrapper.java.

216  {
217  if(!Tags.existsTag("contracted")) {
218  Dao dao = new FinancialsPU();
219  for(String contractor : (List<String>) dao.getResultList(
220  "select distinct ctc.contractor from Contract as ctc")) {
221  checkContractedTag(contractor);
222  }
223  }
224  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ generateRegisters()

void org.turro.financials.contract.logic.ContractWrapper.generateRegisters ( final DocumentDefinition  docDef,
final int  year 
)

Reimplemented from org.turro.financials.model.contract.ContractWrapper.

Definition at line 85 of file bsfinancials-www/src/main/java/org/turro/financials/contract/logic/ContractWrapper.java.

85  {
86  Messages.confirmProcess().show(() -> {
87  ContractWrapper.super.generateRegisters(docDef, year);
88  });
89  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getReqCtrl()

HtmlBasedComponent org.turro.financials.contract.logic.ContractWrapper.getReqCtrl ( )

Definition at line 133 of file bsfinancials-www/src/main/java/org/turro/financials/contract/logic/ContractWrapper.java.

133  {
134  ArrayList<Double> taxes = new ArrayList<Double>();
135  for(Tax tax : entity.getTaxes()) {
136  if(tax.getTaxType().equals(TaxType.VAT)) {
137  taxes.add(tax.getEquivalenceSurcharge());
138  }
139  }
140  if(!taxes.isEmpty()) {
141  CollectionListbox<Double> cl = new CollectionListbox<Double>() {
142  @Override
143  protected String convertToString(Double v) {
144  return v.toString();
145  }
146  };
147  taxes.add(0.0);
148  cl.setCollection(taxes);
149  cl.setMold("select");
150  return cl;
151  }
152  return null;
153  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getRetentionCtrl()

HtmlBasedComponent org.turro.financials.contract.logic.ContractWrapper.getRetentionCtrl ( )

Definition at line 155 of file bsfinancials-www/src/main/java/org/turro/financials/contract/logic/ContractWrapper.java.

155  {
156  ArrayList<Double> retentions = new ArrayList<Double>();
157  for(Tax tax : entity.getTaxes()) {
158  if(tax.getTaxType().equals(TaxType.RETENTION)) {
159  retentions.add(tax.getTax());
160  }
161  }
162  if(!retentions.isEmpty()) {
163  CollectionListbox<Double> cl = new CollectionListbox<Double>() {
164  @Override
165  protected String convertToString(Double v) {
166  return v.toString();
167  }
168  };
169  retentions.add(0.0);
170  cl.setCollection(retentions);
171  cl.setMold("select");
172  return cl;
173  }
174  return null;
175 // if(!Strings.isBlank(entity.getNotes())) {
176 // String rets = Strings.extract(entity.getNotes(), "IRPF:([0-9\\,]+)");
177 // if(!Strings.isBlank(rets)) {
178 // CollectionListbox<Double> cl = new CollectionListbox<Double>() {
179 // @Override
180 // protected String convertToString(Double v) {
181 // return v.toString();
182 // }
183 // };
184 // ArrayList<Double> al = new ArrayList<Double>();
185 // for(String ret : rets.split("\\,")) {
186 // al.add(new Double(ret));
187 // }
188 // al.add(0.0);
189 // cl.setCollection(al);
190 // cl.setMold("select");
191 // return cl;
192 // }
193 // }
194 // return null;
195  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSelfLabel()

String org.turro.financials.contract.logic.ContractWrapper.getSelfLabel ( )

Definition at line 51 of file bsfinancials-www/src/main/java/org/turro/financials/contract/logic/ContractWrapper.java.

51  {
52  return I_.get("Contract");
53  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTabLabel()

String org.turro.financials.contract.logic.ContractWrapper.getTabLabel ( )

Definition at line 47 of file bsfinancials-www/src/main/java/org/turro/financials/contract/logic/ContractWrapper.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTaxCtrl()

HtmlBasedComponent org.turro.financials.contract.logic.ContractWrapper.getTaxCtrl ( )

Definition at line 91 of file bsfinancials-www/src/main/java/org/turro/financials/contract/logic/ContractWrapper.java.

91  {
92  ArrayList<Double> taxes = new ArrayList<Double>();
93  for(Tax tax : entity.getTaxes()) {
94  if(tax.getTaxType().equals(TaxType.VAT)) {
95  taxes.add(tax.getTax());
96  }
97  }
98  if(!taxes.isEmpty()) {
99  CollectionListbox<Double> cl = new CollectionListbox<Double>() {
100  @Override
101  protected String convertToString(Double v) {
102  return v.toString();
103  }
104  };
105  taxes.add(0.0);
106  cl.setCollection(taxes);
107  cl.setMold("select");
108  return cl;
109  }
110  return null;
111 // if(!Strings.isBlank(entity.getNotes())) {
112 // String taxs = Strings.extract(entity.getNotes(), "IVA:([0-9\\,]+)");
113 // if(!Strings.isBlank(taxs)) {
114 // CollectionListbox<Double> cl = new CollectionListbox<Double>() {
115 // @Override
116 // protected String convertToString(Double v) {
117 // return v.toString();
118 // }
119 // };
120 // ArrayList<Double> al = new ArrayList<Double>();
121 // for(String tax : taxs.split("\\,")) {
122 // al.add(new Double(tax));
123 // }
124 // al.add(0.0);
125 // cl.setCollection(al);
126 // cl.setMold("select");
127 // return cl;
128 // }
129 // }
130 // return null;
131  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTooltiptext()

String org.turro.financials.contract.logic.ContractWrapper.getTooltiptext ( )

Definition at line 55 of file bsfinancials-www/src/main/java/org/turro/financials/contract/logic/ContractWrapper.java.

55  {
56  try {
57  return entity.getFullDescription();
58  } catch(Exception ex) {
59  return null;
60  }
61  }
Here is the caller graph for this function:

◆ save()

Contract org.turro.financials.contract.logic.ContractWrapper.save ( )

Reimplemented from org.turro.jpa.entity.DaoEntity< T extends IDaoEntity, ID extends Serializable >.

Definition at line 71 of file bsfinancials-www/src/main/java/org/turro/financials/contract/logic/ContractWrapper.java.

71  {
73 
74  if(entity.getContractDefinition() == null || entity.getContractor() == null) {
75  return null;
76  }
77 
78  entity = super.save();
79  checkContractedTag(entity.getContractor());
80  checkTaxes();
81  return entity;
82  }
Here is the call graph for this function:

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