Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 2e9dddf1

Von Bernd Bleßmann vor mehr als 6 Jahren hinzugefügt

  • ID 2e9dddf1e0e218172404a4fd395c83228280fb09
  • Vorgänger 4624b187
  • Nachfolger 7d2700f0

Auftrags-Controller: Bei Angeboten das richtige Nummern-Feld nehmen

Fehler waren hier: keine Angebotsnummer in Name des Anhangs, kein Speichern
im Webdav oder Datei-Storage.

Unterschiede anzeigen:

SL/Controller/Order.pm
212 212
  $language = SL::DB::Language->new(id => $::form->{print_options}->{language_id})->load if $::form->{print_options}->{language_id};
213 213

  
214 214
  # create a form for generate_attachment_filename
215
  my $form = Form->new;
216
  $form->{ordnumber} = $self->order->ordnumber;
217
  $form->{type}      = $self->type;
218
  $form->{format}    = $format;
219
  $form->{formname}  = $formname;
220
  $form->{language}  = '_' . $language->template_code if $language;
221
  my $pdf_filename   = $form->generate_attachment_filename();
215
  my $form   = Form->new;
216
  $form->{$self->_nr_key()} = $self->order->number;
217
  $form->{type}             = $self->type;
218
  $form->{format}           = $format;
219
  $form->{formname}         = $formname;
220
  $form->{language}         = '_' . $language->template_code if $language;
221
  my $pdf_filename          = $form->generate_attachment_filename();
222 222

  
223 223
  my $pdf;
224 224
  my @errors = _create_pdf($self->order, \$pdf, { format     => $format,
......
254 254
  }
255 255

  
256 256
  # copy file to webdav folder
257
  if ($self->order->ordnumber && $::instance_conf->get_webdav_documents) {
257
  if ($self->order->number && $::instance_conf->get_webdav_documents) {
258 258
    my $webdav = SL::Webdav->new(
259 259
      type     => $self->type,
260
      number   => $self->order->ordnumber,
260
      number   => $self->order->number,
261 261
    );
262 262
    my $webdav_file = SL::Webdav::File->new(
263 263
      webdav   => $webdav,
......
270 270
      $self->js->flash('error', t8('Storing PDF to webdav folder failed: #1', $@));
271 271
    }
272 272
  }
273
  if ($self->order->ordnumber && $::instance_conf->get_doc_storage) {
273
  if ($self->order->number && $::instance_conf->get_doc_storage) {
274 274
    eval {
275 275
      SL::File->save(object_id     => $self->order->id,
276 276
                     object_type   => $self->type,
......
321 321
  # Todo: get addresses from shipto, if any
322 322

  
323 323
  my $form = Form->new;
324
  $form->{ordnumber} = $self->order->ordnumber;
325
  $form->{formname}  = $self->type;
326
  $form->{type}      = $self->type;
327
  $form->{language} = 'de';
328
  $form->{format}   = 'pdf';
324
  $form->{$self->_nr_key()} = $self->order->number;
325
  $form->{formname}         = $self->type;
326
  $form->{type}             = $self->type;
327
  $form->{language}         = 'de';
328
  $form->{format}           = 'pdf';
329 329

  
330 330
  $email_form->{subject}             = $form->generate_email_subject();
331 331
  $email_form->{attachment_filename} = $form->generate_attachment_filename();
......
1445 1445
    $item->active_discount_source($price_source->discount_from_source($item->active_discount_source));
1446 1446
  }
1447 1447

  
1448
  if ($self->order->ordnumber && $::instance_conf->get_webdav) {
1448
  if ($self->order->number && $::instance_conf->get_webdav) {
1449 1449
    my $webdav = SL::Webdav->new(
1450 1450
      type     => $self->type,
1451
      number   => $self->order->ordnumber,
1451
      number   => $self->order->number,
1452 1452
    );
1453 1453
    my @all_objects = $webdav->get_all_objects;
1454 1454
    @{ $self->{template_args}->{WEBDAV} } = map { { name => $_->filename,
......
1692 1692
  'request_quotation';
1693 1693
}
1694 1694

  
1695
sub _nr_key {
1696
  return $_[0]->type eq _sales_order_type()       ? 'ordnumber'
1697
       : $_[0]->type eq _purchase_order_type()    ? 'ordnumber'
1698
       : $_[0]->type eq _sales_quotation_type()   ? 'quonumber'
1699
       : $_[0]->type eq _request_quotation_type() ? 'quonumber'
1700
       : '';
1701
}
1702

  
1695 1703
1;
1696 1704

  
1697 1705
__END__

Auch abrufbar als: Unified diff