Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 039f2101

Von Cem Aydin vor 12 Monaten hinzugefügt

  • ID 039f2101e258e94a46d7080a90d32683b0bbde50
  • Vorgänger 6accc5b8
  • Nachfolger 73ce43f0

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

- dadurch obsolet gewordenen code, JavaScript sowie im Controller entfernt

Unterschiede anzeigen:

SL/Controller/DeliveryOrder.pm
76 76

  
77 77
__PACKAGE__->run_before('check_auth_for_edit',
78 78
  except => [ qw(
79
    update_stock_information edit show_customer_vendor_details_dialog
79
    update_stock_information edit
80 80
    price_popup stock_in_out_dialog load_second_rows
81 81
    ) ]);
82 82

  
......
611 611
  $self->js->render();
612 612
}
613 613

  
614
# open the dialog for customer/vendor details
615
sub action_show_customer_vendor_details_dialog {
616
  my ($self) = @_;
617

  
618
  my $is_customer = 'customer' eq $::form->{vc};
619
  my $cv;
620
  if ($is_customer) {
621
    $cv = SL::DB::Customer->new(id => $::form->{vc_id})->load;
622
  } else {
623
    $cv = SL::DB::Vendor->new(id => $::form->{vc_id})->load;
624
  }
625

  
626
  my %details = map { $_ => $cv->$_ } @{$cv->meta->columns};
627
  $details{discount_as_percent} = $cv->discount_as_percent;
628
  $details{creditlimt}          = $cv->creditlimit_as_number;
629
  $details{business}            = $cv->business->description      if $cv->business;
630
  $details{language}            = $cv->language_obj->description  if $cv->language_obj;
631
  $details{delivery_terms}      = $cv->delivery_term->description if $cv->delivery_term;
632
  $details{payment_terms}       = $cv->payment->description       if $cv->payment;
633
  $details{pricegroup}          = $cv->pricegroup->pricegroup     if $is_customer && $cv->pricegroup;
634

  
635
  foreach my $entry (@{ $cv->shipto }) {
636
    push @{ $details{SHIPTO} },   { map { $_ => $entry->$_ } @{$entry->meta->columns} };
637
  }
638
  foreach my $entry (@{ $cv->contacts }) {
639
    push @{ $details{CONTACTS} }, { map { $_ => $entry->$_ } @{$entry->meta->columns} };
640
  }
641

  
642
  $_[0]->render('common/show_vc_details', { layout => 0 },
643
                is_customer => $is_customer,
644
                %details);
645
}
646

  
647 614
# called if a unit in an existing item row is changed
648 615
sub action_unit_changed {
649 616
  my ($self) = @_;

Auch abrufbar als: Unified diff