Package org.internna.ossmoney.model

Examples of org.internna.ossmoney.model.Account.belongsTo()


    @RequestMapping(value = "/edit", method = RequestMethod.POST)
    public String edit(Account account, ModelMap modelMap) {
      UserDetails user = UserDetails.findCurrentUser();
      Account loaded = Account.findAccount(account.getId());
      if (loaded.belongsTo(user)) {
        cache.invalidate(user);
      loaded.setIsbn(account.getIsbn());
        loaded.setName(account.getName());
        loaded.setLocale(account.getLocale());
        loaded.setOpened(account.getOpened());
View Full Code Here


    public String remove(@PathVariable Long id, ModelMap modelMap) {
      Account account = null;
      AccountTransaction transaction  = AccountTransaction.findAccountTransaction(id);
      if (transaction != null) {
        account = transaction.getAccount();
        if (account.belongsTo(UserDetails.findCurrentUser())) {
          transaction.remove();
        }
      }
      return details(account, modelMap);
    }
View Full Code Here

    Account account = qifImporterService.createAccount(Locale.US, institution, register);
    assertNotNull("Account created", account);
    assertEquals("Amount processed", new Double(20), new Double(account.calculateBalance().doubleValue()));
    assertEquals("Account name processed", "Test account", account.getName());
    assertEquals("Financial institution processed", institution, account.getHeldAt());
    assertTrue("User correctly assumed", account.belongsTo(UserDetails.findCurrentUser()));
  }

  @Test
  public void testGetOrCreatePayee() {
    Register register = new Register();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.