Package org.pau.assetmanager.entities

Examples of org.pau.assetmanager.entities.PropertyIncomeAnnotation


  }

  private Annotation getPropertyIncomeAnnotationDoneForCompany(
      PropertyBook propertyBook) {
    // property income: done and for_company
    PropertyIncomeAnnotation propertyIncomeAnnotation_done_for_company = new PropertyIncomeAnnotation();
    propertyIncomeAnnotation_done_for_company.setAmount(1000.0);
    propertyIncomeAnnotation_done_for_company.setBook(propertyBook);
    propertyIncomeAnnotation_done_for_company.setConcept("Renting");
    propertyIncomeAnnotation_done_for_company.setDate(getDateFromString("01/01/2012"));
    propertyIncomeAnnotation_done_for_company.setDone(true);
    propertyIncomeAnnotation_done_for_company.setForCompany(true);
    propertyIncomeAnnotation_done_for_company.setRetention(20.0);
    propertyIncomeAnnotation_done_for_company.setVat(20.0);
    propertyIncomeAnnotation_done_for_company = AnnotationsBusiness
        .createAnnotation(propertyIncomeAnnotation_done_for_company);

    // for premises, it is always a company
    Assert.assertFalse(propertyIncomeAnnotation_done_for_company
        .getAppliesForCompany());
    // for premises, retention and vat always applies when done
    Assert.assertTrue(propertyIncomeAnnotation_done_for_company
        .getAppliesRetentionAndVAT());
    // when vat = retention --> tax_base == amount
    Assert.assertEquals(new Double(1000.0),
        propertyIncomeAnnotation_done_for_company
            .getBaseImponibleQuarterly());
    // in case of property, base tax = base tax yearly
    Assert.assertEquals(new Double(1000.0),
        propertyIncomeAnnotation_done_for_company
            .getBaseImponibleYearly());
    // in case of property, declared = base tax yearly
    Assert.assertEquals(new Double(1000.0),
        propertyIncomeAnnotation_done_for_company.getDeclaredYearly());
    // for the properties the retention amount is the retention percentage
    // of the amount
    Assert.assertEquals(new Double(1000.0 * 20.0 / 100.0),
        propertyIncomeAnnotation_done_for_company
            .getRetentionAmountYearly());
    // for income the signed amount must be the same as the unsigned amount
    Assert.assertEquals(new Double(1000.0),
        propertyIncomeAnnotation_done_for_company.getSignedAmount());
    Assert.assertEquals(new Long(100000L),
        propertyIncomeAnnotation_done_for_company
            .getTwoDecimalLongCodifiedAmount());
    return propertyIncomeAnnotation_done_for_company;
  }
View Full Code Here


  }

  private Annotation getPropertyIncomeAnnotationNotDoneNotForCompany(
      PropertyBook propertyBook) {
    // property income: not done and not for_company
    PropertyIncomeAnnotation propertyIncomeAnnotation_not_done_not_forComapany = new PropertyIncomeAnnotation();
    propertyIncomeAnnotation_not_done_not_forComapany.setAmount(1000.0);
    propertyIncomeAnnotation_not_done_not_forComapany.setBook(propertyBook);
    propertyIncomeAnnotation_not_done_not_forComapany.setConcept("Renting");
    propertyIncomeAnnotation_not_done_not_forComapany.setDate(getDateFromString("01/01/2012"));
    propertyIncomeAnnotation_not_done_not_forComapany.setDone(false);
    propertyIncomeAnnotation_not_done_not_forComapany.setForCompany(false);
    propertyIncomeAnnotation_not_done_not_forComapany.setRetention(20.0);
    propertyIncomeAnnotation_not_done_not_forComapany.setVat(20.0);
    propertyIncomeAnnotation_not_done_not_forComapany = AnnotationsBusiness
        .createAnnotation(propertyIncomeAnnotation_not_done_not_forComapany);

    // for premises, it is always a company
    Assert.assertFalse(propertyIncomeAnnotation_not_done_not_forComapany
        .getAppliesForCompany());
    // retention and vat never applies when not done
    Assert.assertFalse(propertyIncomeAnnotation_not_done_not_forComapany
        .getAppliesRetentionAndVAT());
    // not done --> 0.0
    Assert.assertEquals(new Double(0.0),
        propertyIncomeAnnotation_not_done_not_forComapany
            .getBaseImponibleQuarterly());
    // not done --> 0.0
    Assert.assertEquals(new Double(0.0),
        propertyIncomeAnnotation_not_done_not_forComapany
            .getBaseImponibleYearly());
    // not done --> 0.0
    Assert.assertEquals(new Double(0.0),
        propertyIncomeAnnotation_not_done_not_forComapany
            .getDeclaredYearly());
    // not done --> 0.0
    Assert.assertEquals(new Double(0.0),
        propertyIncomeAnnotation_not_done_not_forComapany
            .getRetentionAmountYearly());
    // for income the signed amount must be the same as the unsigned amount
    Assert.assertEquals(new Double(1000.0),
        propertyIncomeAnnotation_not_done_not_forComapany
            .getSignedAmount());
    Assert.assertEquals(new Long(100000L),
        propertyIncomeAnnotation_not_done_not_forComapany
            .getTwoDecimalLongCodifiedAmount());
    return propertyIncomeAnnotation_not_done_not_forComapany;
  }
View Full Code Here

  }

  private Annotation getPropertyIncomeAnnotationDoneNotForCompany(
      PropertyBook propertyBook) {
    // property income: done and for_company
    PropertyIncomeAnnotation propertyIncomeAnnotation_done_not_for_company = new PropertyIncomeAnnotation();
    propertyIncomeAnnotation_done_not_for_company.setAmount(1000.0);
    propertyIncomeAnnotation_done_not_for_company.setBook(propertyBook);
    propertyIncomeAnnotation_done_not_for_company.setConcept("Renting");
    propertyIncomeAnnotation_done_not_for_company.setDate(getDateFromString("01/01/2012"));
    propertyIncomeAnnotation_done_not_for_company.setDone(true);
    propertyIncomeAnnotation_done_not_for_company.setForCompany(false);
    propertyIncomeAnnotation_done_not_for_company.setRetention(20.0);
    propertyIncomeAnnotation_done_not_for_company.setVat(20.0);
    propertyIncomeAnnotation_done_not_for_company = AnnotationsBusiness
        .createAnnotation(propertyIncomeAnnotation_done_not_for_company);

    // for premises, it is always a company
    Assert.assertFalse(propertyIncomeAnnotation_done_not_for_company
        .getAppliesForCompany());
    // for premises, retention and vat always applies when done
    Assert.assertTrue(propertyIncomeAnnotation_done_not_for_company
        .getAppliesRetentionAndVAT());
    // when vat = retention --> tax_base == amount
    Assert.assertEquals(new Double(1000.0),
        propertyIncomeAnnotation_done_not_for_company
            .getBaseImponibleQuarterly());
    // in case of property, base tax = base tax yearly
    Assert.assertEquals(new Double(1000.0),
        propertyIncomeAnnotation_done_not_for_company
            .getBaseImponibleYearly());
    // in case of property, declared = base tax yearly
    Assert.assertEquals(new Double(1000.0),
        propertyIncomeAnnotation_done_not_for_company
            .getDeclaredYearly());
    // for the properties the retention amount is the retention percentage
    // of the amount
    Assert.assertEquals(new Double(1000.0 * 20.0 / 100.0),
        propertyIncomeAnnotation_done_not_for_company
            .getRetentionAmountYearly());
    // for income the signed amount must be the same as the unsigned amount
    Assert.assertEquals(new Double(1000.0),
        propertyIncomeAnnotation_done_not_for_company.getSignedAmount());
    Assert.assertEquals(new Long(100000L),
        propertyIncomeAnnotation_done_not_for_company
            .getTwoDecimalLongCodifiedAmount());
   
    return propertyIncomeAnnotation_done_not_for_company;
  }
View Full Code Here

  }

  private Annotation getPropertyIncomeAnnotationDoneForCompany(
      PropertyBook propertyBook) {
    // property income: done and for_company
    PropertyIncomeAnnotation propertyIncomeAnnotation_done_for_company = new PropertyIncomeAnnotation();
    propertyIncomeAnnotation_done_for_company.setAmount(1000.0);
    propertyIncomeAnnotation_done_for_company.setBook(propertyBook);
    propertyIncomeAnnotation_done_for_company.setConcept("Renting");
    propertyIncomeAnnotation_done_for_company
        .setDate(getDateFromString("01/01/2012"));
    propertyIncomeAnnotation_done_for_company.setDone(true);
    propertyIncomeAnnotation_done_for_company.setForCompany(true);
    propertyIncomeAnnotation_done_for_company.setRetention(20.0);
    propertyIncomeAnnotation_done_for_company.setVat(20.0);
    propertyIncomeAnnotation_done_for_company = AnnotationsBusiness
        .createAnnotation(propertyIncomeAnnotation_done_for_company);

    Assert.assertTrue(propertyIncomeAnnotation_done_for_company
        .getAppliesForCompany());
    Assert.assertTrue(propertyIncomeAnnotation_done_for_company
        .getAppliesRetentionAndVAT());
    Assert.assertEquals(new Double(1000.0),
        propertyIncomeAnnotation_done_for_company
            .getBaseImponibleQuarterly());
    Assert.assertEquals(new Double(1000.0),
        propertyIncomeAnnotation_done_for_company
            .getBaseImponibleYearly());
    Assert.assertEquals(new Double(1000.0),
        propertyIncomeAnnotation_done_for_company.getDeclaredYearly());
    Assert.assertEquals(new Double(1000.0 * 20.0 / 100.0),
        propertyIncomeAnnotation_done_for_company
            .getRetentionAmountYearly());
    Assert.assertEquals(new Double(1000.0),
        propertyIncomeAnnotation_done_for_company.getSignedAmount());
    Assert.assertEquals(new Long(100000L),
        propertyIncomeAnnotation_done_for_company
            .getTwoDecimalLongCodifiedAmount());

    return propertyIncomeAnnotation_done_for_company;
  }
View Full Code Here

  }

  private Annotation getPropertyIncomeAnnotationNotDoneNotForComapany(
      PropertyBook propertyBook) {
    // property income: not done and not for_company
    PropertyIncomeAnnotation propertyIncomeAnnotation_not_done_not_forComapany = new PropertyIncomeAnnotation();
    propertyIncomeAnnotation_not_done_not_forComapany.setAmount(1000.0);
    propertyIncomeAnnotation_not_done_not_forComapany.setBook(propertyBook);
    propertyIncomeAnnotation_not_done_not_forComapany.setConcept("Renting");
    propertyIncomeAnnotation_not_done_not_forComapany
        .setDate(getDateFromString("01/01/2012"));
    propertyIncomeAnnotation_not_done_not_forComapany.setDone(false);
    propertyIncomeAnnotation_not_done_not_forComapany.setForCompany(false);
    propertyIncomeAnnotation_not_done_not_forComapany.setRetention(20.0);
    propertyIncomeAnnotation_not_done_not_forComapany.setVat(20.0);
    propertyIncomeAnnotation_not_done_not_forComapany = AnnotationsBusiness
        .createAnnotation(propertyIncomeAnnotation_not_done_not_forComapany);

    Assert.assertTrue(propertyIncomeAnnotation_not_done_not_forComapany
        .getAppliesForCompany());
    Assert.assertFalse(propertyIncomeAnnotation_not_done_not_forComapany
        .getAppliesRetentionAndVAT());
    Assert.assertEquals(new Double(0.0),
        propertyIncomeAnnotation_not_done_not_forComapany
            .getBaseImponibleQuarterly());
    Assert.assertEquals(new Double(0.0),
        propertyIncomeAnnotation_not_done_not_forComapany
            .getBaseImponibleYearly());
    Assert.assertEquals(new Double(0.0),
        propertyIncomeAnnotation_not_done_not_forComapany
            .getDeclaredYearly());
    Assert.assertEquals(new Double(0.0),
        propertyIncomeAnnotation_not_done_not_forComapany
            .getRetentionAmountYearly());
    Assert.assertEquals(new Double(1000.0),
        propertyIncomeAnnotation_not_done_not_forComapany
            .getSignedAmount());
    Assert.assertEquals(new Long(100000L),
        propertyIncomeAnnotation_not_done_not_forComapany
            .getTwoDecimalLongCodifiedAmount());

    return propertyIncomeAnnotation_not_done_not_forComapany;

  }
View Full Code Here

  }

  private Annotation getPropertyIncomeAnnotationDoneNotForCompany(
      PropertyBook propertyBook) {
    // property income: done and for_company
    PropertyIncomeAnnotation propertyIncomeAnnotation_done_not_for_company = new PropertyIncomeAnnotation();
    propertyIncomeAnnotation_done_not_for_company.setAmount(1000.0);
    propertyIncomeAnnotation_done_not_for_company.setBook(propertyBook);
    propertyIncomeAnnotation_done_not_for_company.setConcept("Renting");
    propertyIncomeAnnotation_done_not_for_company
        .setDate(getDateFromString("01/01/2012"));
    propertyIncomeAnnotation_done_not_for_company.setDone(true);
    propertyIncomeAnnotation_done_not_for_company.setForCompany(false);
    propertyIncomeAnnotation_done_not_for_company.setRetention(20.0);
    propertyIncomeAnnotation_done_not_for_company.setVat(20.0);
    propertyIncomeAnnotation_done_not_for_company = AnnotationsBusiness
        .createAnnotation(propertyIncomeAnnotation_done_not_for_company);

    Assert.assertTrue(propertyIncomeAnnotation_done_not_for_company
        .getAppliesForCompany());
    Assert.assertFalse(propertyIncomeAnnotation_done_not_for_company
        .getAppliesRetentionAndVAT());
    Assert.assertEquals(new Double(0.0),
        propertyIncomeAnnotation_done_not_for_company
            .getBaseImponibleQuarterly());
    Assert.assertEquals(new Double(1000.0),
        propertyIncomeAnnotation_done_not_for_company
            .getBaseImponibleYearly());
    Assert.assertEquals(new Double(1000.0),
        propertyIncomeAnnotation_done_not_for_company
            .getDeclaredYearly());
    Assert.assertEquals(new Double(0.0),
        propertyIncomeAnnotation_done_not_for_company
            .getRetentionAmountYearly());
    Assert.assertEquals(new Double(1000.0),
        propertyIncomeAnnotation_done_not_for_company.getSignedAmount());
    Assert.assertEquals(new Long(100000L),
        propertyIncomeAnnotation_done_not_for_company
            .getTwoDecimalLongCodifiedAmount());

    return propertyIncomeAnnotation_done_not_for_company;
  }
View Full Code Here

  public static QuarterlyHaciendaResults compute(Annotation[] groupdata) {
    QuarterlyHaciendaResults haciendaResults = new QuarterlyHaciendaResults();
    for (Annotation annotation : groupdata) {
      if (annotation instanceof PropertyIncomeAnnotation) {
        PropertyIncomeAnnotation propertyIncomeAnnotation = (PropertyIncomeAnnotation) annotation;
        haciendaResults.baseImponibleRepercutido += propertyIncomeAnnotation.getBaseImponibleQuarterly();
        haciendaResults.ivaRepercutido += propertyIncomeAnnotation.getBaseImponibleQuarterly()
            * propertyIncomeAnnotation.getVat() / 100.0;
      } else if (annotation instanceof PropertyExpensesAnnotation) {
        PropertyExpensesAnnotation propertyExpensesAnnotation = (PropertyExpensesAnnotation) annotation;
        haciendaResults.baseImponibleSoportado += propertyExpensesAnnotation.getBaseImponibleQuarterly();
        haciendaResults.ivaSoportado += propertyExpensesAnnotation.getBaseImponibleQuarterly()
            * propertyExpensesAnnotation.getVat() / 100.0;
View Full Code Here

          amortizacion = propertyBook.getProperty()
              .getOfficialValue() * percentageDeductible / 100.0;
        }
      }
      if (annotation instanceof PropertyIncomeAnnotation) {
        PropertyIncomeAnnotation incomeAnnotation = (PropertyIncomeAnnotation) annotation;
        ingresos += incomeAnnotation.getDeclaredYearly();
        retenciones += incomeAnnotation.getRetentionAmountYearly();
      } else if (annotation instanceof PropertyExpensesAnnotation) {
        PropertyExpensesAnnotation expensesAnnotation = (PropertyExpensesAnnotation) annotation;
        if (expensesAnnotation.getCommunity()) {
          comunidad += expensesAnnotation.getDeclaredYearly();
        } else {
View Full Code Here

      BindContext bindContext) {
    if (annotation instanceof PropertyExpensesAnnotation) {
      PropertyExpensesAnnotation expensesAnnotation = (PropertyExpensesAnnotation) annotation;
      return expensesAnnotation.getPropertyBook().getProperty().getName();
    } else if (annotation instanceof PropertyIncomeAnnotation) {
      PropertyIncomeAnnotation incomeAnnotation = (PropertyIncomeAnnotation) annotation;
      return incomeAnnotation.getPropertyBook().getProperty().getName();
    }
    return "";
  }
View Full Code Here

          return NumberFomatter.formatMoney(expensesAnnotation
              .getBaseImponibleQuarterly());
        }
      }
    } else if (annotation instanceof PropertyIncomeAnnotation) {
      PropertyIncomeAnnotation incomeAnnotation = (PropertyIncomeAnnotation) annotation;
      if (incomeAnnotation.getAppliesRetentionAndVAT()) {
        return NumberFomatter.formatMoney(incomeAnnotation
            .getBaseImponibleQuarterly())
            + " ("
            + NumberFomatter.formatPercentage(incomeAnnotation.getVat())
            + "%  IVA, "
            + NumberFomatter.formatPercentage(incomeAnnotation
                .getRetention()) + "% IRPF )";
      } else {
        return NumberFomatter.formatMoney(incomeAnnotation
            .getBaseImponibleQuarterly());
      }
    }
    return "";
  }
View Full Code Here

TOP

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

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.