/**
 * public/js/invoice-confirm.js
 * Ersetzt onsubmit="return confirm(...)" in offenen Rechnungen (CSP-sicher)
 */
document.addEventListener('DOMContentLoaded', function () {
  document.querySelectorAll('.js-confirm-pay, .js-confirm-cancel').forEach(function (form) {
    form.addEventListener('submit', function (e) {
      const msg = form.dataset.msg || 'Wirklich fortfahren?';
      if (!confirm(msg)) e.preventDefault();
    });
  });
});
