Added notifications to expense claim creation, attestation, validation

This commit is contained in:
Rick Falkvinge
2013-11-12 21:49:46 +00:00
parent e19c490e9e
commit 7f9f43be3c
5 changed files with 170 additions and 1 deletions
@@ -81,6 +81,24 @@ namespace Swarmops.Logic.App_GlobalResources {
}
}
/// <summary>
/// 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..
/// </summary>
internal static string ExpenseClaim_Attested_Body {
get {
return ResourceManager.GetString("ExpenseClaim_Attested_Body", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to [OrganizationName] Expense Claim Attested: [CurrencyCode] [BudgetAmountFloat].
/// </summary>
internal static string ExpenseClaim_Attested_Subject {
get {
return ResourceManager.GetString("ExpenseClaim_Attested_Subject", resourceCulture);
}
}
/// <summary>
/// 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 {
}
}
/// <summary>
/// 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..
/// </summary>
internal static string ExpenseClaim_Deattested_Body {
get {
return ResourceManager.GetString("ExpenseClaim_Deattested_Body", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to [OrganizationName] Expense Claim DE-attested: [CurrencyCode] [BudgetAmountFloat].
/// </summary>
internal static string ExpenseClaim_Deattested_Subject {
get {
return ResourceManager.GetString("ExpenseClaim_Deattested_Subject", resourceCulture);
}
}
/// <summary>
/// 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..
/// </summary>
internal static string ExpenseClaim_Denied_Body {
get {
return ResourceManager.GetString("ExpenseClaim_Denied_Body", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to [OrganizationName] Expense Claim DENIED: [CurrencyCode] [BudgetAmountFloat].
/// </summary>
internal static string ExpenseClaim_Denied_Subject {
get {
return ResourceManager.GetString("ExpenseClaim_Denied_Subject", resourceCulture);
}
}
/// <summary>
/// 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&apos;t hear from record keepers in short time on this matter, do follow up with them..
/// </summary>
internal static string ExpenseClaim_Devalidated_Body {
get {
return ResourceManager.GetString("ExpenseClaim_Devalidated_Body", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to [OrganizationName] Expense Claim Receipts DE-validated: [CurrencyCode] [BudgetAmountFloat].
/// </summary>
internal static string ExpenseClaim_Devalidated_Subject {
get {
return ResourceManager.GetString("ExpenseClaim_Devalidated_Subject", resourceCulture);
}
}
/// <summary>
/// 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..
/// </summary>
internal static string ExpenseClaim_Validated_Body {
get {
return ResourceManager.GetString("ExpenseClaim_Validated_Body", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to [OrganizationName] Expense Claim Receipts Validated: [CurrencyCode] [BudgetAmountFloat].
/// </summary>
internal static string ExpenseClaim_Validated_Subject {
get {
return ResourceManager.GetString("ExpenseClaim_Validated_Subject", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to An unhandled exception was thrown in Swarmops:
///
@@ -121,18 +121,60 @@
<value>[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.</value>
<comment>This is sent to the budget owner(s) only.</comment>
</data>
<data name="CashAdvance_Requested_Subject" xml:space="preserve">
<value>[OrganizationName] Cash Advance Requested: [CurrencyCode] [BudgetAmountFloat]</value>
</data>
<data name="ExpenseClaim_Attested_Body" xml:space="preserve">
<value>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.</value>
<comment>This is sent to the claimer.</comment>
</data>
<data name="ExpenseClaim_Attested_Subject" xml:space="preserve">
<value>[OrganizationName] Expense Claim Attested: [CurrencyCode] [BudgetAmountFloat]</value>
</data>
<data name="ExpenseClaim_Created_Body" xml:space="preserve">
<value>[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.</value>
<comment>This is sent to the budget owner(s)only.</comment>
</data>
<data name="ExpenseClaim_Created_Subject" xml:space="preserve">
<value>[OrganizationName] Expense Claim Created: [CurrencyCode] [BudgetAmountFloat]</value>
</data>
<data name="ExpenseClaim_Deattested_Body" xml:space="preserve">
<value>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.</value>
<comment>This is sent to the claimer.</comment>
</data>
<data name="ExpenseClaim_Deattested_Subject" xml:space="preserve">
<value>[OrganizationName] Expense Claim DE-attested: [CurrencyCode] [BudgetAmountFloat]</value>
</data>
<data name="ExpenseClaim_Denied_Body" xml:space="preserve">
<value>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.</value>
<comment>This is sent to the claimer.</comment>
</data>
<data name="ExpenseClaim_Denied_Subject" xml:space="preserve">
<value>[OrganizationName] Expense Claim DENIED: [CurrencyCode] [BudgetAmountFloat]</value>
</data>
<data name="ExpenseClaim_Devalidated_Body" xml:space="preserve">
<value>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.</value>
</data>
<data name="ExpenseClaim_Devalidated_Subject" xml:space="preserve">
<value>[OrganizationName] Expense Claim Receipts DE-validated: [CurrencyCode] [BudgetAmountFloat]</value>
</data>
<data name="ExpenseClaim_Validated_Body" xml:space="preserve">
<value>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.</value>
<comment>This is sent to the claimer.</comment>
</data>
<data name="ExpenseClaim_Validated_Subject" xml:space="preserve">
<value>[OrganizationName] Expense Claim Receipts Validated: [CurrencyCode] [BudgetAmountFloat]</value>
</data>
<data name="System_Exception_Body" xml:space="preserve">
<value>An unhandled exception was thrown in Swarmops:
+24 -1
View File
@@ -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; }
@@ -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
}
+5
View File
@@ -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