Esempio n. 1
0
        private static void MakeAccounts(AccountingDb db, string name)
        {
            var b = MakeBusiness(db, name);

            db.BusinessId = b.Id;

            var ba = new m.Account(name, m.Account.Default)
            {
                IsSummaryAccount = true
            };

            var a = new m.Account("Assets", ba, "Tangible and intangible items that the company owns that have value.")
            {
                IsSummaryAccount = true, Type = m.AccountType.Asset
            };
            var l = new m.Account("Liabilities", ba, "Money that the company owes to others.")
            {
                IsSummaryAccount = true, Type = m.AccountType.Liability
            };
            var q = new m.Account("Equity", ba, "That portion of the total assets that the owners or stockholders of the company fully own; have paid for outright.")
            {
                IsSummaryAccount = true, Type = m.AccountType.Equity
            };
            var r = new m.Account("Revenues", ba, "Money the company earns from its sales of products or services, and interest and dividends earned from marketable securities.")
            {
                IsSummaryAccount = true, Type = m.AccountType.Revenue
            };
            var x = new m.Account("Expences", ba, "Money the company spends to produce the goods or services that it sells.")
            {
                IsSummaryAccount = true, Type = m.AccountType.Expence
            };

            db.Accounts.AddRange(a, l, q, r, x);

            var ca = new m.Account("Current Assets", a)
            {
                IsSummaryAccount = true
            };
            var bk = new m.Account("Bank Accounts", ca)
            {
                IsSummaryAccount = true
            };

            for (int i = 0; i < 4; i++)
            {
                db.Accounts.Add(new m.Account($"Bank account #{i + 1}", bk));
            }
            foreach (string s in new [] { "Cash on hand", "Petty Cash", "Debtors", "Stock on hand" })
            {
                db.Accounts.Add(new m.Account(s, ca));
            }

            b.Detail.ABN = 2498345633;
            b.Detail.ACN = 98345633;
            db.SaveChanges();
        }
Esempio n. 2
0
        static s.Account MapTransport(m.Account data)
        {
            var res = new s.Account
            {
                Id               = data.Id,
                Name             = data.Name,
                Description      = data.Description,
                AccountNumber    = data.AccountNumber,
                IsSummaryAccount = data.IsSummaryAccount,
                Type             = data.Type.ToString(),
                ParentId         = data.ParentId,
                Direction        = data.Direction
            };

            return(res);
        }