0001: /*
0002: * Copyright 2006-2007 The Kuali Foundation.
0003: *
0004: * Licensed under the Educational Community License, Version 1.0 (the "License");
0005: * you may not use this file except in compliance with the License.
0006: * You may obtain a copy of the License at
0007: *
0008: * http://www.opensource.org/licenses/ecl1.php
0009: *
0010: * Unless required by applicable law or agreed to in writing, software
0011: * distributed under the License is distributed on an "AS IS" BASIS,
0012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0013: * See the License for the specific language governing permissions and
0014: * limitations under the License.
0015: */
0016:
0017: package org.kuali.module.labor.bo;
0018:
0019: import java.math.BigDecimal;
0020: import java.sql.Date;
0021: import java.text.ParseException;
0022: import java.text.SimpleDateFormat;
0023:
0024: import org.apache.commons.lang.StringUtils;
0025: import org.kuali.core.bo.DocumentType;
0026: import org.kuali.core.util.GlobalVariables;
0027: import org.kuali.core.util.KualiDecimal;
0028: import org.kuali.kfs.KFSKeyConstants;
0029: import org.kuali.kfs.KFSPropertyConstants;
0030: import org.kuali.kfs.bo.GeneralLedgerPendingEntry;
0031: import org.kuali.kfs.bo.OriginationCode;
0032: import org.kuali.module.chart.bo.AccountingPeriod;
0033: import org.kuali.module.gl.bo.OriginEntryFull;
0034: import org.kuali.module.gl.bo.UniversityDate;
0035: import org.kuali.module.gl.exception.LoadException;
0036: import org.kuali.module.labor.LaborConstants;
0037:
0038: /**
0039: * Labor business object for LaborOriginEntry.
0040: */
0041: public class LaborOriginEntry extends OriginEntryFull implements
0042: LaborTransaction {
0043: private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger
0044: .getLogger(LaborOriginEntry.class);
0045: private static String SPACES = " ";
0046: private static final String DATE_FORMAT = "yyyy-MM-dd";
0047: private String positionNumber;
0048: private Date transactionPostingDate;
0049: private Date payPeriodEndDate;
0050: private BigDecimal transactionTotalHours;
0051: private Integer payrollEndDateFiscalYear;
0052: private String payrollEndDateFiscalPeriodCode;
0053: private String financialDocumentApprovedCode;
0054: private String transactionEntryOffsetCode;
0055: private Date transactionEntryProcessedTimestamp;
0056: private String emplid;
0057: private Integer employeeRecord;
0058: private String earnCode;
0059: private String payGroup;
0060: private String salaryAdministrationPlan;
0061: private String grade;
0062: private String runIdentifier;
0063: private String laborLedgerOriginalChartOfAccountsCode;
0064: private String laborLedgerOriginalAccountNumber;
0065: private String laborLedgerOriginalSubAccountNumber;
0066: private String laborLedgerOriginalFinancialObjectCode;
0067: private String laborLedgerOriginalFinancialSubObjectCode;
0068: private String hrmsCompany;
0069: private String setid;
0070: private Date transactionDateTimeStamp;
0071: private DocumentType referenceFinancialDocumentType;
0072: private OriginationCode referenceFinancialSystemOrigination;
0073: private AccountingPeriod payrollEndDateFiscalPeriod;
0074:
0075: /**
0076: * Constructor with generalLedgerPendingEntry
0077: *
0078: * @param glpe
0079: */
0080: public LaborOriginEntry(GeneralLedgerPendingEntry glpe) {
0081: super ();
0082: }
0083:
0084: /**
0085: * Constructor with financialDocumentTypeCode and financialSystemOriginationCode.
0086: *
0087: * @param financialDocumentTypeCode
0088: * @param financialSystemOriginationCode
0089: */
0090: public LaborOriginEntry(String financialDocumentTypeCode,
0091: String financialSystemOriginationCode) {
0092: super (financialDocumentTypeCode, financialSystemOriginationCode);
0093: }
0094:
0095: /**
0096: * Default constructor.
0097: */
0098: public LaborOriginEntry() {
0099: this (null, null);
0100: }
0101:
0102: /**
0103: * Constructor with laborTransaction
0104: *
0105: * @param t
0106: */
0107: public LaborOriginEntry(LaborTransaction t) {
0108: this ();
0109: copyFieldsFromTransaction(t);
0110: setPositionNumber(t.getPositionNumber());
0111: setTransactionPostingDate(t.getTransactionPostingDate());
0112: setPayPeriodEndDate(t.getPayPeriodEndDate());
0113: setTransactionTotalHours(t.getTransactionTotalHours());
0114: setPayrollEndDateFiscalYear(t.getPayrollEndDateFiscalYear());
0115: setPayrollEndDateFiscalPeriodCode(t
0116: .getPayrollEndDateFiscalPeriodCode());
0117: setFinancialDocumentApprovedCode(t
0118: .getFinancialDocumentApprovedCode());
0119: setTransactionEntryOffsetCode(t.getTransactionEntryOffsetCode());
0120: setTransactionEntryProcessedTimestamp(t
0121: .getTransactionEntryProcessedTimestamp());
0122: setEmplid(t.getEmplid());
0123: setEmployeeRecord(t.getEmployeeRecord());
0124: setEarnCode(t.getEarnCode());
0125: setPayGroup(t.getPayGroup());
0126: setSalaryAdministrationPlan(t.getSalaryAdministrationPlan());
0127: setGrade(t.getGrade());
0128: setRunIdentifier(t.getRunIdentifier());
0129: setLaborLedgerOriginalChartOfAccountsCode(t
0130: .getLaborLedgerOriginalChartOfAccountsCode());
0131: setLaborLedgerOriginalAccountNumber(t
0132: .getLaborLedgerOriginalAccountNumber());
0133: setLaborLedgerOriginalSubAccountNumber(t
0134: .getLaborLedgerOriginalSubAccountNumber());
0135: setLaborLedgerOriginalFinancialObjectCode(t
0136: .getLaborLedgerOriginalFinancialObjectCode());
0137: setLaborLedgerOriginalFinancialSubObjectCode(t
0138: .getLaborLedgerOriginalFinancialSubObjectCode());
0139: setHrmsCompany(t.getHrmsCompany());
0140: setSetid(t.getSetid());
0141: setReferenceFinancialDocumentType(t
0142: .getReferenceFinancialDocumentType());
0143: setReferenceFinancialSystemOrigination(t
0144: .getReferenceFinancialSystemOrigination());
0145: setPayrollEndDateFiscalPeriod(t.getPayrollEndDateFiscalPeriod());
0146: }
0147:
0148: /**
0149: * Constructor with string line
0150: *
0151: * @param line
0152: */
0153: public LaborOriginEntry(String line) {
0154: try {
0155: setFromTextFile(line, 0);
0156: } catch (LoadException e) {
0157: LOG.error("OriginEntryFull() Error loading line", e);
0158: }
0159: }
0160:
0161: /**
0162: * Gets the positionNumber
0163: *
0164: * @return Returns the positionNumber
0165: */
0166: public String getPositionNumber() {
0167: return positionNumber;
0168: }
0169:
0170: /**
0171: * Sets the positionNumber
0172: *
0173: * @param positionNumber The positionNumber to set.
0174: */
0175: public void setPositionNumber(String positionNumber) {
0176: this .positionNumber = positionNumber;
0177: }
0178:
0179: /**
0180: * Gets the transactionPostingDate
0181: *
0182: * @return Returns the transactionPostingDate
0183: */
0184: public Date getTransactionPostingDate() {
0185: return transactionPostingDate;
0186: }
0187:
0188: /**
0189: * Sets the transactionPostingDate
0190: *
0191: * @param transactionPostingDate The transactionPostingDate to set.
0192: */
0193: public void setTransactionPostingDate(Date transactionPostingDate) {
0194: this .transactionPostingDate = transactionPostingDate;
0195: }
0196:
0197: /**
0198: * Gets the payPeriodEndDate
0199: *
0200: * @return Returns the payPeriodEndDate
0201: */
0202: public Date getPayPeriodEndDate() {
0203: return payPeriodEndDate;
0204: }
0205:
0206: /**
0207: * Sets the payPeriodEndDate
0208: *
0209: * @param payPeriodEndDate The payPeriodEndDate to set.
0210: */
0211: public void setPayPeriodEndDate(Date payPeriodEndDate) {
0212: this .payPeriodEndDate = payPeriodEndDate;
0213: }
0214:
0215: /**
0216: * Gets the transactionTotalHours
0217: *
0218: * @return Returns the transactionTotalHours
0219: */
0220: public BigDecimal getTransactionTotalHours() {
0221: return transactionTotalHours;
0222: }
0223:
0224: /**
0225: * Sets the transactionTotalHours
0226: *
0227: * @param transactionTotalHours The transactionTotalHours to set.
0228: */
0229: public void setTransactionTotalHours(
0230: BigDecimal transactionTotalHours) {
0231: this .transactionTotalHours = transactionTotalHours;
0232: }
0233:
0234: /**
0235: * Gets the payrollEndDateFiscalYear
0236: *
0237: * @return Returns the payrollEndDateFiscalYear
0238: */
0239: public Integer getPayrollEndDateFiscalYear() {
0240: return payrollEndDateFiscalYear;
0241: }
0242:
0243: /**
0244: * Sets the payrollEndDateFiscalYear
0245: *
0246: * @param payrollEndDateFiscalYear The payrollEndDateFiscalYear to set.
0247: */
0248: public void setPayrollEndDateFiscalYear(
0249: Integer payrollEndDateFiscalYear) {
0250: this .payrollEndDateFiscalYear = payrollEndDateFiscalYear;
0251: }
0252:
0253: /**
0254: * Gets the payrollEndDateFiscalPeriodCode
0255: *
0256: * @return Returns the payrollEndDateFiscalPeriodCode
0257: */
0258: public String getPayrollEndDateFiscalPeriodCode() {
0259: return payrollEndDateFiscalPeriodCode;
0260: }
0261:
0262: /**
0263: * Sets the payrollEndDateFiscalPeriodCode
0264: *
0265: * @param payrollEndDateFiscalPeriodCode The payrollEndDateFiscalPeriodCode to set.
0266: */
0267: public void setPayrollEndDateFiscalPeriodCode(
0268: String payrollEndDateFiscalPeriodCode) {
0269: this .payrollEndDateFiscalPeriodCode = payrollEndDateFiscalPeriodCode;
0270: }
0271:
0272: /**
0273: * Gets the financialDocumentApprovedCode
0274: *
0275: * @return Returns the financialDocumentApprovedCode
0276: */
0277: public String getFinancialDocumentApprovedCode() {
0278: return financialDocumentApprovedCode;
0279: }
0280:
0281: /**
0282: * Sets the financialDocumentApprovedCode
0283: *
0284: * @param financialDocumentApprovedCode The financialDocumentApprovedCode to set.
0285: */
0286: public void setFinancialDocumentApprovedCode(
0287: String financialDocumentApprovedCode) {
0288: this .financialDocumentApprovedCode = financialDocumentApprovedCode;
0289: }
0290:
0291: /**
0292: * Gets the transactionEntryOffsetCode
0293: *
0294: * @return Returns the transactionEntryOffsetCode
0295: */
0296: public String getTransactionEntryOffsetCode() {
0297: return transactionEntryOffsetCode;
0298: }
0299:
0300: /**
0301: * Sets the transactionEntryOffsetCode
0302: *
0303: * @param transactionEntryOffsetCode The transactionEntryOffsetCode to set.
0304: */
0305: public void setTransactionEntryOffsetCode(
0306: String transactionEntryOffsetCode) {
0307: this .transactionEntryOffsetCode = transactionEntryOffsetCode;
0308: }
0309:
0310: /**
0311: * Gets the transactionEntryProcessedTimestamp
0312: *
0313: * @return Returns the transactionEntryProcessedTimestamp
0314: */
0315: public Date getTransactionEntryProcessedTimestamp() {
0316: return transactionEntryProcessedTimestamp;
0317: }
0318:
0319: /**
0320: * Sets the transactionEntryProcessedTimestamp
0321: *
0322: * @param transactionEntryProcessedTimestamp The transactionEntryProcessedTimestamp to set.
0323: */
0324: public void setTransactionEntryProcessedTimestamp(
0325: Date transactionEntryProcessedTimestamp) {
0326: this .transactionEntryProcessedTimestamp = transactionEntryProcessedTimestamp;
0327: }
0328:
0329: /**
0330: * Gets the emplid
0331: *
0332: * @return Returns the emplid
0333: */
0334: public String getEmplid() {
0335: return emplid;
0336: }
0337:
0338: /**
0339: * Sets the emplid
0340: *
0341: * @param emplid The emplid to set.
0342: */
0343: public void setEmplid(String emplid) {
0344: this .emplid = emplid;
0345: }
0346:
0347: /**
0348: * Gets the employeeRecord
0349: *
0350: * @return Returns the employeeRecord
0351: */
0352: public Integer getEmployeeRecord() {
0353: return employeeRecord;
0354: }
0355:
0356: /**
0357: * Sets the employeeRecord
0358: *
0359: * @param employeeRecord The employeeRecord to set.
0360: */
0361: public void setEmployeeRecord(Integer employeeRecord) {
0362: this .employeeRecord = employeeRecord;
0363: }
0364:
0365: /**
0366: * Gets the earnCode
0367: *
0368: * @return Returns the earnCode
0369: */
0370: public String getEarnCode() {
0371: return earnCode;
0372: }
0373:
0374: /**
0375: * Sets the earnCode
0376: *
0377: * @param earnCode The earnCode to set.
0378: */
0379: public void setEarnCode(String earnCode) {
0380: this .earnCode = earnCode;
0381: }
0382:
0383: /**
0384: * Gets the payGroup
0385: *
0386: * @return Returns the payGroup
0387: */
0388: public String getPayGroup() {
0389: return payGroup;
0390: }
0391:
0392: /**
0393: * Sets the payGroup
0394: *
0395: * @param payGroup The payGroup to set.
0396: */
0397: public void setPayGroup(String payGroup) {
0398: this .payGroup = payGroup;
0399: }
0400:
0401: /**
0402: * Gets the salaryAdministrationPlan
0403: *
0404: * @return Returns the salaryAdministrationPlan
0405: */
0406: public String getSalaryAdministrationPlan() {
0407: return salaryAdministrationPlan;
0408: }
0409:
0410: /**
0411: * Sets the salaryAdministrationPlan
0412: *
0413: * @param salaryAdministrationPlan The salaryAdministrationPlan to set.
0414: */
0415: public void setSalaryAdministrationPlan(
0416: String salaryAdministrationPlan) {
0417: this .salaryAdministrationPlan = salaryAdministrationPlan;
0418: }
0419:
0420: /**
0421: * Gets the grade
0422: *
0423: * @return Returns the grade
0424: */
0425: public String getGrade() {
0426: return grade;
0427: }
0428:
0429: /**
0430: * Sets the grade
0431: *
0432: * @param grade The grade to set.
0433: */
0434: public void setGrade(String grade) {
0435: this .grade = grade;
0436: }
0437:
0438: /**
0439: * Gets the runIdentifier
0440: *
0441: * @return Returns the runIdentifier
0442: */
0443: public String getRunIdentifier() {
0444: return runIdentifier;
0445: }
0446:
0447: /**
0448: * Sets the runIdentifier
0449: *
0450: * @param runIdentifier The runIdentifier to set.
0451: */
0452: public void setRunIdentifier(String runIdentifier) {
0453: this .runIdentifier = runIdentifier;
0454: }
0455:
0456: /**
0457: * Gets the laborLedgerOriginalChartOfAccountsCode
0458: *
0459: * @return Returns the laborLedgerOriginalChartOfAccountsCode
0460: */
0461: public String getLaborLedgerOriginalChartOfAccountsCode() {
0462: return laborLedgerOriginalChartOfAccountsCode;
0463: }
0464:
0465: /**
0466: * Sets the laborLedgerOriginalChartOfAccountsCode
0467: *
0468: * @param laborLedgerOriginalChartOfAccountsCode The laborLedgerOriginalChartOfAccountsCode to set.
0469: */
0470: public void setLaborLedgerOriginalChartOfAccountsCode(
0471: String laborLedgerOriginalChartOfAccountsCode) {
0472: this .laborLedgerOriginalChartOfAccountsCode = laborLedgerOriginalChartOfAccountsCode;
0473: }
0474:
0475: /**
0476: * Gets the laborLedgerOriginalAccountNumber
0477: *
0478: * @return Returns the laborLedgerOriginalAccountNumber
0479: */
0480: public String getLaborLedgerOriginalAccountNumber() {
0481: return laborLedgerOriginalAccountNumber;
0482: }
0483:
0484: /**
0485: * Sets the laborLedgerOriginalAccountNumber
0486: *
0487: * @param laborLedgerOriginalAccountNumber The laborLedgerOriginalAccountNumber to set.
0488: */
0489: public void setLaborLedgerOriginalAccountNumber(
0490: String laborLedgerOriginalAccountNumber) {
0491: this .laborLedgerOriginalAccountNumber = laborLedgerOriginalAccountNumber;
0492: }
0493:
0494: /**
0495: * Gets the laborLedgerOriginalSubAccountNumber
0496: *
0497: * @return Returns the laborLedgerOriginalSubAccountNumber
0498: */
0499: public String getLaborLedgerOriginalSubAccountNumber() {
0500: return laborLedgerOriginalSubAccountNumber;
0501: }
0502:
0503: /**
0504: * Sets the laborLedgerOriginalSubAccountNumber
0505: *
0506: * @param laborLedgerOriginalSubAccountNumber The laborLedgerOriginalSubAccountNumber to set.
0507: */
0508: public void setLaborLedgerOriginalSubAccountNumber(
0509: String laborLedgerOriginalSubAccountNumber) {
0510: this .laborLedgerOriginalSubAccountNumber = laborLedgerOriginalSubAccountNumber;
0511: }
0512:
0513: /**
0514: * Gets the laborLedgerOriginalFinancialObjectCode
0515: *
0516: * @return Returns the laborLedgerOriginalFinancialObjectCode
0517: */
0518: public String getLaborLedgerOriginalFinancialObjectCode() {
0519: return laborLedgerOriginalFinancialObjectCode;
0520: }
0521:
0522: /**
0523: * Sets the laborLedgerOriginalFinancialObjectCode
0524: *
0525: * @param laborLedgerOriginalFinancialObjectCode The laborLedgerOriginalFinancialObjectCode to set.
0526: */
0527: public void setLaborLedgerOriginalFinancialObjectCode(
0528: String laborLedgerOriginalFinancialObjectCode) {
0529: this .laborLedgerOriginalFinancialObjectCode = laborLedgerOriginalFinancialObjectCode;
0530: }
0531:
0532: /**
0533: * Gets the laborLedgerOriginalFinancialSubObjectCode
0534: *
0535: * @return Returns the laborLedgerOriginalFinancialSubObjectCode
0536: */
0537: public String getLaborLedgerOriginalFinancialSubObjectCode() {
0538: return laborLedgerOriginalFinancialSubObjectCode;
0539: }
0540:
0541: /**
0542: * Sets the laborLedgerOriginalFinancialSubObjectCode
0543: *
0544: * @param laborLedgerOriginalFinancialSubObjectCode The laborLedgerOriginalFinancialSubObjectCode to set.
0545: */
0546: public void setLaborLedgerOriginalFinancialSubObjectCode(
0547: String laborLedgerOriginalFinancialSubObjectCode) {
0548: this .laborLedgerOriginalFinancialSubObjectCode = laborLedgerOriginalFinancialSubObjectCode;
0549: }
0550:
0551: /**
0552: * Gets the hrmsCompany
0553: *
0554: * @return Returns the hrmsCompany
0555: */
0556: public String getHrmsCompany() {
0557: return hrmsCompany;
0558: }
0559:
0560: /**
0561: * Sets the hrmsCompany
0562: *
0563: * @param hrmsCompany The hrmsCompany to set.
0564: */
0565: public void setHrmsCompany(String hrmsCompany) {
0566: this .hrmsCompany = hrmsCompany;
0567: }
0568:
0569: /**
0570: * Gets the setid
0571: *
0572: * @return Returns the setid
0573: */
0574: public String getSetid() {
0575: return setid;
0576: }
0577:
0578: /**
0579: * Sets the setid
0580: *
0581: * @param setid The setid to set.
0582: */
0583: public void setSetid(String setid) {
0584: this .setid = setid;
0585: }
0586:
0587: /**
0588: * Gets the transactionDateTimeStamp
0589: *
0590: * @return Returns the transactionDateTimeStamp
0591: */
0592: public Date getTransactionDateTimeStamp() {
0593: return transactionDateTimeStamp;
0594: }
0595:
0596: /**
0597: * Sets the transactionDateTimeStamp
0598: *
0599: * @param transactionDateTimeStamp The transactionDateTimeStamp to set.
0600: */
0601: public void setTransactionDateTimeStamp(
0602: Date transactionDateTimeStamp) {
0603: this .transactionDateTimeStamp = transactionDateTimeStamp;
0604: }
0605:
0606: /**
0607: * Gets the payrollEndDateFiscalPeriod
0608: *
0609: * @return Returns the payrollEndDateFiscalPeriod.
0610: */
0611: public AccountingPeriod getPayrollEndDateFiscalPeriod() {
0612: return payrollEndDateFiscalPeriod;
0613: }
0614:
0615: /**
0616: * Sets the payrollEndDateFiscalPeriod
0617: *
0618: * @param payrollEndDateFiscalPeriod The payrollEndDateFiscalPeriod to set.
0619: */
0620: public void setPayrollEndDateFiscalPeriod(
0621: AccountingPeriod payrollEndDateFiscalPeriod) {
0622: this .payrollEndDateFiscalPeriod = payrollEndDateFiscalPeriod;
0623: }
0624:
0625: /**
0626: * Gets the referenceFinancialDocumentType
0627: *
0628: * @return Returns the referenceFinancialDocumentType.
0629: */
0630: public DocumentType getReferenceFinancialDocumentType() {
0631: return referenceFinancialDocumentType;
0632: }
0633:
0634: /**
0635: * Sets the referenceFinancialDocumentType
0636: *
0637: * @param referenceFinancialDocumentType The referenceFinancialDocumentType to set.
0638: */
0639: public void setReferenceFinancialDocumentType(
0640: DocumentType referenceFinancialDocumentType) {
0641: this .referenceFinancialDocumentType = referenceFinancialDocumentType;
0642: }
0643:
0644: /**
0645: * Gets the referenceFinancialSystemOrigination
0646: *
0647: * @return Returns the referenceFinancialSystemOrigination.
0648: */
0649: public OriginationCode getReferenceFinancialSystemOrigination() {
0650: return referenceFinancialSystemOrigination;
0651: }
0652:
0653: /**
0654: * Sets the referenceFinancialSystemOrigination
0655: *
0656: * @param referenceFinancialSystemOrigination The referenceFinancialSystemOrigination to set.
0657: */
0658: public void setReferenceFinancialSystemOrigination(
0659: OriginationCode referenceFinancialSystemOrigination) {
0660: this .referenceFinancialSystemOrigination = referenceFinancialSystemOrigination;
0661: }
0662:
0663: /**
0664: * Sets transactionTotalHours to null.
0665: */
0666: public void clearTransactionTotalHours() {
0667: this .transactionTotalHours = null;
0668: }
0669:
0670: /**
0671: * Get lines from string
0672: */
0673: public String getLine() {
0674: StringBuffer sb = new StringBuffer();
0675: if (universityFiscalYear == null) {
0676: sb.append(" ");
0677: } else {
0678: sb.append(universityFiscalYear);
0679: }
0680:
0681: sb.append(getField(2, chartOfAccountsCode));
0682: sb.append(getField(7, accountNumber));
0683: sb.append(getField(5, subAccountNumber));
0684: sb.append(getField(4, financialObjectCode));
0685: sb.append(getField(3, financialSubObjectCode));
0686: sb.append(getField(2, financialBalanceTypeCode));
0687: sb.append(getField(2, financialObjectTypeCode));
0688: sb.append(getField(2, universityFiscalPeriodCode));
0689: sb.append(getField(4, financialDocumentTypeCode));
0690: sb.append(getField(2, financialSystemOriginationCode));
0691: sb.append(getField(14, documentNumber));
0692:
0693: if (transactionLedgerEntrySequenceNumber == null) {
0694: sb.append("00000");
0695: } else {
0696: // Format to a length of 5
0697: String seqNum = transactionLedgerEntrySequenceNumber
0698: .toString();
0699: while (5 > seqNum.length()) {
0700: seqNum = "0" + seqNum;
0701: }
0702: sb.append(seqNum);
0703: }
0704:
0705: // Labor Specified fields
0706: sb.append(getField(8, positionNumber));
0707: sb.append(getField(10, projectCode));
0708: sb.append(getField(40, transactionLedgerEntryDescription));
0709:
0710: // The length of Labor's transactionLedgerEntryAmount is 19
0711: // GL's transactionLedgerEntryAmount is 17
0712: if (transactionLedgerEntryAmount == null) {
0713: sb.append(" ");
0714: } else {
0715: String a = transactionLedgerEntryAmount.toString();
0716: sb.append(" ".substring(0, 19 - a
0717: .length()));
0718: sb.append(a);
0719: }
0720:
0721: sb.append(getField(1, transactionDebitCreditCode));
0722: sb.append(formatDate(transactionDate));
0723: sb.append(getField(10, organizationDocumentNumber));
0724: sb.append(getField(8, organizationReferenceId));
0725: sb.append(getField(4, referenceFinancialDocumentTypeCode));
0726: sb.append(getField(2, referenceFinancialSystemOriginationCode));
0727: sb.append(getField(14, referenceFinancialDocumentNumber));
0728: sb.append(formatDate(financialDocumentReversalDate));
0729: sb.append(getField(1, transactionEncumbranceUpdateCode));
0730: sb.append(formatDate(transactionPostingDate));
0731: sb.append(formatDate(payPeriodEndDate));
0732:
0733: if (transactionTotalHours == null) {
0734: sb.append(" ");
0735: } else {
0736: sb.append(getField(9, transactionTotalHours.toString()));
0737: }
0738:
0739: if (payrollEndDateFiscalYear == null) {
0740: sb.append(" ");
0741: } else {
0742: sb.append(getField(4, payrollEndDateFiscalYear.toString()));
0743: }
0744:
0745: sb.append(getField(2, payrollEndDateFiscalPeriodCode));
0746: sb.append(getField(11, emplid));
0747:
0748: if (employeeRecord == null) {
0749: sb.append(" ");
0750: } else {
0751: sb.append(getField(3, employeeRecord.toString()));
0752: }
0753:
0754: sb.append(getField(3, earnCode));
0755: sb.append(getField(3, payGroup));
0756: sb.append(getField(4, salaryAdministrationPlan));
0757: sb.append(getField(3, grade));
0758: sb.append(getField(10, runIdentifier));
0759: sb.append(getField(2, laborLedgerOriginalChartOfAccountsCode));
0760: sb.append(getField(7, laborLedgerOriginalAccountNumber));
0761: sb.append(getField(5, laborLedgerOriginalSubAccountNumber));
0762: sb.append(getField(4, laborLedgerOriginalFinancialObjectCode));
0763: sb
0764: .append(getField(3,
0765: laborLedgerOriginalFinancialSubObjectCode));
0766: sb.append(getField(3, hrmsCompany));
0767: sb.append(getField(5, setid));
0768:
0769: // Labor need it?
0770: // pad to full length of 173 chars.
0771: /*
0772: * while (173 > sb.toString().length()) { sb.append(' '); }
0773: */
0774:
0775: return sb.toString();
0776: }
0777:
0778: /**
0779: * Sets the entries from text file.
0780: */
0781: public void setFromTextFile(String line, int lineNumber)
0782: throws LoadException {
0783: // Just in case
0784: line = line + SPACES;
0785:
0786: if (!" ".equals(line.substring(0, 4))) {
0787: try {
0788: setUniversityFiscalYear(new Integer(line
0789: .substring(0, 4)));
0790: } catch (NumberFormatException e) {
0791: GlobalVariables
0792: .getErrorMap()
0793: .putError(
0794: "fileUpload",
0795: KFSKeyConstants.ERROR_NUMBER_FORMAT_ORIGIN_ENTRY_FROM_TEXT_FILE,
0796: new String[] {
0797: new Integer(lineNumber)
0798: .toString(),
0799: "University Fiscal Year" });
0800: throw new LoadException(
0801: "Invalid university fiscal year");
0802: }
0803: } else {
0804: setUniversityFiscalYear(null);
0805: }
0806:
0807: setChartOfAccountsCode(getValue(line, 4, 6));
0808: setAccountNumber(getValue(line, 6, 13));
0809: setSubAccountNumber(getValue(line, 13, 18));
0810: setFinancialObjectCode(getValue(line, 18, 22));
0811: setFinancialSubObjectCode(getValue(line, 22, 25));
0812: setFinancialBalanceTypeCode(getValue(line, 25, 27));
0813: setFinancialObjectTypeCode(getValue(line, 27, 29));
0814: setUniversityFiscalPeriodCode(getValue(line, 29, 31));
0815: setFinancialDocumentTypeCode(getValue(line, 31, 35));
0816: setFinancialSystemOriginationCode(getValue(line, 35, 37));
0817: setDocumentNumber(getValue(line, 37, 51));
0818: String sequenceNumber = getValue(line, 51, 56);
0819: if (StringUtils.isNotBlank(sequenceNumber)
0820: && !"00000".equals(sequenceNumber)) {
0821: try {
0822: setTransactionLedgerEntrySequenceNumber(new Integer(
0823: sequenceNumber));
0824: } catch (NumberFormatException e) {
0825: GlobalVariables
0826: .getErrorMap()
0827: .putError(
0828: "fileUpload",
0829: KFSKeyConstants.ERROR_NUMBER_FORMAT_ORIGIN_ENTRY_FROM_TEXT_FILE,
0830: new String[] {
0831: new Integer(lineNumber)
0832: .toString(),
0833: "Sequence Number" });
0834: throw new LoadException("Invalid sequence number");
0835: }
0836: } else {
0837: setTransactionLedgerEntrySequenceNumber(null);
0838: }
0839: setPositionNumber(getValue(line, 56, 64));
0840: setProjectCode(getValue(line, 64, 74));
0841: setTransactionLedgerEntryDescription(getValue(line, 74, 114));
0842: try {
0843: setTransactionLedgerEntryAmount(new KualiDecimal(getValue(
0844: line, 114, 133)));
0845: } catch (NumberFormatException e) {
0846: GlobalVariables
0847: .getErrorMap()
0848: .putError(
0849: "fileUpload",
0850: KFSKeyConstants.ERROR_NUMBER_FORMAT_ORIGIN_ENTRY_FROM_TEXT_FILE,
0851: new String[] {
0852: new Integer(lineNumber).toString(),
0853: "Transaction Ledger Entry Amount" });
0854: throw new LoadException("Invalid Entry Amount");
0855: }
0856: setTransactionDebitCreditCode(getValue(line, 133, 134));
0857: try {
0858: setTransactionDate(parseDate(getValue(line, 134, 144),
0859: false));
0860: } catch (ParseException e) {
0861: GlobalVariables
0862: .getErrorMap()
0863: .putError(
0864: "fileUpload",
0865: KFSKeyConstants.ERROR_NUMBER_FORMAT_ORIGIN_ENTRY_FROM_TEXT_FILE,
0866: new String[] {
0867: new Integer(lineNumber).toString(),
0868: "Transaction Date" });
0869: throw new LoadException("Invalid Transaction Date");
0870: }
0871: setOrganizationDocumentNumber(getValue(line, 144, 154));
0872: setOrganizationReferenceId(getValue(line, 154, 162));
0873: setReferenceFinancialDocumentTypeCode(getValue(line, 162, 166));
0874: setReferenceFinancialSystemOriginationCode(getValue(line, 166,
0875: 168));
0876: setReferenceFinancialDocumentNumber(getValue(line, 168, 182));
0877: try {
0878: setFinancialDocumentReversalDate(parseDate(getValue(line,
0879: 182, 192), false));
0880: } catch (ParseException e) {
0881: GlobalVariables
0882: .getErrorMap()
0883: .putError(
0884: "fileUpload",
0885: KFSKeyConstants.ERROR_NUMBER_FORMAT_ORIGIN_ENTRY_FROM_TEXT_FILE,
0886: new String[] {
0887: new Integer(lineNumber).toString(),
0888: "Transaction Date" });
0889: throw new LoadException("Invalid Reversal Date");
0890: }
0891:
0892: setTransactionEncumbranceUpdateCode(getValue(line, 192, 193));
0893: try {
0894: setTransactionPostingDate(parseDate(
0895: getValue(line, 193, 203), false));
0896: } catch (ParseException e) {
0897: GlobalVariables
0898: .getErrorMap()
0899: .putError(
0900: "fileUpload",
0901: KFSKeyConstants.ERROR_NUMBER_FORMAT_ORIGIN_ENTRY_FROM_TEXT_FILE,
0902: new String[] {
0903: new Integer(lineNumber).toString(),
0904: "Transaction Date" });
0905: throw new LoadException("Invalid Transaction Date");
0906: }
0907: try {
0908: setPayPeriodEndDate(parseDate(getValue(line, 203, 213),
0909: false));
0910: } catch (ParseException e) {
0911: GlobalVariables
0912: .getErrorMap()
0913: .putError(
0914: "fileUpload",
0915: KFSKeyConstants.ERROR_NUMBER_FORMAT_ORIGIN_ENTRY_FROM_TEXT_FILE,
0916: new String[] {
0917: new Integer(lineNumber).toString(),
0918: "Transaction Date" });
0919: throw new LoadException("Invalid Transaction Date");
0920: }
0921:
0922: if (getValue(line, 213, 222).equals("")) {
0923:
0924: } else {
0925: try {
0926: setTransactionTotalHours(new BigDecimal(getValue(line,
0927: 213, 222)));
0928: } catch (NumberFormatException e) {
0929: GlobalVariables
0930: .getErrorMap()
0931: .putError(
0932: "fileUpload",
0933: KFSKeyConstants.ERROR_NUMBER_FORMAT_ORIGIN_ENTRY_FROM_TEXT_FILE,
0934: new String[] {
0935: new Integer(lineNumber)
0936: .toString(),
0937: "Transaction Total Hours" });
0938: throw new LoadException(
0939: "Invalid Transaction Total Hours");
0940: }
0941: }
0942:
0943: if (getValue(line, 222, 226).equals("")) {
0944:
0945: } else {
0946: try {
0947: setPayrollEndDateFiscalYear(new Integer(getValue(line,
0948: 222, 226)));
0949: } catch (NumberFormatException e) {
0950: GlobalVariables
0951: .getErrorMap()
0952: .putError(
0953: "fileUpload",
0954: KFSKeyConstants.ERROR_NUMBER_FORMAT_ORIGIN_ENTRY_FROM_TEXT_FILE,
0955: new String[] {
0956: new Integer(lineNumber)
0957: .toString(),
0958: "Payroll End Date Fiscal Year" });
0959: throw new LoadException(
0960: "Invalid Payroll EndDate Fiscal Year");
0961: }
0962: }
0963:
0964: setPayrollEndDateFiscalPeriodCode(getValue(line, 226, 228));
0965: setEmplid(getValue(line, 228, 239));
0966: if (getValue(line, 239, 242).equals("")) {
0967:
0968: } else {
0969: try {
0970: setEmployeeRecord(new Integer(getValue(line, 239, 242)));
0971: } catch (NumberFormatException e) {
0972: GlobalVariables
0973: .getErrorMap()
0974: .putError(
0975: "fileUpload",
0976: KFSKeyConstants.ERROR_NUMBER_FORMAT_ORIGIN_ENTRY_FROM_TEXT_FILE,
0977: new String[] {
0978: new Integer(lineNumber)
0979: .toString(),
0980: "Employee Record" });
0981: throw new LoadException("Invalid Employee Record");
0982: }
0983: }
0984: setEarnCode(getValue(line, 242, 245));
0985: setPayGroup(getValue(line, 245, 248));
0986: setSalaryAdministrationPlan(getValue(line, 248, 252));
0987: setGrade(getValue(line, 252, 255));
0988: setRunIdentifier(getValue(line, 255, 265));
0989: setLaborLedgerOriginalChartOfAccountsCode(getValue(line, 265,
0990: 267));
0991: setLaborLedgerOriginalAccountNumber(getValue(line, 267, 274));
0992: setLaborLedgerOriginalSubAccountNumber(getValue(line, 274, 279));
0993: setLaborLedgerOriginalFinancialObjectCode(getValue(line, 279,
0994: 283));
0995: setLaborLedgerOriginalFinancialSubObjectCode(getValue(line,
0996: 283, 286));
0997: setHrmsCompany(getValue(line, 286, 289));
0998: setSetid(getValue(line, 289, 294));
0999: }
1000:
1001: /**
1002: * Get fieldValue from fieldName.
1003: *
1004: * @param fieldName
1005: */
1006:
1007: public Object getFieldValue(String fieldName) {
1008: if ("universityFiscalYear".equals(fieldName)) {
1009: return getUniversityFiscalYear();
1010: } else if ("chartOfAccountsCode".equals(fieldName)) {
1011: return getChartOfAccountsCode();
1012: } else if ("accountNumber".equals(fieldName)) {
1013: return getAccountNumber();
1014: } else if ("subAccountNumber".equals(fieldName)) {
1015: return getSubAccountNumber();
1016: } else if ("financialObjectCode".equals(fieldName)) {
1017: return getFinancialObjectCode();
1018: } else if ("financialSubObjectCode".equals(fieldName)) {
1019: return getFinancialSubObjectCode();
1020: } else if ("financialBalanceTypeCode".equals(fieldName)) {
1021: return getFinancialBalanceTypeCode();
1022: } else if ("financialObjectTypeCode".equals(fieldName)) {
1023: return getFinancialObjectTypeCode();
1024: } else if ("universityFiscalPeriodCode".equals(fieldName)) {
1025: return getUniversityFiscalPeriodCode();
1026: } else if ("financialDocumentTypeCode".equals(fieldName)) {
1027: return getFinancialDocumentTypeCode();
1028: } else if ("financialSystemOriginationCode".equals(fieldName)) {
1029: return getFinancialSystemOriginationCode();
1030: } else if (KFSPropertyConstants.DOCUMENT_NUMBER
1031: .equals(fieldName)) {
1032: return getDocumentNumber();
1033: } else if ("transactionLedgerEntrySequenceNumber"
1034: .equals(fieldName)) {
1035: return getTransactionLedgerEntrySequenceNumber();
1036: } else if ("positionNumber".equals(fieldName)) {
1037: return getPositionNumber();
1038: } else if ("transactionLedgerEntryDescription"
1039: .equals(fieldName)) {
1040: return getTransactionLedgerEntryDescription();
1041: } else if ("transactionLedgerEntryAmount".equals(fieldName)) {
1042: return getTransactionLedgerEntryAmount();
1043: } else if ("transactionDebitCreditCode".equals(fieldName)) {
1044: return getTransactionDebitCreditCode();
1045: } else if ("transactionDate".equals(fieldName)) {
1046: return getTransactionDate();
1047: } else if ("organizationDocumentNumber".equals(fieldName)) {
1048: return getOrganizationDocumentNumber();
1049: } else if ("projectCode".equals(fieldName)) {
1050: return getProjectCode();
1051: } else if ("organizationReferenceId".equals(fieldName)) {
1052: return getOrganizationReferenceId();
1053: } else if ("referenceFinancialDocumentTypeCode"
1054: .equals(fieldName)) {
1055: return getReferenceFinancialDocumentTypeCode();
1056: } else if ("referenceFinancialSystemOriginationCode"
1057: .equals(fieldName)) {
1058: return getReferenceFinancialSystemOriginationCode();
1059: } else if ("referenceFinancialDocumentNumber".equals(fieldName)) {
1060: return getReferenceFinancialDocumentNumber();
1061: } else if ("financialDocumentReversalDate".equals(fieldName)) {
1062: return getFinancialDocumentReversalDate();
1063: } else if ("transactionEncumbranceUpdateCode".equals(fieldName)) {
1064: return getTransactionEncumbranceUpdateCode();
1065: } else if ("transactionPostingDate".equals(fieldName)) {
1066: return getTransactionPostingDate();
1067: } else if ("payPeriodEndDate".equals(fieldName)) {
1068: return getPayPeriodEndDate();
1069: } else if ("transactionTotalHours".equals(fieldName)) {
1070: return getTransactionTotalHours();
1071: } else if ("payrollEndDateFiscalYear".equals(fieldName)) {
1072: return getPayrollEndDateFiscalYear();
1073: } else if ("payrollEndDateFiscalPeriodCode".equals(fieldName)) {
1074: return getPayrollEndDateFiscalPeriodCode();
1075: } else if ("emplid".equals(fieldName)) {
1076: return getEmplid();
1077: } else if ("employeeRecord".equals(fieldName)) {
1078: return getEmployeeRecord();
1079: } else if ("earnCode".equals(fieldName)) {
1080: return getEarnCode();
1081: } else if ("payGroup".equals(fieldName)) {
1082: return getPayGroup();
1083: } else if ("salaryAdministrationPlan".equals(fieldName)) {
1084: return getSalaryAdministrationPlan();
1085: } else if ("grade".equals(fieldName)) {
1086: return getGrade();
1087: } else if ("runIdentifier".equals(fieldName)) {
1088: return getRunIdentifier();
1089: } else if ("laborLedgerOriginalChartOfAccountsCode"
1090: .equals(fieldName)) {
1091: return getLaborLedgerOriginalChartOfAccountsCode();
1092: } else if ("laborLedgerOriginalAccountNumber".equals(fieldName)) {
1093: return getLaborLedgerOriginalAccountNumber();
1094: } else if ("laborLedgerOriginalSubAccountNumber"
1095: .equals(fieldName)) {
1096: return getLaborLedgerOriginalSubAccountNumber();
1097: } else if ("laborLedgerOriginalFinancialObjectCode"
1098: .equals(fieldName)) {
1099: return getLaborLedgerOriginalFinancialObjectCode();
1100: } else if ("laborLedgerOriginalFinancialSubObjectCode"
1101: .equals(fieldName)) {
1102: return getLaborLedgerOriginalFinancialSubObjectCode();
1103: } else if ("hrmsCompany".equals(fieldName)) {
1104: return getHrmsCompany();
1105: } else if ("setid".equals(fieldName)) {
1106: return getSetid();
1107: } else {
1108: throw new IllegalArgumentException("Invalid Field Name "
1109: + fieldName);
1110: }
1111: }
1112:
1113: /**
1114: * Sets the fieldValue
1115: *
1116: * @param fieldName
1117: * @param fieldValue
1118: */
1119: public void setFieldValue(String fieldName, String fieldValue) {
1120: if ("universityFiscalYear".equals(fieldName)) {
1121: if (StringUtils.isNotBlank(fieldValue)) {
1122: setUniversityFiscalYear(Integer.parseInt(fieldValue));
1123: } else {
1124: setUniversityFiscalYear(null);
1125: }
1126: } else if ("chartOfAccountsCode".equals(fieldName)) {
1127: setChartOfAccountsCode(fieldValue);
1128: } else if ("accountNumber".equals(fieldName)) {
1129: setAccountNumber(fieldValue);
1130: } else if ("subAccountNumber".equals(fieldName)) {
1131: setSubAccountNumber(fieldValue);
1132: } else if ("financialObjectCode".equals(fieldName)) {
1133: setFinancialObjectCode(fieldValue);
1134: } else if ("financialSubObjectCode".equals(fieldName)) {
1135: setFinancialSubObjectCode(fieldValue);
1136: } else if ("financialBalanceTypeCode".equals(fieldName)) {
1137: setFinancialBalanceTypeCode(fieldValue);
1138: } else if ("financialObjectTypeCode".equals(fieldName)) {
1139: setFinancialObjectTypeCode(fieldValue);
1140: } else if ("universityFiscalPeriodCode".equals(fieldName)) {
1141: setUniversityFiscalPeriodCode(fieldValue);
1142: } else if ("financialDocumentTypeCode".equals(fieldName)) {
1143: setFinancialDocumentTypeCode(fieldValue);
1144: } else if ("financialSystemOriginationCode".equals(fieldName)) {
1145: setFinancialSystemOriginationCode(fieldValue);
1146: } else if (KFSPropertyConstants.DOCUMENT_NUMBER
1147: .equals(fieldName)) {
1148: setDocumentNumber(fieldValue);
1149: } else if ("transactionLedgerEntrySequenceNumber"
1150: .equals(fieldName)) {
1151: if (StringUtils.isNotBlank(fieldValue)) {
1152: setTransactionLedgerEntrySequenceNumber(Integer
1153: .parseInt(fieldValue));
1154: } else {
1155: setTransactionLedgerEntrySequenceNumber(null);
1156: }
1157: } else if ("positionNumber".equals(fieldName)) {
1158: setPositionNumber(fieldValue);
1159: } else if ("projectCode".equals(fieldName)) {
1160: setProjectCode(fieldValue);
1161: } else if ("transactionLedgerEntryDescription"
1162: .equals(fieldName)) {
1163: setTransactionLedgerEntryDescription(fieldValue);
1164: } else if ("transactionLedgerEntryAmount".equals(fieldName)) {
1165: if (StringUtils.isNotBlank(fieldValue)) {
1166: setTransactionLedgerEntryAmount(new KualiDecimal(
1167: fieldValue));
1168: } else {
1169: clearTransactionLedgerEntryAmount();
1170: }
1171: } else if ("transactionDebitCreditCode".equals(fieldName)) {
1172: setTransactionDebitCreditCode(fieldValue);
1173: } else if ("transactionDate".equals(fieldName)) {
1174: if (StringUtils.isNotBlank(fieldValue)) {
1175: try {
1176: SimpleDateFormat df = new SimpleDateFormat(
1177: "yyyy-MM-dd");
1178: setTransactionDate(new java.sql.Date((df
1179: .parse(fieldValue)).getTime()));
1180: } catch (ParseException e) {
1181: setTransactionDate(null);
1182: }
1183: } else {
1184: setTransactionDate(null);
1185: }
1186: } else if ("organizationDocumentNumber".equals(fieldName)) {
1187: setOrganizationDocumentNumber(fieldValue);
1188: } else if ("organizationReferenceId".equals(fieldName)) {
1189: setOrganizationReferenceId(fieldValue);
1190: } else if ("referenceFinancialDocumentTypeCode"
1191: .equals(fieldName)) {
1192: setReferenceFinancialDocumentTypeCode(fieldValue);
1193: } else if ("referenceFinancialSystemOriginationCode"
1194: .equals(fieldName)) {
1195: setReferenceFinancialSystemOriginationCode(fieldValue);
1196: } else if ("referenceFinancialDocumentNumber".equals(fieldName)) {
1197: setReferenceFinancialDocumentNumber(fieldValue);
1198: } else if ("financialDocumentReversalDate".equals(fieldName)) {
1199: if (StringUtils.isNotBlank(fieldValue)) {
1200: try {
1201: SimpleDateFormat df = new SimpleDateFormat(
1202: "yyyy-MM-dd");
1203: setFinancialDocumentReversalDate(new java.sql.Date(
1204: (df.parse(fieldValue)).getTime()));
1205: } catch (ParseException e) {
1206: setFinancialDocumentReversalDate(null);
1207: }
1208: } else {
1209: setFinancialDocumentReversalDate(null);
1210: }
1211: } else if ("transactionEncumbranceUpdateCode".equals(fieldName)) {
1212: setTransactionEncumbranceUpdateCode(fieldValue);
1213: } else if ("transactionPostingDate".equals(fieldName)) {
1214: if (StringUtils.isNotBlank(fieldValue)) {
1215: try {
1216: SimpleDateFormat df = new SimpleDateFormat(
1217: "yyyy-MM-dd");
1218: setTransactionPostingDate(new java.sql.Date((df
1219: .parse(fieldValue)).getTime()));
1220: } catch (ParseException e) {
1221: setTransactionPostingDate(null);
1222: }
1223: } else {
1224: setTransactionPostingDate(null);
1225: }
1226: } else if ("payPeriodEndDate".equals(fieldName)) {
1227: if (StringUtils.isNotBlank(fieldValue)) {
1228: try {
1229: SimpleDateFormat df = new SimpleDateFormat(
1230: "yyyy-MM-dd");
1231: setPayPeriodEndDate(new java.sql.Date((df
1232: .parse(fieldValue)).getTime()));
1233: } catch (ParseException e) {
1234: setPayPeriodEndDate(null);
1235: }
1236: } else {
1237: setPayPeriodEndDate(null);
1238: }
1239: } else if ("transactionTotalHours".equals(fieldName)) {
1240: if (StringUtils.isNotBlank(fieldValue)) {
1241: setTransactionTotalHours(new BigDecimal(fieldValue));
1242: } else {
1243: clearTransactionTotalHours();
1244: }
1245: } else if ("payrollEndDateFiscalYear".equals(fieldName)) {
1246: if (StringUtils.isNotBlank(fieldValue)) {
1247: setPayrollEndDateFiscalYear(Integer
1248: .parseInt(fieldValue));
1249: } else {
1250: setPayrollEndDateFiscalYear(null);
1251: }
1252: } else if ("payrollEndDateFiscalPeriodCode".equals(fieldName)) {
1253: setPayrollEndDateFiscalPeriodCode(fieldValue);
1254: } else if ("emplid".equals(fieldName)) {
1255: setEmplid(fieldValue);
1256: } else if ("employeeRecord".equals(fieldName)) {
1257: if (StringUtils.isNotBlank(fieldValue)) {
1258: setEmployeeRecord(Integer.parseInt(fieldValue));
1259: } else {
1260: setEmployeeRecord(null);
1261: }
1262: } else if ("earnCode".equals(fieldName)) {
1263: setEarnCode(fieldValue);
1264: } else if ("payGroup".equals(fieldName)) {
1265: setPayGroup(fieldValue);
1266: } else if ("salaryAdministrationPlan".equals(fieldName)) {
1267: setSalaryAdministrationPlan(fieldValue);
1268: } else if ("grade".equals(fieldName)) {
1269: setGrade(fieldValue);
1270: } else if ("runIdentifier".equals(fieldName)) {
1271: setRunIdentifier(fieldValue);
1272: } else if ("laborLedgerOriginalChartOfAccountsCode"
1273: .equals(fieldName)) {
1274: setLaborLedgerOriginalChartOfAccountsCode(fieldValue);
1275: } else if ("laborLedgerOriginalAccountNumber".equals(fieldName)) {
1276: setLaborLedgerOriginalAccountNumber(fieldValue);
1277: } else if ("laborLedgerOriginalSubAccountNumber"
1278: .equals(fieldName)) {
1279: setLaborLedgerOriginalSubAccountNumber(fieldValue);
1280: } else if ("laborLedgerOriginalFinancialObjectCode"
1281: .equals(fieldName)) {
1282: setLaborLedgerOriginalFinancialObjectCode(fieldValue);
1283: } else if ("laborLedgerOriginalFinancialSubObjectCode"
1284: .equals(fieldName)) {
1285: setLaborLedgerOriginalFinancialSubObjectCode(fieldValue);
1286: } else if ("hrmsCompany".equals(fieldName)) {
1287: setHrmsCompany(fieldValue);
1288: } else if ("setid".equals(fieldName)) {
1289: setSetid(fieldValue);
1290: } else {
1291: throw new IllegalArgumentException("Invalid Field Name "
1292: + fieldName);
1293: }
1294: }
1295:
1296: /**
1297: * Formats date and returns date
1298: *
1299: * @param date
1300: * @see org.kuali.module.gl.bo.OriginEntryLite#formatDate(java.sql.Date)
1301: */
1302: protected String formatDate(Date date) {
1303: if (date == null) {
1304: return LaborConstants.getSpaceTransactionDate();
1305: } else {
1306: SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT);
1307: return sdf.format(date);
1308: }
1309: }
1310: }
|