skip empty parts during clone and LIMS export

This commit is contained in:
2026-05-13 11:54:28 +02:00
parent 836fc055ec
commit f97b52f158
2 changed files with 14 additions and 10 deletions
+7 -5
View File
@@ -28,11 +28,13 @@ try {
// 1. Load source parts // 1. Load source parts
$stmtParts = $pdo->prepare(" $stmtParts = $pdo->prepare("
SELECT id, part_number, part_description, mix, idmatrice, note, dateexpiry SELECT id, part_number, part_description, mix, idmatrice, note, dateexpiry
FROM identification_parts FROM identification_parts
WHERE iddatadb = ? WHERE iddatadb = ?
ORDER BY part_number ASC, id ASC AND part_description IS NOT NULL
"); AND TRIM(part_description) <> ''
ORDER BY part_number ASC, id ASC
");
$stmtParts->execute([$sourceIddatadb]); $stmtParts->execute([$sourceIddatadb]);
$sourceParts = $stmtParts->fetchAll(PDO::FETCH_ASSOC); $sourceParts = $stmtParts->fetchAll(PDO::FETCH_ASSOC);
+7 -5
View File
@@ -107,11 +107,13 @@ try {
// 🔹 STEP 3: Fetch Parts (including idmatrice and part id for custom fields) // 🔹 STEP 3: Fetch Parts (including idmatrice and part id for custom fields)
$stmt = $pdo->prepare(" $stmt = $pdo->prepare("
SELECT id AS part_id, part_number, part_description, material, color, mix, idmatrice, dateexpiry SELECT id AS part_id, part_number, part_description, material, color, mix, idmatrice, dateexpiry
FROM identification_parts FROM identification_parts
WHERE iddatadb = :iddatadb WHERE iddatadb = :iddatadb
ORDER BY CAST(part_number AS UNSIGNED) ASC, part_number ASC AND part_description IS NOT NULL
"); AND TRIM(part_description) <> ''
ORDER BY CAST(part_number AS UNSIGNED) ASC, part_number ASC
");
$stmt->execute(['iddatadb' => $iddatadb]); $stmt->execute(['iddatadb' => $iddatadb]);
$parts = $stmt->fetchAll(PDO::FETCH_ASSOC); $parts = $stmt->fetchAll(PDO::FETCH_ASSOC);