projects
/
kivitendo-erp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
57d6293
)
SL::DB::DeliveryOrder: donumber in before_save-Hook erzeugen
author
Moritz Bunkus
<m.bunkus@linet-services.de>
Thu, 11 Jul 2013 07:28:38 +0000
(09:28 +0200)
committer
Moritz Bunkus
<m.bunkus@linet-services.de>
Thu, 11 Jul 2013 07:30:01 +0000
(09:30 +0200)
SL/DB/DeliveryOrder.pm
patch
|
blob
|
history
diff --git
a/SL/DB/DeliveryOrder.pm
b/SL/DB/DeliveryOrder.pm
index
7b530c6
..
372a5cc
100644
(file)
--- a/
SL/DB/DeliveryOrder.pm
+++ b/
SL/DB/DeliveryOrder.pm
@@
-20,6
+20,18
@@
__PACKAGE__->meta->add_relationship(orderitems => { type => 'one to many
__PACKAGE__->meta->initialize;
+__PACKAGE__->before_save('_before_save_set_donumber');
+
+# hooks
+
+sub _before_save_set_donumber {
+ my ($self) = @_;
+
+ $self->create_trans_number if !$self->donumber;
+
+ return 1;
+}
+
# methods
sub items { goto &orderitems; }