Package com.peusoft.ptcollect.core.persistance.domain

Examples of com.peusoft.ptcollect.core.persistance.domain.UserProjectActivity


        ProjectActivity pa = new ProjectActivity();
        pa.setProject(p);
        pa.setProjectActivityName("TestProjectActivity");
        objects.add(pa);
        to_delete.add(0, pa);
        UserProjectActivity upa = new UserProjectActivity();
        upa.setProjectActivity(pa);
        upa.setUser(user);
//        upa.setPrise(new BigDecimal("200.50"));
        upa.setBudget(new BigDecimal("20.00"));
        objects.add(upa);
        to_delete.add(0, upa);
        daSrv.persistChanges(objects, null, null);
        List<UserProjectActivity> upas = admSrv.getUserProjectActivities(user);
        assertEquals("Wrong number of user project activities: ", 1, upas.size());
View Full Code Here


        BigDecimal const100 = new BigDecimal("100.00");
        BigDecimal hours_cnt = BigDecimal.ZERO.setScale(2, BigDecimal.ROUND_HALF_UP);
        BigDecimal money = BigDecimal.ZERO.setScale(2, BigDecimal.ROUND_HALF_UP);
        BigDecimal taxes = BigDecimal.ZERO.setScale(2, BigDecimal.ROUND_HALF_UP);
        for (WorkDayTimeRecord wdtr : workTimeRecords) {
            UserProjectActivity upa = wdtr.getUserProjectActivity();
            BigDecimal hours = wdtr.getAmountOfHours();
            hours_cnt = hours_cnt.add(hours);
            BigDecimal price = upa.getPrice(
                    wdtr.getDay().getDate()).getPrice();
            BigDecimal local_money = price.multiply(hours);
            money = money.add(local_money);
            taxes = taxes.add(
                    getVAT(vats,
View Full Code Here

        }
        List<UserProjectActivity> result = userProjectActivityDao.find(user);
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("number of loaded user project activities: " + result.size());
            for (int i = 0; i < result.size(); i++) {
                UserProjectActivity upa = (UserProjectActivity) result.get(i);
                LOGGER.debug("user project activity " + i + " is "
                        + upa.getId()
                        + ", " + upa.getUserLogin() + ", " + upa.getProjectActivityName());
            }
        }

        return result;
    }
View Full Code Here

        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();
        wd1.setUser(user);
View Full Code Here

        return findSingle("select * from User u where u.uid = ?1", uid);
    }

    @Override
    public boolean isObjectInUse(User user) {
        UserProjectActivity upa = userProjectActivityDao.findMaxOneObject("select * from UserProjectActirviy upa where upa.user = ?1", user);
        if (upa != null) {
            return true;
        }
        Contract contract = contractDao.findMaxOneObject("select * from Contract c where c.user = ?1", user);
        if (contract != null) {
View Full Code Here

        super(ProjectActivity.class);
    }

    @Override
    public boolean isObjectInUse(ProjectActivity projectActivity) {
        UserProjectActivity upa = userProjectActivityDao.findMaxOneObject("select * from UserProjectActivity upa where upa.projectActivity = ?1", projectActivity);
        return upa != null;
    }
View Full Code Here

        ProjectActivity pa = new ProjectActivity();
        pa.setProject(p);
        pa.setProjectActivityName("TestProjectActivity");
        objects.add(pa);
        to_delete.add(0, pa);
        UserProjectActivity upa = new UserProjectActivity();
        upa.setProjectActivity(pa);
        upa.setUser(user);
//        upa.setPrise(new BigDecimal("200.50"));
        upa.setBudget(new BigDecimal("20.00"));
        objects.add(upa);
        to_delete.add(0, upa);
        daSrv.persistChanges(objects, null, null);
        AdminService admSrv = configSrv.getAdminService();
        List<UserProjectActivity> upas = admSrv.getUserProjectActivities(user);
View Full Code Here

    public static final BigDecimal BUDGET = new BigDecimal("340.50");
    public static final BigDecimal PRICE1 = new BigDecimal("64.50");
    public static final BigDecimal PRICE2 = new BigDecimal("72.20");

    public static UserProjectActivity getUserProjectActivity(ProjectActivity projectActivity, User user) {
        UserProjectActivity userProjectActivity = new UserProjectActivity();
        userProjectActivity.setBudget(BUDGET);
        userProjectActivity.setPrices(
                getPrices(userProjectActivity));
        userProjectActivity.setProjectActivity(projectActivity);
        userProjectActivity.setUser(user);
        return userProjectActivity;
    }
View Full Code Here

    public static final BigDecimal PRICE1 = new BigDecimal("60.50");
    public static final BigDecimal PRICE2 = new BigDecimal("71.20");
    public static final BigDecimal PRICE3 = new BigDecimal("84.65");

    public static UserProjectActivity getUserProjectActivity(ProjectActivity projectActivity, User user) {
        UserProjectActivity userProjectActivity = new UserProjectActivity();
        userProjectActivity.setBudget(BUDGET);
        userProjectActivity.setPrices(
                getPrices(userProjectActivity));
        userProjectActivity.setProjectActivity(projectActivity);
        userProjectActivity.setUser(user);
        return userProjectActivity;
    }
View Full Code Here

        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();
        wd1.setUser(user);
View Full Code Here

TOP

Related Classes of com.peusoft.ptcollect.core.persistance.domain.UserProjectActivity

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.