From b47574cb2bdd79d3c172f67d94d3eada4bd3f981 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Wed, 16 Sep 2015 09:55:25 +0200 Subject: [PATCH] Auftrags-Controller: Zahlungs- und Lieferbedingungen --- SL/Controller/Order.pm | 27 +++++++++----- templates/webpages/order/tabs/basic_data.html | 37 ++++++++++++------- 2 files changed, 41 insertions(+), 23 deletions(-) diff --git a/SL/Controller/Order.pm b/SL/Controller/Order.pm index 0e89bfea1..8ecfaf6c9 100644 --- a/SL/Controller/Order.pm +++ b/SL/Controller/Order.pm @@ -137,10 +137,15 @@ sub action_customer_vendor_changed { $self->js->hide('#shipto_row'); } + $self->order->payment_id($self->order->$cv_method->payment_id); + $self->order->delivery_term_id($self->order->$cv_method->delivery_term_id); + $self->js ->replaceWith('#order_cp_id', $self->build_contact_select) ->replaceWith('#order_shipto_id', $self->build_shipto_select) ->val('#order_taxzone_id', $self->order->taxzone_id) + ->val('#order_payment_id', $self->order->payment_id) + ->val('#order_delivery_term_id', $self->order->delivery_term_id) ->focus('#order_' . $self->cv . '_id') ->render($self); } @@ -400,16 +405,18 @@ sub _save { sub _pre_render { my ($self) = @_; - $self->{all_taxzones} = SL::DB::Manager::TaxZone->get_all_sorted(); - $self->{all_employees} = SL::DB::Manager::Employee->get_all(where => [ or => [ id => $self->order->employee_id, - deleted => 0 ] ], - sort_by => 'name'); - $self->{all_salesmen} = SL::DB::Manager::Employee->get_all(where => [ or => [ id => $self->order->salesman_id, - deleted => 0 ] ], - sort_by => 'name'); - $self->{all_projects} = SL::DB::Manager::Project->get_all(where => [ or => [ id => $self->order->globalproject_id, - active => 1 ] ], - sort_by => 'projectnumber'); + $self->{all_taxzones} = SL::DB::Manager::TaxZone->get_all_sorted(); + $self->{all_employees} = SL::DB::Manager::Employee->get_all(where => [ or => [ id => $self->order->employee_id, + deleted => 0 ] ], + sort_by => 'name'); + $self->{all_salesmen} = SL::DB::Manager::Employee->get_all(where => [ or => [ id => $self->order->salesman_id, + deleted => 0 ] ], + sort_by => 'name'); + $self->{all_projects} = SL::DB::Manager::Project->get_all(where => [ or => [ id => $self->order->globalproject_id, + active => 1 ] ], + sort_by => 'projectnumber'); + $self->{all_payment_terms} = SL::DB::Manager::PaymentTerm->get_all_sorted(); + $self->{all_delivery_terms} = SL::DB::Manager::DeliveryTerm->get_all_sorted(); $self->{current_employee_id} = SL::DB::Manager::Employee->current->id; } diff --git a/templates/webpages/order/tabs/basic_data.html b/templates/webpages/order/tabs/basic_data.html index 02d6cb715..d10995416 100644 --- a/templates/webpages/order/tabs/basic_data.html +++ b/templates/webpages/order/tabs/basic_data.html @@ -165,21 +165,32 @@ - - - [%- IF NOT taxincluded %] +
+ - - - - [%- END %] - [%- FOREACH tax = SELF.taxes %] - [%- PROCESS order/tabs/_tax_row.html TAX=tax %] - [%- END %] - - +
[%- 'Subtotal' | $T8 %] - [%- L.div_tag(SELF.order.netamount_as_number, id='netamount_id') %] + + + + + + + + + + +
[% 'Payment Terms' | $T8 %][% L.select_tag('order.payment_id', + SELF.all_payment_terms, + default = SELF.order.payment_id, + with_empty = 1, + title_key = 'description', + style = 'width: 250px') %]
[% 'Delivery Terms' | $T8 %][% L.select_tag('order.delivery_term_id', + SELF.all_delivery_terms, + default = SELF.order.delivery_term_id, + with_empty = 1, + title_key = 'description', + style = 'width: 250px') %]
[%- 'Total' | $T8 %] [%- IF NOT taxincluded %] -- 2.20.1