Package org.internna.ossmoney.model.security

Examples of org.internna.ossmoney.model.security.UserDetails


      return "widgets/networth";
    }

    @RequestMapping("/income_vs_expenses_over_time/{months}")
    public String incomeVsExpensesOverTime(@PathVariable int months, ModelMap modelMap) {
      UserDetails user = getCurrentUser();
        Date[] dates = DateUtils.dates(months);
        Map<Currency, Map<Date, IncomeExpense>> data = cache.getIncomeVsExpensesOverTime(user, months);
        if (data == null) {
          data = calculateIncomeVsExpensesOverTime(dates, getAccounts());
          cache.storeIncomeVsExpensesOverTime(user, months, data);
View Full Code Here


        return expensesOverTimeAndCurrency;
    }

    @RequestMapping("/remainder/{days}")
    public String remainders(@PathVariable int days, ModelMap modelMap) {
      UserDetails user = UserDetails.findCurrentUser();
      modelMap.addAttribute("bills", Bill.findPending(user, days));
      return "widgets/remainders";
    }
View Full Code Here

  @Autowired private AccountService accountService;

    @RequestMapping("/manage")
    public String manage(ModelMap modelMap) {
      UserDetails user = UserDetails.findCurrentUser();
      modelMap.addAttribute("budgets", user.getBudget().getBudgets());
      modelMap.addAttribute("categories", Subcategory.findExpenseCategories(user));
        return "budget/manage";
    }
View Full Code Here

        return "budget/manage";
    }

    @RequestMapping(value = "/manage", method = RequestMethod.POST)
    public String manage(String currency, long subcategory, int month, double amount, ModelMap modelMap) {
      UserDetails user = UserDetails.findCurrentUser();
      Subcategory loaded = Subcategory.findSubcategory(subcategory);
      if (month == -1) {
        for (int i = 0; i < 12; i++) {
          createBudget(user, currency, i, amount, loaded);
        }
View Full Code Here

      }
      return deleted;
    }

    private CategoryBudget getBudget(long id) {
      UserDetails user = UserDetails.findCurrentUser();
      CategoryBudget budget = CategoryBudget.findCategoryBudget(id);
      return budget != null && user != null && budget.getMonthlyBudget().getBudget().getOwner().equals(user) ? budget : null;
    }
View Full Code Here

    @RequestMapping("/graph/{expanded}")
    public String widget(@PathVariable String expanded, ModelMap modelMap) {
      BigDecimal budgeted = BigDecimal.ZERO;
      BigDecimal expended = BigDecimal.ZERO;
      UserDetails user = UserDetails.findCurrentUser();
      Interval monthToDate = new Interval(Interval.Intervals.MONTH_TO_DATE);
      MonthlyBudget budget = user.getBudget().getMonthlyBudget(Calendar.getInstance().get(Calendar.MONTH));
      for (CategoryBudget categoryBudget : budget.getBudgets()) {
        budgeted = budgeted.add(categoryBudget.getExpectedAmount());
        BigDecimal expendedInCategory = accountService.getExpenses(user, categoryBudget.getLocale(), categoryBudget.getCategory(), monthToDate);
        expended = expended.add(expendedInCategory);
        categoryBudget.setExpended(expendedInCategory);
View Full Code Here

    @RequestMapping("/{id}")
    public String investments(@PathVariable Long id, ModelMap modelMap) {
      modelMap.addAttribute("id", id);
      Account account = Account.findAccount(id);
      UserDetails user = UserDetails.findCurrentUser();
      if (account.belongsTo(user)) {
        modelMap.addAttribute("investments", account.getCurrentInvestments());
      }
      return "investment/performance";
    }
View Full Code Here

      return add(null, modelMap);
    }

    @RequestMapping("/add/{id}")
    public String add(@PathVariable Long id, ModelMap modelMap) {
      UserDetails user = UserDetails.findCurrentUser();
      Collection<Account> accounts = user.getInvestmentAccounts();
      if (id != null) {
        Account account = Account.findAccount(id);
        if (account.belongsTo(user)) {
            modelMap.addAttribute("account", account);
            modelMap.addAttribute("currency", account.getCurrency());
View Full Code Here

        return "investment/add";
    }

    @RequestMapping(value = "/add", method = RequestMethod.POST)
    public String add(InvestmentTransaction transaction, double commision, ModelMap modelMap) {
      UserDetails user = UserDetails.findCurrentUser();
      Account account = Account.findAccount(transaction.getAccountTransaction().getAccount().getId());
      if (account.belongsTo(user)) {
        cache.invalidate(user);
        investmentService.addInvestment(user, account, transaction, commision);
      }
View Full Code Here

      return "redirect:/financial/accounts/" + transaction.getAccountTransaction().getAccount().getId();
    }

    @RequestMapping("/view/{id}")
    public String view(@PathVariable Long id, ModelMap modelMap) {
      UserDetails user = UserDetails.findCurrentUser();
      InvestmentTransaction transaction = InvestmentTransaction.findInvestmentTransaction(id);
      Account account = transaction.getAccountTransaction().getAccount();
      if (account.belongsTo(user)) {
        modelMap.addAttribute("account", account);
        modelMap.addAttribute("transaction", transaction);
View Full Code Here

TOP

Related Classes of org.internna.ossmoney.model.security.UserDetails

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.