Revision 86ece8e2
Von Werner Hahn vor etwa 2 Jahren hinzugefügt
SL/Controller/DeliveryOrder.pm | ||
---|---|---|
251 | 251 |
sub action_print { |
252 | 252 |
my ($self) = @_; |
253 | 253 |
|
254 |
my $errors = $self->save(); |
|
254 |
if ( !$self->order->delivered ) { |
|
255 |
my $errors = $self->save(); |
|
255 | 256 |
|
256 |
if (scalar @{ $errors }) { |
|
257 |
$self->js->flash('error', $_) foreach @{ $errors }; |
|
258 |
return $self->js->render(); |
|
259 |
} |
|
257 |
if (scalar @{ $errors }) {
|
|
258 |
$self->js->flash('error', $_) foreach @{ $errors };
|
|
259 |
return $self->js->render();
|
|
260 |
}
|
|
260 | 261 |
|
261 |
$self->js_reset_order_and_item_ids_after_save; |
|
262 |
$self->js_reset_order_and_item_ids_after_save; |
|
263 |
} |
|
262 | 264 |
|
263 | 265 |
my $format = $::form->{print_options}->{format}; |
264 | 266 |
my $media = $::form->{print_options}->{media}; |
... | ... | |
331 | 333 |
sub action_preview_pdf { |
332 | 334 |
my ($self) = @_; |
333 | 335 |
|
334 |
my $errors = $self->save(); |
|
335 |
if (scalar @{ $errors }) { |
|
336 |
$self->js->flash('error', $_) foreach @{ $errors }; |
|
337 |
return $self->js->render(); |
|
338 |
} |
|
336 |
if ( !$self->order->delivered ) { |
|
337 |
my $errors = $self->save(); |
|
338 |
if (scalar @{ $errors }) { |
|
339 |
$self->js->flash('error', $_) foreach @{ $errors }; |
|
340 |
return $self->js->render(); |
|
341 |
} |
|
339 | 342 |
|
340 |
$self->js_reset_order_and_item_ids_after_save; |
|
343 |
$self->js_reset_order_and_item_ids_after_save; |
|
344 |
} |
|
341 | 345 |
|
342 | 346 |
my $format = 'pdf'; |
343 | 347 |
my $media = 'screen'; |
... | ... | |
376 | 380 |
sub action_save_and_show_email_dialog { |
377 | 381 |
my ($self) = @_; |
378 | 382 |
|
379 |
my $errors = $self->save(); |
|
383 |
if ( !$self->order->delivered ) { |
|
384 |
my $errors = $self->save(); |
|
380 | 385 |
|
381 |
if (scalar @{ $errors }) { |
|
382 |
$self->js->flash('error', $_) foreach @{ $errors }; |
|
383 |
return $self->js->render(); |
|
386 |
if (scalar @{ $errors }) { |
|
387 |
$self->js->flash('error', $_) foreach @{ $errors }; |
|
388 |
return $self->js->render(); |
|
389 |
} |
|
384 | 390 |
} |
385 | 391 |
|
386 | 392 |
my $cv_method = $self->cv; |
... | ... | |
434 | 440 |
sub action_send_email { |
435 | 441 |
my ($self) = @_; |
436 | 442 |
|
437 |
my $errors = $self->save(); |
|
443 |
if ( !$self->order->delivered ) { |
|
444 |
my $errors = $self->save(); |
|
438 | 445 |
|
439 |
if (scalar @{ $errors }) { |
|
440 |
$self->js->run('kivi.DeliveryOrder.close_email_dialog'); |
|
441 |
$self->js->flash('error', $_) foreach @{ $errors }; |
|
442 |
return $self->js->render(); |
|
446 |
if (scalar @{ $errors }) { |
|
447 |
$self->js->run('kivi.DeliveryOrder.close_email_dialog'); |
|
448 |
$self->js->flash('error', $_) foreach @{ $errors }; |
|
449 |
return $self->js->render(); |
|
450 |
} |
|
451 |
$self->js_reset_order_and_item_ids_after_save; |
|
443 | 452 |
} |
444 | 453 |
|
445 |
$self->js_reset_order_and_item_ids_after_save; |
|
446 | 454 |
|
447 | 455 |
my $email_form = delete $::form->{email_form}; |
448 | 456 |
my %field_names = (to => 'email'); |
... | ... | |
1807 | 1815 |
warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts, |
1808 | 1816 |
warn_on_reqdate => $::instance_conf->get_order_warn_no_deliverydate }, |
1809 | 1817 |
], |
1810 |
disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef, |
|
1818 |
disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') |
|
1819 |
: $self->order->delivered ? t8('This record has already been delivered.') |
|
1820 |
: undef, |
|
1811 | 1821 |
], |
1812 | 1822 |
action => [ |
1813 | 1823 |
t8('Save as new'), |
Auch abrufbar als: Unified diff
fix #506 - Beistelllieferschein/DeliveryOrderController speichern deaktiviert wenn schon geliefert und ausgelagert