From 766259e157ac38e5f2a8f9ad15dbcae08fc9f05a Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Sun, 24 Feb 2019 13:18:23 +0100 Subject: [PATCH] Fix for org-specific IDs --- Logic/Financial/Payouts.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Logic/Financial/Payouts.cs b/Logic/Financial/Payouts.cs index 80db1d43..fed8e185 100644 --- a/Logic/Financial/Payouts.cs +++ b/Logic/Financial/Payouts.cs @@ -146,11 +146,13 @@ namespace Swarmops.Logic.Financial { Int64 newAmountCents = 0; List claimIds = new List(); + List claimSequenceIds = new List(); foreach (ExpenseClaim claim in payout.DependentExpenseClaims) { newAmountCents += claim.AmountCents; claimIds.Add (claim.Identity); + claimSequenceIds.Add(claim.OrganizationSequenceId); } foreach (CashAdvance previousAdvance in payout.DependentCashAdvancesPayback) @@ -173,7 +175,7 @@ namespace Swarmops.Logic.Financial { claimIds.Sort(); payout.Reference = "[Loc]Financial_ExpenseClaimsSpecification" + lessAdvancesIndicator + "|" + - Formatting.GenerateRangeString (claimIds); + Formatting.GenerateRangeString (claimSequenceIds); } // Finally, add the payout to the result list if and only if the resulting debt less cash advances @@ -234,11 +236,13 @@ namespace Swarmops.Logic.Financial { Int64 newAmountCents = 0; List advanceIds = new List(); + List advanceSequenceIds = new List(); foreach (CashAdvance advance in payout.DependentCashAdvancesPayout) { newAmountCents += advance.AmountCents; advanceIds.Add (advance.Identity); + advanceSequenceIds.Add(advance.OrganizationSequenceId); } payout.AmountCents = newAmountCents; @@ -250,9 +254,9 @@ namespace Swarmops.Logic.Financial } else { - advanceIds.Sort(); + advanceSequenceIds.Sort(); payout.Reference = "[Loc]Financial_CashAdvancesSpecification|" + - Formatting.GenerateRangeString (advanceIds); + Formatting.GenerateRangeString (advanceSequenceIds); } if (newAmountCents > 0)