Bugfix for database replication topology in Organization.EnableEconomy()

This commit is contained in:
Rick Falkvinge
2012-11-24 20:58:38 +00:00
parent 2514c9a245
commit 6f10e5ee89
2 changed files with 10 additions and 4 deletions
+9 -3
View File
@@ -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
+1 -1
View File
@@ -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,