From 656b3c3a6e463861fbd90f9b9aa1d5dc074262ed Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Tue, 29 Jan 2019 19:39:20 +0100 Subject: [PATCH] Work on Payment History --- .../Json-MasterPersonEditPaymentHistory.aspx.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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,