Fix: iOS Modal scrollIntoView bei Tastatur; CSV Stornierte mit 0€ + Stornonummer (SW by-v975)
This commit is contained in:
parent
2bbf3bc3f6
commit
cabb2fd6f7
6 changed files with 38 additions and 19 deletions
|
|
@ -3,7 +3,7 @@
|
|||
Router, State-Management, Navigation, Initialisierung.
|
||||
============================================================ */
|
||||
|
||||
const APP_VER = '974'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
|
||||
const APP_VER = '975'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
|
||||
const APP_VERSION = '1.6.0'; // ← semantische Version, wird bei make release gesetzt
|
||||
const IS_STAGING = location.hostname === 'staging.banyaro.app';
|
||||
// Cache-Bust-Parameter nach Update-Reload sofort entfernen
|
||||
|
|
|
|||
|
|
@ -4355,15 +4355,21 @@ window.Page_admin = (() => {
|
|||
const fmtDate = iso => iso ? new Date(iso).toLocaleDateString('de-DE') : '';
|
||||
const escape = v => `"${String(v || '').replace(/"/g, '""')}"`;
|
||||
|
||||
const header = 'Nummer;Empfaenger;E-Mail;Rechnungsdatum;Leistungszeitraum;Nettobetrag;Bruttobetrag;Eingegangener Betrag;Status;Versendet am;Zahlungseingang\n';
|
||||
const csvRows = data.invoices.map(inv =>
|
||||
[inv.invoice_number, inv.recipient_name, inv.recipient_email || '',
|
||||
fmtDate(inv.created_at), inv.service_period || '',
|
||||
fmtEur(inv.amount_net), fmtEur(inv.amount_gross),
|
||||
inv.paid_amount != null ? fmtEur(inv.paid_amount) : '',
|
||||
inv.status, fmtDate(inv.sent_at), fmtDate(inv.paid_at)
|
||||
].map(escape).join(';')
|
||||
).join('\n');
|
||||
const header = 'Nummer;Stornonummer;Empfaenger;E-Mail;Rechnungsdatum;Leistungszeitraum;Nettobetrag;Bruttobetrag;Eingegangener Betrag;Status;Versendet am;Zahlungseingang\n';
|
||||
const csvRows = data.invoices.map(inv => {
|
||||
const cancelled = inv.status === 'cancelled';
|
||||
return [
|
||||
inv.invoice_number,
|
||||
inv.cancellation_number || '',
|
||||
inv.recipient_name, inv.recipient_email || '',
|
||||
fmtDate(inv.created_at), inv.service_period || '',
|
||||
cancelled ? '0.00' : fmtEur(inv.amount_net),
|
||||
cancelled ? '0.00' : fmtEur(inv.amount_gross),
|
||||
cancelled ? '0.00' : (inv.paid_amount != null ? fmtEur(inv.paid_amount) : ''),
|
||||
cancelled ? 'Storniert' : inv.status,
|
||||
fmtDate(inv.sent_at), fmtDate(inv.paid_at)
|
||||
].map(escape).join(';');
|
||||
}).join('\n');
|
||||
|
||||
const blob = new Blob(['' + header + csvRows], { type: 'text/csv;charset=utf-8;' });
|
||||
const url = URL.createObjectURL(blob);
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ const UI = (() => {
|
|||
document.getElementById('modal-container').appendChild(overlay);
|
||||
document.documentElement.classList.add('modal-open');
|
||||
|
||||
// Tastatur auf Mobilgeräten: Modal nach oben schieben wenn Keyboard erscheint
|
||||
// Tastatur auf Mobilgeräten: Modal nach oben schieben + fokussiertes Feld einblenden
|
||||
let _vvCleanup = null;
|
||||
const vv = window.visualViewport;
|
||||
if (vv) {
|
||||
|
|
@ -100,16 +100,26 @@ const UI = (() => {
|
|||
};
|
||||
}
|
||||
|
||||
_current = { overlay, onClose, _vvCleanup };
|
||||
// Fokussiertes Feld in den sichtbaren Bereich scrollen (iOS)
|
||||
const _onFocusin = e => {
|
||||
const el = e.target;
|
||||
if (el.tagName === 'INPUT' || el.tagName === 'TEXTAREA' || el.tagName === 'SELECT') {
|
||||
setTimeout(() => el.scrollIntoView({ block: 'nearest', behavior: 'smooth' }), 320);
|
||||
}
|
||||
};
|
||||
overlay.addEventListener('focusin', _onFocusin);
|
||||
|
||||
_current = { overlay, onClose, _vvCleanup, _onFocusin };
|
||||
|
||||
return overlay.querySelector('.modal');
|
||||
}
|
||||
|
||||
function close() {
|
||||
if (!_current) return;
|
||||
const { onClose, _vvCleanup } = _current;
|
||||
const { onClose, _vvCleanup, _onFocusin } = _current;
|
||||
onClose?.();
|
||||
_vvCleanup?.();
|
||||
if (_onFocusin) _current.overlay.removeEventListener('focusin', _onFocusin);
|
||||
_current.overlay.remove();
|
||||
document.documentElement.classList.remove('modal-open');
|
||||
_current = null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue