Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 7589c136

Von Tamino Steinert vor etwa 2 Monaten hinzugefügt

  • ID 7589c13627fe3de8b397d3dae6270f566664d3d2
  • Vorgänger 0cdb369e
  • Nachfolger 976b7115

S:C:Order: Positionskonfiguration für Wied. Rech. bearbeiten können

Unterschiede anzeigen:

SL/Controller/Order.pm
41 41
use SL::DB::Order::TypeData qw(:types);
42 42
use SL::DB::DeliveryOrder::TypeData qw(:types);
43 43
use SL::DB::Reclamation::TypeData qw(:types);
44
use SL::DB::PeriodicInvoiceItemsConfig;
44 45

  
45 46
use SL::Helper::CreatePDF qw(:all);
46 47
use SL::Helper::PrintOptions;
......
820 821
  $_[0]->render(\ !!$has_active_periodic_invoices, { type => 'text' });
821 822
}
822 823

  
824
sub action_show_periodic_invoice_items_config_dialog {
825
  my ($self) = @_;
826

  
827
  my $config = SL::DB::PeriodicInvoiceItemsConfig->new(
828
    %{$::form->{periodic_invoice_items_config}}
829
  );
830

  
831
  $self->render(
832
    'order/tabs/_edit_periodic_invoice_items_config', { layout => 0 },
833
    CONFIG => $config,
834
    ITEM_ID => $::form->{item_id},
835
  );
836
}
837

  
838
sub action_update_periodic_invoice_items_config_button {
839
  my ($self) = @_;
840

  
841
  my $config = SL::DB::PeriodicInvoiceItemsConfig->new(
842
    %{$::form->{periodic_invoice_items_config}}
843
  );
844
  my $item_id = $::form->{item_id} or die "No item id given";
845
  my $button_text = $self->get_button_text_for_periodic_invoice_items_config($config);
846

  
847
  $self->js->val("#periodic_invoice_items_config_button_$item_id", $button_text)->render();
848
}
849

  
850
sub get_button_text_for_periodic_invoice_items_config {
851
  my ($self, $config) = @_;
852

  
853
  my $button_text = t8('Periodic Invoices') . ': ';
854

  
855
  if ($config && $config->periodicity) {
856
    my %peridoicity_to_text = (
857
      p => t8("same as periodicity"),
858
      n => t8("never"),
859
      o => t8("one time"),
860
      m => t8("monthly"),
861
      q => t8("every third month"),
862
      b => t8("semiannually"),
863
      y => t8("yearly")
864
    );
865
    $button_text .= $peridoicity_to_text{$config->periodicity};
866
    $button_text .= " | ";
867
    $button_text .= $config->start_date_as_date || "_";
868
    $button_text .= " " . t8("to") . " ";
869
    $button_text .= $config->end_date_as_date || "_";
870
    if ($config->terminated) {
871
      $button_text .= " X";
872
    } elsif ($config->extend_automatically_by) {
873
      $button_text .= " +" . $config->extend_automatically_by;
874
    }
875

  
876
  } else {
877
    $button_text .= t8('standard');
878
  }
879

  
880
  return $button_text;
881
}
882

  
823 883
sub action_save_and_new_record {
824 884
  my ($self) = @_;
825 885
  my $to_type = $::form->{to_type};
......
1549 1609
    $item->parse_custom_variable_values;
1550 1610
  }
1551 1611

  
1552
  my $row_as_html = $self->p->render('order/tabs/_second_row', ITEM => $item, TYPE => $self->type);
1612
  my $row_as_html = $self->p->render(
1613
    'order/tabs/_second_row',
1614
    SELF => $self,
1615
    ITEM => $item,
1616
    ID   => $item_id,
1617
    TYPE => $self->type
1618
  );
1553 1619

  
1554 1620
  $self->js
1555 1621
    ->html('#second_row_' . $item_id, $row_as_html)

Auch abrufbar als: Unified diff