Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 08cfeacc

Von Bernd Bleßmann vor etwa 1 Jahr hinzugefügt

  • ID 08cfeacc6a8b7bfa491f47643605685adaa33ceb
  • Vorgänger 8fc3e634
  • Nachfolger 38a11ba4

RecordController: TODO-Update

Unterschiede anzeigen:

TODO_rebase.md
1 1

  
2
# Close intake
3

  
4
In `./SL/Controller/Order.pm` `sub save`: link records
5

  
6
```perl
7
        $src->update_attributes(closed => 1) if $src->type eq purchase_quotation_intake_type() && $self->type eq purchase_order_type();
8
```
9

  
10
To `.SL/DB/Order.pm` `sub _after_save_link_records` and `./SL/DB/Helper/RecordLink.pm`
11

  
12
# Close reachable intake
13

  
14

  
15
In `./SL/Controller/Order.pm` `sub save`: after save
16

  
17
```perl
18
    # Close reachable sales order intakes in the from-workflow if this is a sales order
19
    if (sales_order_type() eq $self->type) {
20
      my $lr = $self->order->linked_records(direction => 'from', recursive => 1);
21
      $lr    = [grep { 'SL::DB::Order' eq ref $_ && !$_->closed && $_->is_type('sales_order_intake')} @$lr];
22
      if (@$lr) {
23
        SL::DB::Manager::Order->update_all(set   => {closed => 1},
24
                                           where => [id => [map {$_->id} @$lr]]);
25
      }
26
    }
27
```
28

  
29
To `.SL/DB/Order.pm` `sub _after_save_link_records` and `./SL/DB/Helper/RecordLink.pm`
30

  
31 2
# Set dates after save as new
32 3

  
33 4
In `./SL/Controller/Order.pm` `sub action_save_as_new`:
......
108 79

  
109 80
Now in `SL::Model::Record->update_after_new`
110 81

  
111
# Create Constants for intake and add to valid type
112

  
113

  
114
```perl
115
  my $text = $self->type eq SALES_ORDER_INTAKE_TYPE()        ? $::locale->text('The order intake has been deleted')
116
           : $self->type eq SALES_ORDER_TYPE()               ? $::locale->text('The order confirmation has been deleted')
117
           : $self->type eq PURCHASE_ORDER_TYPE()            ? $::locale->text('The order has been deleted')
118
           : $self->type eq SALES_QUOTATION_TYPE()           ? $::locale->text('The quotation has been deleted')
119
           : $self->type eq REQUEST_QUOTATION_TYPE()         ? $::locale->text('The rfq has been deleted')
120
           : $self->type eq PURCHASE_QUOTATION_INTAKE_TYPE() ? $::locale->text('The quotation intake has been deleted')
121
```
122

  
123
```perl
124
sub init_valid_types {
125
  [ sales_order_intake_type(), sales_order_type(), purchase_order_type(), sales_quotation_type(), request_quotation_type(), purchase_quotation_intake_type() ];
126
  }
127
```
128

  
129 82
# End request after save with error
130 83

  
131 84
``
......
150 103
Order setup action bar
151 104

  
152 105

  
153
# Type data order intake
154

  
155 106
# Delivery: order_type errors (Tests)
156 107

  

Auch abrufbar als: Unified diff