예제 #1
0
        public GncCommodityAmount GetTotalConverted(DateInterval interval, bool withSubaccts, GncCommodity convertTo)
        {
            var result = new GncCommodityAmount(0, convertTo);

            foreach (var split in EnumSplits(withSubaccts).Where(spl => interval.Contains(spl.Transaction.DatePosted)))
            {
                result += split.AmountConverted(convertTo);
            }
            return(result);
        }
예제 #2
0
        public GncCommodityAmount GetBalanceConverted(DateTime asOf, bool withSubaccts, GncCommodity convertTo)
        {
            var result = new GncCommodityAmount(0, convertTo);

            foreach (var split in EnumSplits(withSubaccts).Where(spl => spl.Transaction.DatePosted <= asOf))
            {
                result += split.AmountConverted(convertTo);
            }
            return(result.WithTimepoint(asOf));
        }