Files
label_editor/bartender/README.md
T

151 lines
4.0 KiB
Markdown

# Bartender settings
---
## SQL
Query to get all articles with their variants and corresponding setting values.
COALESCE to select between two values where one is not null, if both are not null first value is used.
With this default values are overridden.
## Lodner 3er Etikett
### SQL Abfrage
```SQL
SELECT
a.name AS product,
CONCAT(a.topm_id, v.topm_row) AS aritcle_number,
COALESCE(v.name, a.name) AS name,
COALESCE(a.additional_name, COALESCE(v.name, a.name)) AS sigel_name,
CONCAT(CONCAT(v.weight, ' '), u.display) AS weight,
a.bio AS bio,
v.ean AS ean,
COALESCE(v.description, a.description) AS description,
CONCAT(COALESCE(v.ingredients, a.ingredients),
CASE
WHEN COALESCE(v.ingredients, a.ingredients) LIKE '%Zutaten:%' THEN CONCAT('<br>', s.bio_info)
ELSE '' END
) AS ingredients,
CONCAT(
CONCAT(
CONCAT(COALESCE(a.bio_origin, s.bio), '<br>'),
CASE
WHEN a.origin = '0' THEN 'EU-'
WHEN a.origin = '1' THEN 'Nicht-EU-'
WHEN a.origin = '2' THEN 'EU-/Nicht-EU-'
ELSE 'ERROR' END
),
'Landwirtschaft'
) AS "bio_text",
COALESCE(a.mhd, s.mhd) AS mhd,
COALESCE(a.allergens_text, s.allergens_text) AS "allergens info"
FROM article AS a
INNER JOIN variant AS v ON v.article_id = a.id
INNER JOIN settings AS s ON v.article_id = v.article_id
INNER JOIN unit AS u ON v.unit_id = u.id
INNER JOIN label AS l ON v.label_id = l.id
WHERE v.label_id = 1
ORDER BY a.name, v.weight ASC
```
---
#### HTML settings for label
##### Product title
```html
<div style="text-align: center; font-size: 13pt; font-family: Arial;"><b>
</b></div>
```
##### Product title Siegel
```html
<div style="text-align: center; font-size: 10pt; font-family: Arial;"><b>
</b></div>
```
##### Description
```html
<div style="text-align: center; font-size: 6pt; font-family: Arial;"><b>
</b></div>
```
##### Ingredients
```html
<div style="text-align: center; font-size: 6pt; font-family: Arial;">
</div>
```
##### Allergens info
```html
<div style="text-align: center; font-size: 5.5pt; font-family: Arial;">
</div>
```
##### BIO text
```html
<div style="text-align: left; font-size: 7px; font-family: Myriad Pro;">
</div>
```
---
## Lodner kleines Etikett
## Käfer Essen im Glas
### SQL Abfrage
```sql
SELECT
a.name AS product,
CONCAT(a.topm_id, v.topm_row) AS aritcle_number,
COALESCE(v.name, a.name) AS name,
COALESCE(a.additional_name, COALESCE(v.name, a.name)) AS sigel_name,
CONCAT(CONCAT(v.weight, ' '), u.display) AS weight,
v.ean AS ean,
COALESCE(v.description, a.description) AS description,
COALESCE(v.ingredients, a.ingredients) AS ingredients,
COALESCE(a.mhd, s.mhd) AS mhd,
COALESCE(a.allergens_text, s.allergens_text) AS allergens_info,
CONCAT(
CONCAT(n.calorific_value_kj, ' kJ<br>'),
CONCAT(n.calorific_value_kcal, ' kcal')
) AS energy,
n.fat,
n.saturated_fat,
n.carbohydrates,
n.sugar,
n.fibers,
n.protein,
n.salt
FROM article AS a
INNER JOIN variant AS v ON v.article_id = a.id
INNER JOIN settings AS s ON v.article_id = v.article_id
INNER JOIN unit AS u ON v.unit_id = u.id
INNER JOIN label AS l ON v.label_id = l.id
INNER JOIN nutrition AS n ON n.id = a.nutrition_id
WHERE v.label_id = 3
ORDER BY a.name, v.weight ASC
```
### HTML settings for label
#### Product title
```html
<div style="text-align: center; font-size: 16pt; font-family: Optima LT Std;">
</div><div style="text-align: center; font-size: 8pt; font-family: Optima nova LT Pro Titling Init;">- HANDGEMACHT -</div>
```
#### MHD
```html
<div style="text-align: center; font-size: 7pt; font-family: Optima LT Std;">Ungeöffnet bei 4°C - 7°C mindestens haltbar bis:
</div>
```
#### Impressum
```html
<div style="text-align: center; font-size: 7pt; font-family: Optima LT Std;">
</div>
```