diff --git a/Site5/Pages/v5/Ledgers/InspectLedgers.aspx b/Site5/Pages/v5/Ledgers/InspectLedgers.aspx index f10db9ab..c58d42fb 100644 --- a/Site5/Pages/v5/Ledgers/InspectLedgers.aspx +++ b/Site5/Pages/v5/Ledgers/InspectLedgers.aspx @@ -249,6 +249,8 @@ var canWriteRows = ; var canAuditTx = ; + var ledgersClosedUntil = ; + var currentYear = 0; diff --git a/Site5/Pages/v5/Ledgers/InspectLedgers.aspx.cs b/Site5/Pages/v5/Ledgers/InspectLedgers.aspx.cs index 59e6401f..b2ecc72c 100644 --- a/Site5/Pages/v5/Ledgers/InspectLedgers.aspx.cs +++ b/Site5/Pages/v5/Ledgers/InspectLedgers.aspx.cs @@ -10,6 +10,7 @@ using Swarmops.Common.Enums; using Swarmops.Common.Interfaces; using Swarmops.Logic.Financial; using Swarmops.Logic.Security; +using Swarmops.Logic.Structure; using Swarmops.Logic.Support; namespace Swarmops.Frontend.Pages.v5.Ledgers @@ -120,6 +121,8 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers (CurrentUser.HasAccess(new Access(CurrentOrganization, AccessAspect.BookkeepingDetails, AccessType.Read))) ? "true" : "false"; + + this.LiteralLedgersClosedUntil.Text = CurrentOrganization.Parameters.FiscalBooksClosedUntilYear.ToString(); } [WebMethod] @@ -135,6 +138,12 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers } FinancialTransaction transaction = FinancialTransaction.FromIdentity(txId); + + if (authData.CurrentOrganization.Parameters.FiscalBooksClosedUntilYear >= transaction.DateTime.Year) + { + return false; // can't edit closed books + } + FinancialAccount account = FinancialAccount.FromIdentity(accountId); Double amountFloat = Double.Parse(amountString);