$self->js->render();
}
+# open the dialog for customer/vendor details
+sub action_show_customer_vendor_details_dialog {
+ my ($self) = @_;
+
+ my $is_customer = 'customer' eq $::form->{vc};
+ my $cv;
+ if ($is_customer) {
+ $cv = SL::DB::Customer->new(id => $::form->{vc_id})->load;
+ } else {
+ $cv = SL::DB::Vendor->new(id => $::form->{vc_id})->load;
+ }
+
+ my %details = map { $_ => $cv->$_ } @{$cv->meta->columns};
+ $details{discount_as_percent} = $cv->discount_as_percent;
+ $details{creditlimt} = $cv->creditlimit_as_number;
+ $details{business} = $cv->business->description if $cv->business;
+ $details{language} = $cv->language_obj->description if $cv->language_obj;
+ $details{delivery_terms} = $cv->delivery_term->description if $cv->delivery_term;
+ $details{payment_terms} = $cv->payment->description if $cv->payment;
+ $details{pricegroup} = $cv->pricegroup->pricegroup if $cv->pricegroup;
+
+ foreach my $entry (@{ $cv->shipto }) {
+ push @{ $details{SHIPTO} }, { map { $_ => $entry->$_ } @{$entry->meta->columns} };
+ }
+ foreach my $entry (@{ $cv->contacts }) {
+ push @{ $details{CONTACTS} }, { map { $_ => $entry->$_ } @{$entry->meta->columns} };
+ }
+
+ $_[0]->render('common/show_vc_details', { layout => 0 },
+ is_customer => $is_customer,
+ %details);
+
+}
+
# called if a unit in an existing item row is changed
sub action_unit_changed {
my ($self) = @_;
=item * currency
-=item * customer/vendor details ('D'-button)
-
=item * credit limit
=item * more workflows (save as new, quotation, purchase order)
return true;
};
+ ns.show_vc_details_dialog = function() {
+ if (!ns.check_cv()) return;
+ var vc;
+ var vc_id;
+ var title;
+ if ($('#type').val() == 'sales_order' || $('#type').val() == 'sales_quotation' ) {
+ vc = 'customer';
+ vc_id = $('#order_customer_id').val();
+ title = kivi.t8('Customer details');
+ } else {
+ vc = 'vendor';
+ vc_id = $('#order_vendor_id').val();
+ title = kivi.t8('Vendor details');
+ }
+
+ kivi.popup_dialog({
+ url: 'controller.pl',
+ data: { action: 'Order/show_customer_vendor_details_dialog',
+ type : $('#type').val(),
+ vc : vc,
+ vc_id : vc_id
+ },
+ id: 'jq_customer_vendor_details_dialog',
+ dialog: {
+ title: title,
+ width: 800,
+ height: 650
+ }
+ });
+ return true;
+ };
+
});
$(function(){
"Create new quotation/order":"Neues Angebot/neuen Auftrag anlegen",
"Create new qutoation/order":"Neues Angebot/neuen Auftrag anlegen",
"Create new version":"Neue Version anlegen",
+"Customer details":"Kundendetails",
"Customer missing!":"Kundenname fehlt!",
"Database Connection Test":"Test der Datenbankverbindung",
"Delete":"Löschen",
"Transaction description":"Vorgangsbezeichnung",
"Update":"Erneuern",
"Update quotation/order":"Auftrag/Angebot aktualisieren",
+"Vendor details":"Lieferantendetails",
"Vendor missing!":"Lieferant fehlt!",
"Version actions":"Aktionen für Versionen",
"Wrong date format (#1)":"Falsches Datumsformat (#1)",
<tr>
<th align="right">[% SELF.cv | $T8 %]</th>
[% SET cv_id = SELF.cv _ '_id' %]
- <td>[% P.customer_vendor.picker("order.${SELF.cv}" _ '_id', SELF.order.$cv_id, type=SELF.cv, style='width: 300px') %]</td>
+ <td>
+ [% P.customer_vendor.picker("order.${SELF.cv}" _ '_id', SELF.order.$cv_id, type=SELF.cv, style='width: 300px') %]
+ [% P.button_tag("kivi.Order.show_vc_details_dialog()", LxERP.t8("Details (one letter abbreviation)")) %]
+ </td>
</tr>
<tr id='cp_row' [%- IF !SELF.order.${SELF.cv}.contacts.size %]style='display:none'[%- END %]>