Warenwirtschaft: F-03 — Entwurf sichert Chargenzeilen verlustfrei

Entwürfe speichern batch_key roh (stock_entry_id nullable), keine Auflösung
und keine Filterung unfertiger Zeilen mehr beim Zwischenspeichern. Eine nicht
mehr verfügbare Charge wird im Formular markiert statt alle Zeilen zu verwerfen.
Ergebniszeilen dürfen im Entwurf ohne Stückzahl bleiben. Auflösung, Prüfung und
Buchung erst beim Abschluss.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Kevin Adametz 2026-09-08 10:53:36 +00:00
parent 73512897ee
commit 859b1f083d
10 changed files with 200 additions and 41 deletions

View file

@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
/**
* Prüfung 08.09.2026 F-03: Entwürfe speichern ihre Chargen-Zeilen roh (batch_key),
* ohne sie beim Zwischenspeichern auf Wareneingänge aufzulösen. Erst der Abschluss
* löst auf und bucht. Dafür darf stock_entry_id im Entwurf leer sein.
*/
return new class extends Migration
{
public function up(): void
{
Schema::table('production_ingredients', function (Blueprint $table) {
$table->string('batch_key', 120)->nullable()->after('stock_entry_id');
});
Schema::table('production_ingredients', function (Blueprint $table) {
$table->unsignedBigInteger('stock_entry_id')->nullable()->change();
});
}
public function down(): void
{
Schema::table('production_ingredients', function (Blueprint $table) {
$table->dropColumn('batch_key');
});
Schema::table('production_ingredients', function (Blueprint $table) {
$table->unsignedBigInteger('stock_entry_id')->nullable(false)->change();
});
}
};