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
|
|
@ -12,6 +12,7 @@ use App\Models\MaterialQuality;
|
|||
use App\Models\PackagingItem;
|
||||
use App\Models\StockEntry;
|
||||
use App\Models\Supplier;
|
||||
use App\Models\TaxRate;
|
||||
use App\Repositories\StockEntryRepository;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
|
|
@ -115,6 +116,37 @@ class StockEntryController extends Controller
|
|||
return redirect()->route('admin.inventory.stock-entries.index');
|
||||
}
|
||||
|
||||
public function copy(StockEntry $stockEntry): RedirectResponse
|
||||
{
|
||||
if (! auth()->user()->isAdmin()) {
|
||||
return redirect()->route('home');
|
||||
}
|
||||
|
||||
$data = $stockEntry->only([
|
||||
'entry_type',
|
||||
'ingredient_id',
|
||||
'packaging_item_id',
|
||||
'supplier_id',
|
||||
'location_id',
|
||||
'ordered_quantity',
|
||||
'price_per_kg',
|
||||
'price_per_kg_gross',
|
||||
'price_total',
|
||||
'tax_rate_id',
|
||||
'tax_rate_percent',
|
||||
'quality_id',
|
||||
]);
|
||||
$data['ordered_at'] = now()->toDateString();
|
||||
$data['ordered_by'] = (int) auth()->id();
|
||||
$data['status'] = 'pending';
|
||||
|
||||
$copy = $this->stockEntryRepository->create($data);
|
||||
|
||||
\Session::flash('alert-warning', __('Kopie angelegt – bitte Menge/Charge prüfen und speichern.'));
|
||||
|
||||
return redirect()->route('admin.inventory.stock-entries.edit', $copy);
|
||||
}
|
||||
|
||||
public function destroy(StockEntry $stockEntry): RedirectResponse
|
||||
{
|
||||
if (! auth()->user()->isAdmin()) {
|
||||
|
|
@ -223,6 +255,7 @@ class StockEntryController extends Controller
|
|||
'suppliers' => Supplier::query()->where('active', true)->orderBy('name')->get(),
|
||||
'locations' => Location::query()->where('active', true)->orderBy('name')->get(),
|
||||
'materialQualities' => MaterialQuality::query()->orderBy('pos')->orderBy('name')->get(),
|
||||
'taxRates' => TaxRate::query()->active()->orderBy('pos')->orderBy('name')->get(),
|
||||
'entryTypeLabels' => [
|
||||
'ingredient' => __('Rohstoff'),
|
||||
'packaging' => __('Produktverpackung'),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue