- keine leeren zu speichern
- das Modul immer auf 'OE' zu setzen
__PACKAGE__->before_save('_before_save_set_ord_quo_number');
__PACKAGE__->before_save('_before_save_create_new_project');
+__PACKAGE__->before_save('_before_save_remove_empty_custom_shipto');
+__PACKAGE__->before_save('_before_save_set_custom_shipto_module');
# hooks
return 1;
}
+
+sub _before_save_remove_empty_custom_shipto {
+ my ($self) = @_;
+
+ $self->custom_shipto(undef) if $self->custom_shipto && $self->custom_shipto->is_empty;
+
+ return 1;
+}
+
+sub _before_save_set_custom_shipto_module {
+ my ($self) = @_;
+
+ $self->custom_shipto->module('OE') if $self->custom_shipto;
+
+ return 1;
+}
+
# methods
sub items { goto &orderitems; }