$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 | .
}
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"
: 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|;