diff --git a/Logic/App_GlobalResources/Logic.Communications.Transmission.NotificationPayload.Designer.cs b/Logic/App_GlobalResources/Logic.Communications.Transmission.NotificationPayload.Designer.cs index 78c48ba5..93dd43ed 100644 --- a/Logic/App_GlobalResources/Logic.Communications.Transmission.NotificationPayload.Designer.cs +++ b/Logic/App_GlobalResources/Logic.Communications.Transmission.NotificationPayload.Designer.cs @@ -81,6 +81,24 @@ namespace Swarmops.Logic.App_GlobalResources { } } + /// + /// Looks up a localized string similar to Your expense claim with [OrganizationName] for [CurrencyCode] [BudgetAmountFloat], concerning [RequestPurpose], has been attested by the budget owner. It will be paid out to you when the receipts are confirmed valid.. + /// + internal static string ExpenseClaim_Attested_Body { + get { + return ResourceManager.GetString("ExpenseClaim_Attested_Body", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [OrganizationName] Expense Claim Attested: [CurrencyCode] [BudgetAmountFloat]. + /// + internal static string ExpenseClaim_Attested_Subject { + get { + return ResourceManager.GetString("ExpenseClaim_Attested_Subject", resourceCulture); + } + } + /// /// Looks up a localized string similar to [ConcernedPersonName] has created an expense claim against the budget of [BudgetName] for the amount of [CurrencyCode] [BudgetAmountFloat]. The claim concerns [RequestPurpose]. You will need to attest this expense claim. /// @@ -101,6 +119,84 @@ namespace Swarmops.Logic.App_GlobalResources { } } + /// + /// Looks up a localized string similar to Your expense claim with [OrganizationName] for [CurrencyCode] [BudgetAmountFloat], concerning [RequestPurpose], has been DE-attested by the budget owner. This usually indicates some sort of problem with your expense claim. + /// + ///Expect more communication from the budget owner to follow on the matter.. + /// + internal static string ExpenseClaim_Deattested_Body { + get { + return ResourceManager.GetString("ExpenseClaim_Deattested_Body", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [OrganizationName] Expense Claim DE-attested: [CurrencyCode] [BudgetAmountFloat]. + /// + internal static string ExpenseClaim_Deattested_Subject { + get { + return ResourceManager.GetString("ExpenseClaim_Deattested_Subject", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Your expense claim with [OrganizationName] for [CurrencyCode] [BudgetAmountFloat] concerning [RequestPurpose] has been denied. Expect more communications to follow on what you need to do to file a proper expense claim.. + /// + internal static string ExpenseClaim_Denied_Body { + get { + return ResourceManager.GetString("ExpenseClaim_Denied_Body", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [OrganizationName] Expense Claim DENIED: [CurrencyCode] [BudgetAmountFloat]. + /// + internal static string ExpenseClaim_Denied_Subject { + get { + return ResourceManager.GetString("ExpenseClaim_Denied_Subject", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The receipts for your expense claim with [OrganizationName] for [CurrencyCode] [BudgetAmountFloat], concerning [RequestPurpose], have been DE-validated by the financial record keepers of the organization. This usually indicates some sort of problem with the documentation of your expense claim. + /// + ///Expect more communication to follow on the matter. If you don't hear from record keepers in short time on this matter, do follow up with them.. + /// + internal static string ExpenseClaim_Devalidated_Body { + get { + return ResourceManager.GetString("ExpenseClaim_Devalidated_Body", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [OrganizationName] Expense Claim Receipts DE-validated: [CurrencyCode] [BudgetAmountFloat]. + /// + internal static string ExpenseClaim_Devalidated_Subject { + get { + return ResourceManager.GetString("ExpenseClaim_Devalidated_Subject", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The receipts for your expense claim with [OrganizationName] for [CurrencyCode] [BudgetAmountFloat], concerning [RequestPurpose], have been validated by people responsible for keeping the records in order. + /// + ///The claim will be paid out to you when the amount has also been attested by the budget owner.. + /// + internal static string ExpenseClaim_Validated_Body { + get { + return ResourceManager.GetString("ExpenseClaim_Validated_Body", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [OrganizationName] Expense Claim Receipts Validated: [CurrencyCode] [BudgetAmountFloat]. + /// + internal static string ExpenseClaim_Validated_Subject { + get { + return ResourceManager.GetString("ExpenseClaim_Validated_Subject", resourceCulture); + } + } + /// /// Looks up a localized string similar to An unhandled exception was thrown in Swarmops: /// diff --git a/Logic/App_GlobalResources/Logic.Communications.Transmission.NotificationPayload.resx b/Logic/App_GlobalResources/Logic.Communications.Transmission.NotificationPayload.resx index 82d75ce1..e54d0b98 100644 --- a/Logic/App_GlobalResources/Logic.Communications.Transmission.NotificationPayload.resx +++ b/Logic/App_GlobalResources/Logic.Communications.Transmission.NotificationPayload.resx @@ -121,18 +121,60 @@ [ConcernedPersonName] has requested a cash advance of [CurrencyCode] [BudgetAmountFloat] for the purpose of [RequestReason]. This money is part of your budget, [BudgetName]. Please log on to Swarmops at [SystemUrl] to attest or deny. + This is sent to the budget owner(s) only. [OrganizationName] Cash Advance Requested: [CurrencyCode] [BudgetAmountFloat] + + Your expense claim with [OrganizationName] for [CurrencyCode] [BudgetAmountFloat], concerning [RequestPurpose], has been attested by the budget owner. It will be paid out to you when the receipts are confirmed valid. + This is sent to the claimer. + + + [OrganizationName] Expense Claim Attested: [CurrencyCode] [BudgetAmountFloat] + [ConcernedPersonName] has created an expense claim against the budget of [BudgetName] for the amount of [CurrencyCode] [BudgetAmountFloat]. The claim concerns [RequestPurpose]. You will need to attest this expense claim. Please log on to Swarmops at [SystemUrl] to attest or deny. + This is sent to the budget owner(s)only. [OrganizationName] Expense Claim Created: [CurrencyCode] [BudgetAmountFloat] + + Your expense claim with [OrganizationName] for [CurrencyCode] [BudgetAmountFloat], concerning [RequestPurpose], has been DE-attested by the budget owner. This usually indicates some sort of problem with your expense claim. + +Expect more communication from the budget owner to follow on the matter. + This is sent to the claimer. + + + [OrganizationName] Expense Claim DE-attested: [CurrencyCode] [BudgetAmountFloat] + + + Your expense claim with [OrganizationName] for [CurrencyCode] [BudgetAmountFloat] concerning [RequestPurpose] has been denied. Expect more communications to follow on what you need to do to file a proper expense claim. + This is sent to the claimer. + + + [OrganizationName] Expense Claim DENIED: [CurrencyCode] [BudgetAmountFloat] + + + The receipts for your expense claim with [OrganizationName] for [CurrencyCode] [BudgetAmountFloat], concerning [RequestPurpose], have been DE-validated by the financial record keepers of the organization. This usually indicates some sort of problem with the documentation of your expense claim. + +Expect more communication to follow on the matter. If you don't hear from record keepers in short time on this matter, do follow up with them. + + + [OrganizationName] Expense Claim Receipts DE-validated: [CurrencyCode] [BudgetAmountFloat] + + + The receipts for your expense claim with [OrganizationName] for [CurrencyCode] [BudgetAmountFloat], concerning [RequestPurpose], have been validated by people responsible for keeping the records in order. + +The claim will be paid out to you when the amount has also been attested by the budget owner. + This is sent to the claimer. + + + [OrganizationName] Expense Claim Receipts Validated: [CurrencyCode] [BudgetAmountFloat] + An unhandled exception was thrown in Swarmops: diff --git a/Logic/Communications/OutboundComm.cs b/Logic/Communications/OutboundComm.cs index 66c62d11..30e5973e 100644 --- a/Logic/Communications/OutboundComm.cs +++ b/Logic/Communications/OutboundComm.cs @@ -95,7 +95,7 @@ namespace Swarmops.Logic.Communications } - public static OutboundComm CreateNotificationForAttest (FinancialAccount budget, Person concernedPerson, double amountRequested, string purpose, NotificationResource notification) + public static OutboundComm CreateNotificationForAttest(FinancialAccount budget, Person concernedPerson, double amountRequested, string purpose, NotificationResource notification) { NotificationPayload payload = new NotificationPayload(notification.ToString()); payload.Strings[NotificationString.CurrencyCode] = budget.Organization.Currency.Code; @@ -125,6 +125,29 @@ namespace Swarmops.Logic.Communications } + public static OutboundComm CreateNotificationOfFinancialValidation(FinancialAccount budget, Person concernedPerson, double amountRequested, string purpose, NotificationResource notification) + { + NotificationPayload payload = new NotificationPayload(notification.ToString()); + payload.Strings[NotificationString.CurrencyCode] = budget.Organization.Currency.Code; + payload.Strings[NotificationString.OrganizationName] = budget.Organization.Name; + payload.Strings[NotificationString.BudgetAmountFloat] = amountRequested.ToString(CultureInfo.InvariantCulture); + payload.Strings[NotificationString.RequestReason] = purpose; + payload.Strings[NotificationString.BudgetName] = budget.Name; + payload.Strings[NotificationString.ConcernedPersonName] = concernedPerson.Canonical; + + OutboundComm comm = OutboundComm.Create(null, null, budget.Organization, CommResolverClass.Unknown, null, + CommTransmitterClass.CommsTransmitterMail, + new PayloadEnvelope(payload).ToXml(), + OutboundCommPriority.Low); + + comm.AddRecipient(concernedPerson); + + comm.Resolved = true; + + return comm; + + } + public new bool Resolved { get { return base.Resolved; } diff --git a/Logic/Communications/Transmission/NotificationPayload.cs b/Logic/Communications/Transmission/NotificationPayload.cs index 583cd9a7..7005ebdb 100644 --- a/Logic/Communications/Transmission/NotificationPayload.cs +++ b/Logic/Communications/Transmission/NotificationPayload.cs @@ -93,7 +93,10 @@ namespace Swarmops.Logic.Communications.Transmission CashAdvance_Attested, ExpenseClaim_Created, ExpenseClaim_Attested, + ExpenseClaim_Deattested, ExpenseClaim_Validated, + ExpenseClaim_Devalidated, + ExpenseClaim_Denied, Payout_Settled } diff --git a/Logic/Financial/ExpenseClaim.cs b/Logic/Financial/ExpenseClaim.cs index b85acecd..1be05e52 100644 --- a/Logic/Financial/ExpenseClaim.cs +++ b/Logic/Financial/ExpenseClaim.cs @@ -430,6 +430,9 @@ namespace Swarmops.Logic.Financial FinancialDependencyType.ExpenseClaim, this.Identity, DateTime.Now, attester.Identity, (double) this.Amount); base.Attested = true; + + OutboundComm.CreateNotificationOfFinancialValidation(this.Budget, this.Claimer, (double)this.AmountCents/100.0, this.Description, NotificationResource.ExpenseClaim_Attested); + } public void Deattest(Person deattester) @@ -439,6 +442,8 @@ namespace Swarmops.Logic.Financial FinancialDependencyType.ExpenseClaim, this.Identity, DateTime.Now, deattester.Identity, (double) this.Amount); base.Attested = false; + + OutboundComm.CreateNotificationOfFinancialValidation(this.Budget, this.Claimer, (double)this.AmountCents / 100.0, this.Description, NotificationResource.ExpenseClaim_Deattested); } #endregion