Add "Don't notify customer" option to Record Payment modal

Adds SuppressNotification to RecordPaymentDto and a checkbox to the
modal. When checked, the payment is fully recorded but NotifyPaymentReceivedAsync
is skipped — useful for historical imports or cases where the customer
should not receive an email.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-16 18:12:25 -04:00
parent eb8fc8b6d0
commit deb248b2a6
3 changed files with 17 additions and 7 deletions
@@ -1335,14 +1335,17 @@ public class InvoicesController : Controller
}); // end ExecuteInTransactionAsync
// Notify (non-blocking)
try
// Notify (non-blocking) — skipped if user explicitly suppressed it
if (!dto.SuppressNotification)
{
await _notificationService.NotifyPaymentReceivedAsync(invoice, payment);
}
catch (Exception notifyEx)
{
_logger.LogWarning(notifyEx, "Payment recorded but notification failed");
try
{
await _notificationService.NotifyPaymentReceivedAsync(invoice, payment);
}
catch (Exception notifyEx)
{
_logger.LogWarning(notifyEx, "Payment recorded but notification failed");
}
}