Revision c389a0e6
Von Tamino Steinert vor mehr als 2 Jahren hinzugefügt
| SL/Controller/Reclamation.pm | ||
|---|---|---|
|                           workflow_save_and_sales_or_purchase_reclamation
 | ||
|                           save_and_order
 | ||
|                           save_and_delivery_order
 | ||
|                           save_and_credit_note
 | ||
|                        )]);
 | ||
|  | ||
| __PACKAGE__->run_before('get_unalterable_data',
 | ||
| ... | ... | |
|                           workflow_save_and_sales_or_purchase_reclamation
 | ||
|                           save_and_order
 | ||
|                           save_and_delivery_order
 | ||
|                           save_and_credit_note
 | ||
|                         )]);
 | ||
|  | ||
| #
 | ||
| ... | ... | |
|   );
 | ||
| }
 | ||
|  | ||
| # save the reclamation and redirect to the frontend subroutine for a new
 | ||
| # credit_note
 | ||
| sub action_save_and_credit_note {
 | ||
|   my ($self) = @_;
 | ||
|  | ||
|   # always save
 | ||
|   $self->save_with_render_error();
 | ||
|  | ||
|   if (!$self->reclamation->is_sales) {
 | ||
|     $self->js->flash('error', t8("Can't convert Purchase Reclamation to Credit Note"));
 | ||
|     return $self->js->render();
 | ||
|   }
 | ||
|  | ||
|   $self->save_and_redirect_to(
 | ||
|     controller => 'is.pl',
 | ||
|     action     => 'credit_note_from_reclamation',
 | ||
|     from_id    => $self->reclamation->id,
 | ||
|   );
 | ||
| }
 | ||
|  | ||
| # set form elements in respect to a changed customer or vendor
 | ||
| #
 | ||
| # This action is called on an change of the customer/vendor picker.
 | ||
| ... | ... | |
|             $::instance_conf->get_reclamation_warn_no_reqdate,
 | ||
|           ],
 | ||
|         ],
 | ||
|         action => [
 | ||
|           t8('Save and Credit Note'),
 | ||
|           call      => [
 | ||
|             'kivi.Reclamation.save', 'save_and_credit_note',
 | ||
|             $::instance_conf->get_reclamation_warn_duplicate_parts,
 | ||
|             $::instance_conf->get_reclamation_warn_no_reqdate,
 | ||
|           ],
 | ||
|           only_if   => (any { $self->type eq $_ } (sales_reclamation_type())),
 | ||
|         ],
 | ||
|       ], # end of combobox "Workflow"
 | ||
|  | ||
|       combobox => [
 | ||
Auch abrufbar als: Unified diff
Workflow: sales_reclamation → credit_note