BrightSide Workbench Full Report + Source Code
SimpleDocumentLine.java
Go to the documentation of this file.
1 /*
2  * TurrĂ³ i Cutiller Foundation. License notice.
3  * Copyright (C) 2011 Lluis TurrĂ³ Cutiller <http://www.turro.org/>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Affero General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Affero General Public License for more details.
14  *
15  * You should have received a copy of the GNU Affero General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 package org.turro.financials.model.document;
19 
20 import org.turro.financials.entity.Contract;
21 import org.turro.financials.entity.Document;
22 import org.turro.financials.entity.DocumentLine;
23 import org.turro.financials.entity.LineType;
24 import org.turro.financials.entity.Product;
25 import org.turro.financials.entity.ProductByContractor;
26 
31 public class SimpleDocumentLine {
32 
33  private Contract store;
34  private int lineOrder;
35  private Product product;
36  private ProductByContractor productByContractor;
37  private String concept;
38  private double quantity;
39  private double price;
40  private double tax;
41  private double discountPerCent;
42  private double discountMoney;
43  private LineType lineType;
44 
46  store = line.getStore();
47  lineOrder = line.getLineOrder();
48  product = line.getProduct();
49  productByContractor = line.getProductByContractor();
50  concept = line.getConcept();
51  quantity = line.getQuantity();
52  price = line.getPrice();
53  tax = line.getTax();
54  discountPerCent = line.getDiscountPerCent();
55  discountMoney = line.getDiscountMoney();
56  lineType = line.getLineType();
57  }
58 
59  public void addToDocument(Document document) {
60  int count = document.getMaxLineOrder() + 1;
61  DocumentLine dl = new DocumentLine();
62  dl.setDocument(document);
63  dl.setProduct(product);
64  dl.setProductByContractor(productByContractor);
65  dl.setConcept(concept);
66  dl.setQuantity(quantity);
67  dl.setPrice(price);
68  dl.setDiscountPerCent(discountPerCent);
69  dl.setDiscountMoney(discountMoney);
70  dl.setTax(tax);
71  dl.setStore(store);
72  dl.setLineOrder(count + lineOrder);
73  dl.setLineType(lineType);
74  document.getDocumentLines().add(dl);
75  }
76 
77 }
void setDiscountMoney(double discountMoney)
void setDiscountPerCent(double discountPerCent)
void setProductByContractor(ProductByContractor productByContractor)
ProductByContractor getProductByContractor()
Set< DocumentLine > getDocumentLines()
Definition: Document.java:180