Revision aacd6696
Von Bernd Bleßmann vor mehr als 6 Jahren hinzugefügt
SL/Controller/Order.pm | ||
---|---|---|
619 | 619 |
$self->js->render(); |
620 | 620 |
} |
621 | 621 |
|
622 |
# open the dialog for customer/vendor details |
|
623 |
sub action_show_customer_vendor_details_dialog { |
|
624 |
my ($self) = @_; |
|
625 |
|
|
626 |
my $is_customer = 'customer' eq $::form->{vc}; |
|
627 |
my $cv; |
|
628 |
if ($is_customer) { |
|
629 |
$cv = SL::DB::Customer->new(id => $::form->{vc_id})->load; |
|
630 |
} else { |
|
631 |
$cv = SL::DB::Vendor->new(id => $::form->{vc_id})->load; |
|
632 |
} |
|
633 |
|
|
634 |
my %details = map { $_ => $cv->$_ } @{$cv->meta->columns}; |
|
635 |
$details{discount_as_percent} = $cv->discount_as_percent; |
|
636 |
$details{creditlimt} = $cv->creditlimit_as_number; |
|
637 |
$details{business} = $cv->business->description if $cv->business; |
|
638 |
$details{language} = $cv->language_obj->description if $cv->language_obj; |
|
639 |
$details{delivery_terms} = $cv->delivery_term->description if $cv->delivery_term; |
|
640 |
$details{payment_terms} = $cv->payment->description if $cv->payment; |
|
641 |
$details{pricegroup} = $cv->pricegroup->pricegroup if $cv->pricegroup; |
|
642 |
|
|
643 |
foreach my $entry (@{ $cv->shipto }) { |
|
644 |
push @{ $details{SHIPTO} }, { map { $_ => $entry->$_ } @{$entry->meta->columns} }; |
|
645 |
} |
|
646 |
foreach my $entry (@{ $cv->contacts }) { |
|
647 |
push @{ $details{CONTACTS} }, { map { $_ => $entry->$_ } @{$entry->meta->columns} }; |
|
648 |
} |
|
649 |
|
|
650 |
$_[0]->render('common/show_vc_details', { layout => 0 }, |
|
651 |
is_customer => $is_customer, |
|
652 |
%details); |
|
653 |
|
|
654 |
} |
|
655 |
|
|
622 | 656 |
# called if a unit in an existing item row is changed |
623 | 657 |
sub action_unit_changed { |
624 | 658 |
my ($self) = @_; |
... | ... | |
1761 | 1795 |
|
1762 | 1796 |
=item * currency |
1763 | 1797 |
|
1764 |
=item * customer/vendor details ('D'-button) |
|
1765 |
|
|
1766 | 1798 |
=item * credit limit |
1767 | 1799 |
|
1768 | 1800 |
=item * more workflows (save as new, quotation, purchase order) |
js/kivi.Order.js | ||
---|---|---|
591 | 591 |
return true; |
592 | 592 |
}; |
593 | 593 |
|
594 |
ns.show_vc_details_dialog = function() { |
|
595 |
if (!ns.check_cv()) return; |
|
596 |
var vc; |
|
597 |
var vc_id; |
|
598 |
var title; |
|
599 |
if ($('#type').val() == 'sales_order' || $('#type').val() == 'sales_quotation' ) { |
|
600 |
vc = 'customer'; |
|
601 |
vc_id = $('#order_customer_id').val(); |
|
602 |
title = kivi.t8('Customer details'); |
|
603 |
} else { |
|
604 |
vc = 'vendor'; |
|
605 |
vc_id = $('#order_vendor_id').val(); |
|
606 |
title = kivi.t8('Vendor details'); |
|
607 |
} |
|
608 |
|
|
609 |
kivi.popup_dialog({ |
|
610 |
url: 'controller.pl', |
|
611 |
data: { action: 'Order/show_customer_vendor_details_dialog', |
|
612 |
type : $('#type').val(), |
|
613 |
vc : vc, |
|
614 |
vc_id : vc_id |
|
615 |
}, |
|
616 |
id: 'jq_customer_vendor_details_dialog', |
|
617 |
dialog: { |
|
618 |
title: title, |
|
619 |
width: 800, |
|
620 |
height: 650 |
|
621 |
} |
|
622 |
}); |
|
623 |
return true; |
|
624 |
}; |
|
625 |
|
|
594 | 626 |
}); |
595 | 627 |
|
596 | 628 |
$(function(){ |
js/locale/de.js | ||
---|---|---|
29 | 29 |
"Create new quotation/order":"Neues Angebot/neuen Auftrag anlegen", |
30 | 30 |
"Create new qutoation/order":"Neues Angebot/neuen Auftrag anlegen", |
31 | 31 |
"Create new version":"Neue Version anlegen", |
32 |
"Customer details":"Kundendetails", |
|
32 | 33 |
"Customer missing!":"Kundenname fehlt!", |
33 | 34 |
"Database Connection Test":"Test der Datenbankverbindung", |
34 | 35 |
"Delete":"Löschen", |
... | ... | |
130 | 131 |
"Transaction description":"Vorgangsbezeichnung", |
131 | 132 |
"Update":"Erneuern", |
132 | 133 |
"Update quotation/order":"Auftrag/Angebot aktualisieren", |
134 |
"Vendor details":"Lieferantendetails", |
|
133 | 135 |
"Vendor missing!":"Lieferant fehlt!", |
134 | 136 |
"Version actions":"Aktionen für Versionen", |
135 | 137 |
"Wrong date format (#1)":"Falsches Datumsformat (#1)", |
templates/webpages/order/tabs/basic_data.html | ||
---|---|---|
14 | 14 |
<tr> |
15 | 15 |
<th align="right">[% SELF.cv | $T8 %]</th> |
16 | 16 |
[% SET cv_id = SELF.cv _ '_id' %] |
17 |
<td>[% P.customer_vendor.picker("order.${SELF.cv}" _ '_id', SELF.order.$cv_id, type=SELF.cv, style='width: 300px') %]</td> |
|
17 |
<td> |
|
18 |
[% P.customer_vendor.picker("order.${SELF.cv}" _ '_id', SELF.order.$cv_id, type=SELF.cv, style='width: 300px') %] |
|
19 |
[% P.button_tag("kivi.Order.show_vc_details_dialog()", LxERP.t8("Details (one letter abbreviation)")) %] |
|
20 |
</td> |
|
18 | 21 |
</tr> |
19 | 22 |
|
20 | 23 |
<tr id='cp_row' [%- IF !SELF.order.${SELF.cv}.contacts.size %]style='display:none'[%- END %]> |
Auch abrufbar als: Unified diff
Auftrags-Controller: Kunden-/Lieferantendetails ("D")
Hier sollte die alte Makse auch umgestellt werden, erstens auf Dialog und
zweitens damit via Rose zugegriffen wird.