code: def get_cash_balance_with_children(self, root_account: Account, currency: Commodity) -> Decimal:
          
          total = Decimal(0)
          svc = CurrenciesAggregate(self.book)
  
          # get all child accounts in a list
          cash_balances = self.load_cash_balances_with_children(
              root_account.fullname)
          # get the amounts
          for cur_symbol in cash_balances:
              # Currency symbol
              value = cash_balances[cur_symbol]["total"]
  
              if cur_symbol != currency.mnemonic:
                  # Convert the amount to the given currency.
                  other_cur = svc.get_by_symbol(cur_symbol)
  
                  cur_svc = svc.get_currency_aggregate(other_cur)
  
                  rate = cur_svc.get_latest_rate(currency)
                  value = value * rate.value
  
              total += value
  
          return total
docs: Loads cash balances in given currency.
          currency: the currency for the total