Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 930e5ecb

Von Moritz Bunkus vor mehr als 13 Jahren hinzugefügt

  • ID 930e5ecb0d071e20e9fc57e6050859a0a7a5a98d
  • Vorgänger 0f84ffa0
  • Nachfolger 0389fbc6

Vergabe von Kunden-/Lieferantennummer beim Speichern eines VC-Objektes implementiert

Unterschiede anzeigen:

SL/DB/Customer.pm
3 3
use strict;
4 4

  
5 5
use SL::DB::MetaSetup::Customer;
6
use SL::DB::Manager::Customer;
7
use SL::DB::Helper::TransNumberGenerator;
6 8

  
7 9
use SL::DB::VC;
8 10

  
......
24 26
__PACKAGE__->meta->make_manager_class;
25 27
__PACKAGE__->meta->initialize;
26 28

  
29
__PACKAGE__->before_save('_before_save_set_customernumber');
30

  
31
sub _before_save_set_customernumber {
32
  my ($self) = @_;
33

  
34
  $self->create_trans_number if $self->customernumber eq '';
35
}
36

  
27 37
sub short_address {
28 38
  my ($self) = @_;
29 39

  
SL/DB/Helper/TransNumberGenerator.pm
25 25
              purchase_order          => { number_column => 'ordnumber', number_range_column => 'ponumber',  scoping => $oe_scoping,                          },
26 26
              sales_delivery_order    => { number_column => 'donumber',  number_range_column => 'sdonumber', scoping => $do_scoping, fill_holes_in_range => 1 },
27 27
              purchase_delivery_order => { number_column => 'donumber',  number_range_column => 'pdonumber', scoping => $do_scoping, fill_holes_in_range => 1 },
28
              customer                => { number_column => 'customernumber', number_range_column => 'customernumber', },
29
              vendor                  => { number_column => 'vendornumber', number_range_column => 'vendornumber', },
28 30
            );
29 31

  
30 32
sub get_next_trans_number {
SL/DB/Vendor.pm
3 3
use strict;
4 4

  
5 5
use SL::DB::MetaSetup::Vendor;
6
use SL::DB::Helper::TransNumberGenerator;
6 7

  
7 8
use SL::DB::VC;
8 9

  
......
24 25
__PACKAGE__->meta->make_manager_class;
25 26
__PACKAGE__->meta->initialize;
26 27

  
28
__PACKAGE__->before_save('_before_save_set_vendornumber');
29

  
30
sub _before_save_set_vendornumber {
31
  my ($self) = @_;
32

  
33
  $self->create_trans_number if $self->vendornumber eq '';
34
}
35

  
27 36
1;

Auch abrufbar als: Unified diff