Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 5eadc966

Von Moritz Bunkus vor mehr als 14 Jahren hinzugefügt

  • ID 5eadc96699ee3f70f3a0bb3f473f3cfea7e8ea68
  • Vorgänger d8d827c9
  • Nachfolger d0b3cf0b

Vertretermodus: Immer bisherigen Vertreter anzeigen & nur wahlweise ändern

Neues Verhalten in der Kundenmaske: Wird ein Kunde neu angelegt, so
muss ein Vertreter ausgewählt werden.

Wird ein bestehender Kunde bearbeitet, so wird der Name des bisher für
ihn ausgewählten Vertreters immer angezeigt. Zusätzlich hat der
Bearbeiter die Möglichkeit, den Vertreter über die Drop-Down-Box der
aktuell gültigen Kunden zu ändern. Wird hier kein Vertreter
ausgewählt, so bleibt der bisherige Vertreter bestehen.

Unterschiede anzeigen:

bin/mozilla/ct.pl
289 289
                   taxzones  => "ALL_TAXZONES");
290 290
  $form->get_pricegroup(\%myconfig, { all => 1 });
291 291

  
292
  $form->get_lists(customers => { key => "ALL_SALESMAN_CUSTOMERS", business_is_salesman => 1, with_obsolete => 1 }) if $::vertreter;
292
  $form->get_lists(customers => { key => "ALL_SALESMAN_CUSTOMERS", business_is_salesman => 1 }) if $::vertreter;
293 293

  
294 294
  $form->{ALL_SALESMEN}   = $form->{ALL_EMPLOYEES};
295 295
  $form->{taxincluded}    = ($form->{taxincluded}) ? "checked" : "";
......
336 336
  $main::lxdebug->leave_sub();
337 337
}
338 338

  
339
sub _do_save {
340
  $main::auth->assert('customer_vendor_edit & ' .
341
                      '(general_ledger         | invoice_edit         | vendor_invoice_edit | ' .
342
                      ' request_quotation_edit | sales_quotation_edit | sales_order_edit    | purchase_order_edit)');
343

  
344
  $::form->isblank("name", $::locale->text("Name missing!"));
345

  
346
  if ($::form->{new_salesman_id} && $::vertreter) {
347
    $::form->{salesman_id} = $::form->{new_salesman_id};
348
    delete $::form->{new_salesman_id};
349
  }
350

  
351
  my $res = $::form->{db} eq 'customer' ? CT->save_customer(\%::myconfig, $::form) : CT->save_vendor(\%::myconfig, $::form);
352

  
353
  if (3 == $res) {
354
    if ($::form->{"db"} eq "customer") {
355
      $::form->error($::locale->text('This customer number is already in use.'));
356
    } else {
357
      $::form->error($::locale->text('This vendor number is already in use.'));
358
    }
359
  }
360
}
361

  
339 362
sub add_transaction {
340 363
  $main::lxdebug->enter_sub();
341 364

  
......
354 377
#  }
355 378
#  # /saving the history
356 379

  
357
  $form->isblank("name", $locale->text("Name missing!"));
358
  if ($form->{"db"} eq "customer") {
359
    CT->save_customer(\%myconfig, \%$form);
360
  } else {
361
    CT->save_vendor(\%myconfig, \%$form);
362
  }
380
  _do_save();
363 381

  
364 382
  $form->{callback} = $form->escape($form->{callback}, 1);
365 383
  my $name = $form->escape("$form->{name}", 1);
......
516 534
  my $msg = ucfirst $form->{db};
517 535
  $msg .= " saved!";
518 536

  
519
  $form->isblank("name", $locale->text("Name missing!"));
520
  my $rc;
521
  if ($form->{"db"} eq "customer") {
522
    $rc = CT->save_customer(\%myconfig, \%$form);
523
  } else {
524
    $rc = CT->save_vendor(\%myconfig, \%$form);
525
  }
526
  if ($rc == 3) {
527
    $form->error($locale->text('customernumber not unique!'));
528
  }
537
  _do_save();
538

  
529 539
  # saving the history
530 540
  if(!exists $form->{addition}) {
531 541
    $form->{snumbers} = ($form->{"db"} eq "customer" ? qq|customernumber_| . $form->{customernumber} : qq|vendornumber_| . $form->{vendornumber});
......
550 560
  my $msg = ucfirst $form->{db};
551 561
  $msg .= " saved!";
552 562

  
553
  $form->isblank("name", $locale->text("Name missing!"));
554

  
555
  my $res;
556
  if ($form->{"db"} eq "customer") {
557
    $res = CT->save_customer(\%myconfig, \%$form);
558
  } else {
559
    $res = CT->save_vendor(\%myconfig, \%$form);
560
  }
563
  _do_save();
561 564

  
562
  if (3 == $res) {
563
    if ($form->{"db"} eq "customer") {
564
      $form->error($locale->text('This customer number is already in use.'));
565
    } else {
566
      $form->error($locale->text('This vendor number is already in use.'));
567
    }
568
  }
569 565
  # saving the history
570 566
  if(!exists $form->{addition}) {
571 567
    $form->{snumbers} = ($form->{"db"} eq "customer" ? qq|customernumber_| . $form->{customernumber} : qq|vendornumber_| . $form->{vendornumber});
locale/de/all
343 343
  'Cash'                        => 'Zahlungsverkehr',
344 344
  'Cc'                          => 'Cc',
345 345
  'Change Lx-Office installation settings (all menu entries beneath \'System\')' => 'Verändern der Lx-Office-Installationseinstellungen (Menüpunkte unterhalb von \'System\')',
346
  'Change representative to'    => 'Vertreter ?ndern in',
346 347
  'Charge Number'               => 'Chargennummer',
347 348
  'Charge number'               => 'Chargennummer',
348 349
  'Chart'                       => 'Buchungskonto',
......
1925 1926
  'cp_greeting to cp_gender migration' => 'Datenumwandlung von Titel nach Geschlecht (cp_greeting to cp_gender)',
1926 1927
  'customer'                    => 'Kunde',
1927 1928
  'customer_list'               => 'kundenliste',
1928
  'customernumber not unique!'  => 'Die Kundennummer ist schon vergeben',
1929 1929
  'debug'                       => 'Debug',
1930 1930
  'delete'                      => 'L?schen',
1931 1931
  'deliverydate'                => 'Lieferdatum',
templates/webpages/ct/form_header.html
36 36
        -%]
37 37
       </td>
38 38
      </tr>
39
      [%- IF id %]
39 40
      <tr>
40 41
       <th align="right">[% 'Representative' | $T8 %]</th>
42
       <td>
43
        <input type="hidden" name="salesman_id" value="[%- HTML.escape(salesman_id) %]"%>
44
        [%- HTML.escape(salesman) %]
45
       </td>
46
      </tr>
47
      [%- END %]
48
      <tr>
49
       <th align="right">
50
        [%- IF !id %]
51
         [% 'Representative' | $T8 %]
52
        [%- ELSE %]
53
         [% 'Change representative to' | $T8 %]
54
        [%- END %]
55
       </th>
41 56
       <td>
42 57
        [%- INCLUDE generic/multibox.html
43
              name      = 'salesman_id',
44
              DATA      = ALL_SALESMAN_CUSTOMERS,
45
              id_key    = 'id',
46
              label_key = 'name',
58
              name       = 'new_salesman_id',
59
              DATA       = ALL_SALESMAN_CUSTOMERS,
60
              id_key     = 'id',
61
              label_key  = 'name',
62
              show_empty = id,
47 63
        -%]
48 64
       </td>
49 65
      </tr>

Auch abrufbar als: Unified diff