diff --git a/Site/Automation/Json-MasterPersonEditPaymentHistory.aspx.cs b/Site/Automation/Json-MasterPersonEditPaymentHistory.aspx.cs index c9d68f2c..53f4ba61 100644 --- a/Site/Automation/Json-MasterPersonEditPaymentHistory.aspx.cs +++ b/Site/Automation/Json-MasterPersonEditPaymentHistory.aspx.cs @@ -166,9 +166,9 @@ namespace Swarmops.Frontend.Automation newItem.PaidToPerson = payout.AmountCents; newItem.OpenedDate = payout.CreatedDateTime; - FinancialTransaction closeTx = payout.FinancialTransaction; - if (closeTx != null) + if (!payout.Open) { + FinancialTransaction closeTx = payout.FinancialTransaction; newItem.ClosedDate = closeTx.DateTime; } @@ -187,7 +187,7 @@ namespace Swarmops.Frontend.Automation { result.Append("{"); result.AppendFormat( - "\"id\":\"{0}\",\"name\":\"{1}\",\"description\":\"{2}\",\"opened\":\"{3}\",\"owedToPerson\":\"{4}\",\"paidToPerson\":\"{5}\",\"closed\":\"{6}\"", + "\"id\":\"{0}\",\"name\":\"{1}\",\"description\":\"{2}\",\"opened\":\"{3}\",\"owedToPerson\":\"{4}\",\"paidToPerson\":\"{5}\",\"closed\":\"{6}\"", JsonSanitize(item.Id), JsonSanitize(item.Name), JsonSanitize(item.Description), @@ -247,7 +247,7 @@ namespace Swarmops.Frontend.Automation } return String.Format( - "\"id\":\"Footer\",\"name\":\"{0}\",\"description\":\"{1}\",\"owedToPerson\":\"{2}\",\"paidToPerson\":\"{3}\"", + "\"id\":\"Footer\",\"name\":\"{0}\",\"description\":\"{1}\",\"owedToPerson\":\"{2}\",\"paidToPerson\":\"{3}\"", JsonSanitize(Resources.Global.Financial_CurrentBalance), JsonSanitize(summary), currentBalance == 0 ? Resources.Global.Financial_Zero : currentBalance > 0 ? (currentBalance / 100.0).ToString("N2") : string.Empty,