X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FSetup.pm;h=cba3c7e3c90f4a9c707715c539053f5161a59d6b;hb=8a79ead8b600494b214d7492dab043d5dfc96587;hp=3c8e817d6272c7c8686a958a14e4ae6092953076;hpb=48bade3f01a672f235d61a29ad0d0b792fc80eab;p=freeside.git diff --git a/FS/FS/Setup.pm b/FS/FS/Setup.pm index 3c8e817d6..cba3c7e3c 100644 --- a/FS/FS/Setup.pm +++ b/FS/FS/Setup.pm @@ -146,6 +146,8 @@ sub populate_initial_data { foreach my $table ( keys %$data ) { + #warn "popuilating $table\n"; + my $class = "FS::$table"; eval "use $class;"; die $@ if $@; @@ -156,11 +158,17 @@ sub populate_initial_data { my @records = @{ $data->{$table} }; foreach my $record ( @records ) { + my $args = delete($record->{'_insert_args'}) || []; my $object = $class->new( $record ); my $error = $object->insert( @$args ); die "error inserting record into $table: $error\n" if $error; + + #my $pkey = $object->primary_key; + #my $pkeyvalue = $object->$pkey(); + #warn " inserted $pkeyvalue\n"; + } } @@ -266,7 +274,7 @@ sub initial_data { #which would only sell regular packages of services. Click on View/Edit #agent types and Add a new agent type. 'agent_type' => [ - { 'atype' => 'internal' }, + { 'atype' => 'Internal' }, ], #Allow this agent type to sell the package you created above.