Revision bee7d33f
Von Jan Büren vor fast 4 Jahren hinzugefügt
SL/Controller/Order.pm | ||
---|---|---|
71 | 71 |
$self->order->transdate(DateTime->now_local()); |
72 | 72 |
my $extra_days = $self->{type} eq 'sales_quotation' ? $::instance_conf->get_reqdate_interval : |
73 | 73 |
$self->{type} eq 'sales_order' ? $::instance_conf->get_delivery_date_interval : 1; |
74 |
$self->order->reqdate(DateTime->today_local->next_workday(extra_days => $extra_days)) if !$self->order->reqdate; |
|
74 |
|
|
75 |
if ( ($self->{type} eq 'sales_order' && $::instance_conf->get_deliverydate_on) |
|
76 |
|| ($self->{type} eq 'sales_quotation' && $::instance_conf->get_reqdate_on) |
|
77 |
&& (!$self->order->reqdate)) { |
|
78 |
$self->order->reqdate(DateTime->today_local->next_workday(extra_days => $extra_days)); |
|
79 |
} |
|
75 | 80 |
|
76 | 81 |
|
77 | 82 |
$self->pre_render(); |
... | ... | |
220 | 225 |
? DateTime->today_local |
221 | 226 |
: $order->transdate; |
222 | 227 |
|
223 |
# Set new reqdate unless changed |
|
228 |
# Set new reqdate unless changed if it is enabled in client config
|
|
224 | 229 |
if ($order->reqdate == $saved_order->reqdate) { |
225 | 230 |
my $extra_days = $self->{type} eq 'sales_quotation' ? $::instance_conf->get_reqdate_interval : |
226 | 231 |
$self->{type} eq 'sales_order' ? $::instance_conf->get_delivery_date_interval : 1; |
227 |
$new_attrs{reqdate} = DateTime->today_local->next_workday(extra_days => $extra_days); |
|
232 |
|
|
233 |
if ( ($self->{type} eq 'sales_order' && !$::instance_conf->get_deliverydate_on) |
|
234 |
|| ($self->{type} eq 'sales_quotation' && !$::instance_conf->get_reqdate_on)) { |
|
235 |
$new_attrs{reqdate} = ''; |
|
236 |
} else { |
|
237 |
$new_attrs{reqdate} = DateTime->today_local->next_workday(extra_days => $extra_days); |
|
238 |
} |
|
228 | 239 |
} else { |
229 | 240 |
$new_attrs{reqdate} = $order->reqdate; |
230 | 241 |
} |
Auch abrufbar als: Unified diff
Mandantenkonfig: Lieferdatum bei VK-Auftrag und Gültigsdatum bei VK-Angebot
Anstatt diese beiden Werte zu berechnen, gibt es die Möglichkeit
diese konfigurativ gar nicht zu setzen. Hoffentlich letzmalig auch
für die OE.pm implementiert.