diff --git a/db/migrations/20261023181637_add_support_weight_to_work_sheet_mescole.php b/db/migrations/20261023181637_add_support_weight_to_work_sheet_mescole.php new file mode 100644 index 00000000..40749cd5 --- /dev/null +++ b/db/migrations/20261023181637_add_support_weight_to_work_sheet_mescole.php @@ -0,0 +1,22 @@ +table('work_sheet_mescole') + ->addColumn('support_weight_g_m', 'decimal', [ + 'precision' => 10, + 'scale' => 2, + 'null' => true, + 'default' => null, + 'after' => 'mix_weight_g_m', + 'comment' => 'Peso metro sostegno mescola (g/m)', + ]) + ->update(); + } +} diff --git a/public/userarea/manage-worksheet.php b/public/userarea/manage-worksheet.php index bf4fae8b..c91b070f 100644 --- a/public/userarea/manage-worksheet.php +++ b/public/userarea/manage-worksheet.php @@ -242,6 +242,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['ajax']) && $_POST['aj if ($pos <= 0) $pos = 1; $mix_weight = $_POST['mix_weight_g_m'] !== '' ? (float)$_POST['mix_weight_g_m'] : null; + $support_weight = ($_POST['support_weight_g_m'] ?? '') !== '' + ? (float)str_replace(',', '.', $_POST['support_weight_g_m']) + : null; $density = trim($_POST['required_density'] ?? ''); $hardness = trim($_POST['required_hardness_shore_a'] ?? ''); @@ -255,6 +258,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['ajax']) && $_POST['aj UPDATE work_sheet_mescole SET idmescola = ?, mix_weight_g_m = ?, + support_weight_g_m = ?, required_density = ?, required_hardness_shore_a = ?, lubrication_type = ?, @@ -263,7 +267,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['ajax']) && $_POST['aj "); $stmt->execute([ $idmescola, - $mix_weight, $density !== '' ? $density : null, $hardness !== '' ? $hardness : null, $lub_type, @@ -291,16 +294,18 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['ajax']) && $_POST['aj INSERT INTO work_sheet_mescole ( worksheet_id, idmescola, mix_position, mix_weight_g_m, + support_weight_g_m, required_density, required_hardness_shore_a, lubrication_type, lubrication_notes ) - VALUES (?, ?, ?, ?, ?, ?, ?, ?) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) "); $stmt->execute([ $worksheet_id, $idmescola, $pos, $mix_weight, + $support_weight, $density !== '' ? $density : null, $hardness !== '' ? $hardness : null, $lub_type, @@ -1389,6 +1394,7 @@ $isEdit = ($worksheet_id > 0);