Beispiel #1
0
float
Budget::PrevRemoved(string category)
{
  if (!_CategoryExists(category)) {
    return 0;
  }
  
  Category* c = _categories.find(category)->second;
  
  // Start at the end and work your way back,
  // looking for a SUB transaction
  for (Category::RevIterator i = c->RevBegin(); i != c->RevEnd(); i++) {
    if (i->second->Action() == Transaction::SUB) {
      return i->second->Amount();
	}
  }
  
  // There aren't any transactions
  return 0;
}