X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/88dea78ecdb77761f71c5016ca97e53b2d55d9d3..c0cc8bb220b76219934bee9ac5dd5e8e971ddc65:/SL/AR.pm diff --git a/SL/AR.pm b/SL/AR.pm index a2cad1196..e01ddcb06 100644 --- a/SL/AR.pm +++ b/SL/AR.pm @@ -473,6 +473,7 @@ sub ar_transactions { qq| dc.dunning_description, | . qq| tz.description AS taxzone, | . qq| pt.description AS payment_terms, | . + qq| d.description AS department, | . qq{ ( SELECT ch.accno || ' -- ' || ch.description FROM acc_trans at LEFT JOIN chart ch ON ch.id = at.chart_id @@ -507,11 +508,11 @@ sub ar_transactions { push(@values, $form->{customer_id}); } elsif ($form->{customer}) { $where .= " AND c.name ILIKE ?"; - push(@values, $form->like($form->{customer})); + push(@values, like($form->{customer})); } if ($form->{"cp_name"}) { $where .= " AND (cp.cp_name ILIKE ? OR cp.cp_givenname ILIKE ?)"; - push(@values, ('%' . trim($form->{"cp_name"}) . '%')x2); + push(@values, (like($form->{"cp_name"}))x2); } if ($form->{business_id}) { my $business_id = $form->{business_id}; @@ -524,14 +525,14 @@ sub ar_transactions { push(@values, $department_id); } if ($form->{department}) { - my $department = "%" . trim($form->{department}) . "%"; + my $department = like($form->{department}); $where .= " AND d.description ILIKE ?"; push(@values, $department); } foreach my $column (qw(invnumber ordnumber cusordnumber notes transaction_description)) { if ($form->{$column}) { $where .= " AND a.$column ILIKE ?"; - push(@values, $form->like($form->{$column})); + push(@values, like($form->{$column})); } } if ($form->{"project_id"}) { @@ -584,6 +585,33 @@ sub ar_transactions { } }; + if ($form->{parts_partnumber}) { + $where .= <{parts_partnumber}); + } + + if ($form->{parts_description}) { + $where .= <{parts_description}); + } + my ($cvar_where, @cvar_values) = CVar->build_filter_query('module' => 'CT', 'trans_id_field' => 'c.id', 'filter' => $form,