Warenwirtschaft: F-15 — ml-Einkauf bleibt beim Kopieren ml-Bestellung
Einheit, ml-Menge und Dichte-Snapshot werden übernommen; fehlt die Rohstoff-Dichte inzwischen, greift der Snapshot der Vorlage. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
parent
8808ff538f
commit
c2a17835ef
3 changed files with 59 additions and 1 deletions
|
|
@ -160,6 +160,15 @@ class StockEntryController extends Controller
|
|||
$data['ordered_by'] = (int) auth()->id();
|
||||
$data['status'] = 'pending';
|
||||
|
||||
// Prüfung 08.09.2026 F-15: In ml erfasste Bestellungen als ml kopieren — Menge
|
||||
// zurück in ml (über den Dichte-Snapshot), Einheit und Dichte mitgeben. Sonst wird
|
||||
// die Kopie zur Gramm-Bestellung und ein Wareneingang „100“ bucht 100 g statt 79 g.
|
||||
if ($stockEntry->purchase_unit === 'ml' && $stockEntry->density_used !== null && (float) $stockEntry->density_used > 0) {
|
||||
$data['ordered_unit'] = 'ml';
|
||||
$data['ordered_quantity'] = round((float) $stockEntry->ordered_quantity / (float) $stockEntry->density_used, 2);
|
||||
$data['density_used'] = (float) $stockEntry->density_used;
|
||||
}
|
||||
|
||||
$copy = $this->stockEntryRepository->create($data);
|
||||
|
||||
\Session::flash('alert-warning', __('Kopie angelegt – bitte Menge/Charge prüfen und speichern.'));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue