Update README: batch deduction, recipe versioning, current DB schema
Deploy / deploy (push) Successful in 10s
Deploy / deploy (push) Successful in 10s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
a34bb29620
commit
af55857883
1 file changed
+62
-29
@@ -1,6 +1,6 @@
|
|||||||
# SpiceManagementSystem
|
# SpiceManagementSystem
|
||||||
|
|
||||||
Warenwirtschafts-Panel für Gewürzmischungen — verwaltet Rohstoffe, Rezepte, Produkte, Lagerbestand und Shopify-Sync.
|
Warenwirtschafts-Panel für Gewürzmischungen — verwaltet Rohstoffe, Rezepte, Produkte, Chargen und Shopify-Sync.
|
||||||
|
|
||||||
Built with [Laravel](https://laravel.com) + [Filament](https://filamentphp.com), deployed via Docker.
|
Built with [Laravel](https://laravel.com) + [Filament](https://filamentphp.com), deployed via Docker.
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ cd ~/app && docker compose exec app php artisan <befehl>
|
|||||||
|
|
||||||
## Shopify-Import
|
## Shopify-Import
|
||||||
|
|
||||||
### Erstimport (Produkte + Lagerbestand)
|
### Erstimport (Produkte + Lagerbestand + Beschreibung)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd ~/app && docker compose exec app php artisan shopify:import
|
cd ~/app && docker compose exec app php artisan shopify:import
|
||||||
@@ -54,8 +54,6 @@ Optionen:
|
|||||||
|
|
||||||
### Produktbilder herunterladen
|
### Produktbilder herunterladen
|
||||||
|
|
||||||
Für bereits importierte Produkte ohne Bilder:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd ~/app && docker compose exec app php artisan shopify:images
|
cd ~/app && docker compose exec app php artisan shopify:images
|
||||||
```
|
```
|
||||||
@@ -63,7 +61,7 @@ cd ~/app && docker compose exec app php artisan shopify:images
|
|||||||
Optionen:
|
Optionen:
|
||||||
- `--force` — lädt Bilder auch für Produkte neu, die bereits welche haben
|
- `--force` — lädt Bilder auch für Produkte neu, die bereits welche haben
|
||||||
|
|
||||||
### Lagerbestand synchronisieren
|
### Lagerbestand + Preise synchronisieren
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd ~/app && docker compose exec app php artisan shopify:sync
|
cd ~/app && docker compose exec app php artisan shopify:sync
|
||||||
@@ -71,6 +69,32 @@ cd ~/app && docker compose exec app php artisan shopify:sync
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## Chargen (LOT) & Rohstoff-Abzug
|
||||||
|
|
||||||
|
Beim Anlegen einer Charge wird der Rohstoffbestand automatisch abgezogen:
|
||||||
|
|
||||||
|
```
|
||||||
|
Charge: 50 Einheiten × 100g Standbodenbeutel = 5000g
|
||||||
|
→ Kurkuma (60%): 3000g vom Lager abgezogen
|
||||||
|
→ Pfeffer (30%): 1500g vom Lager abgezogen
|
||||||
|
→ Ingwer (10%): 500g vom Lager abgezogen
|
||||||
|
```
|
||||||
|
|
||||||
|
- Beim **Bearbeiten** einer Charge wird der Abzug neu berechnet
|
||||||
|
- Beim **Löschen** werden die Mengen zurückgebucht
|
||||||
|
- Chargen können direkt auf der Produktseite angelegt werden
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Rezept-Versionierung
|
||||||
|
|
||||||
|
Rezepte sind versioniert und einem Produkt zugeordnet:
|
||||||
|
- Jedes Rezept hat eine Versionsnummer (v1, v2, …)
|
||||||
|
- Beim Anlegen eines neuen Rezepts über das Produktformular wird die Version automatisch hochgezählt
|
||||||
|
- Ältere Versionen bleiben erhalten (z.B. für Chargen-Rückverfolgung)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Cronjob
|
## Cronjob
|
||||||
|
|
||||||
Auf dem Server einrichten, damit der Laravel-Scheduler läuft:
|
Auf dem Server einrichten, damit der Laravel-Scheduler läuft:
|
||||||
@@ -83,28 +107,18 @@ Auf dem Server einrichten, damit der Laravel-Scheduler läuft:
|
|||||||
|
|
||||||
## Datenbankstruktur
|
## Datenbankstruktur
|
||||||
|
|
||||||
Migrationen ausführen:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
php artisan migrate
|
|
||||||
```
|
|
||||||
|
|
||||||
Im Entwicklungsmodus komplett neu aufsetzen:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
php artisan migrate:refresh
|
|
||||||
```
|
|
||||||
|
|
||||||
```
|
```
|
||||||
Table spices {
|
Table spices {
|
||||||
id int [pk]
|
id int [pk]
|
||||||
name varchar(255)
|
name varchar(255)
|
||||||
amount decimal(10,2)
|
quantity decimal(10,2) -- immer in Gramm
|
||||||
unit text
|
unit varchar
|
||||||
}
|
}
|
||||||
|
|
||||||
Table recipes {
|
Table recipes {
|
||||||
id int [pk]
|
id int [pk]
|
||||||
|
product_id int [ref: > products.id, nullable]
|
||||||
|
version int -- auto-increment pro Produkt
|
||||||
name varchar(255)
|
name varchar(255)
|
||||||
description text
|
description text
|
||||||
}
|
}
|
||||||
@@ -113,13 +127,12 @@ Table recipes_spices {
|
|||||||
recipe_id int [ref: > recipes.id]
|
recipe_id int [ref: > recipes.id]
|
||||||
spice_id int [ref: > spices.id]
|
spice_id int [ref: > spices.id]
|
||||||
amount_in_percent decimal(4,2)
|
amount_in_percent decimal(4,2)
|
||||||
indexes { (recipe_id, spice_id) [pk] }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Table packings {
|
Table packings {
|
||||||
id int [pk]
|
id int [pk]
|
||||||
name varchar(255)
|
name varchar(255)
|
||||||
size decimal(10,2)
|
size decimal(10,2) -- Gramm pro Einheit
|
||||||
}
|
}
|
||||||
|
|
||||||
Table products {
|
Table products {
|
||||||
@@ -127,7 +140,6 @@ Table products {
|
|||||||
title text
|
title text
|
||||||
images json
|
images json
|
||||||
description text
|
description text
|
||||||
package_content text
|
|
||||||
recipes_id int [ref: > recipes.id]
|
recipes_id int [ref: > recipes.id]
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -137,9 +149,8 @@ Table products_sizes {
|
|||||||
packing_id int [ref: > packings.id]
|
packing_id int [ref: > packings.id]
|
||||||
sku varchar
|
sku varchar
|
||||||
shopify_variant_id varchar
|
shopify_variant_id varchar
|
||||||
price float
|
|
||||||
description text
|
|
||||||
gtin varchar
|
gtin varchar
|
||||||
|
price float
|
||||||
}
|
}
|
||||||
|
|
||||||
Table products_inventory {
|
Table products_inventory {
|
||||||
@@ -148,6 +159,28 @@ Table products_inventory {
|
|||||||
size_id int [ref: > products_sizes.id]
|
size_id int [ref: > products_sizes.id]
|
||||||
out_at timestamp
|
out_at timestamp
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Table batches {
|
||||||
|
id int [pk]
|
||||||
|
lot_number varchar [unique]
|
||||||
|
product_id int [ref: > products.id]
|
||||||
|
size_id int [ref: > products_sizes.id]
|
||||||
|
recipe_id int [ref: > recipes.id]
|
||||||
|
units_produced int
|
||||||
|
quantity_g decimal(10,2) -- berechnet: units × packing.size
|
||||||
|
produced_at date
|
||||||
|
expires_at date
|
||||||
|
}
|
||||||
|
|
||||||
|
Table batch_origins {
|
||||||
|
id int [pk]
|
||||||
|
batch_id int [ref: > batches.id]
|
||||||
|
spice_id int [ref: > spices.id]
|
||||||
|
supplier_id int [ref: > suppliers.id, nullable]
|
||||||
|
origin_country varchar
|
||||||
|
farmer varchar
|
||||||
|
notes text
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -157,12 +190,12 @@ Table products_inventory {
|
|||||||
**Fokus: Warenwirtschaft (Lager, Rohstoffe, Produkte)**
|
**Fokus: Warenwirtschaft (Lager, Rohstoffe, Produkte)**
|
||||||
|
|
||||||
- [x] DB-Schema mit Produkthistorie
|
- [x] DB-Schema mit Produkthistorie
|
||||||
- [x] Rezepte (prozentual)
|
- [x] Rezepte mit Versionierung
|
||||||
- [x] Produktgrößen und -preise
|
- [x] Produktgrößen, Preise, SKU, GTIN mit Barcode-Vorschau
|
||||||
- [x] Inventar (eindeutige Items mit Ausgangs-Flag)
|
- [x] Inventar (eindeutige Items mit Ausgangs-Flag)
|
||||||
- [x] Füllstandsanpassung der Rohstoffe beim Inventar anlegen
|
- [x] Chargen (LOT) mit automatischem Rohstoff-Abzug
|
||||||
- [x] Warenausgang (Produktverkauf)
|
- [x] Warenausgang (Produktverkauf)
|
||||||
- [x] Shopify-Import (Produkte, Varianten, Lagerbestand, Bilder)
|
- [x] Shopify-Import (Produkte, Varianten, Lagerbestand, Bilder, Beschreibung, Preise)
|
||||||
- [x] Continuous Deployment via Gitea Actions + Docker
|
- [x] Continuous Deployment via Gitea Actions + Docker
|
||||||
- [x] Frontend (Sidebar-Struktur, Navigation)
|
- [x] Frontend (Sidebar, Navigation, Barcode-Preview, Bild-Grid)
|
||||||
- [ ] Dashboard (Füllstände, Lager, Sales-Zeitspanne)
|
- [ ] Dashboard (Füllstände, Lager, Sales-Zeitspanne)
|
||||||
Reference in new issue
Block a user