}
@Override
protected Object executeAndQuery(PrevalentSystem system) {
Registration registration = system.registrations.get(idRegistration);
Parcel parcel = registration.getParcel(idParcel);
if(parcel != null){
parcel.setTicket(ticket);
parcel.setMora(mora);
parcel.setDiscount(discount);
parcel.setPayValue(payValue);
parcel.setPayDate(gdDatePayDate);
parcel.setPayed(true);
parcel.setPersonReceivedId(personId);
parcel.setValueReceived(_valueReceived);
if(paymentType == null){
parcel.setPaymenType(system.getPaymentMoney());
}else{
if (paymentType.getType().equals("Dinheiro")) {
parcel.setPaymenType(system.getPaymentMoney());
} else if (paymentType.getType().equals("D�bito autom�tico")) {
parcel.setPaymenType(system.getPaymentAutomaticDebit());
} else if (paymentType.getType().equals("Pagamento eletr�nico")) {
parcel.setPaymenType(system.getPaymentEletronic());
} else if (paymentType.getType().equals("Transfer�ncia eletr�nica")) {
parcel.setPaymenType(system.getPaymentEletronicTransfer());
} else if (paymentType.getType().equals("TED")) {
parcel.setPaymenType(system.getPaymentTED());
} else if (paymentType.getType().equals("DOC")) {
parcel.setPaymenType(system.getPaymentDOC());
} else if (paymentType.getType().equals("Saque cart�o")) {
parcel.setPaymenType(system.getPaymentGetMoney());
}else if(paymentType instanceof PaymentBankAccountPayed){
boolean paymentTypeBankAccountExists = false;
for (int i = 0; i< system.getPaymentTypeBankAccount().size(); i++) {
if(system.getPaymentTypeBankAccount().get(i).getAccountId().equals(this.accountId)){
parcel.setPaymenType(system.getPaymentTypeBankAccount().get(i));
paymentTypeBankAccountExists = true;
break;
}
}
if(!paymentTypeBankAccountExists){
PaymentBankAccountPayed paymentTypeBankAccount = new PaymentBankAccountPayed(this.accountId);
system.getPaymentTypeBankAccount().add(paymentTypeBankAccount);
for (int j=0; j < system.getPaymentTypeBankAccount().size(); j++){
if(system.getPaymentTypeBankAccount().get(j).getAccountId().equals(this.accountId)){
parcel.setPaymenType(system.getPaymentTypeBankAccount().get(j));
break;
}
}
}
} else if (paymentType.getType().equals("Cheque")) {
parcel.setPaymenType(paymentType);
}
}