Search in sources :

Example 6 with BillBreakDown

use of com.autentia.tnt.businessobject.BillBreakDown in project TNTConcept by autentia.

the class BillBeanTest method createBreakDownIn2009Test.

@Test
public void createBreakDownIn2009Test() {
    this.prepareTestsIVA();
    final GregorianCalendar calendar = new GregorianCalendar(2009, 8, 31);
    billBean.setCreationDate(calendar.getTime());
    billBean.createBreakDown();
    for (BillBreakDown billBreakDown : billBean.getBill().getBreakDown()) {
        assertThat(billBreakDown.getIva(), is(new BigDecimal(IVA_UNTIL_JUL_2010)));
    }
}
Also used : GregorianCalendar(java.util.GregorianCalendar) BillBreakDown(com.autentia.tnt.businessobject.BillBreakDown) BigDecimal(java.math.BigDecimal) Test(org.junit.Test)

Example 7 with BillBreakDown

use of com.autentia.tnt.businessobject.BillBreakDown in project TNTConcept by autentia.

the class BillBeanTest method createBreakDownInFirstDayOf21Test.

@Test
public void createBreakDownInFirstDayOf21Test() {
    this.prepareTestsIVA();
    final GregorianCalendar calendar = new GregorianCalendar(2012, 8, 1);
    billBean.setCreationDate(calendar.getTime());
    billBean.createBreakDown();
    for (BillBreakDown billBreakDown : billBean.getBill().getBreakDown()) {
        assertThat(billBreakDown.getIva(), is(new BigDecimal(IVA_ACTUAL)));
    }
}
Also used : GregorianCalendar(java.util.GregorianCalendar) BillBreakDown(com.autentia.tnt.businessobject.BillBreakDown) BigDecimal(java.math.BigDecimal) Test(org.junit.Test)

Example 8 with BillBreakDown

use of com.autentia.tnt.businessobject.BillBreakDown in project TNTConcept by autentia.

the class BillManagerTest method getAllBitacoreBreakDownsHaveCorrectIvaFirstDayOf21IvaTest.

@Test
public void getAllBitacoreBreakDownsHaveCorrectIvaFirstDayOf21IvaTest() {
    final Project project = insertProjectIntoContext(firstDateFor21Iva);
    ProjectCost projectCost = createProjectCost(project);
    final GregorianCalendar calendarEnd = new GregorianCalendar(2012, 10, 1);
    final List<BillBreakDown> billBreakDownList = billManager.getAllBitacoreBreakDowns(firstDateFor21Iva, calendarEnd.getTime(), project);
    assertEquals(IVA21, billBreakDownList.get(0).getIva());
    assertEquals(IVA21, billBreakDownList.get(1).getIva());
    deleteProjectCostFromContext(projectCost);
    deleteProjectFromContext(project);
}
Also used : Project(com.autentia.tnt.businessobject.Project) GregorianCalendar(java.util.GregorianCalendar) ProjectCost(com.autentia.tnt.businessobject.ProjectCost) BillBreakDown(com.autentia.tnt.businessobject.BillBreakDown) Test(org.junit.Test)

Example 9 with BillBreakDown

use of com.autentia.tnt.businessobject.BillBreakDown in project TNTConcept by autentia.

the class BillManagerTest method getAllBitacoreBreakDownsHaveCorrectIvaForJune2009Test.

@Test
public void getAllBitacoreBreakDownsHaveCorrectIvaForJune2009Test() {
    final Project project = insertProjectIntoContext(dateFor16Iva);
    ProjectCost projectCost = createProjectCost(project);
    final GregorianCalendar calendarEnd = new GregorianCalendar(2009, 10, 21);
    final List<BillBreakDown> billBreakDownList = billManager.getAllBitacoreBreakDowns(dateFor16Iva, calendarEnd.getTime(), project);
    assertEquals(IVA16, billBreakDownList.get(0).getIva());
    assertEquals(IVA16, billBreakDownList.get(1).getIva());
    deleteProjectCostFromContext(projectCost);
    deleteProjectFromContext(project);
}
Also used : Project(com.autentia.tnt.businessobject.Project) GregorianCalendar(java.util.GregorianCalendar) ProjectCost(com.autentia.tnt.businessobject.ProjectCost) BillBreakDown(com.autentia.tnt.businessobject.BillBreakDown) Test(org.junit.Test)

Example 10 with BillBreakDown

use of com.autentia.tnt.businessobject.BillBreakDown in project TNTConcept by autentia.

the class BillManagerTest method getAllBitacoreBreakDownsHaveCorrectIvaFirstDayOf18IvaTest.

@Test
public void getAllBitacoreBreakDownsHaveCorrectIvaFirstDayOf18IvaTest() {
    final Project project = insertProjectIntoContext(firstDateFor18Iva);
    ProjectCost projectCost = createProjectCost(project);
    final GregorianCalendar calendarEnd = new GregorianCalendar(2010, 10, 1);
    final List<BillBreakDown> billBreakDownList = billManager.getAllBitacoreBreakDowns(firstDateFor18Iva, calendarEnd.getTime(), project);
    assertEquals(IVA18, billBreakDownList.get(0).getIva());
    assertEquals(IVA18, billBreakDownList.get(1).getIva());
    deleteProjectCostFromContext(projectCost);
    deleteProjectFromContext(project);
}
Also used : Project(com.autentia.tnt.businessobject.Project) GregorianCalendar(java.util.GregorianCalendar) ProjectCost(com.autentia.tnt.businessobject.ProjectCost) BillBreakDown(com.autentia.tnt.businessobject.BillBreakDown) Test(org.junit.Test)

Aggregations

BillBreakDown (com.autentia.tnt.businessobject.BillBreakDown)13 GregorianCalendar (java.util.GregorianCalendar)9 Test (org.junit.Test)9 BigDecimal (java.math.BigDecimal)6 ProjectCost (com.autentia.tnt.businessobject.ProjectCost)5 Project (com.autentia.tnt.businessobject.Project)4 LinkedHashSet (java.util.LinkedHashSet)3 BillBean (com.autentia.tnt.bean.billing.BillBean)1 Activity (com.autentia.tnt.businessobject.Activity)1 Bill (com.autentia.tnt.businessobject.Bill)1 OfferCost (com.autentia.tnt.businessobject.OfferCost)1 OfferRole (com.autentia.tnt.businessobject.OfferRole)1 ProjectRole (com.autentia.tnt.businessobject.ProjectRole)1 User (com.autentia.tnt.businessobject.User)1 SortCriteria (com.autentia.tnt.dao.SortCriteria)1 ActivityDAO (com.autentia.tnt.dao.hibernate.ActivityDAO)1 ProjectCostDAO (com.autentia.tnt.dao.hibernate.ProjectCostDAO)1 ProjectRoleDAO (com.autentia.tnt.dao.hibernate.ProjectRoleDAO)1 ActivitySearch (com.autentia.tnt.dao.search.ActivitySearch)1 ProjectCostSearch (com.autentia.tnt.dao.search.ProjectCostSearch)1