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