From 974bf331dafdc901c72e42f0034f2428b3e57d6b Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 30 Dec 2020 14:44:38 +0000 Subject: [PATCH] --- source/Plugins/AyaNova.Plugin.V8/V8.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/Plugins/AyaNova.Plugin.V8/V8.cs b/source/Plugins/AyaNova.Plugin.V8/V8.cs index 775c497..3bab705 100644 --- a/source/Plugins/AyaNova.Plugin.V8/V8.cs +++ b/source/Plugins/AyaNova.Plugin.V8/V8.cs @@ -2439,6 +2439,7 @@ namespace AyaNova.PlugIn.V8 //foreach (ServiceBankListRI.ServiceBankListRIInfo i in pl) //for (int x = 0; x < pl.Count; x++) //list is backwards order most recent first + bool FirstEntry = true; for (int x = pl.Count-1; x > -1; x--) { @@ -2477,9 +2478,9 @@ namespace AyaNova.PlugIn.V8 d.hours = i.LT_ServiceBank_Label_Hours; d.hoursBalance = i.LT_ServiceBank_Label_HoursBalance; //Last values - if (x > 0) + if (!FirstEntry) { - ServiceBankListRI.ServiceBankListRIInfo iLast = pl[x - 1]; + ServiceBankListRI.ServiceBankListRIInfo iLast = pl[x + 1]; d.lastEntryDate = util.DateToV8(iLast.LT_ServiceBank_Label_Created); d.lastIncidentsBalance = iLast.LT_ServiceBank_Label_IncidentsBalance; d.lastCurrencyBalance = iLast.LT_ServiceBank_Label_CurrencyBalance; @@ -2496,7 +2497,7 @@ namespace AyaNova.PlugIn.V8 //Event log fixup ServiceBank sb = ServiceBank.GetItem(i.LT_ServiceBank_Label_ID); await util.EventLog(util.AyaType.ServiceBank, RavenId, SafeGetUserMap(sb.Creator), SafeGetUserMap(sb.Creator), sb.Created, sb.Created); - + FirstEntry = false; } } }