Package org.pau.assetmanager.entities

Examples of org.pau.assetmanager.entities.Annotation


  }

  @NotifyChange({ "annotations" })
  @Command
  public void addGeneralAnnotation() {
    Annotation annotation = null;
    if (annotationType.equals(AnnotationType.EXPENSES)) {
      ExpensesAnnotation stockExpensesAnnotation = new GeneralExpensesAnnotation();
      annotation = stockExpensesAnnotation;
      addDefaultValuesToAnnotation(annotation,
          bookSelection.getSelectedBook(), currentYear,
View Full Code Here


  }

  @NotifyChange({ "annotations" })
  @Command
  public void addStocksAnnotation() {
    Annotation annotation = null;
    if (annotationType.equals(AnnotationType.EXPENSES)) {
      StockExpensesAnnotation stockExpensesAnnotation = new StockExpensesAnnotation();
      annotation = stockExpensesAnnotation;
    } else if (annotationType.equals(AnnotationType.INCOME)) {
      StockIncomeAnnotation stockIncomeAnnotation = new StockIncomeAnnotation();
View Full Code Here

  @NotifyChange({ "annotations" })
  @Command
  public void deleteAnnotation(
      @ContextParam(ContextType.TRIGGER_EVENT) Event event) {
    Annotation annotation = (Annotation) event.getData();
    AnnotationsBusiness.deleteAnnotation(annotation);
    BindUtils
        .postGlobalCommand(null, null, "updateReportAnnotations", null);
    Clients.clearBusy();
  }
View Full Code Here

  public void importAnnotations(
      @ContextParam(ContextType.TRIGGER_EVENT) Event event) {
    for (AnnotationImport annotationImport : importedAnnotations) {
      Book annotationImportBook = annotationImport.getBook();
      String concept = annotationImport.getConcept();
      Annotation annotationToCreate = null;
      if (annotationImportBook instanceof PropertyBook) {
        // property book
        if (annotationImport.getTwoDecimalLongCodifiedAmount() >= 0) {
          PropertyIncomeAnnotation propertyIncomeAnnotation = new PropertyIncomeAnnotation();
          propertyIncomeAnnotation.setUpDefaults();
          annotationToCreate = propertyIncomeAnnotation;
        } else {
          PropertyExpensesAnnotation propertyExpensesAnnotation = new PropertyExpensesAnnotation();
          propertyExpensesAnnotation.setUpDefaults();
          annotationToCreate = propertyExpensesAnnotation;
        }
      } else if (annotationImportBook instanceof StocksBook) {
        // stocks book
        if (annotationImport.getTwoDecimalLongCodifiedAmount() >= 0) {
          StockIncomeAnnotation stockIncomeAnnotation = new StockIncomeAnnotation();
          annotationToCreate = stockIncomeAnnotation;
        } else {
          StockExpensesAnnotation stockExpensesAnnotation = new StockExpensesAnnotation();
          annotationToCreate = stockExpensesAnnotation;
        }
      } else {
        // general books
        if (annotationImport.getTwoDecimalLongCodifiedAmount() >= 0) {
          IncomeAnnotation incomeAnnotation = new GeneralIncomeAnnotation();
          annotationToCreate = incomeAnnotation;
        } else {
          ExpensesAnnotation expensesAnnotation = new GeneralExpensesAnnotation();
          annotationToCreate = expensesAnnotation;
        }
      }
      if (annotationToCreate != null) {
        annotationToCreate.setConcept(concept);
        annotationToCreate.setTwoDecimalLongCodifiedAmount(annotationImport
            .getTwoDecimalLongCodifiedAmount());
        annotationToCreate.setBook(annotationImportBook);
        annotationToCreate.setDate(annotationImport.getDate());
        AnnotationsBusiness.createAnnotation(annotationToCreate);
      }
    }
    importedAnnotations.clear();
    Clients.clearBusy();
View Full Code Here

    Converter<String, StockIncomeDescription, Label> {

  @Override
  public String coerceToUi(StockIncomeDescription stockIncomeDescription, Label label,
      BindContext bindContext) {
    Annotation annotation = stockIncomeDescription.getStockIncomeAnnotation();
    if (annotation instanceof StockExpensesAnnotation) {
      StockExpensesAnnotation expensesAnnotation = (StockExpensesAnnotation) annotation;
      return "Comprados " + expensesAnnotation.getNumberOfStocks()
          + " valores por "
          + NumberFomatter.formatMoney(expensesAnnotation.getAmount());
View Full Code Here

TOP

Related Classes of org.pau.assetmanager.entities.Annotation

Copyright © 2018 www.massapicom. 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.