Package org.internna.ossmoney.model.support

Examples of org.internna.ossmoney.model.support.InflowOutflow


      Map<String, InflowOutflow> data = new HashMap<String, InflowOutflow>();
      if (!CollectionUtils.isEmpty(transactions)) {
        for (AccountTransaction transaction : transactions) {
          Locale locale = transaction.getAccount().getLocale();
          String currency = transaction.getAccount().getCurrency();
          InflowOutflow inflowOutflow = getOrCreateInflowOutflow(interval, currency, locale, data);
          process(transaction, inflowOutflow);
        }
      }
      return data.values();
    }
View Full Code Here


      }
      return data.values();
    }

    protected final InflowOutflow getOrCreateInflowOutflow(final Interval interval, final String currency, final Locale locale, final Map<String, InflowOutflow> inflowsOutflows) {
      InflowOutflow inflowOutflow = inflowsOutflows.get(currency);
      if (inflowOutflow == null) {
        inflowOutflow = new InflowOutflow(interval, currency, locale, messageSource);
        inflowsOutflows.put(currency, inflowOutflow);
      }
      return inflowOutflow;
    }
View Full Code Here

    assertEquals("InflowOutflow already exists", result, controller.getOrCreateInflowOutflow(interval, transaction.getAccount().getCurrency(), Locale.US, inflowsOutflows));
  }

  @Test
  public void testProcess() {
    InflowOutflow inflowOutflow = new InflowOutflow(interval, "USD", Locale.US, messageSource);
    controller.process(transaction, inflowOutflow);
    assertEquals("InflowOutflow modified", BigDecimal.TEN, inflowOutflow.getInflow(date).get(transaction.getSubcategory().getParentCategory()).get(transaction.getSubcategory()));
  }
View Full Code Here

TOP

Related Classes of org.internna.ossmoney.model.support.InflowOutflow

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.