From a5f409be8c9f981038b94d5e1822185c73ad3949 Mon Sep 17 00:00:00 2001
From: Philip Reetz
Date: Sat, 10 Nov 2007 15:05:30 +0000
Subject: [PATCH] Fehler bei neuen Rechnungen ohne Umwandlung
---
SL/IS.pm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/SL/IS.pm b/SL/IS.pm
index a24468652..2cf148268 100644
--- a/SL/IS.pm
+++ b/SL/IS.pm
@@ -1513,7 +1513,7 @@ sub get_customer {
}
my $cid = conv_i($form->{customer_id});
-
+ my $payment_id = ($form->{payment_id}) ? "($form->{payment_id} = pt.id) OR" : "";
# get customer
$query =
qq|SELECT
@@ -1525,7 +1525,7 @@ sub get_customer {
b.discount AS tradediscount, b.description AS business
FROM customer c
LEFT JOIN business b ON (b.id = c.business_id)
- LEFT JOIN payment_terms pt ON (($form->{payment_id} = pt.id) OR (c.payment_id = pt.id))
+ LEFT JOIN payment_terms pt ON ($payment_id (c.payment_id = pt.id))
WHERE c.id = ?|;
push @values, $cid;
$ref = selectfirst_hashref_query($form, $dbh, $query, @values);
--
2.20.1