Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 9aa58dc1

Von Bernd Bleßmann vor mehr als 6 Jahren hinzugefügt

  • ID 9aa58dc1c8cf72ad95a90688ae2245abe589dd78
  • Vorgänger c3db1b36
  • Nachfolger c4c97beb

Workflow VK-Rechnung->Auftrag auf neuen Controller bei experimentellen Features

Unterschiede anzeigen:

SL/Controller/Order.pm
72 72
sub action_edit {
73 73
  my ($self) = @_;
74 74

  
75
  $self->load_order;
75
  if ($::form->{id}) {
76
    $self->load_order;
77

  
78
  } else {
79
    # this is to edit an order from an unsaved order object
80

  
81
    # set item ids to new fake id, to identify them as new items
82
    foreach my $item (@{$self->order->items_sorted}) {
83
      $item->{new_fake_id} = join('_', 'new', Time::HiRes::gettimeofday(), int rand 1000000000000);
84
    }
85
    # trigger rendering values for second row/longdescription as hidden,
86
    # because they are loaded only on demand. So we need to keep the values
87
    # from the source.
88
    $_->{render_second_row}      = 1 for @{ $self->order->items_sorted };
89
    $_->{render_longdescription} = 1 for @{ $self->order->items_sorted };
90
  }
91

  
76 92
  $self->recalc();
77 93
  $self->pre_render();
78 94
  $self->render(
bin/mozilla/io.pl
909 909
sub order {
910 910
  $main::lxdebug->enter_sub();
911 911

  
912
  _order();
913

  
914
  if ($::instance_conf->get_feature_experimental) {
915
    my $order = _make_record();
916
    $order->globalproject_id(undef) if !$order->globalproject_id;
917
    $order->payment_id(undef)       if !$order->payment_id;
918
    my $row = 1;
919
    foreach my $item (@{$order->items_sorted}) {
920
      $item->custom_variables([]);
921

  
922
      $item->price_factor_id(undef) if !$item->price_factor_id;
923
      $item->project_id(undef)      if !$item->project_id;
924
      $item->discount($item->discount/100.0);
925

  
926
      # autovivify all cvars that are not in the form (cvars_by_config can do it).
927
      # workaround to pre-parse number-cvars (parse_custom_variable_values does not parse number values).
928
       foreach my $var (@{ $item->cvars_by_config }) {
929
        my $key = 'ic_cvar_' . $var->config->name . '_' . $row;
930
        $var->unparsed_value($::form->{$key});
931
        $var->unparsed_value($::form->parse_amount(\%::myconfig, $var->{__unparsed_value})) if ($var->config->type eq 'number' && exists($var->{__unparsed_value}));
932
      }
933
      $item->parse_custom_variable_values;
934

  
935
      $row++;
936
    }
937

  
938
    require SL::Controller::Order;
939
    my $c = SL::Controller::Order->new(order => $order);
940
    $c->action_edit();
941

  
942
    $main::lxdebug->leave_sub();
943
    $::dispatcher->end_request;
944
  }
945

  
946
  &display_form;
947

  
948
  $main::lxdebug->leave_sub();
949
}
950

  
951
sub _order {
912 952
  my $form     = $main::form;
913 953
  my %myconfig = %main::myconfig;
914 954
  my $locale   = $main::locale;
......
982 1022
  }
983 1023

  
984 1024
  &prepare_order;
985
  &display_form;
986

  
987
  $main::lxdebug->leave_sub();
988 1025
}
989 1026

  
990 1027
sub quotation {

Auch abrufbar als: Unified diff