+sub home_address_for_google_maps {
+ my ($self) = @_;
+
+ my $address = $::instance_conf->get_address // '';
+ $address =~ s{^\s+|\s+$|\r+}{}g;
+ $address =~ s{\n+}{,}g;
+ $address =~ s{\s+}{ }g;
+
+ return $address;
+}
+
+sub init_customer_models {
+ my ($self) = @_;
+
+ SL::Controller::Helper::GetModels->new(
+ controller => $self,
+ model => 'Customer',
+ sorted => {
+ _default => {
+ by => 'name',
+ dir => 1,
+ },
+ name => t8('Name'),
+ },
+ );
+}
+
+sub init_vendor_models {
+ my ($self) = @_;
+
+ SL::Controller::Helper::GetModels->new(
+ controller => $self,
+ model => 'Vendor',
+ sorted => {
+ _default => {
+ by => 'name',
+ dir => 1,
+ },
+ name => t8('Name'),
+ },
+ );
+}
+
+sub _new_customer_vendor_object {
+ my ($self) = @_;
+
+ my $class = 'SL::DB::' . ($self->is_vendor ? 'Vendor' : 'Customer');
+ return $class->new(
+ contacts => [],
+ shipto => [],
+ custom_variables => [],
+ );
+}
+
+sub _new_contact_object {
+ my ($self) = @_;
+
+ return SL::DB::Contact->new(custom_variables => []);
+}
+