Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision a1a3bfd8

Von Moritz Bunkus vor fast 18 Jahren hinzugefügt

  • ID a1a3bfd84dbda57fe1c7a9d581a599067557ff7a
  • Vorgänger 379aa61a
  • Nachfolger dbafd846

Codeduplikation vermeiden.

Unterschiede anzeigen:

SL/IR.pm
1425 1425
  return $rc;
1426 1426
}
1427 1427

  
1428
sub has_storno {
1429
  $main::lxdebug->enter_sub();
1430

  
1431
  my ($self, $myconfig, $form) = @_;
1432

  
1433
  $main::lxdebug->leave_sub() and return 0 unless ($form->{id});
1434

  
1435
  my $dbh = $form->dbconnect($myconfig);
1436

  
1437
  my $query = qq|SELECT storno FROM ap WHERE id = ?|;
1438
  my ($result) = selectrow_query($form, $dbh, $query, $form->{id});
1439

  
1440
  $dbh->disconnect();
1441

  
1442
  $main::lxdebug->leave_sub();
1443

  
1444
  return $result;
1445
}
1446

  
1447 1428
1;
SL/IS.pm
2226 2226
sub has_storno {
2227 2227
  $main::lxdebug->enter_sub();
2228 2228

  
2229
  my ($self, $myconfig, $form) = @_;
2229
  my ($self, $myconfig, $form, $table) = @_;
2230 2230

  
2231 2231
  $main::lxdebug->leave_sub() and return 0 unless ($form->{id});
2232 2232

  
2233 2233
  my $dbh = $form->dbconnect($myconfig);
2234 2234

  
2235
  my $query = qq|SELECT storno FROM ar WHERE id = ?|;
2235
  my $query = qq|SELECT storno FROM $table WHERE id = ?|;
2236 2236
  my ($result) = selectrow_query($form, $dbh, $query, $form->{id});
2237 2237

  
2238 2238
  $dbh->disconnect();
bin/mozilla/ir.pl
32 32
#======================================================================
33 33

  
34 34
use SL::IR;
35
use SL::IS;
35 36
use SL::PE;
36 37

  
37 38
require "$form->{path}/io.pl";
......
972 973
    $form->error($locale->text('Cannot storno storno invoice!'));
973 974
  }
974 975

  
975
  if (IR->has_storno(\%myconfig, $form)) {
976
  if (IS->has_storno(\%myconfig, $form, "ap")) {
976 977
    $form->error($locale->text("Invoice has already been storno'd!"));
977 978
  }
978 979

  
bin/mozilla/is.pl
1518 1518
    $form->error($locale->text('Cannot storno storno invoice!'));
1519 1519
  }
1520 1520

  
1521
  if (IS->has_storno(\%myconfig, $form)) {
1521
  if (IS->has_storno(\%myconfig, $form, "ar")) {
1522 1522
    $form->error($locale->text("Invoice has already been storno'd!"));
1523 1523
  }
1524 1524

  

Auch abrufbar als: Unified diff