Revision 6373da0c
Von Sven Schöling vor fast 2 Jahren hinzugefügt
SL/DB/PurchaseInvoice.pm | ||
---|---|---|
11 | 11 |
use SL::DB::Helper::AttrSorted; |
12 | 12 |
use SL::DB::Helper::LinkedRecords; |
13 | 13 |
use SL::DB::Helper::Payment qw(:ALL); |
14 |
use SL::DB::Helper::RecordLink qw(RECORD_ID RECORD_TYPE_REF RECORD_ITEM_ID RECORD_ITEM_TYPE_REF); |
|
14 | 15 |
use SL::DB::Helper::SalesPurchaseInvoice; |
15 | 16 |
use SL::Locale::String qw(t8); |
16 | 17 |
use Rose::DB::Object::Helpers qw(has_loaded_related forget_related as_tree strip); |
... | ... | |
57 | 58 |
__PACKAGE__->attr_html('notes'); |
58 | 59 |
__PACKAGE__->attr_sorted('items'); |
59 | 60 |
|
61 |
__PACKAGE__->after_save('_after_save_link_records'); |
|
62 |
|
|
63 |
# hooks |
|
64 |
|
|
65 |
sub _after_save_link_records { |
|
66 |
my ($self) = @_; |
|
67 |
|
|
68 |
my @allowed_record_sources = qw(SL::DB::Reclamation SL::DB::Order); |
|
69 |
my @allowed_item_sources = qw(SL::DB::ReclamationItem SL::DB::OrderItem); |
|
70 |
|
|
71 |
SL::DB::Helper::RecordLink::link_records( |
|
72 |
$self, |
|
73 |
\@allowed_record_sources, |
|
74 |
\@allowed_item_sources, |
|
75 |
close_source_quotations => 1, |
|
76 |
); |
|
77 |
} |
|
78 |
|
|
79 |
# methods |
|
80 |
|
|
60 | 81 |
sub items { goto &invoiceitems; } |
61 | 82 |
sub add_items { goto &add_invoiceitems; } |
62 | 83 |
sub record_number { goto &invnumber; }; |
Auch abrufbar als: Unified diff
RecordLink: post save hook für alle Hauptbelege