Package com.peusoft.ptcollect.core.util

Examples of com.peusoft.ptcollect.core.util.DayPeriod


        List<AbstractDomainObject<?>> objects = new ArrayList<AbstractDomainObject<?>>();
        Project p = new Project();
        p.setProjectState(ProjectState.OPENED);
        p.setProjectName("TestProject");
        p.setProjectNumber("00001");
        p.setProjectPeriod(new DayPeriod());
        p.setBudget(new BigDecimal("100.00"));
        objects.add(p);
        to_delete.add(0, p);
        ProjectActivity pa = new ProjectActivity();
        pa.setProject(p);
View Full Code Here


        Project p = new Project();
        p.setProjectState(ProjectState.OPENED);
        p.setProjectNumber("0001");
        p.setProjectName("TestProject1");
        DayPeriod dp = new DayPeriod();
        Calendar cal = Calendar.getInstance();
        cal.set(Calendar.DAY_OF_MONTH, 1);
        cal.set(Calendar.MONTH, Calendar.JANUARY);
        cal.set(Calendar.YEAR, 2005);
        dp.setBegin(cal.getTime());
        cal = Calendar.getInstance();
        cal.set(Calendar.DAY_OF_MONTH, 1);
        cal.set(Calendar.MONTH, Calendar.JANUARY);
        cal.set(Calendar.YEAR, 2006);
        dp.setEnd(cal.getTime());
        p.setProjectPeriod(dp);
        p.setBudget(new BigDecimal("1000.00").setScale(2, BigDecimal.ROUND_HALF_UP));
        new_objs.add(p);
        del_objs.push(p);

        ProjectActivity pa = new ProjectActivity();
        pa.setProject(p);
        pa.setProjectActivityName("TestActivity1");
        new_objs.add(pa);
        del_objs.push(pa);

        UserProjectActivity upa = new UserProjectActivity();
        upa.setUser(user);
        upa.setProjectActivity(pa);
        upa.setBudget(new BigDecimal("1000.00").setScale(2, BigDecimal.ROUND_HALF_UP));
        new_objs.add(upa);
        del_objs.push(upa);

        UserProjectActivityPrice price = new UserProjectActivityPrice();
        price.setUserProjectActivity(upa);
        price.setPrice(new BigDecimal("123.00").setScale(2, BigDecimal.ROUND_HALF_UP));
        price.setPeriod(new DayPeriod());
        upa.addPrice(price);

        // create test data

        WorkDay wd1 = new WorkDay();
View Full Code Here

        Project p = new Project();
        p.setProjectState(ProjectState.OPENED);
        p.setProjectNumber("0001");
        p.setProjectName("TestProject1");
        DayPeriod dp = new DayPeriod();
        Calendar cal = Calendar.getInstance();
        cal.set(Calendar.DAY_OF_MONTH, 1);
        cal.set(Calendar.MONTH, Calendar.JANUARY);
        cal.set(Calendar.YEAR, 2005);
        dp.setBegin(cal.getTime());
        cal = Calendar.getInstance();
        cal.set(Calendar.DAY_OF_MONTH, 1);
        cal.set(Calendar.MONTH, Calendar.JANUARY);
        cal.set(Calendar.YEAR, 2006);
        dp.setEnd(cal.getTime());
        p.setProjectPeriod(dp);
        p.setBudget(new BigDecimal("1000.00").setScale(2, BigDecimal.ROUND_HALF_UP));
        new_objs.add(p);
        del_objs.push(p);

        ProjectActivity pa = new ProjectActivity();
        pa.setProject(p);
        pa.setProjectActivityName("TestActivity1");
        new_objs.add(pa);
        del_objs.push(pa);

        UserProjectActivity upa = new UserProjectActivity();
        upa.setUser(user);
        upa.setProjectActivity(pa);
        upa.setBudget(new BigDecimal("1000.00").setScale(2, BigDecimal.ROUND_HALF_UP));
        new_objs.add(upa);
        del_objs.push(upa);

        UserProjectActivityPrice price = new UserProjectActivityPrice();
        price.setUserProjectActivity(upa);
        price.setPrice(new BigDecimal("123.00").setScale(2, BigDecimal.ROUND_HALF_UP));
        price.setPeriod(new DayPeriod());
        upa.addPrice(price);

        // create test data

        WorkDay wd1 = new WorkDay();
View Full Code Here

        List<AbstractDomainObject> objects = new ArrayList<AbstractDomainObject>();
        Project p = new Project();
        p.setProjectState(ProjectState.OPENED);
        p.setProjectName("TestProject");
        p.setProjectNumber("00001");
        p.setProjectPeriod(new DayPeriod());
        p.setBudget(new BigDecimal("100.00"));
        objects.add(p);
        to_delete.add(0, p);
        ProjectActivity pa = new ProjectActivity();
        pa.setProject(p);
View Full Code Here

    /**
     * Test method for {@link com.peu.pt.shared.persistance.domain.config.VAT#getLogicalKey()}.
     */
    @Test
    public final void testGetLogicalKey() {
        vat.setVatPeriod(new DayPeriod());
        Object[] key = vat.getLogicalKey();
        assertNotNull(key);
        assertEquals("Wrong lenght of the key: ", 1, key.length);
        assertEquals("Wrong value of the key: ", new DayPeriod(), key[0]);
    }
View Full Code Here

    /**
     * Test method for {@link com.peu.pt.shared.persistance.domain.config.VAT#getVatPeriod()}.
     */
    @Test
    public final void testPeriod() {
        vat.setVatPeriod(new DayPeriod());
        assertEquals("Wrong period: ", new DayPeriod(), vat.getVatPeriod());
    }
View Full Code Here

    /**
     * Test method for {@link com.peu.pt.shared.persistance.domain.config.VAT#getBegin()}.
     */
    @Test
    public final void testGetBegin() {
        DayPeriod p = new DayPeriod();
        p.setBegin(new Date(0));
        vat.setVatPeriod(p);
        assertEquals("Wrong period begin: ", new Date(0), vat.getBegin());
    }
View Full Code Here

    /**
     * Test method for {@link com.peu.pt.shared.persistance.domain.config.VAT#getEnd()}.
     */
    @Test
    public final void testGetEnd() {
        DayPeriod p = new DayPeriod();
        p.setEnd(new Date(33333333333L));
        vat.setVatPeriod(p);
        assertEquals("Wrong period end: ", new Date(33333333333L), vat.getEnd());
    }
View Full Code Here

        UserProjectActivityPrice price1 = new UserProjectActivityPrice();
        Calendar cal = Calendar.getInstance();
        cal.set(Calendar.YEAR, 2006);
        cal.set(Calendar.MONTH, Calendar.JANUARY);
        cal.set(Calendar.DAY_OF_MONTH, 1);
        DayPeriod p = new DayPeriod();
        p.setBegin(cal.getTime());
        cal.set(Calendar.YEAR, 2007);
        cal.set(Calendar.MONTH, Calendar.DECEMBER);
        cal.set(Calendar.DAY_OF_MONTH, 31);
        p.setEnd(cal.getTime());
        price1.setPeriod(p);
        price1.setPrice(PRICE1);
        price1.setUserProjectActivity(userProjectActivity);

        UserProjectActivityPrice price2 = new UserProjectActivityPrice();
        cal = Calendar.getInstance();
        cal.set(Calendar.YEAR, 2008);
        cal.set(Calendar.MONTH, Calendar.JANUARY);
        cal.set(Calendar.DAY_OF_MONTH, 1);
        p = new DayPeriod();
        p.setBegin(cal.getTime());
        cal.set(Calendar.YEAR, 2009);
        cal.set(Calendar.MONTH, Calendar.DECEMBER);
        cal.set(Calendar.DAY_OF_MONTH, 31);
        p.setEnd(cal.getTime());
        price2.setPeriod(p);
        price2.setPrice(PRICE1);
        price2.setUserProjectActivity(userProjectActivity);

        prices.add(price1);
View Full Code Here

        UserProjectActivityPrice price1 = new UserProjectActivityPrice();
        Calendar cal = Calendar.getInstance();
        int month = cal.get(Calendar.MONTH);
        int day = cal.get(Calendar.DAY_OF_MONTH);
        cal.set(Calendar.MONTH, month - 1);
        DayPeriod p = new DayPeriod();
        p.setBegin(cal.getTime());
        cal.set(Calendar.MONTH, month);
        cal.set(Calendar.DAY_OF_MONTH, day - 1);
        p.setEnd(cal.getTime());
        price1.setPeriod(p);
        price1.setPrice(new BigDecimal("64.50"));

        upa1.addPrice(price1);

        UserProjectActivityPrice price2 = new UserProjectActivityPrice();
        cal = Calendar.getInstance();
        p = new DayPeriod();
        p.setBegin(cal.getTime());
        cal.set(Calendar.MONTH, month + 1);
        p.setEnd(cal.getTime());
        price2.setPeriod(p);
        price2.setPrice(new BigDecimal("72.20"));

        upa1.addPrice(price2);

        UserProjectActivityPrice price3 = new UserProjectActivityPrice();
        cal = Calendar.getInstance();
        cal.set(Calendar.MONTH, month + 1);
        cal.set(Calendar.DAY_OF_MONTH, day + 1);
        p = new DayPeriod();
        p.setBegin(cal.getTime());
        cal.set(Calendar.MONTH, month + 2);
        p.setEnd(cal.getTime());
        price3.setPeriod(p);
        price3.setPrice(new BigDecimal("89.65"));

        upa1.addPrice(price3);
View Full Code Here

TOP

Related Classes of com.peusoft.ptcollect.core.util.DayPeriod

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.