Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 58ae7e4d

Von Werner Hahn vor fast 2 Jahren hinzugefügt

  • ID 58ae7e4dea18b112b66066d3ca3aa49d1fc697d3
  • Vorgänger 13b8f24a
  • Nachfolger a24773da

fix #506 - Beistelllieferschein/DeliveryOrderController speichern deaktiviert wenn schon geliefert und ausgelagert

Unterschiede anzeigen:

SL/Controller/DeliveryOrder.pm
264 264
sub action_print {
265 265
  my ($self) = @_;
266 266

  
267
  my $errors = $self->save();
267
  if ( !$self->order->delivered ) {
268
    my $errors = $self->save();
268 269

  
269
  if (scalar @{ $errors }) {
270
    $self->js->flash('error', $_) foreach @{ $errors };
271
    return $self->js->render();
272
  }
270
    if (scalar @{ $errors }) {
271
      $self->js->flash('error', $_) foreach @{ $errors };
272
      return $self->js->render();
273
    }
273 274

  
274
  $self->js_reset_order_and_item_ids_after_save;
275
    $self->js_reset_order_and_item_ids_after_save;
276
  }
275 277

  
276 278
  my $format      = $::form->{print_options}->{format};
277 279
  my $media       = $::form->{print_options}->{media};
......
344 346
sub action_preview_pdf {
345 347
  my ($self) = @_;
346 348

  
347
  my $errors = $self->save();
348
  if (scalar @{ $errors }) {
349
    $self->js->flash('error', $_) foreach @{ $errors };
350
    return $self->js->render();
351
  }
349
  if ( !$self->order->delivered ) {
350
    my $errors = $self->save();
351
    if (scalar @{ $errors }) {
352
      $self->js->flash('error', $_) foreach @{ $errors };
353
      return $self->js->render();
354
    }
352 355

  
353
  $self->js_reset_order_and_item_ids_after_save;
356
    $self->js_reset_order_and_item_ids_after_save;
357
  }
354 358

  
355 359
  my $format      = 'pdf';
356 360
  my $media       = 'screen';
......
389 393
sub action_save_and_show_email_dialog {
390 394
  my ($self) = @_;
391 395

  
392
  my $errors = $self->save();
396
  if ( !$self->order->delivered ) {
397
    my $errors = $self->save();
393 398

  
394
  if (scalar @{ $errors }) {
395
    $self->js->flash('error', $_) foreach @{ $errors };
396
    return $self->js->render();
399
    if (scalar @{ $errors }) {
400
      $self->js->flash('error', $_) foreach @{ $errors };
401
      return $self->js->render();
402
    }
397 403
  }
398 404

  
399 405
  my $cv_method = $self->cv;
......
447 453
sub action_send_email {
448 454
  my ($self) = @_;
449 455

  
450
  my $errors = $self->save();
456
  if ( !$self->order->delivered ) {
457
    my $errors = $self->save();
451 458

  
452
  if (scalar @{ $errors }) {
453
    $self->js->run('kivi.DeliveryOrder.close_email_dialog');
454
    $self->js->flash('error', $_) foreach @{ $errors };
455
    return $self->js->render();
459
    if (scalar @{ $errors }) {
460
      $self->js->run('kivi.DeliveryOrder.close_email_dialog');
461
      $self->js->flash('error', $_) foreach @{ $errors };
462
      return $self->js->render();
463
    }
464
    $self->js_reset_order_and_item_ids_after_save;
456 465
  }
457 466

  
458
  $self->js_reset_order_and_item_ids_after_save;
459 467

  
460 468
  my $email_form  = delete $::form->{email_form};
461 469
  my %field_names = (to => 'email');
......
1865 1873
                                                     warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts,
1866 1874
                                                     warn_on_reqdate    => $::instance_conf->get_order_warn_no_deliverydate },
1867 1875
          ],
1868
          disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef,
1876
          disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.')
1877
                    : $self->order->delivered ? t8('This record has already been delivered.')
1878
                    :                        undef,
1869 1879
        ],
1870 1880
        action => [
1871 1881
          t8('Save as new'),

Auch abrufbar als: Unified diff