getCreditAccount :: Ext Record -> Maybe AccountID
getCreditAccount r =
  case getContent r of
    Transaction (TEntry (UEntry dr cr corr _)) ->
      case cr of
        [] -> if null dr then Nothing else ((getID . fst) <$> corr)
        (CPosting acc _ _: _) -> Just (getID acc)
    _ -> Nothing
getCreditAccount :: Ext Record -> Maybe AccountID
getCreditAccount r =
  case getContent r of
    Transaction (TEntry (UEntry dr cr corr _)) ->
      case cr of
        [] -> if null dr then Nothing else ((getID . fst) <$> corr)
        (CPosting acc _ _: _) -> Just (getID acc)
    _ -> Nothing
getCreditAccount r =
  case getContent r of
    Transaction (TEntry (UEntry dr cr corr _)) ->
      case cr of
        [] -> if null dr then Nothing else ((getID . fst) <$> corr)
        (CPosting acc _ _: _) -> Just (getID acc)
    _ -> Nothing