public ConsolidatedBalanceSheet(Assets assets, LiabilitiesAndEquity liabilities, StockholdersEquity stockholdersEquity)
 {
     Assets = assets;
     LiabilitiesAndEquity = liabilities;
     StockholdersEquity   = stockholdersEquity;
 }
 public ConsolidatedBalanceSheet()
 {
     Assets = new Assets();
     LiabilitiesAndEquity = new LiabilitiesAndEquity();
     StockholdersEquity   = new StockholdersEquity();
 }
Esempio n. 3
0
        private ConsolidatedBalanceSheet GetBalanceSheet(IWebElement table)
        {
            var currentAssets      = new CurrentAssets();
            var assets             = new Assets();
            var liabilities        = new LiabilitiesAndEquity();
            var currentLiabilities = new CurrentLiabilities();
            var stockholdersEquity = new StockholdersEquity();

            var tableRows = table.FindElements(By.TagName("tr"));

            foreach (var tr in tableRows)
            {
                var tableCellCount = tr.FindElements(By.TagName("td")).Count();
                var tcs            = tr.FindElements(By.TagName("td"));

                if (tr.Text.Contains("Cash and cash equivalents"))
                {
                    currentAssets.CashAndEquivalents = GetDoubleFromString(tcs[tableCellCount - 2].Text);
                }
                else if (tr.Text.Contains("Marketable securities"))
                {
                    currentAssets.MarketableSecurities = GetDoubleFromString(tcs[tableCellCount - 2].Text);
                }
                else if (tr.Text.Contains("Accounts receivable"))
                {
                    currentAssets.AccountsReceivable = GetDoubleFromString(tcs[tableCellCount - 2].Text);
                }
                else if (tr.Text.Contains("Receivable under reverse repurchase agreements"))
                {
                    currentAssets.ReceivableUnderReversePurchase = GetDoubleFromString(tcs[tableCellCount - 2].Text);
                }
                else if (tr.Text.Contains("Deferred income taxes, net"))
                {
                    assets.DeferredIncomeTaxes = GetDoubleFromString(tcs[tableCellCount - 2].Text);
                }
                else if (tr.Text.Contains("Income taxes receivable, net"))
                {
                    currentAssets.IncomeTaxesReceivable = GetDoubleFromString(tcs[tableCellCount - 2].Text);
                }
                else if (tr.Text.Contains("Prepaid revenue share, expenses and other assets") || tr.Text.Contains("Other current assets"))
                {
                    currentAssets.OtherCurrentAssets = GetDoubleFromString(tcs[tableCellCount - 2].Text);
                }
                else if (tr.Text.Contains("Prepaid revenue share, expenses and other assets, non-current") || tr.Text.Contains("Other non-current assets"))
                {
                    assets.OtherNoncurrentAssets = GetDoubleFromString(tcs[tableCellCount - 2].Text);
                }
                else if (tr.Text.Contains("Non-marketable investments"))
                {
                    assets.NonmarketableInvestments = GetDoubleFromString(tcs[tableCellCount - 2].Text);
                }
                else if (tr.Text.Contains("Property and equipment, net"))
                {
                    assets.NetProperty = GetDoubleFromString(tcs[tableCellCount - 2].Text);
                }
                else if (tr.Text.Contains("Intangible assets, net"))
                {
                    assets.NetIntangibleAssets = GetDoubleFromString(tcs[tableCellCount - 2].Text);
                }
                else if (tr.Text.Contains("Goodwill"))
                {
                    assets.Goodwill = GetDoubleFromString(tcs[tableCellCount - 2].Text);
                }
                else if (tr.Text.Contains("Accounts payable"))
                {
                    currentLiabilities.AccountsPayable = GetDoubleFromString(tcs[tableCellCount - 2].Text);
                }
                else if (tr.Text.Contains("Short-term debt"))
                {
                    currentLiabilities.ShortTermDebt = GetDoubleFromString(tcs[tableCellCount - 2].Text);
                }
                else if (tr.Text.Contains("Accrued compensation and benefits"))
                {
                    currentLiabilities.AccruedCompensationAndBenefits = GetDoubleFromString(tcs[tableCellCount - 2].Text);
                }
                else if (tr.Text.Contains("Accrued expenses and other current liabilities"))
                {
                    currentLiabilities.AccruedExpensesAndOtherCurrentLiabilities = GetDoubleFromString(tcs[tableCellCount - 2].Text);
                }
                else if (tr.Text.Contains("Accrued revenue share"))
                {
                    currentLiabilities.AccruedRevenueShare = GetDoubleFromString(tcs[tableCellCount - 2].Text);
                }
                else if (tr.Text.Contains("Securities lending payable"))
                {
                    currentLiabilities.SecuritiesLendingPayable = GetDoubleFromString(tcs[tableCellCount - 2].Text);
                }
                else if (tr.Text.Contains("Deferred revenue"))
                {
                    currentLiabilities.DeferredRevenue = GetDoubleFromString(tcs[tableCellCount - 2].Text);
                }
                else if (tr.Text.Contains("Income taxes payable, net"))
                {
                    currentLiabilities.NetIncomeTaxesPayable = GetDoubleFromString(tcs[tableCellCount - 2].Text);
                }
                else if (tr.Text.Contains("Long-term debt"))
                {
                    liabilities.LongTermDebt = GetDoubleFromString(tcs[tableCellCount - 2].Text);
                }
                else if (tr.Text.Contains("Deferred revenue, non-current"))
                {
                    liabilities.DeferredRevenueNonCurrent = GetDoubleFromString(tcs[tableCellCount - 2].Text);
                }
                else if (tr.Text.Contains("Income taxes payable, non-current"))
                {
                    liabilities.IncomeTaxesPayableNonCurrent = GetDoubleFromString(tcs[tableCellCount - 2].Text);
                }
                else if (tr.Text.Contains("Deferred income taxes, net, non-current"))
                {
                    liabilities.DeferredIncomeTaxes = GetDoubleFromString(tcs[tableCellCount - 2].Text);
                }
                else if (tr.Text.Contains("Other long-term liabilities"))
                {
                    liabilities.OtherLongTermLiabilities = GetDoubleFromString(tcs[tableCellCount - 2].Text);
                }
                else if (tr.Text.Contains("Convertible preferred stock"))
                {
                    stockholdersEquity.ConvertiblePreferredStock = GetDoubleFromString(tcs[tableCellCount - 2].Text);
                }
                else if (tr.Text.Contains("Class A and Class B common stock, and Class C capital stock and additional paid-in capital"))
                {
                    stockholdersEquity.CommonStockClassAandB = GetDoubleFromString(tcs[tableCellCount - 2].Text);
                }
                else if (tr.Text.Contains("Accumulated other comprehensive income"))
                {
                    stockholdersEquity.AccumulatedOtherCompehensiveLoss = GetDoubleFromString(tcs[tableCellCount - 2].Text);
                }
                else if (tr.Text.Contains("Retained earnings"))
                {
                    stockholdersEquity.RetainedEarnings = GetDoubleFromString(tcs[tableCellCount - 2].Text);
                }
            }

            assets.CurrentAssets           = currentAssets;
            liabilities.CurrentLiabilities = currentLiabilities;

            return(new ConsolidatedBalanceSheet(assets, liabilities, stockholdersEquity));
        }