18 package org.turro.financials.model.document;
20 import java.util.ArrayList;
21 import org.turro.financials.db.FinancialsPU;
22 import org.turro.financials.entity.Document;
23 import org.turro.financials.entity.DocumentLine;
24 import org.turro.financials.entity.LineType;
25 import org.turro.jpa.Dao;
33 private static final long
34 PAYROLL_TYPE = 8, RETENTION_TYPE = 10,
35 INSURANCE_TYPE = 9, SEIZURE_TYPE = 159,
36 PROTECTION_TYPE = 167, CONTINGENCIES_TYPE = 168;
39 private DocumentLine payrollLine, retentionLine, insuranceLine, seizureLine,
40 protectionLine, contingenciesLine;
43 this.payroll = payroll;
77 return protectionLine;
81 return contingenciesLine;
84 private void assignLines() {
87 payrollLine = retentionLine = insuranceLine = seizureLine = protectionLine =
null;
89 if(dl.getLineType().getId() == PAYROLL_TYPE) {
91 }
else if(dl.getLineType().getId() == RETENTION_TYPE) {
93 }
else if(dl.getLineType().getId() == INSURANCE_TYPE) {
95 }
else if(dl.getLineType().getId() == SEIZURE_TYPE) {
97 }
else if(dl.getLineType().getId() == PROTECTION_TYPE) {
99 }
else if(dl.getLineType().getId() == CONTINGENCIES_TYPE) {
100 contingenciesLine = dl;
103 if(payrollLine ==
null) {
104 payrollLine =
new DocumentLine();
106 payrollLine.
setLineType(dao.find(LineType.class, PAYROLL_TYPE));
111 if(retentionLine ==
null) {
112 retentionLine =
new DocumentLine();
114 retentionLine.
setLineType(dao.find(LineType.class, RETENTION_TYPE));
119 if(insuranceLine ==
null) {
120 insuranceLine =
new DocumentLine();
122 insuranceLine.
setLineType(dao.find(LineType.class, INSURANCE_TYPE));
127 if(seizureLine ==
null) {
128 seizureLine =
new DocumentLine();
130 seizureLine.
setLineType(dao.find(LineType.class, SEIZURE_TYPE));
135 if(protectionLine ==
null) {
136 protectionLine =
new DocumentLine();
138 protectionLine.
setLineType(dao.find(LineType.class, PROTECTION_TYPE));
143 if(contingenciesLine ==
null) {
144 contingenciesLine =
new DocumentLine();
146 contingenciesLine.
setLineType(dao.find(LineType.class, CONTINGENCIES_TYPE));
void setLineOrder(int lineOrder)
void setLineType(LineType lineType)
void setDocument(Document document)
Set< DocumentRelation > getDescendants()
Set< DocumentLine > getDocumentLines()
DocumentLine getInsuranceLine()
DocumentLine getProtectionLine()
PayrollWrapper(Document payroll)
DocumentLine getRetentionLine()
DocumentLine getSeizureLine()
DocumentLine getContingenciesLine()
DocumentLine getPayrollLine()