Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 7c3117b5

Von Thomas Kasulke vor fast 18 Jahren hinzugefügt

  • ID 7c3117b50d46f04f589aae322525f0797c4146e9
  • Vorgänger f0167814
  • Nachfolger 8299e7bc

Abfangen von doppelten Lieferantenadressen (beim Eintragen)

Unterschiede anzeigen:

SL/Form.pm
1344 1344
                      WHERE shipto_id = $self->{shipto_id}|;
1345 1345
      $dbh->do($query) || $self->dberror($query);
1346 1346
    } else {
1347
      my $query =
1348
      qq|INSERT INTO shipto (trans_id, shiptoname, shiptodepartment_1, shiptodepartment_2, shiptostreet,
1347
      my $query = qq|SELECT * FROM shipto
1348
                                 WHERE shiptoname = '$self->{shiptoname}' AND
1349
                      shiptodepartment_1 = '$self->{shiptodepartment_1}' AND
1350
                      shiptodepartment_2 = '$self->{shiptodepartment_2}' AND
1351
                      shiptostreet = '$self->{shiptostreet}' AND
1352
                      shiptozipcode = '$self->{shiptozipcode}' AND
1353
                      shiptocity = '$self->{shiptocity}' AND
1354
                      shiptocountry = '$self->{shiptocountry}' AND
1355
                      shiptocontact = '$self->{shiptocontact}' AND
1356
                      shiptophone = '$self->{shiptophone}' AND
1357
                      shiptofax = '$self->{shiptofax}' AND
1358
                      shiptoemail = '$self->{shiptoemail}'
1359
                      | ;
1360
      my $sth = $dbh->prepare($query);
1361
      $sth->execute() || $self->dberror($query);
1362
      my $insert_check = $sth->fetch();
1363
      $sth->finish();
1364
      if(!$insert_check){
1365
        $query =
1366
        qq|INSERT INTO shipto (trans_id, shiptoname, shiptodepartment_1,
1367
                   shiptodepartment_2, shiptostreet,
1349 1368
                   shiptozipcode, shiptocity, shiptocountry, shiptocontact,
1350 1369
		   shiptophone, shiptofax, shiptoemail, module) VALUES ($id,
1351 1370
		   '$self->{shiptoname}', '$self->{shiptodepartment_1}', '$self->{shiptodepartment_2}', '$self->{shiptostreet}',
1352 1371
		   '$self->{shiptozipcode}', '$self->{shiptocity}',
1353 1372
		   '$self->{shiptocountry}', '$self->{shiptocontact}',
1354 1373
		   '$self->{shiptophone}', '$self->{shiptofax}',
1355
		   '$self->{shiptoemail}', '$module')|;
1356
      $dbh->do($query) || $self->dberror($query);
1374
                   '$self->{shiptoemail}', '$module')|;              
1375
        $dbh->do($query) || $self->dberror($query);
1376
     }
1357 1377
    }
1358 1378
  }
1359 1379
##/LINET

Auch abrufbar als: Unified diff