This commit is contained in:
2020-12-30 14:44:38 +00:00
parent 76114cfe2f
commit 974bf331da

View File

@@ -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;
}
}
}