Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 5aa9b450

Von Cem Aydin vor etwa 1 Jahr hinzugefügt

  • ID 5aa9b450375ef9014b7207e868372a737d396b62
  • Vorgänger 6c758ac4
  • Nachfolger c3896321

Auftrag/Angebot (neuer controller): Kunden-/Lieferanten picker mit Details Option verwenden

- dadurch obsolet gewordenen code, JavaScript sowie im Controller entfernt

Unterschiede anzeigen:

SL/Controller/Order.pm
73 73
                        except => [ qw(close_quotations) ]);
74 74

  
75 75
__PACKAGE__->run_before('check_auth_for_edit',
76
                        except => [ qw(edit show_customer_vendor_details_dialog price_popup load_second_rows close_quotations) ]);
76
                        except => [ qw(edit price_popup load_second_rows close_quotations) ]);
77 77
__PACKAGE__->run_before('get_basket_info_from_from');
78 78

  
79 79
#
......
999 999
  $self->js->render();
1000 1000
}
1001 1001

  
1002
# open the dialog for customer/vendor details
1003
sub action_show_customer_vendor_details_dialog {
1004
  my ($self) = @_;
1005

  
1006
  my $is_customer = $self->type_data->properties('is_customer');
1007
  my $cv;
1008
  if ($is_customer) {
1009
    $cv = SL::DB::Customer->new(id => $::form->{vc_id})->load;
1010
  } else {
1011
    $cv = SL::DB::Vendor->new(id => $::form->{vc_id})->load;
1012
  }
1013

  
1014
  my %details = map { $_ => $cv->$_ } @{$cv->meta->columns};
1015
  $details{discount_as_percent} = $cv->discount_as_percent;
1016
  $details{creditlimt}          = $cv->creditlimit_as_number;
1017
  $details{business}            = $cv->business->description      if $cv->business;
1018
  $details{language}            = $cv->language_obj->description  if $cv->language_obj;
1019
  $details{delivery_terms}      = $cv->delivery_term->description if $cv->delivery_term;
1020
  $details{payment_terms}       = $cv->payment->description       if $cv->payment;
1021
  $details{pricegroup}          = $cv->pricegroup->pricegroup     if $is_customer && $cv->pricegroup;
1022

  
1023
  if ($is_customer) {
1024
    foreach my $entry (@{ $cv->additional_billing_addresses }) {
1025
      push @{ $details{ADDITIONAL_BILLING_ADDRESSES} },   { map { $_ => $entry->$_ } @{$entry->meta->columns} };
1026
    }
1027
  }
1028
  foreach my $entry (@{ $cv->shipto }) {
1029
    push @{ $details{SHIPTO} },   { map { $_ => $entry->$_ } @{$entry->meta->columns} };
1030
  }
1031
  foreach my $entry (@{ $cv->contacts }) {
1032
    push @{ $details{CONTACTS} }, { map { $_ => $entry->$_ } @{$entry->meta->columns} };
1033
  }
1034

  
1035
  $_[0]->render('common/show_vc_details', { layout => 0 },
1036
                is_customer => $is_customer,
1037
                %details);
1038

  
1039
}
1040

  
1041 1002
# called if a unit in an existing item row is changed
1042 1003
sub action_unit_changed {
1043 1004
  my ($self) = @_;

Auch abrufbar als: Unified diff