pdf erstellung aufhrbung der 50 Personen Grenze
This commit is contained in:
+12
-4
@@ -275,7 +275,8 @@ function saas_fetch_tenant_settings(PDO $pdo, int $tenantId): ?array
|
||||
ts.sheet_window_days,
|
||||
ts.negative_warning_cents,
|
||||
ts.pdf_show_empty_rows,
|
||||
ts.pdf_split_mode
|
||||
ts.pdf_split_mode,
|
||||
ts.pdf_row_height_px
|
||||
FROM tenants t
|
||||
LEFT JOIN tenant_settings ts ON ts.tenant_id = t.id
|
||||
WHERE t.id = ?
|
||||
@@ -310,6 +311,7 @@ function saas_fetch_tenant_settings(PDO $pdo, int $tenantId): ?array
|
||||
'negative_warning_cents' => (int)$settings['negative_warning_cents'],
|
||||
'pdf_show_empty_rows' => (int)$settings['pdf_show_empty_rows'],
|
||||
'pdf_split_mode' => (string)$settings['pdf_split_mode'],
|
||||
'pdf_row_height_px' => (int)$settings['pdf_row_height_px'],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -324,6 +326,7 @@ function saas_update_tenant_settings(PDO $pdo, int $tenantId, array $input): arr
|
||||
$negativeWarningCents = saas_parse_money_cents($input['negative_warning'] ?? '');
|
||||
$paypalUrlTemplate = trim((string)($input['paypal_url_template'] ?? ''));
|
||||
$pdfSplitMode = trim((string)($input['pdf_split_mode'] ?? 'drinking_behavior'));
|
||||
$pdfRowHeightPx = filter_var($input['pdf_row_height_px'] ?? null, FILTER_VALIDATE_INT);
|
||||
|
||||
$errors = [];
|
||||
if (strlen($tenantName) < 3 || strlen($tenantName) > 255) {
|
||||
@@ -353,6 +356,9 @@ function saas_update_tenant_settings(PDO $pdo, int $tenantId, array $input): arr
|
||||
if (!in_array($pdfSplitMode, ['drinking_behavior', 'alphabetical'], true)) {
|
||||
$errors[] = 'Die Sortierung für den Ausdruck ist ungültig.';
|
||||
}
|
||||
if ($pdfRowHeightPx === false || $pdfRowHeightPx < 10 || $pdfRowHeightPx > 60) {
|
||||
$errors[] = 'Die Zeilenhöhe im Ausdruck muss zwischen 10 und 60 Pixel liegen.';
|
||||
}
|
||||
|
||||
if ($errors !== []) {
|
||||
return ['ok' => false, 'errors' => $errors];
|
||||
@@ -376,8 +382,8 @@ function saas_update_tenant_settings(PDO $pdo, int $tenantId, array $input): arr
|
||||
'INSERT INTO tenant_settings
|
||||
(tenant_id, mark_price_cents, self_entry_enabled, paypal_enabled,
|
||||
paypal_url_template, sheet_window_days, negative_warning_cents,
|
||||
pdf_show_empty_rows, pdf_split_mode)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
|
||||
pdf_show_empty_rows, pdf_split_mode, pdf_row_height_px)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
||||
ON DUPLICATE KEY UPDATE
|
||||
mark_price_cents = VALUES(mark_price_cents),
|
||||
self_entry_enabled = VALUES(self_entry_enabled),
|
||||
@@ -386,7 +392,8 @@ function saas_update_tenant_settings(PDO $pdo, int $tenantId, array $input): arr
|
||||
sheet_window_days = VALUES(sheet_window_days),
|
||||
negative_warning_cents = VALUES(negative_warning_cents),
|
||||
pdf_show_empty_rows = VALUES(pdf_show_empty_rows),
|
||||
pdf_split_mode = VALUES(pdf_split_mode)'
|
||||
pdf_split_mode = VALUES(pdf_split_mode),
|
||||
pdf_row_height_px = VALUES(pdf_row_height_px)'
|
||||
);
|
||||
$stmt->execute([
|
||||
$tenantId,
|
||||
@@ -398,6 +405,7 @@ function saas_update_tenant_settings(PDO $pdo, int $tenantId, array $input): arr
|
||||
-abs($negativeWarningCents),
|
||||
$pdfShowEmptyRows,
|
||||
$pdfSplitMode,
|
||||
(int)$pdfRowHeightPx,
|
||||
]);
|
||||
|
||||
$pdo->commit();
|
||||
|
||||
Reference in New Issue
Block a user