Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 37367349

Von Moritz Bunkus vor fast 3 Jahren hinzugefügt

  • ID 373673499958d1b5c5f6551ea2f30539e0ad6382
  • Vorgänger 49c2674e
  • Nachfolger ded6910e

Kundenstammdaten: keine leeren »zusätzliche Rechnungsadressen« erzeugen

Unterschiede anzeigen:

SL/Controller/CustomerVendor.pm
283 283
      $self->{shipto}->save(cascade => 1);
284 284
    }
285 285

  
286
    if ($self->is_customer && any { $self->{additional_billing_address}->$_ ne '' } @ADDITIONAL_BILLING_ADDRESS_COLUMNS) {
286
    if ($self->is_customer && any { $self->{additional_billing_address}->$_ ne '' } grep { $_ ne 'default_address' } @ADDITIONAL_BILLING_ADDRESS_COLUMNS) {
287 287
      $self->{additional_billing_address}->customer_id($self->{cv}->id);
288 288
      $self->{additional_billing_address}->save(cascade => 1);
289 289

  
sql/Pg-upgrade2/customer_remove_empty_additional_billing_addresses.sql
1
-- @tag: customer_remove_empty_additional_billing_addresses
2
-- @description: Leere »zusätzliche Rechnungsadressen« entfernen
3
-- @depends: customer_additional_billing_addresses
4
DELETE
5
FROM additional_billing_addresses
6
WHERE (coalesce(name,         '') = '')
7
  AND (coalesce(department_1, '') = '')
8
  AND (coalesce(department_2, '') = '')
9
  AND (coalesce(contact,      '') = '')
10
  AND (coalesce(street,       '') = '')
11
  AND (coalesce(zipcode,      '') = '')
12
  AND (coalesce(city,         '') = '')
13
  AND (coalesce(country,      '') = '')
14
  AND (coalesce(email,        '') = '')
15
  AND (coalesce(phone,        '') = '')
16
  AND (coalesce(fax,          '') = '');

Auch abrufbar als: Unified diff