From 6216f7b53a81a73641a2d98ea43f363b6a615b07 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 8 Oct 2007 08:42:44 +0000 Subject: [PATCH] =?utf8?q?Die=20Variable=20"ranking"=20f=C3=BCr=20Zahlungs?= =?utf8?q?bedinungen=20konnte=20nirgends=20konfiguriert=20werden.=20Zus?= =?utf8?q?=C3=A4tzlich=20werden=20beim=20Wechsel=20des=20Kunden=20in=20ein?= =?utf8?q?er=20Verkaufsmaske=20die=20beim=20Kunden=20hinterlegten=20Zahlun?= =?utf8?q?gsbedingungen=20immer=20ausgew=C3=A4hlt,=20nicht=20nur=20dann,?= =?utf8?q?=20wenn=20vorher=20keine=20ausgew=C3=A4hlt=20waren.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/AM.pm | 2 -- SL/IS.pm | 32 +------------------------------- 2 files changed, 1 insertion(+), 33 deletions(-) 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}; } -- 2.20.1