From a9325fe964a8b3c4c240409ddf5020756324b1e4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Wed, 11 Jun 2014 13:11:21 +0200 Subject: [PATCH] =?utf8?q?Kunden-/Lieferantenbericht:=20Zahlungsbegingunge?= =?utf8?q?n=20anzeigen=20k=C3=B6nnen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/CT.pm | 17 +++++++++++++---- bin/mozilla/ct.pl | 8 +++++--- templates/webpages/ct/search.html | 4 ++++ 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/SL/CT.pm b/SL/CT.pm index fa1f91477..92011897c 100644 --- a/SL/CT.pm +++ b/SL/CT.pm @@ -76,7 +76,8 @@ sub search { "city" => "ct.city", "country" => "ct.country", "discount" => "ct.discount", - "salesman" => "e.name" + "salesman" => "e.name", + "payment" => "pt.description" ); $form->{sort} ||= "name"; @@ -197,11 +198,13 @@ sub search { } my $query = - qq|SELECT ct.*, b.description AS business, e.name as salesman | . + qq|SELECT ct.*, b.description AS business, e.name as salesman, |. + qq| pt.description as payment | . (qq|, NULL AS invnumber, NULL AS ordnumber, NULL AS quonumber, NULL AS invid, NULL AS module, NULL AS formtype, NULL AS closed | x!! $join_records) . qq|FROM $cv ct | . qq|LEFT JOIN business b ON (ct.business_id = b.id) | . qq|LEFT JOIN employee e ON (ct.salesman_id = e.id) | . + qq|LEFT JOIN payment_terms pt ON (ct.payment_id = pt.id) | . qq|WHERE $where|; my @saved_values = @values; @@ -215,7 +218,8 @@ sub search { push(@values, @saved_values); $query .= qq| UNION | . - qq|SELECT ct.*, b.description AS business, e.name as salesman, | . + qq|SELECT ct.*, b.description AS business, e.name as salesman, |. + qq| pt.description as payment, | . qq| a.invnumber, a.ordnumber, a.quonumber, a.id AS invid, | . qq| '$module' AS module, 'invoice' AS formtype, | . qq| (a.amount = a.paid) AS closed | . @@ -223,6 +227,7 @@ sub search { qq|JOIN $ar a ON (a.${cv}_id = ct.id) | . qq|LEFT JOIN business b ON (ct.business_id = b.id) | . qq|LEFT JOIN employee e ON (ct.salesman_id = e.id) | . + qq|LEFT JOIN payment_terms pt ON (ct.payment_id = pt.id) | . qq|WHERE $where AND (a.invoice = '1')|; } @@ -230,13 +235,15 @@ sub search { push(@values, @saved_values); $query .= qq| UNION | . - qq|SELECT ct.*, b.description AS business, e.name as salesman, | . + qq|SELECT ct.*, b.description AS business, e.name as salesman, |. + qq| pt.description as payment, | . qq| ' ' AS invnumber, o.ordnumber, o.quonumber, o.id AS invid, | . qq| 'oe' AS module, 'order' AS formtype, o.closed | . qq|FROM $cv ct | . qq|JOIN oe o ON (o.${cv}_id = ct.id) | . qq|LEFT JOIN business b ON (ct.business_id = b.id) | . qq|LEFT JOIN employee e ON (ct.salesman_id = e.id) | . + qq|LEFT JOIN payment_terms pt ON (ct.payment_id = pt.id) | . qq|WHERE $where AND (o.quotation = '0')|; } @@ -245,12 +252,14 @@ sub search { $query .= qq| UNION | . qq|SELECT ct.*, b.description AS business, e.name as salesman, | . + qq| pt.description as payment, | . qq| ' ' AS invnumber, o.ordnumber, o.quonumber, o.id AS invid, | . qq| 'oe' AS module, 'quotation' AS formtype, o.closed | . qq|FROM $cv ct | . qq|JOIN oe o ON (o.${cv}_id = ct.id) | . qq|LEFT JOIN business b ON (ct.business_id = b.id) | . qq|LEFT JOIN employee e ON (ct.salesman_id = e.id) | . + qq|LEFT JOIN payment_terms pt ON (ct.payment_id = pt.id) | . qq|WHERE $where AND (o.quotation = '1')|; } } diff --git a/bin/mozilla/ct.pl b/bin/mozilla/ct.pl index 845fc3ab4..0793a4459 100644 --- a/bin/mozilla/ct.pl +++ b/bin/mozilla/ct.pl @@ -153,9 +153,10 @@ sub list_names { } my @columns = ( - 'id', 'name', "$form->{db}number", 'contact', 'phone', 'discount', - 'fax', 'email', 'taxnumber', 'street', 'zipcode' , 'city', - 'business', 'invnumber', 'ordnumber', 'quonumber', 'salesman', 'country' + 'id', 'name', "$form->{db}number", 'contact', 'phone', 'discount', + 'fax', 'email', 'taxnumber', 'street', 'zipcode' , 'city', + 'business', 'payment', 'invnumber', 'ordnumber', 'quonumber', 'salesman', + 'country' ); my @includeable_custom_variables = grep { $_->{includeable} } @{ $cvar_configs }; @@ -184,6 +185,7 @@ sub list_names { 'country' => { 'text' => $locale->text('Country'), }, 'salesman' => { 'text' => $locale->text('Salesman'), }, 'discount' => { 'text' => $locale->text('Discount'), }, + 'payment' => { 'text' => $locale->text('Payment Terms'), }, %column_defs_cvars, ); diff --git a/templates/webpages/ct/search.html b/templates/webpages/ct/search.html index 2a7748c58..2d237264a 100644 --- a/templates/webpages/ct/search.html +++ b/templates/webpages/ct/search.html @@ -159,6 +159,10 @@ + + + + [% IF IS_CUSTOMER %] -- 2.20.1