Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 5d4c9dd1

Von Tamino Steinert vor mehr als 1 Jahr hinzugefügt

  • ID 5d4c9dd1722ed6ba0f37a91334013afa523acd30
  • Vorgänger 8b9e5920
  • Nachfolger 5ff56ded

BJ: CheckBelowMinimumStock: FIX: speichere keine IDs und Fehler

Unterschiede anzeigen:

SL/BackgroundJob/CheckBelowMinimumStock.pm
41 41
          . "\n";
42 42
      push @ids, $part_hash->{id};
43 43
    }
44
    $self->{job_obj}->set_data(
45
      errors => $error_string,
46
      ids => \@ids,
47
    )->save;
44
    $self->{errors} = $error_string;
45
    $self->{ids}    = \@ids;
48 46
  }
49 47
  return;
50 48
}
......
77 75
  my $err = $mail->send;
78 76

  
79 77
  if ($err) {
80
    my $error = $self->{job_obj}->data_as_hash->{errors} . t8('Mailer error #1', $err);
81
    $self->{job_obj}->set_data(errors => $error)->save;
78
    $self->{errors} .= t8('Mailer error #1', $err);
82 79
  }
83 80

  
84 81
  return
......
98 95
  my $filename       = $email_template || ( (SL::DB::Default->get->templates || "templates/mails") . "/below_minimum_stock/error_email.html" );
99 96
  my $content_type   = $filename =~ m/.html$/ ? 'text/html' : 'text/plain';
100 97

  
101
  my @ids = @{$self->{job_obj}->data_as_hash->{ids}};
98
  my @ids = @{$self->{ids}};
102 99
  my @parts = @{SL::DB::Manager::Part->get_all(where => [id => @ids])};
103 100

  
104 101

  
......
147 144

  
148 145
  $self->check_below_minimum_stock();
149 146

  
150
  my $data = $job_obj->data_as_hash;
151
  if ($data->{errors}) {
147
  if ($self->{errors}) {
152 148
      # on error we have to inform the user
153 149
      $self->send_email();
154
      die $data->{errors};
150
      die $self->{errors};
155 151
  }
156 152

  
157 153
  $job_obj->set_data(status => DONE())->save;

Auch abrufbar als: Unified diff