18 package org.turro.financials.entity;
20 import javax.persistence.*;
21 import org.turro.string.Strings;
22 import org.turro.math.Round;
32 @GeneratedValue(strategy=GenerationType.IDENTITY)
33 @Column(name=
"IDENTIFIER")
42 private int lineOrder;
50 private String concept;
52 private double quantity;
55 private double equivalenceSurcharge;
56 private double discountPerCent;
57 private double discountMoney;
58 private double retention;
71 if(!Strings.isBlank(concept)) {
72 if(concept.length() > 255) {
73 concept = concept.substring(0, 255);
76 this.concept = concept;
80 return contractPreference;
84 this.contractPreference = contractPreference;
92 this.discountMoney = discountMoney;
96 return discountPerCent;
100 this.discountPerCent = discountPerCent;
108 this.document = document;
124 this.lineOrder = lineOrder;
128 if(lineType !=
null) {
135 this.lineType = lineType;
154 this.product = product;
158 return productByContractor;
162 this.productByContractor = productByContractor;
170 this.quantity = quantity;
178 this.retention = retention;
198 return equivalenceSurcharge;
202 this.equivalenceSurcharge = equivalenceSurcharge;
208 return (Strings.isBlank(concept) &&
225 if(product !=
null) {
226 return product.getDescription();
228 if(productByContractor !=
null && productByContractor.getProduct() !=
null) {
229 return productByContractor.getProduct().getDescription();
235 int fractions = document.getCurrency() ==
null ? 2 : document.getCurrency().getDefaultFractionDigits();
236 return new Round(quantity == 0 ? price : price * quantity).
decimals(fractions).value();
244 return new Round(((
getSubtotal() - discountMoney) * (discountPerCent / 100.0)) + discountMoney).
decimals(document.getCurrency().getDefaultFractionDigits()).value();
256 if(document.getContract().getOperatingModifier().isSumTax(
this)) {
261 .
decimals(document.getCurrency().getDefaultFractionDigits())
268 if(equivalenceSurcharge != 0) {
278 if(equivalenceSurcharge > 0) {
285 if(document.getContract().getOperatingModifier().isSumTax(
this)) {
293 if(document.getContract().getOperatingModifier().isSumTax(
this)) {
301 return tax + equivalenceSurcharge;
void setStore(Contract store)
void setEquivalenceSurcharge(double equivalenceSurcharge)
void setLineOrder(int lineOrder)
void setContractPreference(ContractPreference contractPreference)
void setQuantity(double quantity)
Double getEquivalenceSurchargeValue()
void setDiscountMoney(double discountMoney)
void setDiscountPerCent(double discountPerCent)
double getDiscountMoney()
double getDiscountPerCent()
void assignValuesFrom(DocumentLine documentLine)
void setLineType(LineType lineType)
void setRetention(double retention)
ContractPreference getContractPreference()
void setDocument(Document document)
double getEquivalenceSurcharge()
void setProduct(Product product)
void setPrice(double price)
void setProductByContractor(ProductByContractor productByContractor)
ProductByContractor getProductByContractor()
void setConcept(String concept)
ContractPreference getContractPreference()
void setContractPreference(ContractPreference contractPreference)
Round decimals(int digits)