Revert "Add documents to stock lots"

This reverts commit 2bec934732.
This commit is contained in:
gitea_admin committed 2026-09-08 13:49:20 +02:00
1 parent f7dcbdf786
commit d640f3656d
5 files changed
+2 -294

No files matched your search

-30
View File
@@ -1,30 +0,0 @@
<?php
declare(strict_types=1);
require_once __DIR__ . '/../../modules/shared/db.php';
require_once __DIR__ . '/../../modules/shared/auth/service.php';
require_once __DIR__ . '/../../modules/erp/lager/service.php';
$env = expand_env_values(parse_env_file(__DIR__ . '/../../../.env'));
try {
$pdo = connect_database($env);
auth_bootstrap_session();
if (auth_current_user($pdo) === null) {
http_response_code(401);
exit('Unauthorized');
}
$document = get_stock_lot_document($pdo, (int) ($_GET['id'] ?? 0));
$path = dirname(__DIR__, 2) . '/runtime/uploads/lager/' . basename((string) $document['stored_filename']);
if (!is_file($path)) {
http_response_code(404);
exit('Not Found');
}
header('Content-Type: application/octet-stream');
header('Content-Length: ' . (string) filesize($path));
header("Content-Disposition: attachment; filename*=UTF-8''" . rawurlencode((string) $document['original_filename']));
readfile($path);
} catch (Throwable) {
http_response_code(404);
exit('Not Found');
}