From c4c01ce8c685edf7a68b03797b72d297c2ed8794 Mon Sep 17 00:00:00 2001 From: AJ Date: Sun, 12 Oct 2025 15:37:10 -0400 Subject: [PATCH] Extend bill date range to include 5 days after due date MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated both auto-mapping and manual mapping logic to search for transactions from bill date to due date + 5 days. This accounts for auto-pay processing delays, weekends, and bank processing times when bills are auto-paid on the due date. This fixes the issue where electric bills and other auto-paid utilities were missing their matching transactions because the payment posted a few days after the due date. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- MoneyMap/Pages/Receipts.cshtml | 4 ++-- MoneyMap/Pages/Receipts.cshtml.cs | 5 +++-- MoneyMap/Services/ReceiptAutoMapper.cs | 5 +++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/MoneyMap/Pages/Receipts.cshtml b/MoneyMap/Pages/Receipts.cshtml index 2a4940e..72f140d 100644 --- a/MoneyMap/Pages/Receipts.cshtml +++ b/MoneyMap/Pages/Receipts.cshtml @@ -304,7 +304,7 @@
@if (r.ReceiptDate.HasValue && r.DueDate.HasValue) { - Showing transactions between bill date (@r.ReceiptDate.Value.ToString("yyyy-MM-dd")) and due date (@r.DueDate.Value.ToString("yyyy-MM-dd")). + Showing transactions between bill date (@r.ReceiptDate.Value.ToString("yyyy-MM-dd")) and 5 days after due date (@r.DueDate.Value.AddDays(5).ToString("yyyy-MM-dd")). } else if (r.ReceiptDate.HasValue) { @@ -384,7 +384,7 @@ No matching transactions found. @if (r.ReceiptDate.HasValue && r.DueDate.HasValue) { - Try searching between @r.ReceiptDate.Value.ToString("yyyy-MM-dd") and @r.DueDate.Value.ToString("yyyy-MM-dd"). + Try searching between @r.ReceiptDate.Value.ToString("yyyy-MM-dd") and @r.DueDate.Value.AddDays(5).ToString("yyyy-MM-dd"). } else if (r.ReceiptDate.HasValue) { diff --git a/MoneyMap/Pages/Receipts.cshtml.cs b/MoneyMap/Pages/Receipts.cshtml.cs index c397426..0e6043d 100644 --- a/MoneyMap/Pages/Receipts.cshtml.cs +++ b/MoneyMap/Pages/Receipts.cshtml.cs @@ -236,9 +236,10 @@ namespace MoneyMap.Pages // If receipt has a date, filter by date range if (receipt.ReceiptDate.HasValue && receipt.DueDate.HasValue) { - // For bills with due dates: use range from bill date to due date + // For bills with due dates: use range from bill date to due date + 5 days + // (to account for auto-pay processing delays, weekends, etc.) var minDate = receipt.ReceiptDate.Value; - var maxDate = receipt.DueDate.Value; + var maxDate = receipt.DueDate.Value.AddDays(5); query = query.Where(t => t.Date >= minDate && t.Date <= maxDate); } else if (receipt.ReceiptDate.HasValue) diff --git a/MoneyMap/Services/ReceiptAutoMapper.cs b/MoneyMap/Services/ReceiptAutoMapper.cs index 1d1aaeb..ab558b8 100644 --- a/MoneyMap/Services/ReceiptAutoMapper.cs +++ b/MoneyMap/Services/ReceiptAutoMapper.cs @@ -99,9 +99,10 @@ namespace MoneyMap.Services // Start with date range filter if (receipt.ReceiptDate.HasValue && receipt.DueDate.HasValue) { - // For bills with due dates: use range from bill date to due date + // For bills with due dates: use range from bill date to due date + 5 days + // (to account for auto-pay processing delays, weekends, etc.) var minDate = receipt.ReceiptDate.Value; - var maxDate = receipt.DueDate.Value; + var maxDate = receipt.DueDate.Value.AddDays(5); query = query.Where(t => t.Date >= minDate && t.Date <= maxDate); } else if (receipt.ReceiptDate.HasValue)