}
}
private void processCode(SibsIncommingPaymentFileDetailLine detailLine, Person person, ProcessResult result) throws Exception {
final PaymentCode paymentCode = getPaymentCode(detailLine, result);
if (paymentCode == null) {
result.addMessage("error.manager.SIBS.codeNotFound", detailLine.getCode());
throw new Exception();
}
final PaymentCode codeToProcess =
getPaymentCodeToProcess(paymentCode, ExecutionYear.readByDateTime(detailLine.getWhenOccuredTransaction()), result);
if (codeToProcess.getState() == PaymentCodeState.INVALID) {
result.addMessage("warning.manager.SIBS.invalidCode", codeToProcess.getCode());
}
if (codeToProcess.isProcessed() && codeToProcess.getWhenUpdated().isBefore(detailLine.getWhenOccuredTransaction())) {
result.addMessage("warning.manager.SIBS.codeAlreadyProcessed", codeToProcess.getCode());
}
codeToProcess.process(person, detailLine.getAmount(), detailLine.getWhenOccuredTransaction(),
detailLine.getSibsTransactionId(), StringUtils.EMPTY);
}