Revision a31c242b
Von Sven Schöling vor mehr als 1 Jahr hinzugefügt
SL/DB/Invoice.pm | ||
---|---|---|
16 | 16 |
use SL::DB::Helper::PDF_A; |
17 | 17 |
use SL::DB::Helper::PriceTaxCalculator; |
18 | 18 |
use SL::DB::Helper::PriceUpdater; |
19 |
use SL::DB::Helper::RecordLink qw(RECORD_ID RECORD_TYPE_REF RECORD_ITEM_ID RECORD_ITEM_TYPE_REF); |
|
19 | 20 |
use SL::DB::Helper::SalesPurchaseInvoice; |
20 | 21 |
use SL::DB::Helper::TransNumberGenerator; |
21 | 22 |
use SL::DB::Helper::ZUGFeRD; |
... | ... | |
77 | 78 |
__PACKAGE__->attr_sorted('items'); |
78 | 79 |
|
79 | 80 |
__PACKAGE__->before_save('_before_save_set_invnumber'); |
81 |
__PACKAGE__->after_save('_after_save_link_records'); |
|
80 | 82 |
|
81 | 83 |
# hooks |
82 | 84 |
|
... | ... | |
88 | 90 |
return 1; |
89 | 91 |
} |
90 | 92 |
|
93 |
sub _after_save_link_records { |
|
94 |
my ($self) = @_; |
|
95 |
|
|
96 |
my @allowed_record_sources = qw(SL::DB::Reclamation SL::DB::Order SL::DB::DeliveryOrder); |
|
97 |
my @allowed_item_sources = qw(SL::DB::ReclamationItem SL::DB::OrderItem SL::DB::DeliveryOrderItem); |
|
98 |
|
|
99 |
SL::DB::Helper::RecordLink::link_records( |
|
100 |
$self, |
|
101 |
\@allowed_record_sources, |
|
102 |
\@allowed_item_sources, |
|
103 |
close_source_quotations => 1, |
|
104 |
); |
|
105 |
} |
|
106 |
|
|
91 | 107 |
# methods |
92 | 108 |
|
93 | 109 |
sub items { goto &invoiceitems; } |
Auch abrufbar als: Unified diff
RecordLink: post save hook für alle Hauptbelege