diff --git a/Site/Pages/v5/Ledgers/EndOfMonth.aspx b/Site/Pages/v5/Ledgers/EndOfMonth.aspx index e1aa9a36..2d9c0b00 100644 --- a/Site/Pages/v5/Ledgers/EndOfMonth.aspx +++ b/Site/Pages/v5/Ledgers/EndOfMonth.aspx @@ -130,14 +130,15 @@ $(this).addClass('action-list-item-disabled'); var groupId = $(this).attr('data-group'); + var itemId = $(this).attr('data-item'); + $('img.action-icon[data-item="' + itemId + '"]').hide(); + $('img.status-icon-completed[data-item="' + itemId + '"]').fadeIn(); + + var selector = ".action-list-item:not(.action-list-item-disabled)[data-group='" + groupId + "']"; - console.log(selector); - var groupActionsRemaining = $(selector); - console.log(groupActionsRemaining); - if (groupActionsRemaining.length == 0) // no further actions in this group enabled + if ($(selector).length == 0) // no further actions in this group enabled { // mark the group as completed - console.log("marking as completed"); $(".group-status-icon[data-group='" + groupId + "']").fadeIn(); } }); diff --git a/Site/Pages/v5/Ledgers/EndOfMonth.aspx.cs b/Site/Pages/v5/Ledgers/EndOfMonth.aspx.cs index 4fe85643..d4ce7366 100644 --- a/Site/Pages/v5/Ledgers/EndOfMonth.aspx.cs +++ b/Site/Pages/v5/Ledgers/EndOfMonth.aspx.cs @@ -64,18 +64,25 @@ namespace Swarmops.Frontend.Pages.Ledgers get { StringBuilder builder = new StringBuilder(16384); + string previousGroupId = string.Empty; foreach (EomItemGroup group in ItemGroups) { if (group.Items.Count > 0) { + string previousGroupIdData = string.Empty; + if (!string.IsNullOrEmpty(previousGroupId)) + { + previousGroupIdData = " data-previous-group='" + previousGroupId + "'"; + } + // Group header builder.Append(@" $('#TableEomItems').datagrid('appendRow', { - itemGroupName: '" + group.Header.Replace(" ", " ").Replace("'", "''") + @"', - action: """", + itemGroupName: '" + group.Header.Replace(" ", " ").Replace("'", "''") + @"', + action: """", itemId: '" + group.Id + @"' }); @@ -94,11 +101,13 @@ namespace Swarmops.Frontend.Pages.Ledgers { builder.Append(@" $('#TableEomItems').datagrid('appendRow', " + '{' + @" - itemName: """ + item.Name + @""", - action: """" + itemName: """ + item.Name + @""", + action: """" }); "); } + + previousGroupId = group.Id; // only set if group has items } }