Examples of Subsidiary


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

    return result;
  }

  @Override
  public Subsidiary updateSubsidiary(Subsidiary subsidiary) {
    Subsidiary result = null;

    SubsidiaryEntity subsidiaryEntity = DozerHelper.map(subsidiary,
        SubsidiaryEntity.class);
    subsidiaryEntity = subsidiaryRepository.merge(subsidiaryEntity);
    result = DozerHelper.map(subsidiaryEntity, Subsidiary.class);
View Full Code Here

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

    subsidiaryRepository.delete(id);
  }

  @Override
  public Subsidiary getSubsidiaryById(Long id) {
    Subsidiary result = null;

    SubsidiaryEntity subsidiaryEntity = subsidiaryRepository.findById(id);
    result = DozerHelper.map(subsidiaryEntity, Subsidiary.class);

    return result;
View Full Code Here

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

  }

  @Override
  public Subsidiary getSubsidiaryByEmployee(Employee employee)
      throws WrongSubsidiaryEmployeeException {
    Subsidiary result = null;

    EmployeeEntity employeeEntity = DozerHelper.map(employee,
        EmployeeEntity.class);
    SubsidiaryEntity subsidiaryEntity = subsidiaryRepository
        .findByEmployee(employeeEntity);
View Full Code Here

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

      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) {
      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());
View Full Code Here

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

    List<Order> orders = orderService
        .getOrdersByMechanic(mechanic, null, 1);
    model.addObject("orders", orders);

    Subsidiary subsidiary = null;
    try {
      subsidiary = subsidiaryService
          .getSubsidiaryByEmployee(mechanic);
    } catch (WrongSubsidiaryEmployeeException e) {
      e.printStackTrace();
View Full Code Here

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

    SubsidiaryEntity subsidiaryEntity = null;
    subsidiaryEntity = subsidiaryRepository.findByName("ARS JUnit Test")
        .get(0);

    Subsidiary subsidiary = DozerHelper.map(subsidiaryEntity,
        Subsidiary.class);
    try {
      subsidiary.addEmployee(mechanic);
    } catch (EmployeeAlreadyExistsException e) {
      e.printStackTrace();
    }
    subsidiaryEntity = DozerHelper.map(subsidiary, SubsidiaryEntity.class);
    subsidiaryRepository.merge(subsidiaryEntity);
View Full Code Here

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

    paymentService.deletePaymentById((long) 1);
  }

  @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);
View Full Code Here

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

  }
 
  @Test
  public void getDetailsBySubsidiaryTest() {
   
    Subsidiary subsidiary = subsidatyService.getSubsidiaryById(new Long(1));
    log.info(subsidiary);
   
    List<Detail> detail = detailService.getDetailsBySubsidiary(subsidiary, true, 1);
    log.info(detail);   
  }
View Full Code Here

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

  }
 
  @Test
  public void getDetailsByNameTest() {
   
    Subsidiary subsidiary = subsidatyService.getSubsidiaryById(new Long(1));
   
    List<Detail> detail = detailService.getDetailsByName("BMW �5 E53 brake pad set",
        subsidiary, true, 1);
   
    log.info(detail);
View Full Code Here

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

  @Autowired
  IDetailService detailService;

  @Test
  public void getSubsidiaryByIDServiceTest() {
    Subsidiary subsidiary = subsidiaryService.getSubsidiaryById((long) 1);
    log.info(subsidiary);
  }
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.