Account account = system.getAccounts().get(accountId);
Expenditure expenditure = system.getExpenditure().get(expenditureId);
// Expenditure myExpenditure = new Expenditure(expediture.getId(), expediture.getDescription(), expediture.getNextPaymentDate(), expediture.getFrequency(), expediture.getNumberOfOcurrencies(), expediture.getValue(), expediture.isFixedValue(), expediture.getCategoryId());
// myExpenditure.setActive(false);
Operation operation;
if(typeOfPayment == null){
typeOfPayment = system.getPaymentMoney();
}else{
if (typeOfPayment.getType().equals("Dinheiro")) {
typeOfPayment = system.getPaymentMoney();
} else if (typeOfPayment.getType().equals("D�bito autom�tico")) {
typeOfPayment = system.getPaymentAutomaticDebit();
} else if (typeOfPayment.getType().equals("Pagamento eletr�nico")) {
typeOfPayment = system.getPaymentEletronic();
} else if (typeOfPayment.getType().equals("Transfer�ncia eletr�nica")) {
typeOfPayment = system.getPaymentEletronicTransfer();
} else if (typeOfPayment.getType().equals("TED")) {
typeOfPayment = system.getPaymentTED();
} else if (typeOfPayment.getType().equals("DOC")) {
typeOfPayment = system.getPaymentDOC();
} else if (typeOfPayment.getType().equals("Saque cart�o")) {
typeOfPayment = system.getPaymentGetMoney();
}
}
if(idExtractItem == null){
operation = new Operation(idOperation, account,expenditure.getCategoryId(),date, expenditure.getDescription(),new Money(value).getFloatValue(),typeOfPayment, true, expenditure.getId());
} else {
operation = new Operation(idOperation, account,expenditure.getCategoryId(),date, expenditure.getDescription(),new Money(value).getFloatValue(),typeOfPayment, true, expenditure.getId(), idExtractItem);
operation.setOperationLinked(true);
system.getExtractItemMap().remove(idExtractItem);
}
system.getOperations().put(idOperation, operation);
expenditure.skip();