X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/87e190b46ddee16b2cf7a2e52e1bbc8555a41f8e..9b49681d3eea019cd1619d5213330efd55fade98:/SL/CT.pm diff --git a/SL/CT.pm b/SL/CT.pm index d235a676a..3df827a6d 100644 --- a/SL/CT.pm +++ b/SL/CT.pm @@ -316,8 +316,7 @@ sub save_customer { qq|taxzone_id = ?, | . qq|user_password = ?, | . qq|c_vendor_id = ?, | . - qq|klass = ?, | . - qq|v_customer_id = ? | . + qq|klass = ? | . qq|WHERE id = ?|; my @values = ( $form->{customernumber}, @@ -357,7 +356,6 @@ sub save_customer { $form->{user_password}, $form->{c_vendor_id}, conv_i($form->{klass}), - $form->{v_customer_id}, $form->{id} ); do_query( $form, $dbh, $query, @values ); @@ -763,17 +761,17 @@ if ($sortorder ne 'id') { $where .= qq| AND ($cvar_where)|; push @values, @cvar_values; } - # Um nach Straße in der Berichtsmaske zu suchen ... jb 13.11.2008 - if ($form->{addr_street}) { - $where .= qq| AND (street ILIKE ?)|; - push @values, ('%' . $form->{addr_street} . '%'); - } - - # Um nach PLZ in der Berichtsmaske zu suchen ... jb 13.11.2008 - if ($form->{addr_zipcode}) { - $where .= qq| AND (zipcode ILIKE ?)|; - push @values, ($form->{addr_zipcode} . '%'); - } + + if ($form->{addr_street}) { + $where .= qq| AND (street ILIKE ?)|; + push @values, '%' . $form->{addr_street} . '%'; + } + + if ($form->{addr_zipcode}) { + $where .= qq| AND (zipcode ILIKE ?)|; + push @values, $form->{addr_zipcode} . '%'; + } + my $query = qq|SELECT ct.*, b.description AS business | . qq|FROM $cv ct | . @@ -925,8 +923,9 @@ sub get_delivery { } my $query = qq|SELECT s.shiptoname, i.qty, | . - qq| ${arap}.transdate, ${arap}.invnumber, ${arap}.ordnumber, | . - qq| i.description, i.unit, i.sellprice | . + qq| ${arap}.id, ${arap}.transdate, ${arap}.invnumber, ${arap}.ordnumber, | . + qq| i.description, i.unit, i.sellprice, | . + qq| oe.id AS oe_id | . qq|FROM $arap | . qq|LEFT JOIN shipto s ON | . ($arap eq "ar" @@ -934,6 +933,7 @@ sub get_delivery { : qq|(ap.id = s.trans_id) |) . qq|LEFT JOIN invoice i ON (${arap}.id = i.trans_id) | . qq|LEFT join parts p ON (p.id = i.parts_id) | . + qq|LEFT JOIN oe ON (oe.ordnumber = ${arap}.ordnumber AND NOT ${arap}.ordnumber = '') | . $where . qq|ORDER BY ${arap}.transdate DESC LIMIT 15|;