use strict;
use SL::DB::MetaSetup::Customer;
+use SL::DB::Manager::Customer;
+use SL::DB::Helper::TransNumberGenerator;
use SL::DB::VC;
__PACKAGE__->meta->make_manager_class;
__PACKAGE__->meta->initialize;
+__PACKAGE__->before_save('_before_save_set_customernumber');
+
+sub _before_save_set_customernumber {
+ my ($self) = @_;
+
+ $self->create_trans_number if $self->customernumber eq '';
+}
+
sub short_address {
my ($self) = @_;
purchase_order => { number_column => 'ordnumber', number_range_column => 'ponumber', scoping => $oe_scoping, },
sales_delivery_order => { number_column => 'donumber', number_range_column => 'sdonumber', scoping => $do_scoping, fill_holes_in_range => 1 },
purchase_delivery_order => { number_column => 'donumber', number_range_column => 'pdonumber', scoping => $do_scoping, fill_holes_in_range => 1 },
+ customer => { number_column => 'customernumber', number_range_column => 'customernumber', },
+ vendor => { number_column => 'vendornumber', number_range_column => 'vendornumber', },
);
sub get_next_trans_number {
use strict;
use SL::DB::MetaSetup::Vendor;
+use SL::DB::Helper::TransNumberGenerator;
use SL::DB::VC;
__PACKAGE__->meta->make_manager_class;
__PACKAGE__->meta->initialize;
+__PACKAGE__->before_save('_before_save_set_vendornumber');
+
+sub _before_save_set_vendornumber {
+ my ($self) = @_;
+
+ $self->create_trans_number if $self->vendornumber eq '';
+}
+
1;