Examples of OutgoingPayment


Examples of com.expositds.ars.domain.billing.OutgoingPayment

      result = incomingPayment;
    }

    if (tmp instanceof OutgoingPaymentEntity) {
      OutgoingPayment outgoingPayment = new OutgoingPayment();

      outgoingPayment.setCompleted(tmp.isCompleted());
      outgoingPayment.setCreationDate(tmp.getCreationDate());
      outgoingPayment.setDirection(EPaymentDirection.OUTGOING);
      outgoingPayment.setId(tmp.getId());
      outgoingPayment.setPaymentDate(tmp.getPaymentDate());

      EmployeeEntity employeeEntity = ((OutgoingPaymentEntity) tmp)
          .getRecipient();
      Employee employee = null;
      if (employeeEntity instanceof MechanicEntity) {
        employee = DozerHelper.map(employee, Mechanic.class);
      }
      if (employeeEntity instanceof EmployeeEntity) {
        employee = DozerHelper.map(employee, Employee.class);
      }

      outgoingPayment.setRecipient(employee);
      outgoingPayment.setSubject(tmp.getSubject());

      Subsidiary subsidiary = DozerHelper.map(tmp.getSubsidiary(),
          Subsidiary.class);
      outgoingPayment.setSubsidiary(subsidiary);

      outgoingPayment.setTotal(tmp.getTotal());
      outgoingPayment.setType(tmp.getType());

      result = outgoingPayment;
    }

    return result;
View Full Code Here

Examples of com.expositds.ars.domain.billing.OutgoingPayment

  @Test
  public void addPaymentServiceTest() {
    Subsidiary subsidiary = subsidiaryService.getSubsidiaryById(new Long(2));
    Employee recepient = employeeService.getEmployeeById(new Long(10));
   
    OutgoingPayment payment = null;
    try {
      payment = new OutgoingPayment(subsidiary, recepient, 200, EPaymentType.SALARY);
    } catch (InvalidPaymentTypeException e) {
      e.printStackTrace();
    } catch (UnknownPaymentTypeException e) {
      e.printStackTrace();
    }
    payment.setPaymentDate(new Date());
    payment.setSubject("subject");;
    payment.setCompleted(true);
   
    Long id = paymentService.addPayment(payment);
    log.info(payment);
  }
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.