diff --git a/MoneyMap/Pages/Index.cshtml b/MoneyMap/Pages/Index.cshtml index e8c9a87..6d8efc7 100644 --- a/MoneyMap/Pages/Index.cshtml +++ b/MoneyMap/Pages/Index.cshtml @@ -111,16 +111,17 @@ Amount Category Card + Action @foreach (var t in Model.Recent) { - + @t.Date.ToString("yyyy-MM-dd")
- @t.Name + @t.Name @if (t.ReceiptCount > 0) { @@ -142,9 +143,12 @@ } @t.CardLabel + + Open + }
- \ No newline at end of file + diff --git a/MoneyMap/Pages/Index.cshtml.cs b/MoneyMap/Pages/Index.cshtml.cs index cb162fa..7d52af5 100644 --- a/MoneyMap/Pages/Index.cshtml.cs +++ b/MoneyMap/Pages/Index.cshtml.cs @@ -50,6 +50,7 @@ namespace MoneyMap.Pages public class RecentTxnRow { + public long Id { get; set; } public DateTime Date { get; set; } public string Name { get; set; } = ""; public string Memo { get; set; } = ""; @@ -230,12 +231,14 @@ namespace MoneyMap.Pages .ThenByDescending(t => t.Id) .Select(t => new IndexModel.RecentTxnRow { + Id = t.Id, Date = t.Date, Name = t.Name, Memo = t.Memo, Amount = t.Amount, Category = t.Category ?? "", - CardLabel = t.PaymentMethodLabel + CardLabel = t.PaymentMethodLabel, + ReceiptCount = t.Receipts.Count() }) .Take(count) .AsNoTracking() @@ -262,4 +265,4 @@ namespace MoneyMap.Pages public required List TopCategories { get; init; } public required List RecentTransactions { get; init; } } -} \ No newline at end of file +}