use of org.estatio.module.capex.dom.coda.DocumentType in project estatio by estatio.
the class CodaMappingImport method handleRow.
@Override
public void handleRow(final CodaMappingImport previousRow) {
atPath = atPath == null && previousRow != null ? previousRow.atPath : atPath;
if (codaElementName == null) {
String.format("");
}
if ((documentType != null || incomingInvoiceType != null) && chargeName != null) {
IncomingInvoiceType incomingInvoiceTypeEnum = IncomingInvoiceType.valueOf(incomingInvoiceType);
DocumentType documentTypeEnum = incomingInvoiceTypeEnum == null ? DocumentType.valueOf(documentType) : DocumentType.INVOICE_IN;
CodaElementLevel codaElementLevelEnum = CodaElementLevel.valueOf(codaElementLevel);
CodaElement codaElement = codaElementRepository.findOrCreate(codaElementLevelEnum, codaElementCode, codaElementName);
Charge charge = chargeRepository.findOrCreate(atPath, chargeReference != null ? chargeReference : chargeNameToReference(chargeName), chargeName, "", Applicability.INCOMING);
final LocalDateInterval interval = period == null ? new LocalDateInterval() : PeriodUtil.yearFromPeriod(period);
final CodaTransactionType codaTransactionType = valueOfElseDefault(transactionType, CodaTransactionType.STAT);
codaMappingRepository.findOrCreate(atPath, documentTypeEnum, incomingInvoiceTypeEnum, codaTransactionType, charge, propertyFullyOwned(propertyOwnershipType), interval.startDate(), interval.endDate(), startDate, endDate, codaElement);
}
}
Aggregations