Die Variable "ranking" für Zahlungsbedinungen konnte nirgends konfiguriert werden...
authorMoritz Bunkus <m.bunkus@linet-services.de>
Mon, 8 Oct 2007 08:42:44 +0000 (08:42 +0000)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Mon, 8 Oct 2007 08:42:44 +0000 (08:42 +0000)
SL/AM.pm
SL/IS.pm

index bb83c79..ec4c3f0 100644 (file)
--- a/SL/AM.pm
+++ b/SL/AM.pm
@@ -1336,12 +1336,10 @@ sub save_payment {
 
   $query = qq|UPDATE payment_terms SET
               description = ?, description_long = ?,
-              ranking = ?,
               terms_netto = ?, terms_skonto = ?,
               percent_skonto = ?
               WHERE id = ?|;
   my @values = ($form->{description}, $form->{description_long},
-                $form->{ranking} * 1,
                 $form->{terms_netto} * 1, $form->{terms_skonto} * 1,
                 $form->{percent_skonto} * 1,
                 $form->{id});
index 7682516..55203db 100644 (file)
--- a/SL/IS.pm
+++ b/SL/IS.pm
@@ -1518,7 +1518,7 @@ sub get_customer {
   $query =
     qq|SELECT
          c.name AS customer, c.discount, c.creditlimit, c.terms,
-         c.email, c.cc, c.bcc, c.language_id, c.payment_id AS customer_payment_id,
+         c.email, c.cc, c.bcc, c.language_id, c.payment_id,
          c.street, c.zipcode, c.city, c.country,
          c.notes AS intnotes, c.klass as customer_klass, c.taxzone_id, c.salesman_id,
          $duedate + COALESCE(pt.terms_netto, 0) AS duedate,
@@ -1550,23 +1550,6 @@ sub get_customer {
   $ref = selectfirst_hashref_query($form, $dbh, $query, $cid);
   map { $form->{$_} = $ref->{$_} } keys %$ref;
 
-  #check whether payment_terms are better than old payment_terms
-  if (($form->{payment_id} ne "") && ($form->{customer_payment_id} ne "")) {
-    $query =
-      qq|SELECT
-          (SELECT ranking FROM payment_terms WHERE id = ?),
-          (SELECT ranking FROM payment_terms WHERE id = ?)|;
-    my ($old_ranking, $new_ranking)
-      = selectrow_query($form, $dbh, $query, conv_i($form->{payment_id}), conv_i($form->{customer_payment_id}));
-    if ($new_ranking > $old_ranking) {
-      $form->{payment_id} = $form->{customer_payment_id};
-    }
-  }
-
-  if ($form->{payment_id} eq "") {
-    $form->{payment_id} = $form->{customer_payment_id};
-  }
-
   $form->{creditremaining} = $form->{creditlimit};
   $query = qq|SELECT SUM(amount - paid) FROM ar WHERE customer_id = ?|;
   my ($value) = selectrow_query($form, $dbh, $query, $cid);
@@ -1755,19 +1738,6 @@ sub retrieve_item {
       }
     }
 
-    #check whether payment_terms are better than old payment_terms
-    if (($form->{payment_id} ne "") && ($form->{part_payment_id} ne "")) {
-      $query =
-        qq|SELECT
-            (SELECT ranking FROM payment_terms WHERE id = ?),
-            (SELECT ranking FROM payment_terms WHERE id = ?)|;
-      my ($old_ranking, $new_ranking)
-        = selectrow_query($form, $dbh, $query, conv_i($form->{payment_id}), conv_i($form->{part_payment_id}));
-      if ($new_ranking > $old_ranking) {
-        $form->{payment_id} = $form->{customer_payment_id};
-      }
-    }
-
     if ($form->{payment_id} eq "") {
       $form->{payment_id} = $form->{part_payment_id};
     }