tolims filter, pagination

This commit is contained in:
2026-03-29 17:13:54 +03:00
parent 3e66d67dc5
commit c573a46318
7 changed files with 768 additions and 57 deletions
+3 -2
View File
@@ -5,6 +5,7 @@ header('Content-Type: application/json');
try {
$input = json_decode(file_get_contents('php://input'), true);
$templateId = intval($input['template_id'] ?? 0);
$importRefFromClient = trim($input['importreferencecode'] ?? '');
if (!$templateId) {
throw new Exception('Template ID missing');
@@ -21,8 +22,8 @@ try {
$template = $stmt->fetch(PDO::FETCH_ASSOC);
$idclient = $template['idclient'] ?? null;
// Generate import reference code
$importReferenceCode = date('YmdHis') . '-' . uniqid();
// Use provided importreferencecode (from filtered page) or generate new
$importReferenceCode = $importRefFromClient !== '' ? $importRefFromClient : date('YmdHis') . '-' . uniqid();
// Insert empty record
$stmt = $pdo->prepare("