fix(sync): Lieferadresse nicht mehr feldweise mischen, Adresszusatz statt Land
- Sync nimmt die Lieferadresse als Ganzes: mit eigener LieferAdressId alle Felder aus ihr, sonst alle aus der Belegadresse. Das bisherige COALESCE je Feld hat leere Felder mit Werten des Bestellers gefüllt (z. B. dessen Ortsteil an eine fremde Anschrift gehängt). - ERP-Freitext `Adressen.Land` (praktisch Ortsteil/Etage/Hinweis) wird zum Adresszusatz `Address.addition`; `country` kommt jetzt aus dem Länderstamm (`LandID` → `Laender.Land`). Deutschland-Kürzel und reine Landnamen sind kein Zusatz. - Migration 0034: `customers.address_addition`, `deliveries.snap_addition`; Bestandstext aus `country` wandert in den Zusatz. - Lieferbericht und Beleg-Ansicht: Land nur außerhalb Deutschlands, Zusatz als eigene Zeile „Zusatz: …". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@ -301,8 +301,13 @@ fn address_lines(a: &Address) -> Vec<String> {
|
||||
if !city.is_empty() {
|
||||
lines.push(city);
|
||||
}
|
||||
if !a.country.trim().is_empty() {
|
||||
lines.push(a.country.clone());
|
||||
// Land nur außerhalb Deutschlands; der Adresszusatz (Ortsteil, Etage,
|
||||
// Hinweis) als eigene, gekennzeichnete Zeile.
|
||||
if let Some(country) = a.foreign_country() {
|
||||
lines.push(country.to_string());
|
||||
}
|
||||
if let Some(addition) = a.addition.as_deref().filter(|z| !z.trim().is_empty()) {
|
||||
lines.push(format!("Zusatz: {addition}"));
|
||||
}
|
||||
lines
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user