From 71aa07e60f7c9ae9ed76c08e9948967db3646cca Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Fri, 23 Jan 2015 19:20:25 +0100 Subject: [PATCH] Account Plan enhancements 3 --- Site5/Pages/v5/Ledgers/AccountPlan.aspx.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Site5/Pages/v5/Ledgers/AccountPlan.aspx.cs b/Site5/Pages/v5/Ledgers/AccountPlan.aspx.cs index 2b8dcc97..3bed1a3f 100644 --- a/Site5/Pages/v5/Ledgers/AccountPlan.aspx.cs +++ b/Site5/Pages/v5/Ledgers/AccountPlan.aspx.cs @@ -390,13 +390,15 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers account.SetBudgetCents (DateTime.Today.Year, newSingleBudget); - // Once we've set the budget, also update the "yearly result" budget + // Once we've set the budget, also update the "yearly result" budget. + // This will be the WRONG SIGN for a P&L budget, but much better for display purposes (positive result is a profit, negative a loss). + // Will need to compensate for this in a future budget vs. actuals display. int thisYear = DateTime.UtcNow.Year; FinancialAccounts allProfitLossAccounts = FinancialAccounts.ForOrganization(authData.CurrentOrganization); Int64 newProfitLossProjection = allProfitLossAccounts.Where(queryAccount => queryAccount.Identity != authData.CurrentOrganization.FinancialAccounts.CostsYearlyResult.Identity).Sum(queryAccount => queryAccount.GetBudgetCents(thisYear)); - authData.CurrentOrganization.FinancialAccounts.CostsYearlyResult.SetBudgetCents(thisYear, -newProfitLossProjection); + authData.CurrentOrganization.FinancialAccounts.CostsYearlyResult.SetBudgetCents(thisYear, newProfitLossProjection); return new ChangeAccountDataResult {