Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision eeec1d5e

Von Tamino Steinert vor fast 2 Jahren hinzugefügt

  • ID eeec1d5ef7f381d8ae495da93ef84f9b742e85b6
  • Vorgänger 0ff3f593
  • Nachfolger 19fda876

Model::Record: Entferne TypedataProxy

Auf Typedata kann jetzt immer über den Belege zugegriffen werden.

Unterschiede anzeigen:

SL/Controller/DeliveryOrder.pm
83 83
sub action_add {
84 84
  my ($self) = @_;
85 85

  
86
  $self->order(SL::Model::Record->update_after_new($self->order, $self->type));
86
  $self->order(SL::Model::Record->update_after_new($self->order));
87 87

  
88 88
  $self->pre_render();
89 89

  
SL/Controller/Order.pm
80 80
sub action_add {
81 81
  my ($self) = @_;
82 82

  
83
  $self->order(SL::Model::Record->update_after_new($self->order, $self->type));
83
  $self->order(SL::Model::Record->update_after_new($self->order));
84 84

  
85 85
  $self->pre_render();
86 86

  
SL/Controller/Reclamation.pm
101 101
sub action_add {
102 102
  my ($self) = @_;
103 103

  
104
  $self->reclamation(SL::Model::Record->update_after_new($self->reclamation, $self->type));
104
  $self->reclamation(SL::Model::Record->update_after_new($self->reclamation));
105 105

  
106 106
  $self->pre_render();
107 107

  
SL/Model/Record.pm
13 13
use SL::DB::Invoice;
14 14
use SL::DB::Status;
15 15
use SL::DB::ValidityToken;
16
use SL::DB::Helper::TypeDataProxy;
17 16
use SL::DB::Order::TypeData qw(:types);
18 17
use SL::DB::DeliveryOrder::TypeData qw(:types);
19 18
use SL::DB::Reclamation::TypeData qw(:types);
......
23 22

  
24 23

  
25 24
sub update_after_new {
26
  my ($class, $new_record, $subtype, %flags) = @_;
25
  my ($class, $new_record, %flags) = @_;
27 26

  
28 27
  $new_record->transdate(DateTime->now_local());
29 28

  
30
  # build TypeDataProxy
31
  # TODO: remove when type is set in record and not infered form customer/vendor_id
32
  my $type_data_proxy = SL::DB::Helper::TypeDataProxy->new(ref $new_record, $subtype);
33
  $new_record->reqdate($type_data_proxy->defaults('reqdate'));
29
  my $default_reqdate = $new_record->type_data->defaults('reqdate');
30
  $new_record->reqdate($default_reqdate);
34 31

  
35 32
  return $new_record;
36 33
}
......
307 304

  
308 305
=item C<update_after_new>
309 306

  
310
Creates a new record_object by record_type and sub_type.
311
Sets reqdate and transdate if required by type_data.
307
Updates a record_object corresponding to type_data.
308
Sets reqdate and transdate.
312 309

  
313 310
Returns the record object.
314 311

  
......
454 451

  
455 452
=item *
456 453

  
457
For SL::DB::Order and SL::DB::Reclamations the subtype should be saved in the database and not inferred from customer/vendor.
458

  
459
=item *
460

  
461 454
Further encapsulate the linking logic for creating linked records.
462 455

  
463 456
=item *

Auch abrufbar als: Unified diff