BrightSide Workbench Full Report + Source Code
org.turro.financials.entity.DocumentLine Class Reference
Inheritance diagram for org.turro.financials.entity.DocumentLine:
Collaboration diagram for org.turro.financials.entity.DocumentLine:

Public Member Functions

String getConcept ()
 
void setConcept (String concept)
 
ContractPreference getContractPreference ()
 
void setContractPreference (ContractPreference contractPreference)
 
double getDiscountMoney ()
 
void setDiscountMoney (double discountMoney)
 
double getDiscountPerCent ()
 
void setDiscountPerCent (double discountPerCent)
 
Document getDocument ()
 
void setDocument (Document document)
 
long getId ()
 
void setId (long id)
 
int getLineOrder ()
 
void setLineOrder (int lineOrder)
 
LineType getLineType ()
 
void setLineType (LineType lineType)
 
double getPrice ()
 
void setPrice (double price)
 
Product getProduct ()
 
void setProduct (Product product)
 
ProductByContractor getProductByContractor ()
 
void setProductByContractor (ProductByContractor productByContractor)
 
double getQuantity ()
 
void setQuantity (double quantity)
 
double getRetention ()
 
void setRetention (double retention)
 
Contract getStore ()
 
void setStore (Contract store)
 
double getTax ()
 
void setTax (double tax)
 
double getEquivalenceSurcharge ()
 
void setEquivalenceSurcharge (double equivalenceSurcharge)
 
boolean isEmpty ()
 
void clearLine ()
 
String getDescription ()
 
double getSubtotal ()
 
double getRetained ()
 
double getDiscount ()
 
Double getTaxable ()
 
Double getFullTaxValue ()
 
Double getTaxValue ()
 
Double getRealTaxValue ()
 
Double getEquivalenceSurchargeValue ()
 
Double getAmount ()
 
Double getToDeclare ()
 
Double getFullTax ()
 
void assignValuesFrom (DocumentLine documentLine)
 

Detailed Description

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

Definition at line 29 of file DocumentLine.java.

Member Function Documentation

◆ assignValuesFrom()

void org.turro.financials.entity.DocumentLine.assignValuesFrom ( DocumentLine  documentLine)

Definition at line 304 of file DocumentLine.java.

304  {
305  setDocument(documentLine.getDocument());
306  setStore(documentLine.getStore());
307  setProduct(documentLine.getProduct());
308  setProductByContractor(documentLine.getProductByContractor());
309  setConcept(documentLine.getConcept());
310  setQuantity(documentLine.getQuantity());
311  setPrice(documentLine.getPrice());
312  setTax(documentLine.getTax());
313  setEquivalenceSurcharge(documentLine.getEquivalenceSurcharge());
314  setRetention(documentLine.getRetention());
315  setDiscountPerCent(documentLine.getDiscountPerCent());
316  setDiscountMoney(documentLine.getDiscountMoney());
317  setLineType(documentLine.getLineType());
318  setContractPreference(documentLine.getContractPreference());
319  }
void setEquivalenceSurcharge(double equivalenceSurcharge)
void setContractPreference(ContractPreference contractPreference)
void setDiscountMoney(double discountMoney)
void setDiscountPerCent(double discountPerCent)
void setProductByContractor(ProductByContractor productByContractor)
Here is the call graph for this function:

◆ clearLine()

void org.turro.financials.entity.DocumentLine.clearLine ( )

Definition at line 213 of file DocumentLine.java.

213  {
214  setProduct(null);
216  setConcept(null);
217  setQuantity(0);
218  setPrice(0);
219  setTax(0);
221  setDiscountMoney(0);
222  }
Here is the call graph for this function:

◆ getAmount()

Double org.turro.financials.entity.DocumentLine.getAmount ( )

Definition at line 284 of file DocumentLine.java.

284  {
285  if(document.getContract().getOperatingModifier().isSumTax(this)) {
286  return new Round((getTaxable() * (1.0 + getFullTax() / 100.0)) - getRetained()).decimals(document.getCurrency().getDefaultFractionDigits()).value();
287  } else {
288  return getTaxable() - getRetained();
289  }
290  }
OperatingModifier getOperatingModifier()
Definition: Contract.java:228
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getConcept()

String org.turro.financials.entity.DocumentLine.getConcept ( )

Definition at line 66 of file DocumentLine.java.

66  {
67  return concept;
68  }
Here is the caller graph for this function:

◆ getContractPreference()

ContractPreference org.turro.financials.entity.DocumentLine.getContractPreference ( )

Definition at line 79 of file DocumentLine.java.

79  {
80  return contractPreference;
81  }
Here is the caller graph for this function:

◆ getDescription()

String org.turro.financials.entity.DocumentLine.getDescription ( )

Definition at line 224 of file DocumentLine.java.

224  {
225  if(product != null) {
226  return product.getDescription();
227  }
228  if(productByContractor != null && productByContractor.getProduct() != null) {
229  return productByContractor.getProduct().getDescription();
230  }
231  return null;
232  }

◆ getDiscount()

double org.turro.financials.entity.DocumentLine.getDiscount ( )

Definition at line 243 of file DocumentLine.java.

243  {
244  return new Round(((getSubtotal() - discountMoney) * (discountPerCent / 100.0)) + discountMoney).decimals(document.getCurrency().getDefaultFractionDigits()).value();
245  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getDiscountMoney()

double org.turro.financials.entity.DocumentLine.getDiscountMoney ( )

Definition at line 87 of file DocumentLine.java.

87  {
88  return discountMoney;
89  }
Here is the caller graph for this function:

◆ getDiscountPerCent()

double org.turro.financials.entity.DocumentLine.getDiscountPerCent ( )

Definition at line 95 of file DocumentLine.java.

95  {
96  return discountPerCent;
97  }
Here is the caller graph for this function:

◆ getDocument()

Document org.turro.financials.entity.DocumentLine.getDocument ( )

Definition at line 103 of file DocumentLine.java.

103  {
104  return document;
105  }
Here is the caller graph for this function:

◆ getEquivalenceSurcharge()

double org.turro.financials.entity.DocumentLine.getEquivalenceSurcharge ( )

Definition at line 197 of file DocumentLine.java.

197  {
198  return equivalenceSurcharge;
199  }
Here is the caller graph for this function:

◆ getEquivalenceSurchargeValue()

Double org.turro.financials.entity.DocumentLine.getEquivalenceSurchargeValue ( )

Definition at line 277 of file DocumentLine.java.

277  {
278  if(equivalenceSurcharge > 0) {
279  return getFullTaxValue() - getRealTaxValue();
280  }
281  return 0.0;
282  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFullTax()

Double org.turro.financials.entity.DocumentLine.getFullTax ( )

Definition at line 300 of file DocumentLine.java.

300  {
301  return tax + equivalenceSurcharge;
302  }
Here is the caller graph for this function:

◆ getFullTaxValue()

Double org.turro.financials.entity.DocumentLine.getFullTaxValue ( )

Definition at line 251 of file DocumentLine.java.

251  {
252  return (getAmount() + getRetained()) - getTaxable();
253  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getId()

long org.turro.financials.entity.DocumentLine.getId ( )

Definition at line 111 of file DocumentLine.java.

111  {
112  return id;
113  }
Here is the caller graph for this function:

◆ getLineOrder()

int org.turro.financials.entity.DocumentLine.getLineOrder ( )

Definition at line 119 of file DocumentLine.java.

119  {
120  return lineOrder;
121  }
Here is the caller graph for this function:

◆ getLineType()

LineType org.turro.financials.entity.DocumentLine.getLineType ( )

Definition at line 127 of file DocumentLine.java.

127  {
128  if(lineType != null) {
129  lineType.setContractPreference(contractPreference);
130  }
131  return lineType;
132  }
void setContractPreference(ContractPreference contractPreference)
Definition: LineType.java:81
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPrice()

double org.turro.financials.entity.DocumentLine.getPrice ( )

Definition at line 141 of file DocumentLine.java.

141  {
142  return price;
143  }
Here is the caller graph for this function:

◆ getProduct()

Product org.turro.financials.entity.DocumentLine.getProduct ( )

Definition at line 149 of file DocumentLine.java.

149  {
150  return product;
151  }
Here is the caller graph for this function:

◆ getProductByContractor()

ProductByContractor org.turro.financials.entity.DocumentLine.getProductByContractor ( )

Definition at line 157 of file DocumentLine.java.

157  {
158  return productByContractor;
159  }
Here is the caller graph for this function:

◆ getQuantity()

double org.turro.financials.entity.DocumentLine.getQuantity ( )

Definition at line 165 of file DocumentLine.java.

165  {
166  return quantity;
167  }
Here is the caller graph for this function:

◆ getRealTaxValue()

Double org.turro.financials.entity.DocumentLine.getRealTaxValue ( )

Definition at line 266 of file DocumentLine.java.

266  {
267  if(tax != 0) {
268  if(equivalenceSurcharge != 0) {
269  return new Round(getFullTaxValue() * tax / getFullTax()).decimals(document.getCurrency().getDefaultFractionDigits()).value();
270  } else {
271  return getTaxValue();
272  }
273  }
274  return 0.0;
275  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getRetained()

double org.turro.financials.entity.DocumentLine.getRetained ( )

Definition at line 239 of file DocumentLine.java.

239  {
240  return new Round((getSubtotal() - getDiscount()) * (retention / 100.0)).decimals(document.getCurrency().getDefaultFractionDigits()).value();
241  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getRetention()

double org.turro.financials.entity.DocumentLine.getRetention ( )

Definition at line 173 of file DocumentLine.java.

173  {
174  return retention;
175  }
Here is the caller graph for this function:

◆ getStore()

Contract org.turro.financials.entity.DocumentLine.getStore ( )

Definition at line 181 of file DocumentLine.java.

181  {
182  return store;
183  }
Here is the caller graph for this function:

◆ getSubtotal()

double org.turro.financials.entity.DocumentLine.getSubtotal ( )

Definition at line 234 of file DocumentLine.java.

234  {
235  int fractions = document.getCurrency() == null ? 2 : document.getCurrency().getDefaultFractionDigits();
236  return new Round(quantity == 0 ? price : price * quantity).decimals(fractions).value();
237  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTax()

double org.turro.financials.entity.DocumentLine.getTax ( )

Definition at line 189 of file DocumentLine.java.

189  {
190  return tax;
191  }
Here is the caller graph for this function:

◆ getTaxable()

Double org.turro.financials.entity.DocumentLine.getTaxable ( )

Definition at line 247 of file DocumentLine.java.

247  {
248  return new Round(getSubtotal() - getDiscount()).decimals(document.getCurrency().getDefaultFractionDigits()).value();
249  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTaxValue()

Double org.turro.financials.entity.DocumentLine.getTaxValue ( )

Definition at line 255 of file DocumentLine.java.

255  {
256  if(document.getContract().getOperatingModifier().isSumTax(this)) {
257  return getFullTaxValue();
258  } else {
259  Double taxable = getTaxable();
260  return new Round((taxable * (1.0 + getFullTax() / 100.0)) - getRetained())
261  .decimals(document.getCurrency().getDefaultFractionDigits())
262  .value() - taxable;
263  }
264  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getToDeclare()

Double org.turro.financials.entity.DocumentLine.getToDeclare ( )

Definition at line 292 of file DocumentLine.java.

292  {
293  if(document.getContract().getOperatingModifier().isSumTax(this)) {
294  return new Round((getTaxable() * (1.0 + getFullTax() / 100.0))).decimals(document.getCurrency().getDefaultFractionDigits()).value();
295  } else {
296  return getTaxable();
297  }
298  }
Here is the call graph for this function:

◆ isEmpty()

boolean org.turro.financials.entity.DocumentLine.isEmpty ( )

Definition at line 207 of file DocumentLine.java.

207  {
208  return (Strings.isBlank(concept) &&
209  getSubtotal() == 0) ||
210  store == null;
211  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setConcept()

void org.turro.financials.entity.DocumentLine.setConcept ( String  concept)

Definition at line 70 of file DocumentLine.java.

70  {
71  if(!Strings.isBlank(concept)) {
72  if(concept.length() > 255) {
73  concept = concept.substring(0, 255);
74  }
75  }
76  this.concept = concept;
77  }
Here is the caller graph for this function:

◆ setContractPreference()

void org.turro.financials.entity.DocumentLine.setContractPreference ( ContractPreference  contractPreference)

Definition at line 83 of file DocumentLine.java.

83  {
84  this.contractPreference = contractPreference;
85  }
Here is the caller graph for this function:

◆ setDiscountMoney()

void org.turro.financials.entity.DocumentLine.setDiscountMoney ( double  discountMoney)

Definition at line 91 of file DocumentLine.java.

91  {
92  this.discountMoney = discountMoney;
93  }
Here is the caller graph for this function:

◆ setDiscountPerCent()

void org.turro.financials.entity.DocumentLine.setDiscountPerCent ( double  discountPerCent)

Definition at line 99 of file DocumentLine.java.

99  {
100  this.discountPerCent = discountPerCent;
101  }
Here is the caller graph for this function:

◆ setDocument()

void org.turro.financials.entity.DocumentLine.setDocument ( Document  document)

Definition at line 107 of file DocumentLine.java.

107  {
108  this.document = document;
109  }
Here is the caller graph for this function:

◆ setEquivalenceSurcharge()

void org.turro.financials.entity.DocumentLine.setEquivalenceSurcharge ( double  equivalenceSurcharge)

Definition at line 201 of file DocumentLine.java.

201  {
202  this.equivalenceSurcharge = equivalenceSurcharge;
203  }
Here is the caller graph for this function:

◆ setId()

void org.turro.financials.entity.DocumentLine.setId ( long  id)

Definition at line 115 of file DocumentLine.java.

115  {
116  this.id = id;
117  }

◆ setLineOrder()

void org.turro.financials.entity.DocumentLine.setLineOrder ( int  lineOrder)

Definition at line 123 of file DocumentLine.java.

123  {
124  this.lineOrder = lineOrder;
125  }
Here is the caller graph for this function:

◆ setLineType()

void org.turro.financials.entity.DocumentLine.setLineType ( LineType  lineType)

Definition at line 134 of file DocumentLine.java.

134  {
135  this.lineType = lineType;
136  if(lineType != null && lineType.getContractPreference() != null) {
137  contractPreference = lineType.getContractPreference();
138  }
139  }
ContractPreference getContractPreference()
Definition: LineType.java:77
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setPrice()

void org.turro.financials.entity.DocumentLine.setPrice ( double  price)

Definition at line 145 of file DocumentLine.java.

145  {
146  this.price = price;
147  }
Here is the caller graph for this function:

◆ setProduct()

void org.turro.financials.entity.DocumentLine.setProduct ( Product  product)

Definition at line 153 of file DocumentLine.java.

153  {
154  this.product = product;
155  }
Here is the caller graph for this function:

◆ setProductByContractor()

void org.turro.financials.entity.DocumentLine.setProductByContractor ( ProductByContractor  productByContractor)

Definition at line 161 of file DocumentLine.java.

161  {
162  this.productByContractor = productByContractor;
163  }
Here is the caller graph for this function:

◆ setQuantity()

void org.turro.financials.entity.DocumentLine.setQuantity ( double  quantity)

Definition at line 169 of file DocumentLine.java.

169  {
170  this.quantity = quantity;
171  }
Here is the caller graph for this function:

◆ setRetention()

void org.turro.financials.entity.DocumentLine.setRetention ( double  retention)

Definition at line 177 of file DocumentLine.java.

177  {
178  this.retention = retention;
179  }
Here is the caller graph for this function:

◆ setStore()

void org.turro.financials.entity.DocumentLine.setStore ( Contract  store)

Definition at line 185 of file DocumentLine.java.

185  {
186  this.store = store;
187  }
Here is the caller graph for this function:

◆ setTax()

void org.turro.financials.entity.DocumentLine.setTax ( double  tax)

Definition at line 193 of file DocumentLine.java.

193  {
194  this.tax = tax;
195  }
Here is the caller graph for this function:

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