19 package org.turro.financials.model.document;
21 import java.util.Date;
22 import java.util.HashSet;
23 import java.util.Iterator;
25 import org.turro.financials.db.FinancialsPU;
26 import org.turro.financials.entity.*;
27 import org.turro.financials.model.register.RegisterWrapper;
28 import org.turro.financials.model.register.ViewWrapper;
29 import org.turro.jpa.entity.XMLSerializer;
30 import org.turro.log.SystemLogType;
31 import org.turro.log.SystemLogger;
32 import org.turro.usual.UsualUsages;
43 private Date receiptDate;
44 private Date documentDate;
45 private String documentNumber;
46 private boolean draft, noAncestors =
false, noDescendants =
false;
51 this.documentDefinition = documentDefinition;
52 this.contract = contract;
54 this.receiptDate = receiptDate;
55 this.documentDate = documentDate;
56 this.documentNumber = documentNumber;
62 this.document = document;
70 double quantity,
double price,
double tax,
double retention,
89 double quantity,
double price,
double tax,
double retention,
109 double quantity,
double price,
double tax,
double retention,
132 if(!l.isEmpty() && l.getStore() !=
null) {
141 Iterator<Register> ir = document.
getRegisters().iterator();
142 while(ir.hasNext()) {
166 Set<RegisterWrapper> s =
new HashSet<RegisterWrapper>();
168 boolean done =
false;
170 if(r.getView().getId() == rv.getId()) {
189 private void createDocument() {
194 document.
setReceiptDate(receiptDate ==
null ? documentDate : receiptDate);
void setStore(Contract store)
void setLineOrder(int lineOrder)
void setContractPreference(ContractPreference contractPreference)
void setQuantity(double quantity)
void setLineType(LineType lineType)
void setRetention(double retention)
void setDocument(Document document)
void setProduct(Product product)
void setPrice(double price)
void setProductByContractor(ProductByContractor productByContractor)
void setConcept(String concept)
Set< Register > getRegisters()
void setDocumentNumber(String documentNumber)
void setDocumentDate(Date documentDate)
RegisterView getForcedView()
void setContract(Contract contract)
void setDraft(boolean draft)
void setCurrency(Currency currency)
Set< DocumentLine > getDocumentLines()
void setDocumentDefinition(DocumentDefinition documentDefinition)
void setReceiptDate(Date receiptDate)
void setNotes(String notes)
void setView(RegisterView view)
void setIdRegister(long idRegister)
void setDocument(Document document)
void setRegisterDate(Date registerDate)
DocumentLine addLine(Contract store, String concept, double quantity, double price, double tax, double retention, LineType lineType, ContractPreference contractPreference)
DocumentGenerator(DocumentDefinition documentDefinition, Contract contract, String notes, Date receiptDate, Date documentDate, String documentNumber, boolean draft)
DocumentLine addLine(Contract store, ProductByContractor product, String concept, double quantity, double price, double tax, double retention, LineType lineType, ContractPreference contractPreference)
Set< RegisterWrapper > getRegisters()
DocumentLine addLine(Contract store, Product product, String concept, double quantity, double price, double tax, double retention, LineType lineType, ContractPreference contractPreference)
DocumentGenerator(Document document)
static List< RegisterView > getViews()
static ISystemLogger getInstance()
static Usually addUsage(String path)
default void removeEmpties()
void doLog(SystemLogType type, Object entity, String comment, Serializable data)