Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision becda06d

Von Moritz Bunkus vor fast 14 Jahren hinzugefügt

  • ID becda06d038cfbcc3b69fbdfa4b89447626e7cab
  • Vorgänger b2c6d5a8
  • Nachfolger 5609a646

Beim Anlegen von Kunden-/Lieferantennummern Lücken im Nummernkreis richtig behandeln

Fix für Bug 1553.

Unterschiede anzeigen:

SL/CT.pm
44 44
use SL::DBUtils;
45 45
use SL::FU;
46 46
use SL::Notes;
47
use SL::TransNumber;
47 48

  
48 49
use strict;
49 50

  
......
261 262
    }
262 263

  
263 264
  } else {
264
    if (!$form->{customernumber} && $form->{business}) {
265
      $form->{customernumber} =
266
        $form->update_business($myconfig, $form->{business}, $dbh);
267
    }
268
    if (!$form->{customernumber}) {
269
      $form->{customernumber} =
270
        $form->update_defaults($myconfig, "customernumber", $dbh);
271
    }
272

  
273
    $query  = qq|SELECT c.id FROM customer c WHERE c.customernumber = ?|;
274
    ($f_id) = selectrow_query($form, $dbh, $query, $form->{customernumber});
275
    if ($f_id ne "") {
276
      $main::lxdebug->leave_sub();
277
      return 3;
278
    }
265
    my $customernumber      = SL::TransNumber->new(type        => 'customer',
266
                                                   dbh         => $dbh,
267
                                                   number      => $form->{customernumber},
268
                                                   business_id => $form->{business},
269
                                                   save        => 1);
270
    $form->{customernumber} = $customernumber->create_unique unless $customernumber->is_unique;
279 271

  
280 272
    $query = qq|SELECT nextval('id')|;
281 273
    ($form->{id}) = selectrow_query($form, $dbh, $query);
......
488 480
    $query = qq|INSERT INTO vendor (id, name) VALUES (?, '')|;
489 481
    do_query($form, $dbh, $query, $form->{id});
490 482

  
491
    if ( !$form->{vendornumber} ) {
492
      $form->{vendornumber} = $form->update_defaults( $myconfig, "vendornumber", $dbh );
493
    }
483
    my $vendornumber      = SL::TransNumber->new(type   => 'vendor',
484
                                                 dbh    => $dbh,
485
                                                 number => $form->{vendornumber},
486
                                                 save   => 1);
487
    $form->{vendornumber} = $vendornumber->create_unique unless $vendornumber->is_unique;
494 488
  }
495 489

  
496 490
  $query =

Auch abrufbar als: Unified diff