From 5fd612b5bdfab2de2a71be5f2544be93dfe8f7a3 Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Tue, 29 Jan 2019 12:14:01 +0100 Subject: [PATCH] Work on Payment History --- .../Json-MasterPersonEditPaymentHistory.aspx.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Site/Automation/Json-MasterPersonEditPaymentHistory.aspx.cs b/Site/Automation/Json-MasterPersonEditPaymentHistory.aspx.cs index 0f3600b5..83cd866f 100644 --- a/Site/Automation/Json-MasterPersonEditPaymentHistory.aspx.cs +++ b/Site/Automation/Json-MasterPersonEditPaymentHistory.aspx.cs @@ -6,6 +6,7 @@ using System.Text; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; +using Swarmops.Common; using Swarmops.Logic.Financial; using Swarmops.Logic.Swarm; @@ -89,11 +90,11 @@ namespace Swarmops.Frontend.Automation "\"id\":\"{0}\",\"name\":\"{1}\",\"description\":\"{2}\",\"opened\":\"{3}\",\"owedToPerson\":\"{4}\",\"paidToPerson\":\"{5}\",\"closed\":\"{6}\"", JsonSanitize(item.Id), JsonSanitize(item.Name), - item.OpenedDate.ToString("yyyy-MMM-dd"), JsonSanitize(item.Description), + item.OpenedDate > Constants.DateTimeLowThreshold? item.OpenedDate.ToString("yyyy-MMM-dd") : string.Empty, item.OwedToPerson > 0 ? (item.OwedToPerson/100.0).ToString("N2") : string.Empty, string.Empty, - item.ClosedDate.ToString("yyyy-MMM-dd") + item.ClosedDate < Constants.DateTimeHighThreshold? item.ClosedDate.ToString("yyyy-MMM-dd"): string.Empty ); @@ -113,6 +114,12 @@ public string JsonWriteFooter(List items) public class PaymentHistoryLineItem { + public PaymentHistoryLineItem() + { + this.OpenedDate = Constants.DateTimeLow; + this.ClosedDate = Constants.DateTimeHigh; + } + public string Id { get; set; } public string Name { get; set; } public string Description { get; set; }