Exemplo n.º 1
0
        public Canvas BalanceSheetCanvas(BalanceSheet bs)
        {
            var canvas = new Canvas( );

            canvas.Children.Add( BSEquities( bs ) );

            return canvas;
        }
Exemplo n.º 2
0
        public static Canvas BalanceSheetCanvas( BalanceSheet bs )
        {
            Grid grid = new Grid( );
            grid.Width = 600;
            grid.Height = 600;
            grid.ColumnDefinitions.Add( new ColumnDefinition( ) );
            grid.ColumnDefinitions.Add( new ColumnDefinition( ) );

            Grid subGridLeft = new Grid( );
            subGridLeft.Width = 300;
            Grid subGridRight = new Grid( );
            subGridRight.Width = 300;

            subGridLeft.RowDefinitions.Add( new RowDefinition( ) );

            subGridRight.RowDefinitions.Add( new RowDefinition( ) );
            subGridRight.RowDefinitions.Add( new RowDefinition( ) );

            var cAssets = BSAsset( bs );
            var cLiabilities = BSLiabilities( bs );
            var cEquity = BSEquities( bs );

            subGridLeft.Children.Add( cAssets );
            Grid.SetRow( cAssets, 0 );

            subGridRight.Children.Add( cLiabilities );
            subGridRight.Children.Add( cEquity );
            Grid.SetRow( cLiabilities, 0 );
            Grid.SetRow( cEquity, 1 );

            grid.Children.Add( subGridLeft );
            grid.Children.Add( subGridRight );
            Grid.SetColumn( subGridLeft, 0 );
            Grid.SetColumn( subGridRight, 1 );
            var canvas = new Canvas( );

            canvas.Children.Add( grid );

            return canvas;
        }
Exemplo n.º 3
0
        public Canvas BSLiabilities( BalanceSheet bs )
        {
            var canvas = new Canvas( );
            canvas.Name = "bsLiabilities";
            // Liabilities
            var liabilities = new Label( );
            liabilities.Content = "Liabilities";
            liabilities.FontSize = 10;
            canvas.Children.Add( liabilities );
            Canvas.SetTop( liabilities, 0 );
            Canvas.SetLeft( liabilities, 0 );

            // Current Liabilities
            var currentLiabilities = new Label( );
            currentLiabilities.Content = "Current Liabilities";
            currentLiabilities.FontSize = 10;
            canvas.Children.Add( currentLiabilities );
            Canvas.SetTop( currentLiabilities, 15 );
            Canvas.SetLeft( currentLiabilities, 10 );

            // Accounts Payable
            var accountsPayable = new Label( );
            accountsPayable.Content = "Accounts Payable";
            accountsPayable.FontSize = 10;
            canvas.Children.Add( accountsPayable );
            Canvas.SetTop( accountsPayable, 30 );
            Canvas.SetLeft( accountsPayable, 20 );
            var accountsPayableData = new Label( );
            accountsPayableData.Content = FormattedCurrencyString( bs.Accounts_Payable );
            accountsPayableData.FontSize = 10;
            canvas.Children.Add( accountsPayableData );
            Canvas.SetTop( accountsPayableData, 30 );
            Canvas.SetLeft( accountsPayableData, 20 + "Current Port. of LT Debt/Capital Leases".Length * 5 );

            // Accrued Expenses
            var accuredExepnses = new Label( );
            accuredExepnses.Content = "Accrued Expenses";
            accuredExepnses.FontSize = 10;
            canvas.Children.Add( accuredExepnses );
            Canvas.SetTop( accuredExepnses, 45 );
            Canvas.SetLeft( accuredExepnses, 20 );
            var accuredExepnsesData = new Label( );
            accuredExepnsesData.Content = FormattedCurrencyString( bs.Accrued_Expenses );
            accuredExepnsesData.FontSize = 10;
            canvas.Children.Add( accuredExepnsesData );
            Canvas.SetTop( accuredExepnsesData, 45 );
            Canvas.SetLeft( accuredExepnsesData, 20 + "Current Port. of LT Debt/Capital Leases".Length * 5 );

            // Notes Payable/Short Term Debt
            var notesPayableST = new Label( );
            notesPayableST.Content = "Notes Payable/Short Term Debt";
            notesPayableST.FontSize = 10;
            canvas.Children.Add( notesPayableST );
            Canvas.SetTop( notesPayableST, 60 );
            Canvas.SetLeft( notesPayableST, 20 );
            var notesPayableSTData = new Label( );
            notesPayableSTData.Content = FormattedCurrencyString( bs.Notes_Payable_and_Short_Term_Debt );
            notesPayableSTData.FontSize = 10;
            canvas.Children.Add( notesPayableSTData );
            Canvas.SetTop( notesPayableSTData, 60 );
            Canvas.SetLeft( notesPayableSTData, 20 + "Current Port. of LT Debt/Capital Leases".Length * 5 );

            // Current Port. of LT Debt/Capital Leases
            var currentPortOfLT = new Label( );
            currentPortOfLT.Content = "Current Port. of LT Debt/Capital Leases";
            currentPortOfLT.FontSize = 10;
            canvas.Children.Add( currentPortOfLT );
            Canvas.SetTop( currentPortOfLT, 75 );
            Canvas.SetLeft( currentPortOfLT, 20 );
            var currentPortOfLTData = new Label( );
            currentPortOfLTData.Content = FormattedCurrencyString( bs.Current_Port_of_LT_Debt_and_Capital_Leases );
            currentPortOfLTData.FontSize = 10;
            canvas.Children.Add( currentPortOfLTData );
            Canvas.SetTop( currentPortOfLTData, 75 );
            Canvas.SetLeft( currentPortOfLTData, 20 + "Current Port. of LT Debt/Capital Leases".Length * 5 );

            // Other Current liabilities, Total
            var otherCLT = new Label( );
            otherCLT.Content = "Other Current liabilities, Total";
            otherCLT.FontSize = 10;
            canvas.Children.Add( otherCLT );
            Canvas.SetTop( otherCLT, 90 );
            Canvas.SetLeft( otherCLT, 20 );
            var otherCLTData = new Label( );
            otherCLTData.Content = FormattedCurrencyString( bs.Other_Current_liabilities__Total );
            otherCLTData.FontSize = 10;
            canvas.Children.Add( otherCLTData );
            Canvas.SetTop( otherCLTData, 90 );
            Canvas.SetLeft( otherCLTData, 20 + "Current Port. of LT Debt/Capital Leases".Length * 5 );

            // Total Current Liabilities
            var tCL = new Label( );
            tCL.Content = "Total Current Liabilities";
            tCL.FontSize = 10;
            canvas.Children.Add( tCL );
            Canvas.SetTop( tCL, 105 );
            Canvas.SetLeft( tCL, 20 );
            var tCLData = new Label( );
            tCLData.Content = FormattedCurrencyString( bs.Total_Current_Liabilities);
            tCLData.FontSize = 10;
            canvas.Children.Add( tCLData );
            Canvas.SetTop( tCLData, 105 );
            Canvas.SetLeft( tCLData, 20 + "Current Port. of LT Debt/Capital Leases".Length * 5 );

            // Long-Term Liabilities
            var ltL = new Label( );
            ltL.Content = "Long-Term Liabilities";
            ltL.FontSize = 10;
            canvas.Children.Add( ltL );
            Canvas.SetTop( ltL, 120 );
            Canvas.SetLeft( ltL, 20 );
            var ltLData = new Label( );
            // TODO: ADD Long-Term Liabilities to KNMFinance API
            // ltLData.Content = FormattedCurrencyString( bs.Lon );
            ltLData.FontSize = 10;
            canvas.Children.Add( ltLData );
            Canvas.SetTop( ltLData, 120 );
            Canvas.SetLeft( ltLData, 20 + "Current Port. of LT Debt/Capital Leases".Length * 5 );

            // Long-Term Debt
            var ltD = new Label( );
            ltD.Content = "Long-Term Debt";
            ltD.FontSize = 10;
            canvas.Children.Add( ltD );
            Canvas.SetTop( ltD, 135 );
            Canvas.SetLeft( ltD, 20 );
            var ltDData = new Label( );
            ltDData.FontSize = 10;
            ltDData.Content = FormattedCurrencyString( bs.Long_Term_Debt);
            canvas.Children.Add( ltDData );
            Canvas.SetTop( ltDData, 135 );
            Canvas.SetLeft( ltDData, 20 + "Current Port. of LT Debt/Capital Leases".Length * 5 );

            // Capital Lease Obligations
            var clo = new Label( );
            clo.Content = "Capital Lease Obligations";
            clo.FontSize = 10;
            canvas.Children.Add( clo );
            Canvas.SetTop( clo, 150 );
            Canvas.SetLeft( clo, 20 );
            var cloData = new Label( );
            cloData.Content = FormattedCurrencyString( bs.Capital_Lease_Obligations);
            cloData.FontSize = 10;
            canvas.Children.Add( cloData );
            Canvas.SetTop( cloData, 150 );
            Canvas.SetLeft( cloData, 20 + "Current Port. of LT Debt/Capital Leases".Length * 5 );

            // Total Long Term Debt
            var lttd = new Label( );
            lttd.Content = "Total Long Term Debt";
            lttd.FontSize = 10;
            canvas.Children.Add( lttd );
            Canvas.SetTop( lttd, 165 );
            Canvas.SetLeft( lttd, 20 );
            var lttdData = new Label( );
            lttdData.Content = FormattedCurrencyString( bs.Total_Long_Term_Debt);
            lttdData.FontSize = 10;
            canvas.Children.Add( lttdData );
            Canvas.SetTop( lttdData, 165 );
            Canvas.SetLeft( lttdData, 20 + "Current Port. of LT Debt/Capital Leases".Length * 5 );

            // Total Debt
            var td = new Label( );
            td.Content = "Total Debt";
            td.FontSize = 10;
            canvas.Children.Add( td );
            Canvas.SetTop( td, 180);
            Canvas.SetLeft( td, 20 );
            var tdData = new Label( );
            tdData.FontSize = 10;
            tdData.Content = FormattedCurrencyString( bs.Total_Debt );
            canvas.Children.Add( tdData );
            Canvas.SetTop( tdData, 180 );
            Canvas.SetLeft( tdData, 20 + "Current Port. of LT Debt/Capital Leases".Length * 5 );

            // Deferred Income Tax
            var dit = new Label( );
            dit.Content = "Deferred Income Tax";
            dit.FontSize = 10;
            canvas.Children.Add( dit );
            Canvas.SetTop( dit, 195 );
            Canvas.SetLeft( dit, 20 );
            var ditData = new Label( );
            ditData.Content = FormattedCurrencyString( bs.Deferred_Income_Tax);
            ditData.FontSize = 10;
            canvas.Children.Add( ditData );
            Canvas.SetTop( ditData, 195 );
            Canvas.SetLeft( ditData, 20 + "Current Port. of LT Debt/Capital Leases".Length * 5 );

            // Minority Interest
            var mi = new Label( );
            mi.Content = "Minority Interest";
            mi.FontSize = 10;
            canvas.Children.Add( mi );
            Canvas.SetTop( mi, 210 );
            Canvas.SetLeft( mi, 20 );
            var miData = new Label( );
            miData.FontSize = 10;
            miData.Content = FormattedCurrencyString( bs.Minority_Interest);
            canvas.Children.Add( miData );
            Canvas.SetTop( miData, 210 );
            Canvas.SetLeft( miData, 20 + "Current Port. of LT Debt/Capital Leases".Length * 5 );

            // Other Liabilities, Total
            var olt = new Label( );
            olt.Content = "Other Liabilities, Total";
            olt.FontSize = 10;
            canvas.Children.Add( olt );
            Canvas.SetTop( olt, 225 );
            Canvas.SetLeft( olt, 20 );
            var oltData = new Label( );
            oltData.FontSize = 10;
            oltData.Content = FormattedCurrencyString( bs.Other_Current_liabilities__Total );
            canvas.Children.Add( oltData );
            Canvas.SetTop( oltData, 225 );
            Canvas.SetLeft( oltData, 20 + "Current Port. of LT Debt/Capital Leases".Length * 5 );

            // Total Long-Term Liabilities
            var tltl = new Label( );
            tltl.Content = "Total Long-Term Liabilities";
            tltl.FontSize = 10;
            canvas.Children.Add( tltl );
            Canvas.SetTop( tltl, 240);
            Canvas.SetLeft( tltl, 20 );
            var tltlData = new Label( );
            tltlData.FontSize = 10;
            // TODO: ADD
            // tltlData.Content = FormattedCurrencyString( bs.Total_Lo);
            canvas.Children.Add( tltlData );
            Canvas.SetTop( tltlData, 240 );
            Canvas.SetLeft( tltlData, 20 + "Current Port. of LT Debt/Capital Leases".Length * 5 );

            // Total Liabilities
            var tl = new Label( );
            tl.Content = "Total Liabilities";
            tl.FontSize = 10;
            canvas.Children.Add( tl );
            Canvas.SetTop( tl, 265 );
            Canvas.SetLeft( tl, 20 );
            var tlData = new Label( );
            tlData.Content = FormattedCurrencyString( bs.Total_Liabilities);
            tlData.FontSize = 10;
            canvas.Children.Add( tlData );
            Canvas.SetTop( tlData, 265 );
            Canvas.SetLeft( tlData, 20 + "Current Port. of LT Debt/Capital Leases".Length * 5 );

            return canvas;
        }
Exemplo n.º 4
0
        public Canvas BSAsset( BalanceSheet bs )
        {
            int maxLengthStr = "Property/Plant/Equipment, Total - Gross".Length * 5;

            // Assets
            var canvas = new Canvas( );
            canvas.Name = "bsAssets";
            var assets = new Label( );
            assets.Content = "Assets";
            canvas.Children.Add( assets );
            Canvas.SetLeft( assets, 0 );
            Canvas.SetTop( assets, 0 );
            assets.FontSize = 10;

            // Current Assets
            var currentAssets = new Label( );
            currentAssets.Content = "Current Assets";
            currentAssets.FontSize = 10;
            canvas.Children.Add( currentAssets);
            Canvas.SetLeft( currentAssets, 10 );
            Canvas.SetTop( currentAssets, 15 );

            // Cash & Equivalents
            var CashAndEquivalents = new Label( );
            CashAndEquivalents.Content = "Cash & Equivalents";
            CashAndEquivalents.FontSize = 10;
            canvas.Children.Add( CashAndEquivalents );
            Canvas.SetLeft( CashAndEquivalents, 20 );
            Canvas.SetTop( CashAndEquivalents, 30 );
            var CashAndEquivalentsData = new Label( );
            CashAndEquivalentsData.Content = FormattedCurrencyString( bs.Cash_and_Equivalents );
            CashAndEquivalentsData.FontSize = 10;
            canvas.Children.Add( CashAndEquivalentsData );
            Canvas.SetLeft( CashAndEquivalentsData, 20 + maxLengthStr );
            Canvas.SetTop( CashAndEquivalentsData, 30 );

            CashAndEquivalentsData.FontSize = 10;

            // Short Term Investments
            var ShortTermInvestments = new Label( );
            ShortTermInvestments.Content = "Short Term Investments";
            ShortTermInvestments.FontSize = 10;
            canvas.Children.Add( ShortTermInvestments );
            Canvas.SetLeft( ShortTermInvestments, 20 );
            Canvas.SetTop( ShortTermInvestments, 45 );
            var ShortTermInvestmentsData = new Label( );
            ShortTermInvestmentsData.Content = FormattedCurrencyString( bs.Short_Term_Investments );
            ShortTermInvestmentsData.FontSize = 10;
            canvas.Children.Add( ShortTermInvestmentsData );
            Canvas.SetLeft( ShortTermInvestmentsData, 20 + maxLengthStr );
            Canvas.SetTop( ShortTermInvestmentsData, 45 );

            ShortTermInvestmentsData.FontSize = 10;

            // Cash & Short Term Investments
            var CashShortTermInvestments = new Label( );
            CashShortTermInvestments.Content = "Cash & Short Term Investments";
            CashShortTermInvestments.FontSize = 10;
            canvas.Children.Add( CashShortTermInvestments );
            Canvas.SetLeft( CashShortTermInvestments, 10 );
            Canvas.SetTop( CashShortTermInvestments, 60 );
            var CashShortTermInvestmentsData = new Label( );
            CashShortTermInvestmentsData.Content = FormattedCurrencyString( bs.Cash_and_Short_Term_Investments );
            CashShortTermInvestmentsData.FontSize = 10;
            canvas.Children.Add( CashShortTermInvestmentsData );
            Canvas.SetLeft( CashShortTermInvestmentsData, 10 + maxLengthStr );
            Canvas.SetTop( CashShortTermInvestmentsData, 60 );

            // Accounts Receivable - Trade, Net
            var AccountsReceivableLessTrade = new Label( );
            AccountsReceivableLessTrade.Content = "Accounts Receivable - Trade, Net";
            AccountsReceivableLessTrade.FontSize = 10;
            canvas.Children.Add( AccountsReceivableLessTrade );
            Canvas.SetLeft( AccountsReceivableLessTrade, 10 );
            Canvas.SetTop( AccountsReceivableLessTrade, 75 );
            var AccountsReceivableLessTradeData = new Label( );
            AccountsReceivableLessTradeData.Content = FormattedCurrencyString( bs.Accounts_Receivable__Trade__Net );
            AccountsReceivableLessTradeData.FontSize = 10;
            canvas.Children.Add( AccountsReceivableLessTradeData );
            Canvas.SetLeft( AccountsReceivableLessTradeData, 10 + maxLengthStr );
            Canvas.SetTop( AccountsReceivableLessTradeData, 75 );

            // Receivables - Other
            var ReceivablesOther = new Label( );
            ReceivablesOther.Content = "Receivables - Other";
            ReceivablesOther.FontSize = 10;
            canvas.Children.Add( ReceivablesOther );
            Canvas.SetLeft( ReceivablesOther, 10 );
            Canvas.SetTop( ReceivablesOther, 90 );
            var ReceivablesOtherData = new Label( );
            ReceivablesOtherData.Content = FormattedCurrencyString( bs.Receivables__Other );
            ReceivablesOtherData.FontSize = 10;
            canvas.Children.Add( ReceivablesOtherData );
            Canvas.SetLeft( ReceivablesOtherData, 10 + maxLengthStr );
            Canvas.SetTop( ReceivablesOtherData, 90 );

            // Total Receivables, Net
            var TotalReceivablesOther = new Label( );
            TotalReceivablesOther.Content = "Total Receivables, Net";
            TotalReceivablesOther.FontSize = 10;
            canvas.Children.Add( TotalReceivablesOther );
            Canvas.SetLeft( TotalReceivablesOther, 10 );
            Canvas.SetTop( TotalReceivablesOther, 105 );
            var TotalReceivablesOtherData = new Label( );
            TotalReceivablesOtherData.Content = FormattedCurrencyString( bs.Total_Receivables__Net );
            TotalReceivablesOtherData.FontSize = 10;
            canvas.Children.Add( TotalReceivablesOtherData );
            Canvas.SetLeft( TotalReceivablesOtherData, 10 + maxLengthStr );
            Canvas.SetTop( TotalReceivablesOtherData, 105 );

            // Total Inventory
            var TotalInventory = new Label( );
            TotalInventory.Content = "Total Inventory";
            TotalInventory.FontSize = 10;
            canvas.Children.Add( TotalInventory );
            Canvas.SetLeft( TotalInventory, 10 );
            Canvas.SetTop( TotalInventory, 120 );
            var TotalInventoryData = new Label( );
            TotalInventoryData.Content = FormattedCurrencyString( bs.Total_Inventory );
            TotalInventoryData.FontSize = 10;
            canvas.Children.Add( TotalInventoryData );
            Canvas.SetLeft( TotalInventoryData, 10 + maxLengthStr );
            Canvas.SetTop( TotalInventoryData, 120 );

            // Prepaid Expenses
            var PrepaidExpenses = new Label( );
            PrepaidExpenses.Content = "Prepaid Expenses";
            PrepaidExpenses.FontSize = 10;
            canvas.Children.Add( PrepaidExpenses );
            Canvas.SetLeft( PrepaidExpenses, 10 );
            Canvas.SetTop( PrepaidExpenses, 135 );
            var PrepaidExpensesData = new Label( );
            PrepaidExpensesData.Content = FormattedCurrencyString( bs.Prepaid_Expenses );
            PrepaidExpensesData.FontSize = 10;
            canvas.Children.Add( PrepaidExpensesData );
            Canvas.SetLeft( PrepaidExpensesData, 10 + maxLengthStr );
            Canvas.SetTop( PrepaidExpensesData, 135 );

            // Other Current Assets, Total
            var OtherCurrentAssetsTotal = new Label( );
            OtherCurrentAssetsTotal.Content = "Other Current Assets, Total";
            OtherCurrentAssetsTotal.FontSize = 10;
            canvas.Children.Add( OtherCurrentAssetsTotal );
            Canvas.SetLeft( OtherCurrentAssetsTotal, 10 );
            Canvas.SetTop( OtherCurrentAssetsTotal, 150 );
            var OtherCurrentAssetsTotalData = new Label( );
            OtherCurrentAssetsTotalData.Content = FormattedCurrencyString( bs.Other_Current_Assets__Total );
            OtherCurrentAssetsTotalData.FontSize = 10;
            canvas.Children.Add( OtherCurrentAssetsTotalData );
            Canvas.SetLeft( OtherCurrentAssetsTotalData, 10 + maxLengthStr );
            Canvas.SetTop( OtherCurrentAssetsTotalData, 150 );

            // Total Current Assets
            var TotalCurrentAssets = new Label( );
            TotalCurrentAssets.Content = "Total Current Assets";
            TotalCurrentAssets.FontSize = 10;
            canvas.Children.Add( TotalCurrentAssets );
            Canvas.SetLeft( TotalCurrentAssets, 10 );
            Canvas.SetTop( TotalCurrentAssets, 165 );
            var TotalCurrentAssetsData = new Label( );
            TotalCurrentAssetsData.Content = FormattedCurrencyString( bs.Total_Current_Assets );
            TotalCurrentAssetsData.FontSize = 10;
            canvas.Children.Add( TotalCurrentAssetsData );
            Canvas.SetLeft( TotalCurrentAssetsData, 10 + maxLengthStr );
            Canvas.SetTop( TotalCurrentAssetsData, 165 );

            // Long-Term Assets
            var longTermAssets = new Label( );
            longTermAssets.Content = "Long-Term Assets";
            longTermAssets.FontSize = 10;
            canvas.Children.Add( longTermAssets );
            Canvas.SetLeft( longTermAssets, 10 );
            Canvas.SetTop( longTermAssets, 180 );

            // Property/Plant/Equipment, Total - Gross
            var PropertyPlantEquipment = new Label( );
            PropertyPlantEquipment.Content = "Property/Plant/Equipment, Total - Gross";
            PropertyPlantEquipment.FontSize = 10;
            canvas.Children.Add( PropertyPlantEquipment );
            Canvas.SetLeft( PropertyPlantEquipment, 10 );
            Canvas.SetTop( PropertyPlantEquipment, 195 );
            var PropertyPlantEquipmentData = new Label( );
            PropertyPlantEquipmentData.Content = FormattedCurrencyString( bs.Property_and_Plant_and_Equipment__Total__Gross);
            PropertyPlantEquipmentData.FontSize = 10;
            canvas.Children.Add( PropertyPlantEquipmentData );
            Canvas.SetLeft( PropertyPlantEquipmentData, 10 + maxLengthStr );
            Canvas.SetTop( PropertyPlantEquipmentData, 195 );

            // Accumulated Depreciation, Total
            var AccumuldatedDepreciation = new Label( );
            AccumuldatedDepreciation.Content = "Accumulated Depreciation, Total";
            AccumuldatedDepreciation.FontSize = 10;
            canvas.Children.Add( AccumuldatedDepreciation );
            Canvas.SetLeft( AccumuldatedDepreciation, 10 );
            Canvas.SetTop( AccumuldatedDepreciation, 210 );
            var AccumuldatedDepreciationData = new Label( );
            AccumuldatedDepreciationData.Content = FormattedCurrencyString( bs.Accumulated_Depreciation__Total );
            AccumuldatedDepreciationData.FontSize = 10;
            canvas.Children.Add( AccumuldatedDepreciationData );
            Canvas.SetLeft( AccumuldatedDepreciationData, 10 + maxLengthStr );
            Canvas.SetTop( AccumuldatedDepreciationData, 210 );

            // Goodwill, Net
            var Goodwill = new Label( );
            Goodwill.Content = "Goodwill, Net";
            Goodwill.FontSize = 10;
            canvas.Children.Add( Goodwill );
            Canvas.SetLeft( Goodwill, 10 );
            Canvas.SetTop( Goodwill, 225);
            var GoodwillData = new Label( );
            GoodwillData.Content = FormattedCurrencyString( bs.Goodwill__Net );
            GoodwillData.FontSize = 10;
            canvas.Children.Add( GoodwillData );
            Canvas.SetLeft( GoodwillData, 10 + maxLengthStr );
            Canvas.SetTop( GoodwillData, 225 );

            // Intangibles, Net
            var Intangibles = new Label( );
            Intangibles.Content = "Intangibles, Net";
            Intangibles.FontSize = 10;
            canvas.Children.Add( Intangibles );
            Canvas.SetLeft( Intangibles, 10 );
            Canvas.SetTop( Intangibles, 240 );
            var IntangiblesData = new Label( );
            IntangiblesData.Content = FormattedCurrencyString( bs.Intangibles__Net );
            IntangiblesData.FontSize = 10;
            canvas.Children.Add( IntangiblesData );
            Canvas.SetLeft( IntangiblesData, 10 + maxLengthStr );
            Canvas.SetTop( IntangiblesData, 240 );

            // Long Term Investments
            var LongTermInvestments = new Label( );
            LongTermInvestments.Content = "Long Term Investments";
            LongTermInvestments.FontSize = 10;
            canvas.Children.Add( LongTermInvestments );
            Canvas.SetLeft( LongTermInvestments, 10 );
            Canvas.SetTop( LongTermInvestments, 265 );
            var LongTermInvestmentsData = new Label( );
            LongTermInvestmentsData.Content = FormattedCurrencyString( bs.Long_Term_Investments );
            LongTermInvestmentsData.FontSize = 10;
            canvas.Children.Add( LongTermInvestmentsData );
            Canvas.SetLeft( LongTermInvestmentsData, 10 + maxLengthStr );
            Canvas.SetTop( LongTermInvestmentsData, 265 );

            // Other Long Term Assets, Total
            var OtherLongTermAssets = new Label( );
            OtherLongTermAssets.Content = "Other Long Term Assets, Total";
            OtherLongTermAssets.FontSize = 10;
            canvas.Children.Add( OtherLongTermAssets );
            Canvas.SetLeft( OtherLongTermAssets, 10 );
            Canvas.SetTop( OtherLongTermAssets, 280 );
            var OtherLongTermAssetsData = new Label( );
            OtherLongTermAssetsData.Content = FormattedCurrencyString( bs.Other_Long_Term_Assets__Total);
            OtherLongTermAssetsData.FontSize = 10;
            canvas.Children.Add( OtherLongTermAssetsData );
            Canvas.SetLeft( OtherLongTermAssetsData, 10 + maxLengthStr );
            Canvas.SetTop( OtherLongTermAssetsData, 280 );

            // Total Long-Term Assets
            var TotalLongTermAssets = new Label( );
            TotalLongTermAssets.Content = "Total Long-Term Assets";
            TotalLongTermAssets.FontSize = 10;
            canvas.Children.Add( TotalLongTermAssets );
            Canvas.SetLeft( TotalLongTermAssets, 10 );
            Canvas.SetTop( TotalLongTermAssets, 295 );
            var TotalLongTermAssetsData = new Label( );
            // TODO fix
            // TotalLongTermAssetsData.Content = FormattedCurrencyString( bs.Total );
            TotalLongTermAssetsData.FontSize = 10;
            canvas.Children.Add( TotalLongTermAssetsData );
            Canvas.SetLeft( TotalLongTermAssetsData, 10 + maxLengthStr );
            Canvas.SetTop( TotalLongTermAssetsData, 295);

            // Total Assets
            var TotalAssets = new Label( );
            TotalAssets.Content = "Total Assets";
            TotalAssets.FontSize = 10;
            canvas.Children.Add( TotalAssets );
            Canvas.SetLeft( TotalAssets, 10 );
            Canvas.SetTop( TotalAssets, 310 );
            var TotalAssetsData = new Label( );
            TotalAssetsData.Content = FormattedCurrencyString( bs.Total_Assets );
            TotalAssetsData.FontSize = 10;
            canvas.Children.Add( TotalAssetsData );
            Canvas.SetLeft( TotalAssetsData, 10 + maxLengthStr );
            Canvas.SetTop( TotalAssetsData, 310 );

            return canvas;
        }
Exemplo n.º 5
0
        public Canvas BSEquities( BalanceSheet bs )
        {
            var canvas = new Canvas( );
            canvas.Name = "bsEquity";
            int maxLengthString = "Shares Outs - Common Stock Primary Issue".Length * 5;
            // Equity
            var Equity = new Label( );
            Equity.Content = "Equity";
            Equity.FontSize = 10;
            canvas.Children.Add( Equity );
            Canvas.SetTop( Equity, 0 );
            Canvas.SetLeft( Equity, 0 );

            // Redeemable Preferred Stock, Total
            var rpst = new Label( );
            rpst.Content = "Redeemable Preferred Stock, Total";
            rpst.FontSize = 10;
            canvas.Children.Add( rpst );
            Canvas.SetTop( rpst, 15 );
            Canvas.SetLeft( rpst, 10 );
            var rpstData = new Label( );
            rpstData.FontSize = 10;
            rpstData.Content = FormattedCurrencyString( bs.Redeemable_Preferred_Stock__Total );
            canvas.Children.Add( rpstData );
            Canvas.SetTop( rpstData, 15 );
            Canvas.SetLeft( rpstData, 10 + maxLengthString );

            // Preferred Stock - Non Redeemable, Net
            var psnrn = new Label( );
            psnrn.Content = "Redeemable Preferred Stock, Total";
            psnrn.FontSize = 10;
            canvas.Children.Add( psnrn );
            Canvas.SetTop( psnrn, 30 );
            Canvas.SetLeft( psnrn, 10 );
            var psnrnData = new Label( );
            psnrnData.Content = FormattedCurrencyString( bs.Redeemable_Preferred_Stock__Total );
            psnrnData.FontSize = 10;
            canvas.Children.Add( psnrnData );
            Canvas.SetTop( psnrnData, 30 );
            Canvas.SetLeft( psnrnData, 10 + maxLengthString );

            // Common Stock, Total
            var cst = new Label( );
            cst.Content = "Common Stock, Total";
            cst.FontSize = 10;
            canvas.Children.Add( cst );
            Canvas.SetTop( cst, 45 );
            Canvas.SetLeft( cst, 10 );
            var cstData = new Label( );
            cstData.Content = FormattedCurrencyString( bs.Common_Stock__Total );
            cstData.FontSize = 10;
            canvas.Children.Add( cstData );
            Canvas.SetTop( cstData, 45 );
            Canvas.SetLeft( cstData, 10 + maxLengthString );

            // Additional Paid-In Capital
            var apic = new Label( );
            apic.Content = "Additional Paid-In Capital";
            apic.FontSize = 10;
            canvas.Children.Add( apic );
            Canvas.SetTop( apic, 60 );
            Canvas.SetLeft( apic, 10 );
            var apicData = new Label( );
            apicData.FontSize = 10;
            apicData.Content = FormattedCurrencyString( bs.Redeemable_Preferred_Stock__Total );
            canvas.Children.Add( apicData );
            Canvas.SetTop( apicData, 60 );
            Canvas.SetLeft( apicData, 10 + maxLengthString );

            // Retained Earnings (Accumulated Deficit)
            var read = new Label( );
            read.Content = "Retained Earnings (Accumulated Deficit)";
            read.FontSize = 10;
            canvas.Children.Add( read );
            Canvas.SetTop( read, 75 );
            Canvas.SetLeft( read, 10 );
            var readData = new Label( );
            readData.Content = FormattedCurrencyString( bs.Retained_Earnings__Accumulated_Deficit_ );
            readData.FontSize = 10;
            canvas.Children.Add( readData );
            Canvas.SetTop( readData, 75 );
            Canvas.SetLeft( readData, 10 + maxLengthString );

            // Treasury Stock - Common
            var tsc = new Label( );
            tsc.Content = "Treasury Stock - Common";
            tsc.FontSize = 10;
            canvas.Children.Add( tsc );
            Canvas.SetTop( tsc, 90 );
            Canvas.SetLeft( tsc, 10 );
            var tscData = new Label( );
            tscData.Content = FormattedCurrencyString( bs.Treasury_Stock__Common );
            tscData.FontSize = 10;
            canvas.Children.Add( tscData );
            Canvas.SetTop( tscData, 90 );
            Canvas.SetLeft( tscData, 10 + maxLengthString );

            // Other Equity, Total
            var oet = new Label( );
            oet.Content = "Other Equity, Total";
            oet.FontSize = 10;
            canvas.Children.Add( oet );
            Canvas.SetTop( oet, 105 );
            Canvas.SetLeft( oet, 10 );
            var oetData = new Label( );
            oetData.FontSize = 10;
            oetData.Content = FormattedCurrencyString( bs.Other_Equity__Total );
            canvas.Children.Add( oetData );
            Canvas.SetTop( oetData, 105 );
            Canvas.SetLeft( oetData, 10 + maxLengthString );

            // Total Equity
            var te = new Label( );
            te.Content = "Total Equity";
            te.FontSize = 10;
            canvas.Children.Add( te );
            Canvas.SetTop( te, 120 );
            Canvas.SetLeft( te, 10 );
            var teData = new Label( );
            teData.FontSize = 10;
            teData.Content = FormattedCurrencyString( bs.Total_Equity );
            canvas.Children.Add( teData );
            Canvas.SetTop( teData, 120 );
            Canvas.SetLeft( teData, 10 + maxLengthString );

            // Total Liabilities & Shareholders' Equity
            var tlse = new Label( );
            tlse.Content = "Total Liabilities & Shareholders' Equity";
            tlse.FontSize = 10;
            canvas.Children.Add( tlse );
            Canvas.SetTop( tlse, 135 );
            Canvas.SetLeft( tlse, 10 );
            var tlseData = new Label( );
            tlseData.FontSize = 10;
            tlseData.Content = FormattedCurrencyString( bs.Total_Liabilities_and_Shareholders_Equity );
            canvas.Children.Add( tlseData );
            Canvas.SetTop( tlseData, 135 );
            Canvas.SetLeft( tlseData, 10 + maxLengthString );

            // Shares Outs - Common Stock Primary Issue
            var socspi = new Label( );
            socspi.Content = "Shares Outs - Common Stock Primary Issue";
            socspi.FontSize = 10;
            canvas.Children.Add( socspi );
            Canvas.SetTop( socspi, 150 );
            Canvas.SetLeft( socspi, 10 );
            var socspiData = new Label( );
            socspiData.Content = FormattedCurrencyString( bs.Shares_Outs__Common_Stock_Primary_Issue );
            socspiData.FontSize = 10;
            canvas.Children.Add( socspiData );
            Canvas.SetTop( socspiData, 150 );
            Canvas.SetLeft( socspiData, 10 + maxLengthString );

            // Total Common Shares Outstanding
            var tcso = new Label( );
            tcso.Content = "Total Common Shares Outstanding";
            tcso.FontSize = 10;
            canvas.Children.Add( tcso );
            Canvas.SetTop( tcso, 165 );
            Canvas.SetLeft( tcso, 10 );
            var tcsoData = new Label( );
            tcsoData.FontSize = 10;
            tcsoData.Content = FormattedCurrencyString( bs.Total_Common_Shares_Outstanding );
            canvas.Children.Add( tcsoData );
            Canvas.SetTop( tcsoData, 165 );
            Canvas.SetLeft( tcsoData, 10 + maxLengthString );

            return canvas;
        }
Exemplo n.º 6
0
        static void CreateIndividualBalanceSheet( BalanceSheet bs )
        {
            string tabName = ( bs.Period == Period.Annual ? "A" : "Q" )
                             + "_" +  bs.PeriodEnd.ToShortDateString( ).Replace( "/", "_" );

            var ws = pck.Workbook.Worksheets.Add( tabName );

            ws.Cells [ 1, 1 ].Value = "Balance Sheet for " + ( bs.Period == Period.Annual ? " Year" : " Quarter" ) + " Ending " + bs.PeriodEnd.ToShortDateString( );
            ws.Cells [ "A1:H1" ].Merge = true;
            ws.Cells [ 3, 1 ].Value = "Assets";
            ws.Cells [ "A3:B3" ].Merge = true;

            // HEADERS
            ws.Cells [ 4, 1 ].Value = "Current Assets";
            ws.Cells [ 5, 1 ].Value = "Cash & Equivalents";
            ws.Cells [ 6, 1 ].Value = "Short Term Investments ";
            ws.Cells [ 7, 1 ].Value = "Accounts Receivable - Trade, Net";
            ws.Cells [ 8, 1 ].Value = "Receivables - Other";
            ws.Cells [ 9, 1 ].Value = "Total Inventory";
            ws.Cells [ 10, 1 ].Value = "Prepaid Expenses";
            ws.Cells [ 11, 1 ].Value = "Other Current Assets, Total";
            ws.Cells [ 12, 1 ].Value = "Total Current Assets";
            ws.Cells [ 13, 1 ].Value = "Long-Term Assets";
            ws.Cells [ 14, 1 ].Value = "Property/Plant/Equipment, Total - Gross";
            ws.Cells [ 15, 1 ].Value = "Goodwill, Net";
            ws.Cells [ 16, 1 ].Value = "Intangibles, Net";
            ws.Cells [ 17, 1 ].Value = "Long-Term Investments";
            ws.Cells [ 18, 1 ].Value = "Other Long Term Assets, Total";
            ws.Cells [   19 ,1].Value = "Total Long-Term Assets";
            ws.Cells [   20, 1 ].Value = "Total Assets";

            // VALUES
            ws.Cells [ 4, 2 ].Value = ""; // This a header--blank
            ws.Cells [ 5, 2 ].Value = bs.Cash_and_Equivalents;
            ws.Cells [ 6, 2 ].Value = bs.Short_Term_Investments;
            ws.Cells [ 7, 2 ].Value =  bs.Accounts_Receivable__Trade__Net; // "Accounts Receivable - Trade, Net";
            ws.Cells [ 8, 2 ].Value = bs.Receivables__Other; // "Receivables - Other";
            ws.Cells [ 9, 2 ].Value = bs.Total_Inventory; //"Total Inventory";
            ws.Cells [ 10, 2 ].Value = bs.Prepaid_Expenses; //"Prepaid Expenses";
            ws.Cells [ 11, 2 ].Value = bs.Other_Current_Assets__Total; //"Other Current Assets, Total";
            ws.Cells [ 12, 2 ].Value = bs.Total_Current_Assets; //"Total Current Assets";
            ws.Cells [ 13, 2 ].Value = "";  // This a header--blank //"Long-Term Assets";
            ws.Cells [ 14, 2 ].Value = bs.Property_and_Plant_and_Equipment__Total__Gross; //"Property/Plant/Equipment, Total - Gross";
            ws.Cells [ 15, 2 ].Value = bs.Goodwill__Net;  //"Goodwill, Net";
            ws.Cells [ 16, 2 ].Value = bs.Intangibles__Net; //"Intangibles, Net";
            ws.Cells [ 17, 2 ].Value = bs.Long_Term_Investments; //"Long-Term Investments";
            ws.Cells [ 18, 2 ].Value = bs.Other_Long_Term_Assets__Total; // "Other Long Term Assets, Total";
            ws.Cells [ 19, 2 ].Value = ""; // ??????? // "Total Long-Term Assets";
            ws.Cells [ 20, 2 ].Value = bs.Total_Assets; // "Total Assets";

            for ( int i = 4; i < 21; i++ )
                ws.Cells [ i, 2 ].Style.Numberformat.Format = "\"$\"#,##0;";

            ws.Cells [ "A3:B3" ].Style.Border.Top.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thick;
            ws.Cells [ "A3:A20" ].Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thick;
            ws.Cells [ "B3:B20" ].Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thick;
            ws.Cells [ "A20:B20" ].Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thick;

            ws.Cells [ 3, 4 ].Value  = "Liabilities";
            ws.Cells [ 4, 4 ].Value  = "Current Liabilities";
            ws.Cells [ 5, 4 ].Value  = "   Accounts Payable";
            ws.Cells [ 6, 4 ].Value  = "Accrued Expensess ";
            ws.Cells [ 7, 4 ].Value  = "   Notes Payable/Short-Term Debt";
            ws.Cells [ 8, 4 ].Value  = "   Current Port. Of LT Debt/Capital Leases";
            ws.Cells [ 9, 4 ].Value  = "   Other Current Liabilities, Total";
            ws.Cells [ 10, 4 ].Value = "   Total Current Liabilities";
            ws.Cells [ 11, 4 ].Value = "Long-Term Liabilities";
            ws.Cells [ 12, 4 ].Value = "   Long-Term Debt";
            ws.Cells [ 13, 4 ].Value = "   Capital Lease Obligations";
            ws.Cells [ 14, 4 ].Value = "   Total Long Term Debt";
            ws.Cells [ 15, 4 ].Value = "   Total Debt";
            ws.Cells [ 16, 4 ].Value = "   Deferred Income Tax";
            ws.Cells [ 17, 4 ].Value = "   Minority Interest";
            ws.Cells [ 18, 4 ].Value = "   Other Liabilities, Total";
            ws.Cells [ 19, 4 ].Value = "   Total Long-Term Liabilities";
            ws.Cells [ 20, 4 ].Value = "   Total Liabilities";

            ws.Cells [ 3, 5 ].Value = ""; // "Liabilities";
            ws.Cells [ 4, 5 ].Value =  ""; // "Current Liabilities";
            ws.Cells [ 5, 5 ].Value =  bs.Accounts_Payable; // "   Accounts Payable";
            ws.Cells [ 6, 5 ].Value =  bs.Accrued_Expenses; // "Accrued Expensess ";
            ws.Cells [ 7, 5 ].Value =  bs.Notes_Payable_and_Short_Term_Debt; // "   Notes Payable/Short-Term Debt";
            ws.Cells [ 8, 5 ].Value =  bs.Current_Port_of_LT_Debt_and_Capital_Leases; // "   Current Port. Of LT Debt/Capital Leases";
            ws.Cells [ 9, 5 ].Value =  bs.Other_Current_liabilities__Total; // "   Other Current Liabilities, Total";
            ws.Cells [ 10, 5 ].Value = bs.Total_Current_Liabilities; // "   Total Current Liabilities";
            ws.Cells [ 11, 5 ].Value =  ""; // "Long-Term Liabilities";
            ws.Cells [ 12, 5 ].Value =  bs.Long_Term_Debt; // "   Long-Term Debt";
            ws.Cells [ 13, 5 ].Value =  bs.Capital_Lease_Obligations; // "   Capital Lease Obligations";
            ws.Cells [ 14, 5 ].Value =  bs.Total_Long_Term_Debt; // "   Total Long Term Debt";
            ws.Cells [ 15, 5 ].Value =  bs.Total_Debt; // "   Total Debt";
            ws.Cells [ 16, 5 ].Value =  bs.Deferred_Income_Tax; // "   Deferred Income Tax";
            ws.Cells [ 17, 5 ].Value =  bs.Minority_Interest; // "   Minority Interest";
            ws.Cells [ 18, 5 ].Value =  bs.Other_Liabilities__Total; // "   Other Liabilities, Total";

            //ws.Cells [ 19, 5 ].Value; // TODO: Add 0 or nulls to prevent errors!

            /*

                ( bs.Capital_Lease_Obligations + bs.Total_Long_Term_Debt + bs.Total_Debt
                  + bs.Deferred_Income_Tax + bs.Minority_Interest + bs.Other_Liabilities__Total);// "   Total Long-Term Liabilities";
             */

            ws.Cells [ 20, 5 ].Value = bs.Total_Liabilities; // "   Total Liabilities";

            ws.Cells [ "D3:BE" ].Style.Border.Top.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thick;
            ws.Cells [ "D3:E20" ].Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thick;
            ws.Cells [ "D3:E20" ].Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thick;
            ws.Cells [ "D20:E20" ].Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thick;

            for ( int i = 4; i < 21; i++ )
                ws.Cells [ i, 5 ].Style.Numberformat.Format = "\"$\"#,##0.00;";

            ws.Cells [ 22, 1 ].Value = "Equity";
            ws.Cells [ 23, 1 ].Value = "Redeemable Preferred Stock, Total";
            ws.Cells [ 24, 1 ].Value = "   Preferred Stock Non-Redeemable, Net";
            ws.Cells [ 25, 1 ].Value = "Common Stock, Total";
            ws.Cells [ 26, 1 ].Value = "Additional Paid-in Capital";
            ws.Cells [ 27, 1 ].Value = "Retained Earnings (Accumulated Deficit)";
            ws.Cells [ 28, 1 ].Value = "Treasury Stock-Common";
            ws.Cells [ 29, 1 ].Value = "Other Equity, Total";
            ws.Cells [ 30, 1 ].Value = "Total Equity";
            ws.Cells [ 31, 1 ].Value = "Total Liabilities & Shareholders' Equity";
            ws.Cells [ 32, 1 ].Value = "Shares Out - Common Stock Primary Issue";
            ws.Cells [ 33, 1 ].Value = "Total Common Shares Outstanding";

            ws.Cells [ 22, 2 ].Value = "";// "Equity";
            ws.Cells [ 23, 2 ].Value = bs.Redeemable_Preferred_Stock__Total; // "Redeemable Preferred Stock, Total";
            ws.Cells [ 24, 2 ].Value = bs.Preferred_Stock__Non_Redeemable__Net; // "   Preferred Stock Non-Redeemable, Net";
            ws.Cells [ 25, 2 ].Value = bs.Common_Stock__Total; // "Common Stock, Total";
            ws.Cells [ 26, 2 ].Value = bs.Additional_PaidIn_Capital;// "Additional Paid-in Capital";
            ws.Cells [ 27, 2 ].Value = bs.Retained_Earnings__Accumulated_Deficit_; // "Retained Earnings (Accumulated Deficit)";
            ws.Cells [ 28, 2 ].Value = bs.Treasury_Stock__Common; // "Treasury Stock-Common";
            ws.Cells [ 29, 2 ].Value = bs.Other_Equity__Total; // "Other Equity, Total";
            ws.Cells [ 30, 2 ].Value = bs.Total_Equity; // "Total Equity";
            ws.Cells [ 31, 2 ].Value = bs.Total_Liabilities_and_Shareholders_Equity;// "Total Liabilities & Shareholders' Equity";
            ws.Cells [ 32, 2 ].Value = bs.Shares_Outs__Common_Stock_Primary_Issue; // "Shares Out - Common Stock Primary Issue";
            ws.Cells [ 33, 2 ].Value = bs.Total_Common_Shares_Outstanding;  // "Total Common Shares Outstanding";

            ws.Cells [ "A22:B22" ].Style.Border.Top.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thick;
            ws.Cells [ "A22:A33" ].Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thick;
            ws.Cells [ "B22:B33" ].Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thick;
            ws.Cells [ "A33:B33" ].Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thick;

            /*

            for ( int i = 22; i < 34; i++ )
                ws.Cells [ i, 2 ].Style.Numberformat.Format = "\"$\"#,##0;";
            */
        }