Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 27ca3a23

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

  • ID 27ca3a23627019c1fbb0a74ce250beae763bc947
  • Vorgänger c1146a01
  • Nachfolger a4bd790b

Anzahlungs-Rg.: Workflow vom Auftrag: alle Anzahlugns-Rg. und Schluss-Rg.

Wird der Workflow vom Auftrag aus begonnen, so werden alle Anzahlungs- und
die Schlussrechnung vom Auftrag aus gemacht.
Der Einstieg über eine Anzahlungs-Rg. und dann der Workflow
"weitere Anzahlungs-Rg." (...) und hieraus Schluss-Rg. bleibt bestehen.

Unterschiede anzeigen:

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

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

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

  
66 66
#
......
663 663
  );
664 664
}
665 665

  
666
sub action_save_and_final_invoice {
667
  my ($self) = @_;
668

  
669
  $self->save_and_redirect_to(
670
    controller       => 'oe.pl',
671
    action           => 'oe_invoice_from_order',
672
    new_invoice_type => 'final_invoice',
673
  );
674
}
675

  
666 676
# workflow from sales order to sales quotation
667 677
sub action_sales_quotation {
668 678
  $_[0]->workflow_sales_or_request_for_quotation();
......
1951 1961
    $has_invoice_for_advance_payment = any {'SL::DB::Invoice' eq ref $_ && "invoice_for_advance_payment" eq $_->type} @$lr;
1952 1962
  }
1953 1963

  
1964
  my $has_final_invoice;
1965
  if ($self->order->id && $self->type eq sales_order_type()) {
1966
    my $lr = $self->order->linked_records(direction => 'to', to => ['Invoice']);
1967
    $has_final_invoice               = any {'SL::DB::Invoice' eq ref $_ && "final_invoice" eq $_->type} @$lr;
1968
  }
1969

  
1954 1970
  for my $bar ($::request->layout->get('actionbar')) {
1955 1971
    $bar->add(
1956 1972
      combobox => [
......
2018 2034
          ],
2019 2035
        ],
2020 2036
        action => [
2021
          t8('Save and Invoice for Advance Payment'),
2037
          ($has_invoice_for_advance_payment ? t8('Save and Further Invoice for Advance Payment') : t8('Save and Invoice for Advance Payment')),
2022 2038
          call      => [ 'kivi.Order.save', 'save_and_invoice_for_advance_payment', $::instance_conf->get_order_warn_duplicate_parts ],
2023 2039
          checks    => [ 'kivi.Order.check_save_active_periodic_invoices',
2024 2040
                         @req_trans_cost_art, @req_cusordnumber,
2025 2041
          ],
2026
          disabled  => $has_invoice_for_advance_payment ? t8('This order has already an invoice for advanced payment.')
2027
                                                        : undef,
2042
          disabled  => $has_final_invoice ? t8('This order has already a final invoice.')
2043
                                          : undef,
2028 2044
          only_if   => (any { $self->type eq $_ } (sales_order_type())),
2029 2045
        ],
2046
        action => [
2047
          t8('Save and Final Invoice'),
2048
          call      => [ 'kivi.Order.save', 'save_and_final_invoice', $::instance_conf->get_order_warn_duplicate_parts ],
2049
          checks    => [ 'kivi.Order.check_save_active_periodic_invoices',
2050
                         @req_trans_cost_art, @req_cusordnumber,
2051
          ],
2052
          disabled  => $has_final_invoice ? t8('This order has already a final invoice.')
2053
                                          : undef,
2054
          only_if   => (any { $self->type eq $_ } (sales_order_type())) && $has_invoice_for_advance_payment,
2055
        ],
2030 2056
        action => [
2031 2057
          t8('Save and AP Transaction'),
2032 2058
          call      => [ 'kivi.Order.save', 'save_and_ap_transaction', $::instance_conf->get_order_warn_duplicate_parts ],

Auch abrufbar als: Unified diff