diff --git a/Logic/Structure/Organization.cs b/Logic/Structure/Organization.cs index cea6f18f..56995ec6 100644 --- a/Logic/Structure/Organization.cs +++ b/Logic/Structure/Organization.cs @@ -197,12 +197,18 @@ namespace Activizr.Logic.Structure FinancialAccount.Create(this.Identity, "Taxes Due", FinancialAccountType.Debt, 0); FinancialAccounts[OrganizationFinancialAccountType.DebtsVat] = FinancialAccount.Create(this.Identity, "Outbound Value Added Tax", FinancialAccountType.Debt, 0); - FinancialAccounts[OrganizationFinancialAccountType.IncomeGeneral] = + + FinancialAccount incomeGeneral = FinancialAccount.Create(this.Identity, "Income", FinancialAccountType.Income, 0); + + // We need to store this in code because of database lag replication issues when creating children - + // we can't use assume that it's available for reading yet. + + FinancialAccounts[OrganizationFinancialAccountType.IncomeGeneral] = incomeGeneral; FinancialAccounts[OrganizationFinancialAccountType.IncomeDonations] = - FinancialAccount.Create(this.Identity, "Donations", FinancialAccountType.Income, FinancialAccounts.IncomeGeneral.Identity); + FinancialAccount.Create(this.Identity, "Donations", FinancialAccountType.Income, incomeGeneral.Identity); FinancialAccounts[OrganizationFinancialAccountType.IncomeSales] = - FinancialAccount.Create(this.Identity, "Sales", FinancialAccountType.Income, FinancialAccounts.IncomeGeneral.Identity); + FinancialAccount.Create(this.Identity, "Sales", FinancialAccountType.Income, incomeGeneral.Identity); // Then, create various cost accounts that are probably needed, or that could be used as a starting point diff --git a/Site5/Pages/v5/Init/Default.aspx.cs b/Site5/Pages/v5/Init/Default.aspx.cs index 0cf2fd9f..f453489d 100644 --- a/Site5/Pages/v5/Init/Default.aspx.cs +++ b/Site5/Pages/v5/Init/Default.aspx.cs @@ -529,7 +529,7 @@ public partial class Pages_v5_Init_Default : System.Web.UI.Page rootGeographyId, true, true, 0).EnableEconomy(); - // Create the + // TEMP - delete this later Activizr.Logic.Structure.Organization.Create(0, "Europirate Academy", "Europirate Academy", "Pirate Academy", "pirateacademy.eu", "Academy", rootGeographyId, true,