Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 6c6cf6d9

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

  • ID 6c6cf6d9946317ff700a5dd2e88a184b186b6013
  • Vorgänger b5e76ec2
  • Nachfolger 2d66b506

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

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_ap_transaction
59
                        only => [ qw(save save_as_new save_and_delivery_order save_and_invoice save_and_invoice_for_advance_payment 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_ap_transaction
63
                        only => [ qw(save save_as_new save_and_delivery_order save_and_invoice save_and_invoice_for_advance_payment save_and_ap_transaction
64 64
                                     print send_email) ]);
65 65

  
66 66
#
......
653 653
  );
654 654
}
655 655

  
656
sub action_save_and_invoice_for_advance_payment {
657
  my ($self) = @_;
658

  
659
  $self->save_and_redirect_to(
660
    controller       => 'oe.pl',
661
    action           => 'oe_invoice_from_order',
662
    new_invoice_type => 'invoice_for_advance_payment',
663
  );
664
}
665

  
656 666
# workflow from sales order to sales quotation
657 667
sub action_sales_quotation {
658 668
  $_[0]->workflow_sales_or_request_for_quotation();
......
1935 1945
  my @req_trans_cost_art = qw(kivi.Order.check_transport_cost_article_presence) x!!$::instance_conf->get_transport_cost_reminder_article_number_id;
1936 1946
  my @req_cusordnumber   = qw(kivi.Order.check_cusordnumber_presence)           x($self->type eq sales_order_type() && $::instance_conf->get_order_warn_no_cusordnumber);
1937 1947

  
1948
  my $has_invoice_for_advance_payment;
1949
  if ($self->order->id && $self->type eq sales_order_type()) {
1950
    my $lr = $self->order->linked_records(direction => 'to', to => ['Invoice']);
1951
    $has_invoice_for_advance_payment = any {'SL::DB::Invoice' eq ref $_ && "invoice_for_advance_payment" eq $_->type} @$lr;
1952
  }
1953

  
1938 1954
  for my $bar ($::request->layout->get('actionbar')) {
1939 1955
    $bar->add(
1940 1956
      combobox => [
......
2001 2017
                         @req_trans_cost_art, @req_cusordnumber,
2002 2018
          ],
2003 2019
        ],
2020
        action => [
2021
          t8('Save and Invoice for Advance Payment'),
2022
          call      => [ 'kivi.Order.save', 'save_and_invoice_for_advance_payment', $::instance_conf->get_order_warn_duplicate_parts ],
2023
          checks    => [ 'kivi.Order.check_save_active_periodic_invoices',
2024
                         @req_trans_cost_art, @req_cusordnumber,
2025
          ],
2026
          disabled  => $has_invoice_for_advance_payment ? t8('This order has already an invoice for advanced payment.')
2027
                                                        : undef,
2028
          only_if   => (any { $self->type eq $_ } (sales_order_type())),
2029
        ],
2004 2030
        action => [
2005 2031
          t8('Save and AP Transaction'),
2006 2032
          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
2959 2959
  'Save and Delivery Order'     => 'Speichern und Lieferschein',
2960 2960
  'Save and E-mail'             => 'Speichern und E-Mail',
2961 2961
  'Save and Invoice'            => 'Speichern und Rechnung erfassen',
2962
  'Save and Invoice for Advance Payment' => 'Speichern und Anzahlungsrechnung',
2962 2963
  'Save and Order'              => 'Speichern und Auftrag erfassen',
2963 2964
  'Save and Purchase Order'     => 'Speichern und Lieferantenauftrag',
2964 2965
  'Save and Quotation'          => 'Speichern und Angebot',
......
3819 3820
  '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',
3820 3821
  'This option controls the method used for profit determination.' => 'Dieser Parameter legt die Berechnungsmethode für die Gewinnermittlung fest.',
3821 3822
  'This option controls the posting and calculation behavior for the accounting method.' => 'Dieser Parameter steuert die Buchungs- und Berechnungsmethoden für die Versteuerungsart.',
3823
  'This order has already an invoice for advanced payment.' => 'Dieser Auftrag hat schon eine Anzahlungsrechnung.',
3822 3824
  'This part has already been added.' => 'Dieser Artikel wurde schon hinzugefügt',
3823 3825
  'This part was already counted for this bin:' => 'Dieser Artikel wurde für diesen Lagerplatz bereits erfasst:',
3824 3826
  'This price has since gone down' => 'Dieser Preis ist mittlerweile niedriger',
locale/en/all
2959 2959
  'Save and Delivery Order'     => '',
2960 2960
  'Save and E-mail'             => '',
2961 2961
  'Save and Invoice'            => '',
2962
  'Save and Invoice for Advance Payment' => '',
2962 2963
  'Save and Order'              => '',
2963 2964
  'Save and Purchase Order'     => '',
2964 2965
  'Save and Quotation'          => '',
......
3818 3819
  'This option controls the method used for determining the startdate for the balance report.' => '',
3819 3820
  'This option controls the method used for profit determination.' => '',
3820 3821
  'This option controls the posting and calculation behavior for the accounting method.' => '',
3822
  'This order has already an invoice for advanced payment.' => '',
3821 3823
  'This part has already been added.' => '',
3822 3824
  'This part was already counted for this bin:' => '',
3823 3825
  'This price has since gone down' => '',

Auch abrufbar als: Unified diff