Mahnungen: Neuer Variable für jede Rechnung: <%dn_linetotal%> als für diese Rechnung...
[kivitendo-erp.git] / SL / CT.pm
index 82e360c..67822d4 100644 (file)
--- a/SL/CT.pm
+++ b/SL/CT.pm
@@ -101,10 +101,6 @@ sub populate_drop_down_boxes {
   $query = qq|SELECT id, description FROM business ORDER BY id|;
   $form->{all_business} = selectall_hashref_query($form, $dbh, $query);
 
-  # get tax zones
-  $query = qq|SELECT id, description FROM tax_zones|;
-  $form->{TAXZONE} = selectall_hashref_query($form, $dbh, $query);
-
   # get shipto address
   $query =
     qq|SELECT shipto_id, shiptoname, shiptodepartment_1 | .
@@ -303,7 +299,7 @@ sub save_customer {
     conv_i($form->{salesman_id}),
     conv_i($form->{language_id}),
     conv_i($form->{payment_id}),
-    conv_i($form->{taxzone_id}),
+    conv_i($form->{taxzone_id}, 0),
     $form->{user_password},
     $form->{c_vendor_id},
     conv_i($form->{klass}),
@@ -499,7 +495,7 @@ sub save_vendor {
     $form->{obsolete} ? 't' : 'f',
     $form->{ustid},
     conv_i($form->{payment_id}),
-    conv_i($form->{taxzone_id}),
+    conv_i($form->{taxzone_id}, 0),
     conv_i( $form->{language_id}),
     $form->{username},
     $form->{user_password},
@@ -630,6 +626,11 @@ sub search {
     $where .= qq| AND NOT obsolete|;
   }
 
+  if ($form->{business_id}) {
+    $where .= qq| AND (business_id = ?)|;
+    push(@values, conv_i($form->{business_id}));
+  }
+
   my $query =
     qq|SELECT ct.*, b.description AS business | .
     qq|FROM $cv ct | .