Revision 57d6293d
Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt
SL/DB/Invoice.pm | ||
---|---|---|
40 | 40 |
|
41 | 41 |
__PACKAGE__->meta->initialize; |
42 | 42 |
|
43 |
__PACKAGE__->before_save('_before_save_set_invnumber'); |
|
44 |
|
|
45 |
# hooks |
|
46 |
|
|
47 |
sub _before_save_set_invnumber { |
|
48 |
my ($self) = @_; |
|
49 |
|
|
50 |
$self->create_trans_number if !$self->invnumber; |
|
51 |
|
|
52 |
return 1; |
|
53 |
} |
|
54 |
|
|
43 | 55 |
# methods |
44 | 56 |
|
45 | 57 |
sub items { goto &invoiceitems; } |
... | ... | |
156 | 168 |
my %data = $self->calculate_prices_and_taxes; |
157 | 169 |
|
158 | 170 |
$self->_post_create_assemblyitem_entries($data{assembly_items}); |
159 |
$self->create_trans_number; |
|
160 | 171 |
$self->save; |
161 | 172 |
|
162 | 173 |
$self->_post_add_acctrans($data{amounts_cogs}); |
Auch abrufbar als: Unified diff
SL::DB::Invoice: invnumber in before_save-Hook erzeugen