sub workflow_sales_or_purchase_order {
my ($self) = @_;
+ # always save
+ my $errors = $self->save();
+
+ if (scalar @{ $errors }) {
+ $self->js->flash('error', $_) foreach @{ $errors };
+ return $self->js->render();
+ }
+
my $destination_type = $::form->{type} eq sales_quotation_type() ? sales_order_type()
: $::form->{type} eq request_quotation_type() ? purchase_order_type()
t8('Workflow'),
],
action => [
- t8('Sales Order'),
+ t8('Save and Sales Order'),
submit => [ '#order_form', { action => "Order/sales_order" } ],
only_if => (any { $self->type eq $_ } (sales_quotation_type(), purchase_order_type())),
disabled => !$self->order->id ? t8('This object has not been saved yet.') : undef,
],
action => [
- t8('Purchase Order'),
+ t8('Save and Purchase Order'),
submit => [ '#order_form', { action => "Order/purchase_order" } ],
only_if => (any { $self->type eq $_ } (sales_order_type(), request_quotation_type())),
disabled => !$self->order->id ? t8('This object has not been saved yet.') : undef,
'Save and E-mail' => 'Speichern und E-Mail',
'Save and Invoice' => 'Speichern und Rechnung erfassen',
'Save and Order' => 'Speichern und Auftrag erfassen',
+ 'Save and Purchase Order' => 'Speichern und Lieferantenauftrag',
'Save and Quotation' => 'Speichern und Angebot',
'Save and RFQ' => 'Speichern und Lieferantenanfrage',
+ 'Save and Sales Order' => 'Speichern und Kundenauftrag',
'Save and close' => 'Speichern und schließen',
'Save and execute' => 'Speichern und ausführen',
'Save and keep open' => 'Speichern und geöffnet lassen',