Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 19132371

Von Bernd Bleßmann vor fast 3 Jahren hinzugefügt

  • ID 19132371fe1237caafc1a2ef589a881de2780d99
  • Vorgänger a198dfae
  • Nachfolger d94f14be

Anzahlungs-Rg.: Workflow Auftrag -> Anzahlungs-Rg.

Unterschiede anzeigen:

SL/Controller/Order.pm
57 57
__PACKAGE__->run_before('check_auth');
58 58

  
59 59
__PACKAGE__->run_before('recalc',
60
                        only => [ qw(save save_as_new save_and_delivery_order save_and_invoice save_and_ap_transaction
60
                        only => [ qw(save save_as_new save_and_delivery_order save_and_invoice save_and_invoice_for_advance_payment save_and_ap_transaction
61 61
                                     print send_email) ]);
62 62

  
63 63
__PACKAGE__->run_before('get_unalterable_data',
64
                        only => [ qw(save save_as_new save_and_delivery_order save_and_invoice save_and_ap_transaction
64
                        only => [ qw(save save_as_new save_and_delivery_order save_and_invoice save_and_invoice_for_advance_payment save_and_ap_transaction
65 65
                                     print send_email) ]);
66 66

  
67 67
#
......
688 688
  );
689 689
}
690 690

  
691
sub action_save_and_invoice_for_advance_payment {
692
  my ($self) = @_;
693

  
694
  $self->save_and_redirect_to(
695
    controller       => 'oe.pl',
696
    action           => 'oe_invoice_from_order',
697
    new_invoice_type => 'invoice_for_advance_payment',
698
  );
699
}
700

  
691 701
# workflow from sales order to sales quotation
692 702
sub action_sales_quotation {
693 703
  $_[0]->workflow_sales_or_request_for_quotation();
......
1974 1984
  my @req_trans_cost_art = qw(kivi.Order.check_transport_cost_article_presence) x!!$::instance_conf->get_transport_cost_reminder_article_number_id;
1975 1985
  my @req_cusordnumber   = qw(kivi.Order.check_cusordnumber_presence)           x($self->type eq sales_order_type() && $::instance_conf->get_order_warn_no_cusordnumber);
1976 1986

  
1987
  my $has_invoice_for_advance_payment;
1988
  if ($self->order->id && $self->type eq sales_order_type()) {
1989
    my $lr = $self->order->linked_records(direction => 'to', to => ['Invoice']);
1990
    $has_invoice_for_advance_payment = any {'SL::DB::Invoice' eq ref $_ && "invoice_for_advance_payment" eq $_->type} @$lr;
1991
  }
1992

  
1977 1993
  for my $bar ($::request->layout->get('actionbar')) {
1978 1994
    $bar->add(
1979 1995
      combobox => [
......
2040 2056
                         @req_trans_cost_art, @req_cusordnumber,
2041 2057
          ],
2042 2058
        ],
2059
        action => [
2060
          t8('Save and Invoice for Advance Payment'),
2061
          call      => [ 'kivi.Order.save', 'save_and_invoice_for_advance_payment', $::instance_conf->get_order_warn_duplicate_parts ],
2062
          checks    => [ 'kivi.Order.check_save_active_periodic_invoices',
2063
                         @req_trans_cost_art, @req_cusordnumber,
2064
          ],
2065
          disabled  => $has_invoice_for_advance_payment ? t8('This order has already an invoice for advanced payment.')
2066
                                                        : undef,
2067
          only_if   => (any { $self->type eq $_ } (sales_order_type())),
2068
        ],
2043 2069
        action => [
2044 2070
          t8('Save and AP Transaction'),
2045 2071
          call      => [ 'kivi.Order.save', 'save_and_ap_transaction', $::instance_conf->get_order_warn_duplicate_parts ],

Auch abrufbar als: Unified diff