Package org.pau.assetmanager.entities

Examples of org.pau.assetmanager.entities.Annotation


    propertyBook.setDescription("property_book_description");
    propertyBook.setName("property_book");
    propertyBook.setProperty(property);
    propertyBook = BooksBusiness.addBook(propertyBook);

    Annotation propertyIncomeAnnotationDoneForCompany = getPropertyIncomeAnnotationDoneForCompany(propertyBook);
    Annotation propertyIncomeAnnotationNotDoneNotForCompany = getPropertyIncomeAnnotationNotDoneNotForCompany(propertyBook);
    Annotation propertyIncomeAnnotationDoneNotForCompany = getPropertyIncomeAnnotationDoneNotForCompany(propertyBook);
    Annotation propertyExpensesAnnotationNotCommunityUseQuarterly = getPropertyExpensesAnnotationNotCommunityUseQuarterly(propertyBook);
    Annotation propertyExpensesAnnotationNotCommunityNotUseQuarterly = getPropertyExpensesAnnotationNotCommunityNotUseQuarterly(propertyBook);
   
    List<Annotation> annotationsExpectedToBeUsedInQuarterly = Lists.newArrayList(propertyIncomeAnnotationDoneForCompany,
        propertyIncomeAnnotationDoneNotForCompany,propertyExpensesAnnotationNotCommunityUseQuarterly
        );
    checkQuarterly(propertyBook, annotationsExpectedToBeUsedInQuarterly);
View Full Code Here


    Assert.assertEquals(new Integer(1), numberOfGroups);
    for (Integer currentProperty = 0; currentProperty < numberOfGroups; currentProperty++) {
      List<Annotation> annotationsForProperty = new LinkedList<Annotation>();
      for (Integer annotationIndex = 0; annotationIndex < annotationsDateYearlyGroupingModel
          .getChildCount(currentProperty); annotationIndex++) {
        Annotation currentAnnotation = annotationsDateYearlyGroupingModel.getChild(
            currentProperty, annotationIndex);
        annotationsForProperty.add(currentAnnotation);
      }
      Assert.assertTrue(annotationsForProperty
          .containsAll(annotationsExpectedToBeUsedInYearly));
View Full Code Here

    Assert.assertEquals(new Integer(1), numberOfGroups);
    for (Integer currentQuarter = 0; currentQuarter < numberOfGroups; currentQuarter++) {
      List<Annotation> annotationsForQuarter = new LinkedList<Annotation>();
      for (Integer annotationIndex = 0; annotationIndex < quarterlyGroupingModel
          .getChildCount(currentQuarter); annotationIndex++) {
        Annotation currentAnnotation = quarterlyGroupingModel.getChild(currentQuarter, annotationIndex);
        annotationsForQuarter.add(currentAnnotation);
      }
      Assert.assertEquals(new Integer(annotationsExpectedToBeUsedInQuarterly.size()), new Integer(annotationsForQuarter.size()));
      Assert.assertTrue(annotationsForQuarter.containsAll(annotationsExpectedToBeUsedInQuarterly));
      QuarterlyHaciendaResults haciendaResults = QuarterlyHaciendaResults.compute(annotationsForQuarter.toArray(new Annotation[0]));
View Full Code Here

    propertyBook.setDescription("property_book_description");
    propertyBook.setName("property_book");
    propertyBook.setProperty(property);
    propertyBook = BooksBusiness.addBook(propertyBook);

    Annotation propertyIncomeAnnotationDoneForCompany = getPropertyIncomeAnnotationDoneForCompany(propertyBook);
    Annotation propertyIncomeAnnotationNotDoneNotForComapany = getPropertyIncomeAnnotationNotDoneNotForComapany(propertyBook);
    Annotation propertyIncomeAnnotationDoneNotForCompany = getPropertyIncomeAnnotationDoneNotForCompany(propertyBook);
    Annotation propertyExpensesAnnotationNotCommnunityUseQuarterly = getPropertyExpensesAnnotationNotCommnunityUseQuarterly(propertyBook);
    Annotation propertyExpensesAnnotationNotCommnunityNotUseQuarterly = getPropertyExpensesAnnotationNotCommnunityNotUseQuarterly(propertyBook);

    List<Annotation> annotationsExpectedToBeUsedInQuarterly = Lists
        .newArrayList(propertyIncomeAnnotationDoneForCompany,
            propertyExpensesAnnotationNotCommnunityUseQuarterly);
View Full Code Here

    Assert.assertEquals(new Integer(1), numberOfGroups);
    for (Integer currentProperty = 0; currentProperty < numberOfGroups; currentProperty++) {
      List<Annotation> annotationsForProperty = new LinkedList<Annotation>();
      for (Integer annotationIndex = 0; annotationIndex < annotationsDateYearlyGroupingModel
          .getChildCount(currentProperty); annotationIndex++) {
        Annotation currentAnnotation = annotationsDateYearlyGroupingModel.getChild(
            currentProperty, annotationIndex);
        annotationsForProperty.add(currentAnnotation);
      }
      Assert.assertTrue(annotationsForProperty
          .containsAll(annotationsExpectedToBeUsedInYearly));
View Full Code Here

    Assert.assertEquals(new Integer(1), numberOfGroups);
    for (Integer currentQuarter = 0; currentQuarter < numberOfGroups; currentQuarter++) {
      List<Annotation> annotationsForQuarter = new LinkedList<Annotation>();
      for (Integer annotationIndex = 0; annotationIndex < quarterlyGroupingModel
          .getChildCount(currentQuarter); annotationIndex++) {
        Annotation currentAnnotation = quarterlyGroupingModel.getChild(
            currentQuarter, annotationIndex);
        annotationsForQuarter.add(currentAnnotation);
      }
      Assert.assertEquals(new Integer(
          annotationsExpectedToBeUsedInQuarterly.size()),
View Full Code Here

    generalBook.setDescription("general_book_description");
    generalBook.setName("general_book");
    generalBook = BooksBusiness.addBook(generalBook);

    // create a generic annotation
    Annotation annotation = new GeneralIncomeAnnotation();
    annotation.setBook(generalBook);
    annotation.setTwoDecimalLongCodifiedAmount(1000L * 100L); // 1000.00
    annotation.setConcept("test");
    Date date = new SimpleDateFormat("dd-MM-yyyy").parse("20-10-2013");
    annotation.setDate(date);
    annotation = AnnotationsBusiness.createAnnotation(annotation);
    Assert.assertEquals(generalBook, annotation.getBook());
    Assert.assertEquals(new Long(1000L * 100L),
        annotation.getTwoDecimalLongCodifiedAmount());
    Assert.assertEquals("test", annotation.getConcept());
    Assert.assertEquals(date, annotation.getDate());

    // find annotation
    List<Annotation> annotations = AnnotationsBusiness
        .getAnnotationsWithFilter(Optional.<AnnotationType>absent(),
            BookSelection.fromBook(generalBook),
View Full Code Here

    generalBook.setDescription("general_book_description");
    generalBook.setName("general_book");
    generalBook = BooksBusiness.addBook(generalBook);

    // create a generic annotation
    Annotation annotation = new GeneralIncomeAnnotation();
    annotation.setBook(generalBook);
    annotation.setTwoDecimalLongCodifiedAmount(1000L * 100L); // 1000.00
    annotation.setConcept("test");
    Date date = new SimpleDateFormat("dd-MM-yyyy").parse("11-11-2013");
    annotation.setDate(date);
    annotation = AnnotationsBusiness.createAnnotation(annotation);
    Assert.assertEquals(generalBook, annotation.getBook());
    Assert.assertEquals(new Long(1000L * 100L),
        annotation.getTwoDecimalLongCodifiedAmount());
    Assert.assertEquals("test", annotation.getConcept());
    Assert.assertEquals(date, annotation.getDate());

    // find annotation for current client
    List<Annotation> annotations = AnnotationsBusiness
        .getAnnotationsWithFilter(Optional.<AnnotationType>absent(),
            BookSelection.fromBook(generalBook),
            Optional.<Integer>of(2013), ClientDomainType.CURRENT_CLIENT, SortingCriteria.ASCENDING,
            AnnotationsFilter.emptyAnnotationsFilter());
    Assert.assertEquals(new Integer(1), new Integer(annotations.size()));
    Assert.assertEquals(annotation, annotations.iterator().next());

    // find annotation all clients
    annotations = AnnotationsBusiness.getAnnotationsWithFilter(Optional.<AnnotationType>absent(),
        BookSelection.fromBook(generalBook),
        Optional.<Integer>of(2013), ClientDomainType.ALL_CLIENTS, SortingCriteria.ASCENDING,
        AnnotationsFilter.emptyAnnotationsFilter());
    Assert.assertEquals(new Integer(1), new Integer(annotations.size()));
    Assert.assertEquals(annotation, annotations.iterator().next());

    // find annotation all clients
    annotations = AnnotationsBusiness.getAnnotationsWithFilter(Optional.<AnnotationType>absent(),
        BookSelection.fromBook(generalBook),
        Optional.<Integer>of(2011), ClientDomainType.ALL_CLIENTS, SortingCriteria.ASCENDING,
        AnnotationsFilter.emptyAnnotationsFilter());
    Assert.assertEquals(new Integer(0), new Integer(annotations.size()));

    // create another user
    User secondUser = UsersBusiness.persistUserByUsernameAndPassword(
        "new_user_2", "fake_password_2");
    Assert.assertArrayEquals(
        new Object[] { "new_user_2", "fake_password_2" }, new Object[] {
            secondUser.getUsername(), secondUser.getPassword() });

    // create another client
    Client secondClient = ClientsBusiness.addClientByClientName(secondUser,
        "new_client_2");
    Assert.assertEquals("new_client_2", secondClient.getName());

    // create another general book
    GeneralBook secondGeneralBook = new GeneralBook();
    secondGeneralBook.setClient(secondClient);
    secondGeneralBook.setDescription("general_book_description_2");
    secondGeneralBook.setName("general_book_2");
    secondGeneralBook = BooksBusiness.addBook(secondGeneralBook);

    // create another generic annotation
    Annotation secondAnnotation = new GeneralIncomeAnnotation();
    secondAnnotation.setBook(secondGeneralBook);
    secondAnnotation.setTwoDecimalLongCodifiedAmount(1000L * 100L * 2L); // 2000.00
    secondAnnotation.setConcept("test_2");
    Date secondDate = new SimpleDateFormat("dd-MM-yyyy")
        .parse("22-12-2013");
    secondAnnotation.setDate(secondDate);
    secondAnnotation = AnnotationsBusiness
        .createAnnotation(secondAnnotation);
    Assert.assertEquals(secondGeneralBook, secondAnnotation.getBook());
    Assert.assertEquals(new Long(1000L * 100L * 2L),
        secondAnnotation.getTwoDecimalLongCodifiedAmount());
    Assert.assertEquals("test_2", secondAnnotation.getConcept());
    Assert.assertEquals(secondDate, secondAnnotation.getDate());

    // find annotation for current client
    annotations = AnnotationsBusiness.getAnnotationsWithFilter(Optional.<AnnotationType>absent(),
        BookSelection.fromBook(secondGeneralBook),
        Optional.<Integer>of(2013), ClientDomainType.CURRENT_CLIENT, SortingCriteria.ASCENDING,
View Full Code Here

          });
      boolean errorInConcept = false;
      for (Iterator<Annotation> annotationIterator = currentListOfAnnotations
          .iterator(); annotationIterator.hasNext()
          && !errorInConcept;) {
        Annotation annotation = annotationIterator.next();
        // if there a purchase stock transaction then we create its subtransaction
        // For a purchase stock the subtransaction is the same as the transaction initially
        // but it can then be splited depending on the sold stocks.
        if (annotation instanceof StockExpensesAnnotation) {
          StockExpensesAnnotation stockExpensesAnnotation = (StockExpensesAnnotation) annotation;
View Full Code Here

  }

  @NotifyChange({ "annotations" })
  @Command
  public void addPropertyAnnotation() {
    Annotation annotation = null;
    if (annotationType.equals(AnnotationType.INCOME)) {
      PropertyIncomeAnnotation incomeAnnotation = new PropertyIncomeAnnotation();
      incomeAnnotation.setUpDefaults();
      annotation = incomeAnnotation;
      addDefaultValuesToAnnotation(annotation,
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.