Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 564b5410

Von Jan Büren vor mehr als 5 Jahren hinzugefügt

  • ID 564b5410a5b4913215b53e659be6ee2a9cf259be
  • Vorgänger 12b522fa
  • Nachfolger 63181547

Ansprechpartner um boolean Hauptansprechpartner erweitert

Entsprechend mit einigen Attributen für den Export von Kundenstammdaten
hinzugefügt.
Hintergrund: Ansprechpartner-Export gibt nur die Liste aller Ansprechpartner.
Das Feld Kontakt (in der Tabelle Kunde) war wahrscheinlich der Vorgänger
für die Ansprechpartner-Logik. Das ist etwas wenig, wenn man noch
E-Mail, Telefon usw. personenbezogen unterbringen will. Deshalb die
Ergänzung für diesen Bericht.

Unterschiede anzeigen:

SL/CT.pm
254 254

  
255 255
  my $pg_select = $form->{l_pricegroup} ? qq|, pg.pricegroup as pricegroup | : '';
256 256
  my $pg_join   = $form->{l_pricegroup} ? qq|LEFT JOIN pricegroup pg ON (ct.pricegroup_id = pg.id) | : '';
257

  
258
  my $main_cp_select = '';
259
  if ($form->{l_main_contact_person}) {
260
    $main_cp_select =  qq/, (SELECT concat(cp.cp_givenname, ' ', cp.cp_name, ' | ', cp.cp_email, ' | ', cp.cp_phone1)
261
                              FROM contacts cp WHERE ct.id=cp.cp_cv_id AND cp.cp_main LIMIT 1)
262
                              AS main_contact_person /;
263
  }
257 264
  my $query =
258 265
    qq|SELECT ct.*, ct.itime::DATE AS insertdate, b.description AS business, e.name as salesman, | .
259 266
    qq|  pt.description as payment | .
260 267
    $pg_select .
268
    $main_cp_select .
261 269
    (qq|, NULL AS invnumber, NULL AS ordnumber, NULL AS quonumber, NULL AS invid, NULL AS module, NULL AS formtype, NULL AS closed | x!! $join_records) .
262 270
    qq|FROM $cv ct | .
263 271
    qq|LEFT JOIN business b ON (ct.business_id = b.id) | .
SL/Controller/CustomerVendor.pm
585 585
      }
586 586
      qw(
587 587
        id gender abteilung title position givenname name email phone1 phone2 fax mobile1 mobile2
588
        satphone satfax project street zipcode city privatphone privatemail birthday
588
        satphone satfax project street zipcode city privatphone privatemail birthday main
589 589
      )
590 590
    )
591 591
  };
592 592

  
593 593
  $data->{contact_cvars} = $self->_prepare_cvar_configs_for_ajaj($self->{contact}->cvars_by_config);
594 594

  
595
  # avoid two or more main_cp
596
  my $has_main_cp = grep { $_->cp_main == 1 } @{ $self->{cv}->contacts };
597
  $data->{contact}->{disable_cp_main} = 1 if ($has_main_cp && !$data->{contact}->{cp_main});
598

  
595 599
  $self->render(\SL::JSON::to_json($data), { type => 'json', process => 0 });
596 600
}
597 601

  
SL/DB/MetaSetup/Contact.pm
18 18
  cp_gender      => { type => 'character', length => 1 },
19 19
  cp_givenname   => { type => 'text' },
20 20
  cp_id          => { type => 'integer', not_null => 1, sequence => 'id' },
21
  cp_main        => { type => 'boolean' },
21 22
  cp_mobile1     => { type => 'text' },
22 23
  cp_mobile2     => { type => 'text' },
23 24
  cp_name        => { type => 'text' },
bin/mozilla/ct.pl
174 174
  };
175 175

  
176 176
  my @columns = (
177
    'id',        'name',    "$form->{db}number",   'contact',   'phone',    'discount',
177
    'id',        'name',    "$form->{db}number",   'contact', 'main_contact_person',
178
    'phone',    'discount',
178 179
    'fax',       'email',   'taxnumber',           'street',    'zipcode' , 'city',
179 180
    'business',  'payment', 'invnumber', 'ordnumber',           'quonumber', 'salesman',
180 181
    'country',   'gln',     'insertdate',           'pricegroup', 'contact_origin', 'invoice_mail',
......
192 193
    "$form->{db}number" => { 'text' => $locale->text('Number'), },
193 194
    'name'              => { 'text' => $form->{IS_CUSTOMER} ? $::locale->text('Customer Name') : $::locale->text('Vendor Name'), },
194 195
    'contact'           => { 'text' => $locale->text('Contact'), },
196
    'main_contact_person'  => { 'text' => $locale->text('Main Contact Person'), },
195 197
    'phone'             => { 'text' => $locale->text('Phone'), },
196 198
    'fax'               => { 'text' => $locale->text('Fax'), },
197 199
    'email'             => { 'text' => $locale->text('E-mail'), },
doc/changelog
21 21
- Kundenstammdaten um Feld Amtsgericht erweitert
22 22
  Falls das Feld Steuernummer mit dem Wert der Hr-Nr gefüllt wurde, wird auch das zuständige
23 23
  Registierungs-Gericht benötigt.
24

  
24
- Ansprechpartner um Feld 'Hauptansprechpartner' erweitert und exportierbar im Kundenbericht gemacht
25 25

  
26 26
2019-01-03 - Release 3.5.3
27 27

  
js/kivi.CustomerVendor.js
71 71
        $('#action_delete_contact').show();
72 72
      else
73 73
        $('#action_delete_contact').hide();
74

  
74
      if (data.contact.disable_cp_main === 1)
75
        $("#contact_cp_main").prop("disabled", true);
76
      else
77
        $("#contact_cp_main").prop("disabled", false);
75 78
      if ( params.onFormSet )
76 79
        params.onFormSet();
77 80
    });
locale/de/all
1836 1836
  'MIME type'                   => 'MIME-Typ',
1837 1837
  'MT940 import'                => 'MT940 Import',
1838 1838
  'Mails'                       => 'E-Mails',
1839
  'Main Contact Person'         => 'Hauptansprechpartner',
1839 1840
  'Main Preferences'            => 'Grundeinstellungen',
1840 1841
  'Main sorting'                => 'Hauptsortierung',
1841 1842
  'Make'                        => 'Lieferant',
sql/Pg-upgrade2/contacts_add_main_contact.pl
1
# @tag: contacts_add_main_contact
2
# @description: Feld 'Hauptansprechpartner' für Kontakte
3
# @depends: release_3_5_3
4
package SL::DBUpgrade2::contacts_add_main_contact;
5

  
6
use strict;
7
use utf8;
8

  
9
use parent qw(SL::DBUpgrade2::Base);
10

  
11
sub run {
12
  my ($self) = @_;
13

  
14
  $self->db_query('ALTER TABLE contacts ADD COLUMN cp_main boolean DEFAULT false', may_fail => 1);
15
  $self->db_query("UPDATE contacts set cp_main='false'");
16

  
17
  return 1;
18
}
19

  
20
1;
templates/webpages/ct/search.html
228 228
        <input name="l_commercial_court" id="l_commercial_court" type="checkbox" class="checkbox" value="Y">
229 229
        <label for="l_commercial_court">[% 'Commercial court' | $T8 %]</label>
230 230
       </td>
231
       <td>
232
        <input name="l_main_contact_person" id="l_main_contact_person" type="checkbox" class="checkbox" value="Y">
233
        <label for="l_main_contact_person">[% 'Main Contact Person' | $T8 %]</label>
234
       </td>
231 235

  
232 236
       <td>
233 237
      </tr>
templates/webpages/customer_vendor/tabs/contacts.html
23 23
        %]
24 24
      </td>
25 25
    </tr>
26

  
26
    <tr>
27
      <th align="right" nowrap>[% 'Main Contact Person' | $T8 %]</th>
28
      <td>[% L.yes_no_tag('contact.cp_main', SELF.contact.cp_main) %]</td>
29
    </tr>
27 30
    <tr>
28 31
      <th align="right" nowrap>[% 'Gender' | $T8 %]</th>
29 32

  

Auch abrufbar als: Unified diff