예제 #1
0
        // Get Value Sum by account types
        public void AccountTypeValues()
        {
            System.Collections.Generic.List <Balance> records = new System.Collections.Generic.List <Balance>();

            records.Add(new Balance()
            {
                Book      = 20,
                Entry     = 1,
                Account   = 200,
                Name      = "Commissions Payable",
                RightSide = true,
                Type      = "Liability",
                Debit     = null,
                Credit    = 700
            });
            records.Add(new Balance()
            {
                Book      = 20,
                Entry     = 1,
                Account   = 200,
                Name      = "Taxes Payable",
                RightSide = true,
                Type      = "Liability",
                Debit     = null,
                Credit    = 50
            });

            Assert.AreEqual(750, Balance.AccountTypeValue(records, "Liability"));
        }
예제 #2
0
        public static void Main(string[] args)
        {
            var profile = new Profile();

            // For each database connection enabled in Profile, execute the same application code
            foreach (var database in Databases(profile))
            {
                Console.WriteLine($"{database.Type}\t\t{database.SchemaVersion()}");
#if DEBUG
                // Sample database agnostic objects classes and function calls
                // Objects
                var individual = new Individual(database, 3);
                if (individual.FullName != null)
                {
                    Console.WriteLine($"Author: {individual.FullName}");
                }

                // Database Functions
                Console.WriteLine(database.Book("Sale", 111.11F));

                Console.WriteLine(
                    Balance.AccountTypeValue(
                        database.BookBalance("Sale", 111.11F),
                        "Income"
                        )
                    );
#endif
            }
        }
예제 #3
0
        // Get Value by account type from BookBalance result
        public void AccountTypeValue()
        {
            System.Collections.Generic.List <Balance> records = new System.Collections.Generic.List <Balance>();

            // BookBalance('Sale Jane Doe', 1000) results
            records.Add(new Balance()
            {
                Book      = 20,
                Entry     = 1,
                Account   = 100,
                Name      = "Cash",
                RightSide = false,
                Type      = "Asset",
                Debit     = 15050,
                Credit    = 10300
            });
            records.Add(new Balance()
            {
                Book      = 20,
                Entry     = 1,
                Account   = 102,
                Name      = "Sales",
                RightSide = true,
                Type      = "Income",
                Debit     = null,
                Credit    = 3300
            });
            records.Add(new Balance()
            {
                Book      = 20,
                Entry     = 1,
                Account   = 200,
                Name      = "Commissions Payable",
                RightSide = true,
                Type      = "Liability",
                Debit     = null,
                Credit    = 750
            });

            Assert.AreEqual(4750, Balance.AccountTypeValue(records, "Asset"));
            Assert.AreEqual(3300, Balance.AccountTypeValue(records, "Income"));
            Assert.AreEqual(750, Balance.AccountTypeValue(records, "Liability"));
        }