public SmartInvoiceDTO convertToDto(SmartInvoice entity) {
    SmartInvoiceDTO p = null;
    if (entity != null) {
      List<SmartInvItemDTO> items = new SmartInvItemDTO().convertToDtoList(entity.getItems());
      PaymentEftDTO eftPay = new PaymentEftDTO().convertToDto(entity.getEftPay());
      PaymentChequeDTO chequePay = new PaymentChequeDTO().convertToDto(entity.getChequePay());

      p =
          new SmartInvoiceDTO(
              entity.getId(),
              entity.getInvoiceNumber(),
              entity.getIssueDate(),
              entity.getTerms(),
              entity.getDueDate(),
              entity.getAppCodeUnique(),
              entity.getUserId(),
              items,
              entity.getComments(),
              entity.getSubTotal(),
              entity.getTotalDueAmount(),
              entity.getTotalTaxableAmount(),
              entity.getTotalDiscountedAmount(),
              eftPay,
              chequePay,
              entity.getStatus());

      // Set these within the BoImpl (or) Autowired in this DTO
      p.setFromOrg(getSmartOrgObj(entity.getFromOrgId()));
      p.setToOrg(getSmartOrgObj(entity.getToOrgId()));
    }
    return p;
  }