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 ],
bin/mozilla/oe.pl
1699 1699

  
1700 1700
  if (   $form->{type} eq 'sales_order'
1701 1701
      || $form->{type} eq 'sales_quotation') {
1702
    $form->{title}  = $locale->text('Add Sales Invoice');
1702
    $form->{title}  = ($form->{new_invoice_type} eq 'invoice_for_advance_payment')
1703
                    ? $locale->text('Add Invoice for Advance Payment')
1704
                    : $locale->text('Add Sales Invoice');
1703 1705
    $form->{script} = 'is.pl';
1704 1706
    $script         = "is";
1705 1707
    $buysell        = 'buy';
......
1708 1710
  # bo creates the id, reset it
1709 1711
  map { delete $form->{$_} } qw(id subject message cc bcc printed emailed queued);
1710 1712
  $form->{ $form->{vc} } =~ s/--.*//g;
1711
  $form->{type} = "invoice";
1713
  $form->{type} = $form->{new_invoice_type} || "invoice";
1712 1714

  
1713 1715
  # locale messages
1714 1716
  $main::locale = Locale->new("$myconfig{countrycode}", "$script");
locale/de/all
3000 3000
  'Save and Delivery Order'     => 'Speichern und Lieferschein',
3001 3001
  'Save and E-mail'             => 'Speichern und E-Mail',
3002 3002
  'Save and Invoice'            => 'Speichern und Rechnung erfassen',
3003
  'Save and Invoice for Advance Payment' => 'Speichern und Anzahlungsrechnung',
3003 3004
  'Save and Order'              => 'Speichern und Auftrag erfassen',
3004 3005
  'Save and Purchase Order'     => 'Speichern und Lieferantenauftrag',
3005 3006
  'Save and Quotation'          => 'Speichern und Angebot',
......
3871 3872
  'This option controls the method used for determining the startdate for the balance report.' => 'Diese Option bestimmt, wie das Startdatum für den Bilanzbericht ermittelt wird',
3872 3873
  'This option controls the method used for profit determination.' => 'Dieser Parameter legt die Berechnungsmethode für die Gewinnermittlung fest.',
3873 3874
  'This option controls the posting and calculation behavior for the accounting method.' => 'Dieser Parameter steuert die Buchungs- und Berechnungsmethoden für die Versteuerungsart.',
3875
  'This order has already an invoice for advanced payment.' => 'Dieser Auftrag hat schon eine Anzahlungsrechnung.',
3874 3876
  'This part has already been added.' => 'Dieser Artikel wurde schon hinzugefügt',
3875 3877
  'This part was already counted for this bin:' => 'Dieser Artikel wurde für diesen Lagerplatz bereits erfasst:',
3876 3878
  'This price has since gone down' => 'Dieser Preis ist mittlerweile niedriger',
locale/en/all
2998 2998
  'Save and Delivery Order'     => '',
2999 2999
  'Save and E-mail'             => '',
3000 3000
  'Save and Invoice'            => '',
3001
  'Save and Invoice for Advance Payment' => '',
3001 3002
  'Save and Order'              => '',
3002 3003
  'Save and Purchase Order'     => '',
3003 3004
  'Save and Quotation'          => '',
......
3866 3867
  'This option controls the method used for determining the startdate for the balance report.' => '',
3867 3868
  'This option controls the method used for profit determination.' => '',
3868 3869
  'This option controls the posting and calculation behavior for the accounting method.' => '',
3870
  'This order has already an invoice for advanced payment.' => '',
3869 3871
  'This part has already been added.' => '',
3870 3872
  'This part was already counted for this bin:' => '',
3871 3873
  'This price has since gone down' => '',

Auch abrufbar als: Unified diff