Buchungskalender: Abgleich – G22/K33-Platzhalter
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
74543b75c3
commit
e5793fd151
6 files changed
+15
-10
No files matched your search
@@ -111,6 +111,7 @@ export function renderMail(id, values = {}, blocks = {}) {
|
||||
.replace(/\{\{(\w+)\}\}/g, (_, key) => escapeHtml(valueOf(key)).replace(/\r?\n/g, '<br>'))
|
||||
// Anrede ohne bekannten Namen
|
||||
.replace(/Guten Tag ,/g, 'Guten Tag,')
|
||||
.replace(/Hallo ,/g, 'Hallo,')
|
||||
|
||||
const subject = template.subject
|
||||
.replace(/\{\{(\w+)\}\}/g, (_, key) => valueOf(key))
|
||||
|
||||
@@ -23,8 +23,8 @@ import { leereCache } from './kontext.js'
|
||||
const TAG_MS = 24 * 60 * 60 * 1000
|
||||
const STANDARD_DECKEL = 500
|
||||
const SEITE = 100
|
||||
const ANONYM_JAHRE = 3
|
||||
const RECHNUNG_JAHRE = 8
|
||||
const ANONYM_JAHRE = () => config.unterkunft.anonymisierenJahre ?? 3
|
||||
const RECHNUNG_JAHRE = () => config.unterkunft.rechnungJahre ?? 8
|
||||
const MARKER = 'Buchungsdaten gelöscht am '
|
||||
const MARKER_RE = /Buchungsdaten gelöscht am (\d{4}-\d{2}-\d{2})/
|
||||
const ANFRAGE_ANONYM = { gast: {}, nachrichtVermieter: '', ipHash: '' }
|
||||
@@ -175,7 +175,7 @@ export async function anonymisiere(now, { deckel = config.unterkunft.aufbewahrun
|
||||
[Query.equal('status', ['gebucht', 'bezahlt', 'storniert'])],
|
||||
['status', 'rechnungId', 'anonymisiertAt', 'bis'],
|
||||
// Abreisejahr Y: faellig, sobald das Berliner Jahr >= Y + 3 + 1 ist (3 Jahre nach Ende des Jahres Y)
|
||||
(d) => !d.anonymisiertAt && gueltigerTag(d.bis) && gebuchtJahr >= jahrVon(d.bis) + ANONYM_JAHRE + 1 && (d.status !== 'storniert' || hatRechnung(d)),
|
||||
(d) => !d.anonymisiertAt && gueltigerTag(d.bis) && gebuchtJahr >= jahrVon(d.bis) + ANONYM_JAHRE() + 1 && (d.status !== 'storniert' || hatRechnung(d)),
|
||||
rest,
|
||||
)
|
||||
await bearbeite('anonymisieren', gebucht, async (d) => {
|
||||
@@ -190,7 +190,7 @@ export async function anonymisiere(now, { deckel = config.unterkunft.aufbewahrun
|
||||
await schritt('rechnungen', async () => {
|
||||
const jahr = jahrVon(heute(new Date(nowMs)))
|
||||
const RE = config.collections.ukRechnungen
|
||||
const faellig = (r) => gueltigerTag(r.datum) && jahr >= jahrVon(r.datum) + RECHNUNG_JAHRE + 1
|
||||
const faellig = (r) => gueltigerTag(r.datum) && jahr >= jahrVon(r.datum) + RECHNUNG_JAHRE() + 1
|
||||
const gefunden = await sammle(RE, [], ['anfrageId', 'datum'], faellig, rest)
|
||||
if (gefunden.gedeckelt) erg.gedeckelt = true
|
||||
const erledigt = new Set()
|
||||
|
||||
@@ -95,7 +95,7 @@ export async function anGast(art, ctx, anfrage, extra = {}) {
|
||||
const blocks = {}
|
||||
let anhang = null
|
||||
|
||||
if (art !== 'G16' && art !== 'G18' && art !== 'G21' && art !== 'G20') values.stornobedingungen = await stornoText(anfrage)
|
||||
if (art !== 'G16' && art !== 'G18' && art !== 'G21' && art !== 'G20' && art !== 'G22') values.stornobedingungen = await stornoText(anfrage)
|
||||
if (art === 'G17' || art === 'G19' || art === 'G20') values.gesamt = formatEuro(anfrage.summen?.bruttoCent ?? 0)
|
||||
if (art === 'G17' || art === 'G19') values.posten_text = postenText(anfrage.posten)
|
||||
if (art === 'G17') {
|
||||
@@ -164,6 +164,7 @@ export async function anVermieter(template, ctx, values = {}) {
|
||||
zahlart_text: ZAHLART[anfrage.zahlart] ?? LEER,
|
||||
})
|
||||
}
|
||||
if (!anfrage) vorgabe.kunde_name = text(ctx?.kundeName) || (await kundenName(ctx))
|
||||
const alle = { portal_url: portalUrl(ctx), ...vorgabe, ...eigene }
|
||||
if (template === 'T22') {
|
||||
const r = await sendAdminNotice({ template, values: nurPlatzhalter(template, alle) })
|
||||
|
||||
Reference in new issue
Block a user