Revision ca34ded6
Von Bernd Bleßmann vor etwa 1 Jahr hinzugefügt
TODO_rebase.md | ||
---|---|---|
1 |
|
|
2 |
# Set dates after save as new |
|
3 |
|
|
4 |
In `./SL/Controller/Order.pm` `sub action_save_as_new`: |
|
5 |
|
|
6 |
From |
|
7 |
|
|
8 |
```perl |
|
9 |
# Set new reqdate unless changed if it is enabled in client config |
|
10 |
if ($order->reqdate == $saved_order->reqdate) { |
|
11 |
my $extra_days = $self->type eq sales_quotation_type() ? $::instance_conf->get_reqdate_interval : |
|
12 |
$self->type eq sales_order_type() ? $::instance_conf->get_delivery_date_interval : 1; |
|
13 |
|
|
14 |
if ( ($self->type eq sales_order_type() && !$::instance_conf->get_deliverydate_on) |
|
15 |
|| ($self->type eq sales_quotation_type() && !$::instance_conf->get_reqdate_on)) { |
|
16 |
$new_attrs{reqdate} = ''; |
|
17 |
} else { |
|
18 |
$new_attrs{reqdate} = DateTime->today_local->next_workday(extra_days => $extra_days); |
|
19 |
} |
|
20 |
} else { |
|
21 |
$new_attrs{reqdate} = $order->reqdate; |
|
22 |
} |
|
23 |
``` |
|
24 |
|
|
25 |
To |
|
26 |
|
|
27 |
```perl |
|
28 |
# Set new reqdate unless changed if it is enabled in client config |
|
29 |
if ($order->reqdate == $saved_order->reqdate) { |
|
30 |
my $extra_days = $self->type eq sales_quotation_type() ? $::instance_conf->get_reqdate_interval : |
|
31 |
$self->type eq sales_order_type() ? $::instance_conf->get_delivery_date_interval : |
|
32 |
$self->type eq sales_order_intake_type() ? $::instance_conf->get_delivery_date_interval : 1; |
|
33 |
|
|
34 |
if ( ($self->type eq sales_order_intake_type() && !$::instance_conf->get_deliverydate_on) |
|
35 |
|| ($self->type eq sales_order_type() && !$::instance_conf->get_deliverydate_on) |
|
36 |
|| ($self->type eq sales_quotation_type() && !$::instance_conf->get_reqdate_on)) { |
|
37 |
$new_attrs{reqdate} = ''; |
|
38 |
} else { |
|
39 |
$new_attrs{reqdate} = DateTime->today_local->next_workday(extra_days => $extra_days); |
|
40 |
} |
|
41 |
} else { |
|
42 |
$new_attrs{reqdate} = $order->reqdate; |
|
43 |
} |
|
44 |
``` |
|
45 |
|
|
46 |
# Set default dates |
|
47 |
|
|
48 |
In ./SL/Controller/Order.pm` sub action_add`: |
|
49 |
|
|
50 |
From: |
|
51 |
|
|
52 |
```perl |
|
53 |
$self->order->transdate(DateTime->now_local()); |
|
54 |
my $extra_days = $self->type eq sales_quotation_type() ? $::instance_conf->get_reqdate_interval : |
|
55 |
$self->type eq sales_order_type() ? $::instance_conf->get_delivery_date_interval : 1; |
|
56 |
|
|
57 |
if ( ($self->type eq sales_order_type() && $::instance_conf->get_deliverydate_on) |
|
58 |
|| ($self->type eq sales_quotation_type() && $::instance_conf->get_reqdate_on) |
|
59 |
&& (!$self->order->reqdate)) { |
|
60 |
$self->order->reqdate(DateTime->today_local->next_workday(extra_days => $extra_days)); |
|
61 |
} |
|
62 |
``` |
|
63 |
|
|
64 |
To: |
|
65 |
|
|
66 |
```perl |
|
67 |
$self->order->transdate(DateTime->now_local()); |
|
68 |
my $extra_days = $self->type eq sales_quotation_type() ? $::instance_conf->get_reqdate_interval : |
|
69 |
$self->type eq sales_order_type() ? $::instance_conf->get_delivery_date_interval : |
|
70 |
$self->type eq sales_order_intake_type() ? $::instance_conf->get_delivery_date_interval : 1; |
|
71 |
|
|
72 |
if (($self->type eq sales_order_intake_type() && $::instance_conf->get_deliverydate_on) |
|
73 |
|| ($self->type eq sales_order_type() && $::instance_conf->get_deliverydate_on) |
|
74 |
|| ($self->type eq sales_quotation_type() && $::instance_conf->get_reqdate_on) |
|
75 |
&& (!$self->order->reqdate)) { |
|
76 |
$self->order->reqdate(DateTime->today_local->next_workday(extra_days => $extra_days)); |
|
77 |
} |
|
78 |
``` |
|
79 |
|
|
80 |
Now in `SL::Model::Record->update_after_new` |
|
81 |
|
|
82 |
# End request after save with error |
|
83 |
|
|
84 |
`` |
|
85 |
d9bb0bb9 Bernd Bleßmann (2023-07-12 16:44): |
|
86 |
Reklamations-Controller: Nach Fehlermeldung beim Speichern Request beenden. … |
|
87 |
`` |
|
88 |
|
|
89 |
# adapte record_type update script for order |
|
90 |
|
|
91 |
Add intake types |
|
92 |
|
|
93 |
# No intake flag |
|
94 |
|
|
95 |
Like |
|
96 |
`a794ea45d8 (DB::Order: Funktionen angepasst (kein Angebotsflag)` |
|
97 |
|
|
98 |
`tig log -p intake` |
|
99 |
|
|
100 |
|
|
101 |
# Show menu intake |
|
102 |
|
|
103 |
Order setup action bar |
|
104 |
|
|
105 |
|
|
106 |
# Delivery: order_type errors (Tests) |
|
107 |
|
Auch abrufbar als: Unified diff
Model::Record: temporäre Todo-Datein wieder raus