Ugly hack to solve temporary PPSE problem
This commit is contained in:
@@ -96,7 +96,14 @@ namespace Swarmops.Logic.Financial
|
||||
|
||||
public static Payout FromIdentity (int payoutId)
|
||||
{
|
||||
return FromBasic(SwarmDb.GetDatabaseForReading().GetPayout(payoutId));
|
||||
try
|
||||
{
|
||||
return FromBasic(SwarmDb.GetDatabaseForReading().GetPayout(payoutId));
|
||||
}
|
||||
catch (ArgumentException e)
|
||||
{
|
||||
throw new InvalidOperationException(String.Format("Error loading Payout #{0}", payoutId), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -633,7 +640,7 @@ namespace Swarmops.Logic.Financial
|
||||
foreach (CashAdvance advance in this.DependentCashAdvancesPayout)
|
||||
{
|
||||
advance.PaidOut = false;
|
||||
advance.Open = true;
|
||||
advance.Open = true; // BUG: Why is this here? Isn't the cash advance open until repaid?
|
||||
}
|
||||
|
||||
foreach (InboundInvoice invoice in this.DependentInvoices)
|
||||
|
||||
@@ -373,7 +373,20 @@ namespace Swarmops.Logic.Financial
|
||||
|
||||
foreach (Payout payout in payouts)
|
||||
{
|
||||
if (payout.ExpectedTransactionDate >= timeLow && payout.ExpectedTransactionDate <= timeHigh && payout.AmountCents == -transaction.Rows.AmountCentsTotal)
|
||||
// Ugly hack to fix cash advance payouts
|
||||
|
||||
DateTime payoutLowerTimeLimit = timeLow;
|
||||
DateTime payoutUpperTimeLimit = timeHigh;
|
||||
|
||||
if (payout.AmountCents == -transaction.Rows.AmountCentsTotal && (payout.DependentCashAdvancesPayout.Count > 0 || payout.DependentCashAdvancesPayback.Count > 0))
|
||||
{
|
||||
// HACK: While PW5 doesn't have a manual-debug interface, special case for cash advances
|
||||
|
||||
payoutLowerTimeLimit = transaction.DateTime.AddDays(-60);
|
||||
payoutUpperTimeLimit = transaction.DateTime.AddDays(60);
|
||||
}
|
||||
|
||||
if (payout.ExpectedTransactionDate >= payoutLowerTimeLimit && payout.ExpectedTransactionDate <= payoutUpperTimeLimit && payout.AmountCents == -transaction.Rows.AmountCentsTotal)
|
||||
{
|
||||
// Console.WriteLine(" - - payout #{0} matches ({1}, {2:yyyy-MM-dd})", payout.Identity, payout.Recipient, payout.ExpectedTransactionDate);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user