Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 9dd69536

Von Sven Schöling vor mehr als 1 Jahr hinzugefügt

  • ID 9dd69536d853bab5e4c2fd72bb5c49bc1c842568
  • Vorgänger 87eea049
  • Nachfolger 640e3288

RecordLink: post save hook für alle Hauptbelege

Unterschiede anzeigen:

SL/DB/Order.pm
20 20
use SL::DB::Helper::PriceUpdater;
21 21
use SL::DB::Helper::TransNumberGenerator;
22 22
use SL::DB::Helper::Payment qw(forex);
23
use SL::DB::Helper::RecordLink qw(RECORD_ID RECORD_TYPE_REF RECORD_ITEM_ID RECORD_ITEM_TYPE_REF);
23 24
use SL::Locale::String qw(t8);
24 25
use SL::RecordLinks;
25 26
use Rose::DB::Object::Helpers qw(as_tree strip);
......
77 78
__PACKAGE__->before_save('_before_save_create_new_project');
78 79
__PACKAGE__->before_save('_before_save_remove_empty_custom_shipto');
79 80
__PACKAGE__->before_save('_before_save_set_custom_shipto_module');
81
__PACKAGE__->after_save('_after_save_link_records');
80 82

  
81 83
# hooks
82 84

  
......
134 136
  return 1;
135 137
}
136 138

  
139
sub _after_save_link_records {
140
  my ($self) = @_;
141

  
142
  my @allowed_record_sources = qw(SL::DB::Reclamation SL::DB::Order);
143
  my @allowed_item_sources = qw(SL::DB::ReclamationItem SL::DB::OrderItem);
144

  
145
  SL::DB::Helper::RecordLink::link_records(
146
    $self,
147
    \@allowed_record_sources,
148
    \@allowed_item_sources,
149
    close_source_quotations => 1,
150
  );
151
}
152

  
153

  
137 154
# methods
138 155

  
139 156
sub items { goto &orderitems; }

Auch abrufbar als: Unified diff