Fast-forwarding to some features of build 860 to find mystery bug; adding things incrementally from here

This commit is contained in:
Rick Falkvinge
2015-03-04 22:41:49 +01:00
parent bdc3fb61b4
commit c2af713d19
2 changed files with 11 additions and 0 deletions
@@ -249,6 +249,8 @@
var canWriteRows = <asp:Literal ID="LiteralWriteAccess" runat="server" />;
var canAuditTx = <asp:Literal ID="LiteralAuditAccess" runat="server" />;
var ledgersClosedUntil = <asp:Literal ID="LiteralLedgersClosedUntil" runat="server" />;
var currentYear = 0;
</script>
@@ -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);