]> wagnertech.de Git - mfinanz.git/blobdiff - SL/Controller/CustomerVendor.pm
Datenbank-Helper(*_as_number) verwenden
[mfinanz.git] / SL / Controller / CustomerVendor.pm
index e64e4b5e5a6a25cf40afe4604cef8c98f33cc656..5985e94d7cebb987b425c673336a229a3f8781cd 100644 (file)
@@ -54,11 +54,11 @@ __PACKAGE__->run_before(
 __PACKAGE__->run_before(
   '_create_customer_vendor',
   only => [
-    'new',
+    'add',
   ]
 );
 
-sub action_new {
+sub action_add {
   my ($self) = @_;
 
   $self->_pre_render();
@@ -291,6 +291,33 @@ sub action_delete_shipto {
   $self->action_edit();
 }
 
+
+sub action_search {
+  my ($self) = @_;
+
+  my $url = 'ct.pl?action=search&db='. ($self->is_vendor() ? 'vendor' : 'customer');
+
+  if ( $::form->{callback} ) {
+    $url .= '&callback='. $::from->escape($::form->{callback});
+  }
+
+  print $::form->redirect_header($url);
+}
+
+
+sub action_search_contact {
+  my ($self) = @_;
+
+  my $url = 'ct.pl?action=search_contact&db=customer';
+
+  if ( $::form->{callback} ) {
+    $url .= '&callback='. $::from->escape($::form->{callback});
+  }
+
+  print $::form->redirect_header($url);
+}
+
+
 sub action_get_delivery {
   my ($self) = @_;
 
@@ -506,12 +533,6 @@ sub _instantiate_args {
 
   my $curr_employee = SL::DB::Manager::Employee->current;
 
-  foreach ( 'cv.creditlimit', 'cv.discount' ) {
-    my ($namespace, $varname) = split('.', $_, 2);
-    $::form->{$namespace}->{$varname} = $::form->parse_amount(\%::myconfig, $::form->{$namespace}->{$varname});
-  }
-  $::form->{cv}->{discount} /= 100;
-
   if ( $::form->{cv}->{id} ) {
     if ( $self->is_vendor() ) {
       $self->{cv} = SL::DB::Vendor->new(id => $::form->{cv}->{id})->load();
@@ -738,9 +759,6 @@ sub _pre_render {
 
   $self->{template_args} = {};
 
-  $self->{cv}->discount($self->{cv}->discount * 100);
-
-
   $::request->{layout}->add_javascripts('autocomplete_customer.js');
 }