Warenwirtschaft: AP-00 bis AP-08 + aktualisierter Entwicklungsplan
Umsetzung der Warenwirtschafts-/Produktmanagement-Erweiterung gemaess Entwicklungsplan V4.0: - AP-00: Regressionsbasis fuer 5.1-Features (ProductPhase51Test) - AP-01: URL-Bugfixes B1/B2 (suppliers/packaging-items, breitere url-Spalten) - AP-04/04.1: iPad-taugliche, vereinheitlichte Tabellen-Aktionen - AP-05: Einstellungen "Allgemein" mit UST-Saetzen (tax_rates) und Lieferzeit-Vorlagen (delivery_times, inkl. Tage-Feld) - AP-06: Lieferanten um Bestellweg, Bestell-Mail/-URL und Lieferzeit erweitert - AP-07/07.1: INCI um Lieferanten-Mehrfachwahl, UST und Lieferzeit erweitert; Lieferanten-Detailansicht im Modal mit pflegbaren INCI-/Verpackungslisten - AP-08: Einkauf um UST-Snapshot, Netto/Brutto-Automatik und Duplizieren erweitert Entwicklungsplan aktualisiert: alle Klaerungspunkte (§5) vom Kunden beantwortet und in die jeweiligen APs eingearbeitet (AP-02/03/09/13/15), neues AP-18 (Hinweise-Doku unter Einstellungen) ergaenzt. Naechster Schritt eindeutig markiert: AP-09 (Produktion auf Hersteller-Rezeptur, kein Fallback, Warnung).
This commit is contained in:
parent
ca3eb663fe
commit
78679e0c55
67 changed files with 3523 additions and 101 deletions
35
app/Http/Requests/Inventory/StoreDeliveryTimeRequest.php
Normal file
35
app/Http/Requests/Inventory/StoreDeliveryTimeRequest.php
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests\Inventory;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreDeliveryTimeRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, string>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'label' => ['required', 'string', 'max:255'],
|
||||
'days' => ['nullable', 'integer', 'min:0', 'max:65535'],
|
||||
'active' => ['sometimes', 'boolean'],
|
||||
'pos' => ['nullable', 'integer', 'min:0', 'max:255'],
|
||||
];
|
||||
}
|
||||
|
||||
protected function prepareForValidation(): void
|
||||
{
|
||||
$this->merge([
|
||||
'active' => $this->boolean('active'),
|
||||
'days' => $this->input('days', '') === '' ? null : $this->input('days'),
|
||||
'pos' => $this->input('pos', '') === '' ? 0 : $this->input('pos'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
@ -24,7 +24,7 @@ class StorePackagingItemRequest extends FormRequest
|
|||
'category' => ['required', Rule::in(['packaging', 'shipping'])],
|
||||
'weight_grams' => ['nullable', 'numeric', 'min:0'],
|
||||
'min_stock_alert' => ['nullable', 'integer', 'min:0'],
|
||||
'url' => ['nullable', 'url', 'max:500'],
|
||||
'url' => ['nullable', 'string', 'max:2048'],
|
||||
'product_id' => ['nullable', 'integer', 'exists:products,id'],
|
||||
'active' => ['sometimes', 'boolean'],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -27,7 +27,9 @@ class StoreStockEntryRequest extends FormRequest
|
|||
'ordered_at' => ['required', 'date'],
|
||||
'ordered_quantity' => ['required', 'numeric', 'min:0.000001'],
|
||||
'quality_id' => ['nullable', 'integer', 'exists:material_qualities,id'],
|
||||
'tax_rate_id' => ['nullable', 'integer', 'exists:tax_rates,id'],
|
||||
'price_per_kg' => ['nullable', 'numeric', 'min:0'],
|
||||
'price_per_kg_gross' => ['nullable', 'numeric', 'min:0'],
|
||||
'price_total' => ['nullable', 'numeric', 'min:0'],
|
||||
];
|
||||
}
|
||||
|
|
@ -39,7 +41,7 @@ class StoreStockEntryRequest extends FormRequest
|
|||
{
|
||||
return [
|
||||
'quality_id.required' => __('Bitte eine Rohstoffqualität wählen.'),
|
||||
'price_per_kg.required' => __('Bitte den Netto-Preis pro kg angeben.'),
|
||||
'price_per_kg.required' => __('Bitte den Netto- oder Brutto-Preis pro kg angeben.'),
|
||||
'price_total.required' => __('Bitte den Gesamtpreis netto angeben.'),
|
||||
];
|
||||
}
|
||||
|
|
@ -49,6 +51,7 @@ class StoreStockEntryRequest extends FormRequest
|
|||
$this->merge([
|
||||
'ordered_quantity' => reFormatNumber($this->input('ordered_quantity')),
|
||||
'price_per_kg' => $this->filled('price_per_kg') ? reFormatNumber($this->input('price_per_kg')) : null,
|
||||
'price_per_kg_gross' => $this->filled('price_per_kg_gross') ? reFormatNumber($this->input('price_per_kg_gross')) : null,
|
||||
'price_total' => $this->filled('price_total') ? reFormatNumber($this->input('price_total')) : null,
|
||||
]);
|
||||
}
|
||||
|
|
@ -64,8 +67,12 @@ class StoreStockEntryRequest extends FormRequest
|
|||
if (empty($this->input('quality_id'))) {
|
||||
$validator->errors()->add('quality_id', __('Bitte eine Rohstoffqualität wählen.'));
|
||||
}
|
||||
if (! is_numeric($this->input('price_per_kg')) || (float) $this->input('price_per_kg') <= 0) {
|
||||
$validator->errors()->add('price_per_kg', __('Bitte den Netto-Preis pro kg angeben.'));
|
||||
$net = $this->input('price_per_kg');
|
||||
$gross = $this->input('price_per_kg_gross');
|
||||
$hasNet = is_numeric($net) && (float) $net > 0;
|
||||
$hasGross = is_numeric($gross) && (float) $gross > 0;
|
||||
if (! $hasNet && ! $hasGross) {
|
||||
$validator->errors()->add('price_per_kg', __('Bitte den Netto- oder Brutto-Preis pro kg angeben.'));
|
||||
}
|
||||
} elseif (! empty($type)) {
|
||||
if (empty($this->input('packaging_item_id'))) {
|
||||
|
|
|
|||
|
|
@ -19,6 +19,11 @@ class StoreSupplierRequest extends FormRequest
|
|||
return [
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'url' => ['nullable', 'string', 'max:2048'],
|
||||
'order_method' => ['nullable', 'in:email,online_shop'],
|
||||
'order_email' => ['nullable', 'email', 'max:255'],
|
||||
'order_url' => ['nullable', 'string', 'max:2048'],
|
||||
'delivery_time' => ['nullable', 'string', 'max:255'],
|
||||
'delivery_time_days' => ['nullable', 'integer', 'min:0', 'max:65535'],
|
||||
'contact_person' => ['nullable', 'string', 'max:255'],
|
||||
'email' => ['nullable', 'email', 'max:255'],
|
||||
'phone' => ['nullable', 'string', 'max:100'],
|
||||
|
|
@ -34,6 +39,7 @@ class StoreSupplierRequest extends FormRequest
|
|||
{
|
||||
$this->merge([
|
||||
'active' => $this->boolean('active'),
|
||||
'delivery_time_days' => $this->input('delivery_time_days', '') === '' ? null : $this->input('delivery_time_days'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
34
app/Http/Requests/Inventory/StoreTaxRateRequest.php
Normal file
34
app/Http/Requests/Inventory/StoreTaxRateRequest.php
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests\Inventory;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreTaxRateRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, string>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'percent' => ['required', 'numeric', 'min:0', 'max:100'],
|
||||
'active' => ['sometimes', 'boolean'],
|
||||
'pos' => ['nullable', 'integer', 'min:0', 'max:255'],
|
||||
];
|
||||
}
|
||||
|
||||
protected function prepareForValidation(): void
|
||||
{
|
||||
$this->merge([
|
||||
'active' => $this->boolean('active'),
|
||||
'pos' => $this->input('pos', '') === '' ? 0 : $this->input('pos'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
35
app/Http/Requests/Inventory/UpdateDeliveryTimeRequest.php
Normal file
35
app/Http/Requests/Inventory/UpdateDeliveryTimeRequest.php
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests\Inventory;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateDeliveryTimeRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, string>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'label' => ['required', 'string', 'max:255'],
|
||||
'days' => ['nullable', 'integer', 'min:0', 'max:65535'],
|
||||
'active' => ['sometimes', 'boolean'],
|
||||
'pos' => ['nullable', 'integer', 'min:0', 'max:255'],
|
||||
];
|
||||
}
|
||||
|
||||
protected function prepareForValidation(): void
|
||||
{
|
||||
$this->merge([
|
||||
'active' => $this->boolean('active'),
|
||||
'days' => $this->input('days', '') === '' ? null : $this->input('days'),
|
||||
'pos' => $this->input('pos', '') === '' ? 0 : $this->input('pos'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
@ -24,7 +24,7 @@ class UpdatePackagingItemRequest extends FormRequest
|
|||
'category' => ['required', Rule::in(['packaging', 'shipping'])],
|
||||
'weight_grams' => ['nullable', 'numeric', 'min:0'],
|
||||
'min_stock_alert' => ['nullable', 'integer', 'min:0'],
|
||||
'url' => ['nullable', 'url', 'max:500'],
|
||||
'url' => ['nullable', 'string', 'max:2048'],
|
||||
'product_id' => ['nullable', 'integer', 'exists:products,id'],
|
||||
'active' => ['sometimes', 'boolean'],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -27,7 +27,9 @@ class UpdateStockEntryRequest extends FormRequest
|
|||
'ordered_at' => ['required', 'date'],
|
||||
'ordered_quantity' => ['required', 'numeric', 'min:0.000001'],
|
||||
'quality_id' => ['nullable', 'integer', 'exists:material_qualities,id'],
|
||||
'tax_rate_id' => ['nullable', 'integer', 'exists:tax_rates,id'],
|
||||
'price_per_kg' => ['nullable', 'numeric', 'min:0'],
|
||||
'price_per_kg_gross' => ['nullable', 'numeric', 'min:0'],
|
||||
'price_total' => ['nullable', 'numeric', 'min:0'],
|
||||
];
|
||||
}
|
||||
|
|
@ -39,7 +41,7 @@ class UpdateStockEntryRequest extends FormRequest
|
|||
{
|
||||
return [
|
||||
'quality_id.required' => __('Bitte eine Rohstoffqualität wählen.'),
|
||||
'price_per_kg.required' => __('Bitte den Netto-Preis pro kg angeben.'),
|
||||
'price_per_kg.required' => __('Bitte den Netto- oder Brutto-Preis pro kg angeben.'),
|
||||
'price_total.required' => __('Bitte den Gesamtpreis netto angeben.'),
|
||||
];
|
||||
}
|
||||
|
|
@ -49,6 +51,7 @@ class UpdateStockEntryRequest extends FormRequest
|
|||
$this->merge([
|
||||
'ordered_quantity' => reFormatNumber($this->input('ordered_quantity')),
|
||||
'price_per_kg' => $this->filled('price_per_kg') ? reFormatNumber($this->input('price_per_kg')) : null,
|
||||
'price_per_kg_gross' => $this->filled('price_per_kg_gross') ? reFormatNumber($this->input('price_per_kg_gross')) : null,
|
||||
'price_total' => $this->filled('price_total') ? reFormatNumber($this->input('price_total')) : null,
|
||||
]);
|
||||
}
|
||||
|
|
@ -64,8 +67,12 @@ class UpdateStockEntryRequest extends FormRequest
|
|||
if (empty($this->input('quality_id'))) {
|
||||
$validator->errors()->add('quality_id', __('Bitte eine Rohstoffqualität wählen.'));
|
||||
}
|
||||
if (! is_numeric($this->input('price_per_kg')) || (float) $this->input('price_per_kg') <= 0) {
|
||||
$validator->errors()->add('price_per_kg', __('Bitte den Netto-Preis pro kg angeben.'));
|
||||
$net = $this->input('price_per_kg');
|
||||
$gross = $this->input('price_per_kg_gross');
|
||||
$hasNet = is_numeric($net) && (float) $net > 0;
|
||||
$hasGross = is_numeric($gross) && (float) $gross > 0;
|
||||
if (! $hasNet && ! $hasGross) {
|
||||
$validator->errors()->add('price_per_kg', __('Bitte den Netto- oder Brutto-Preis pro kg angeben.'));
|
||||
}
|
||||
} elseif (! empty($type)) {
|
||||
if (empty($this->input('packaging_item_id'))) {
|
||||
|
|
|
|||
|
|
@ -19,6 +19,11 @@ class UpdateSupplierRequest extends FormRequest
|
|||
return [
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'url' => ['nullable', 'string', 'max:2048'],
|
||||
'order_method' => ['nullable', 'in:email,online_shop'],
|
||||
'order_email' => ['nullable', 'email', 'max:255'],
|
||||
'order_url' => ['nullable', 'string', 'max:2048'],
|
||||
'delivery_time' => ['nullable', 'string', 'max:255'],
|
||||
'delivery_time_days' => ['nullable', 'integer', 'min:0', 'max:65535'],
|
||||
'contact_person' => ['nullable', 'string', 'max:255'],
|
||||
'email' => ['nullable', 'email', 'max:255'],
|
||||
'phone' => ['nullable', 'string', 'max:100'],
|
||||
|
|
@ -34,6 +39,7 @@ class UpdateSupplierRequest extends FormRequest
|
|||
{
|
||||
$this->merge([
|
||||
'active' => $this->boolean('active'),
|
||||
'delivery_time_days' => $this->input('delivery_time_days', '') === '' ? null : $this->input('delivery_time_days'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
34
app/Http/Requests/Inventory/UpdateTaxRateRequest.php
Normal file
34
app/Http/Requests/Inventory/UpdateTaxRateRequest.php
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests\Inventory;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateTaxRateRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, string>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'percent' => ['required', 'numeric', 'min:0', 'max:100'],
|
||||
'active' => ['sometimes', 'boolean'],
|
||||
'pos' => ['nullable', 'integer', 'min:0', 'max:255'],
|
||||
];
|
||||
}
|
||||
|
||||
protected function prepareForValidation(): void
|
||||
{
|
||||
$this->merge([
|
||||
'active' => $this->boolean('active'),
|
||||
'pos' => $this->input('pos', '') === '' ? 0 : $this->input('pos'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue