Revision 80d3ef8f
Von Cem Aydin vor etwa 1 Jahr hinzugefügt
SL/Controller/CustomerVendor.pm | ||
---|---|---|
851 | 851 |
$self->report_generator_list_objects(report => $report, objects => $prices, layout => 0, header => 0); |
852 | 852 |
} |
853 | 853 |
|
854 |
# open the dialog for customer/vendor details |
|
855 |
# called from SL::Presenter::customer_vendor |
|
856 |
sub action_show_customer_vendor_details_dialog { |
|
857 |
my ($self) = @_; |
|
858 |
|
|
859 |
my $is_customer = 'customer' eq $::form->{cv}; |
|
860 |
my $cv; |
|
861 |
if ($is_customer) { |
|
862 |
$cv = SL::DB::Customer->new(id => $::form->{cv_id})->load; |
|
863 |
} else { |
|
864 |
$cv = SL::DB::Vendor->new(id => $::form->{cv_id})->load; |
|
865 |
} |
|
866 |
|
|
867 |
my %details = map { $_ => $cv->$_ } @{$cv->meta->columns}; |
|
868 |
$details{discount_as_percent} = $cv->discount_as_percent; |
|
869 |
$details{creditlimt} = $cv->creditlimit_as_number; |
|
870 |
$details{business} = $cv->business->description if $cv->business; |
|
871 |
$details{language} = $cv->language_obj->description if $cv->language_obj; |
|
872 |
$details{delivery_terms} = $cv->delivery_term->description if $cv->delivery_term; |
|
873 |
$details{payment_terms} = $cv->payment->description if $cv->payment; |
|
874 |
$details{pricegroup} = $cv->pricegroup->pricegroup if $is_customer && $cv->pricegroup; |
|
875 |
|
|
876 |
if ($is_customer) { |
|
877 |
foreach my $entry (@{ $cv->additional_billing_addresses }) { |
|
878 |
push @{ $details{ADDITIONAL_BILLING_ADDRESSES} }, { map { $_ => $entry->$_ } @{$entry->meta->columns} }; |
|
879 |
} |
|
880 |
} |
|
881 |
foreach my $entry (@{ $cv->shipto }) { |
|
882 |
push @{ $details{SHIPTO} }, { map { $_ => $entry->$_ } @{$entry->meta->columns} }; |
|
883 |
} |
|
884 |
foreach my $entry (@{ $cv->contacts }) { |
|
885 |
push @{ $details{CONTACTS} }, { map { $_ => $entry->$_ } @{$entry->meta->columns} }; |
|
886 |
} |
|
887 |
|
|
888 |
$_[0]->render('common/show_vc_details', { layout => 0 }, |
|
889 |
is_customer => $is_customer, |
|
890 |
%details); |
|
891 |
|
|
892 |
} |
|
893 |
|
|
854 | 894 |
sub is_vendor { |
855 | 895 |
return $::form->{db} eq 'vendor'; |
856 | 896 |
} |
Auch abrufbar als: Unified diff
Kunden/Lieferanten Presenter: Details als Option zum picker hinzugefügt
- Option show_details zeigt Info Popup sowie Link zum bearbeiten an
- möglicher Einsatz bei Angebot, Aufträgen, Rechnungen ect., sowie Debitoren-/Kreditorenbuchung