if (source != null) {
tmp = HibernateHelper.initializeAndUnproxy(source);
}
if (tmp instanceof IncomingPaymentEntity) {
IncomingPayment incomingPayment = new IncomingPayment();
incomingPayment.setCompleted(tmp.isCompleted());
incomingPayment.setCreationDate(tmp.getCreationDate());
incomingPayment.setDirection(EPaymentDirection.INCOMING);
incomingPayment.setId(tmp.getId());
CustomerEntity customerEntity = ((IncomingPaymentEntity) tmp).getPayer();
Customer customer = null;
if (customerEntity instanceof PersonalCustomerEntity) {
customer = DozerHelper.map(customerEntity, PersonalCustomer.class);
}
if (customerEntity instanceof CorporateCustomerEntity) {
customer = DozerHelper.map(customerEntity, CorporateCustomer.class);
}
incomingPayment.setPayer(customer);
incomingPayment.setPaymentDate(tmp.getPaymentDate());
incomingPayment.setSubject(tmp.getSubject());
Subsidiary subsidiary = DozerHelper.map(tmp.getSubsidiary(),
Subsidiary.class);
incomingPayment.setSubsidiary(subsidiary);
incomingPayment.setTotal(tmp.getTotal());
incomingPayment.setType(tmp.getType());
result = incomingPayment;
}
if (tmp instanceof OutgoingPaymentEntity) {