White Label: Sofortpaket WL-00 und Bestandsprüfung WL-01
- Etikettgröße im Lieferschein korrekt parsen ("40#3,5" ergab 3 statt 3,5 cm)
- Produktkopie optional inkl. Kundenzuordnungen und Logo-Dateien (zweiter Kopier-Link)
- whitelabel:transfer-assignments: gezielte, wiederholbare Übertragung ohne Dubletten
- whitelabel:migrate-colors: Zuordnungen anhand der Bildfarbe auf die Farbprodukte übertragen (Dry-Run ohne --execute)
- whitelabel:report: rein lesende Bestandsprüfung (fehlende Zuordnungen, Farbwidersprüche, Dateien, Dubletten)
- Migration für attributes.value (Schema-Drift, auf Live No-op)
- Analyse/Entwicklungsplan um Gegenprüfung, systemischen Befund und neue Paketreihenfolge ergänzt
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
f7ab4c4519
commit
d687a6c569
11 changed files with 1012 additions and 13 deletions
|
|
@ -317,13 +317,13 @@ class InvoiceRepository extends BaseRepository
|
|||
foreach ($label->attributes as $attribute) {
|
||||
if ($attribute = Attribute::find($attribute)) {
|
||||
if (! isset($varinats[$attribute->value])) {
|
||||
$temp = explode('#', $attribute->value);
|
||||
$sorter = $temp[1] > $sorter ? $temp[1] : $sorter;
|
||||
[$vol, $size] = self::parseVariantValue($attribute->value);
|
||||
$sorter = max($sorter, $size);
|
||||
$label->varinat = [
|
||||
'key' => $attribute->value,
|
||||
'id' => $attribute->id,
|
||||
'vol' => (float) $temp[0],
|
||||
'size' => (float) $temp[1],
|
||||
'vol' => $vol,
|
||||
'size' => $size,
|
||||
'name' => $label->product_id ? 'Standard' : $attribute->name,
|
||||
];
|
||||
}
|
||||
|
|
@ -334,13 +334,13 @@ class InvoiceRepository extends BaseRepository
|
|||
if ($shopping_order_item->product->attribute_variants) {
|
||||
foreach ($shopping_order_item->product->attribute_variants as $attribute_variant) {
|
||||
if (! isset($varinats[$attribute_variant->attribute->value])) {
|
||||
$temp = explode('#', $attribute_variant->attribute->value);
|
||||
$sorter = $temp[1] > $sorter ? $temp[1] : $sorter;
|
||||
[$vol, $size] = self::parseVariantValue($attribute_variant->attribute->value);
|
||||
$sorter = max($sorter, $size);
|
||||
$label->varinat = [
|
||||
'key' => $attribute_variant->attribute->value,
|
||||
'id' => $attribute_variant->attribute->id,
|
||||
'vol' => (float) $temp[0],
|
||||
'size' => (float) $temp[1],
|
||||
'vol' => $vol,
|
||||
'size' => $size,
|
||||
'name' => 'Standard',
|
||||
];
|
||||
}
|
||||
|
|
@ -361,4 +361,20 @@ class InvoiceRepository extends BaseRepository
|
|||
|
||||
return array_merge($wl_items, $items);
|
||||
}
|
||||
|
||||
/**
|
||||
* Attributwert "Volumen#Größe" (z. B. "40#3,5") in Volumen (ml) und Etikettgröße (cm) zerlegen.
|
||||
* Die Größe steht mit deutschem Komma im Bestand; ein reiner (float)-Cast würde "3,5" zu 3.0 kürzen.
|
||||
*
|
||||
* @return array{0: float, 1: float}
|
||||
*/
|
||||
public static function parseVariantValue(?string $value): array
|
||||
{
|
||||
$parts = explode('#', (string) $value);
|
||||
|
||||
return [
|
||||
(float) reFormatNumber($parts[0] ?? ''),
|
||||
(float) reFormatNumber($parts[1] ?? ''),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue