Examples of IncomingPaymentEntity


Examples of com.expositds.ars.dao.entity.billing.IncomingPaymentEntity

  @Override
  public PaymentEntity convertTo(Payment source, PaymentEntity destination) {
    PaymentEntity result = null;

    if (source instanceof IncomingPayment) {
      IncomingPaymentEntity incomingPaymentEntity = new IncomingPaymentEntity();

      incomingPaymentEntity.setCompleted(source.isCompleted());
      incomingPaymentEntity.setCreationDate(source.getCreationDate());
      incomingPaymentEntity.setId(source.getId());

      Customer customer = ((IncomingPayment) source).getPayer();
      CustomerEntity customerEntity = null;
      if (customer instanceof PersonalCustomer) {
        customerEntity = DozerHelper
            .map(customer, PersonalCustomerEntity.class);
      }
      if (customer instanceof CorporateCustomer) {
        customerEntity = DozerHelper.map(customer,
            CorporateCustomerEntity.class);
      }

      incomingPaymentEntity.setPayer(customerEntity);
      incomingPaymentEntity.setPaymentDate(source.getPaymentDate());
      incomingPaymentEntity.setSubject(source.getSubject());

      SubsidiaryEntity subsidiaryEntity = DozerHelper.map(
          source.getSubsidiary(), SubsidiaryEntity.class);
      incomingPaymentEntity.setSubsidiary(subsidiaryEntity);

      incomingPaymentEntity.setTotal(source.getTotal());
      incomingPaymentEntity.setType(source.getType());

      result = incomingPaymentEntity;
    }

    if (source instanceof OutgoingPayment) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.