From: Moritz Bunkus Date: Mon, 8 Oct 2007 08:42:44 +0000 (+0000) Subject: Die Variable "ranking" für Zahlungsbedinungen konnte nirgends konfiguriert werden... X-Git-Tag: release-2.6.0beta1~482 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=6216f7b53a81a73641a2d98ea43f363b6a615b07;p=kivitendo-erp.git Die Variable "ranking" für Zahlungsbedinungen konnte nirgends konfiguriert werden. Zusätzlich werden beim Wechsel des Kunden in einer Verkaufsmaske die beim Kunden hinterlegten Zahlungsbedingungen immer ausgewählt, nicht nur dann, wenn vorher keine ausgewählt waren. --- diff --git a/SL/AM.pm b/SL/AM.pm index bb83c7956..ec4c3f00c 100644 --- 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}); diff --git a/SL/IS.pm b/SL/IS.pm index 76825169c..55203db2a 100644 --- 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}; }