Package org.internna.ossmoney.model.security

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


        binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false));
    }

    @RequestMapping
    public String index(ModelMap modelMap) {
      UserDetails user = UserDetails.findCurrentUser();
      modelMap.addAttribute("bills", Bill.findByOwner(user));
        return "bills/index";
    }
View Full Code Here


        return "bills/index";
    }

    @RequestMapping("/create")
    public String createForm(HttpServletRequest request, ModelMap modelMap) {
      UserDetails user = UserDetails.findCurrentUser();
      modelMap.addAttribute("payees", Payee.findByOwner(user));
      modelMap.addAttribute("categories", new TreeSet<Subcategory>(Subcategory.findExpenseCategories(user)));
      return "bills/create";
    }
View Full Code Here

      bill.persist();
    }

    @RequestMapping("/pay/{id}")
    public String pay(@PathVariable Long id, ModelMap modelMap) {
      UserDetails user = UserDetails.findCurrentUser();
      Bill bill = Bill.findBill(id);
      if (bill.belongsTo(user)) {
        modelMap.addAttribute("bill", bill);
        modelMap.addAttribute("origin", user.getBankAccounts(bill.getCurrency()));
        modelMap.addAttribute("currency", Currency.getInstance(bill.getCurrency()).getCurrencyCode());
      }
      return "bills/pay";
    }
View Full Code Here

      return "bills/pay";
    }

    @RequestMapping(value = "/pay", method = RequestMethod.POST)
    public String pay(Long id, Long origin, Double amount, Date operationDate, ModelMap modelMap) {
      UserDetails user = UserDetails.findCurrentUser();
      Bill bill = Bill.findBill(id);
      if (bill.belongsTo(user)) {
        accountService.payBill(user, bill, origin, amount, operationDate);
      }
      return dashboard.index(modelMap);
View Full Code Here

  @Autowired private AccountController accountController;

    @RequestMapping
    public String index(ModelMap modelMap) {
      UserDetails user = UserDetails.findCurrentUser();
      if (CollectionUtils.isEmpty(user.getAccounts())) {
        return accountController.index(modelMap);
      } else {
        modelMap.addAttribute("dashboard", user.getDashboard());
          return "dashboard/index";
      }
    }
View Full Code Here

        binder.registerCustomEditor(byte[].class, new ByteArrayMultipartFileEditor());
    }

    @RequestMapping
    public String index(ModelMap modelMap) {
      UserDetails user = UserDetails.findCurrentUser();
      modelMap.addAttribute("institutions", new TreeSet<FinancialInstitution>(user.getInstitutions()));
        return "qif/index";
    }
View Full Code Here

    this.cache = cache;
  }

  @RequestMapping("/income_vs_expenses/{intervals}")
    public String incomeVsExpenses(@PathVariable String intervals, ModelMap modelMap) {
      UserDetails user = getCurrentUser();
      String interval = hasText(intervals) ? intervals.toUpperCase() : Interval.Intervals.PREVIOUS_MONTH.toString();
      Map<Currency, NameValuePair<BigDecimal, BigDecimal>> data = cache.getIncomeAndExpenses(user, intervals);
      if (data == null) {
        List<AccountTransaction> transactions = getTransactions(user, intervals, null, modelMap);
        data = calculateIncomeAndExpenses(transactions);
View Full Code Here

      return Math.round(max * 1.1);
    }

    @RequestMapping("/expenses_by_category/{intervals}")
    public String expensesByCategory(@PathVariable String intervals, ModelMap modelMap) {
      UserDetails user = getCurrentUser();
      Interval interval = getInterval(intervals);
      Map<Currency, Map<Subcategory, BigDecimal>> data = cache.getExpensesByCategory(user, intervals);
      if (data == null) {
        List<AccountTransaction> transactions = getTransactions(interval, null, modelMap);
        data = organizeByCategory(transactions);
View Full Code Here

      return data;
    }

    @RequestMapping("/expenses_over_time/{months}")
    public String expensesOverTime(@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 "widgets/expensesovertime";
    }

    @RequestMapping("/networth/{months}")
    public String netWorthOverTime(@PathVariable int months, ModelMap modelMap) {
      UserDetails user = getCurrentUser();
      Date[] dates = DateUtils.dates(months);
      Map<Currency, Map<Date, IncomeExpense>> data = cache.getNetWorthOverTime(user, months);
      if (data == null) {
        data = calculateWealth(dates, getAccounts());
        cache.storeNetWorthOverTime(user, months, data);
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.