X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/4493d1eb7845b7eba868f0a16ec2e623dcf1d591..4a06c43348965e95ca77af5ac38f89fedefdc25f:/SL/OE.pm diff --git a/SL/OE.pm b/SL/OE.pm index 149a6cf1a..61af6211c 100644 --- a/SL/OE.pm +++ b/SL/OE.pm @@ -159,7 +159,7 @@ sub transactions { WHERE proi.projectnumber ILIKE ? AND oi.trans_id = o.id )) SQL - push @values, "%" . $form->{"projectnumber"} . "%", "%" . $form->{"projectnumber"} . "%" ; + push @values, like($form->{"projectnumber"}), like($form->{"projectnumber"}); } if ($form->{"business_id"}) { @@ -173,12 +173,12 @@ SQL } elsif ($form->{$vc}) { $query .= " AND ct.name ILIKE ?"; - push(@values, '%' . trim($form->{$vc}) . '%'); + push(@values, like($form->{$vc})); } if ($form->{"cp_name"}) { $query .= " 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 (!$main::auth->assert('sales_all_edit', 1)) { @@ -209,12 +209,12 @@ SQL if ($form->{$ordnumber}) { $query .= qq| AND o.$ordnumber ILIKE ?|; - push(@values, '%' . trim($form->{$ordnumber}) . '%'); + push(@values, like($form->{$ordnumber})); } if ($form->{cusordnumber}) { $query .= qq| AND o.cusordnumber ILIKE ?|; - push(@values, '%' . trim($form->{cusordnumber}) . '%'); + push(@values, like($form->{cusordnumber})); } if($form->{transdatefrom}) { @@ -249,7 +249,7 @@ SQL if ($form->{shippingpoint}) { $query .= qq| AND o.shippingpoint ILIKE ?|; - push(@values, '%' . trim($form->{shippingpoint}) . '%'); + push(@values, like($form->{shippingpoint})); } if ($form->{taxzone_id} ne '') { # taxzone_id could be 0 @@ -259,7 +259,7 @@ SQL if ($form->{transaction_description}) { $query .= qq| AND o.transaction_description ILIKE ?|; - push(@values, '%' . trim($form->{transaction_description}) . '%'); + push(@values, like($form->{transaction_description})); } if ($form->{periodic_invoices_active} ne $form->{periodic_invoices_inactive}) { @@ -287,6 +287,33 @@ SQL push @values, conv_date($form->{expected_billing_date_to}); } + if ($form->{parts_partnumber}) { + $query .= <{parts_partnumber}); + } + + if ($form->{parts_description}) { + $query .= <{parts_description}); + } + if ($form->{all}) { my @tokens = parse_line('\s+', 0, $form->{all}); # ordnumber quonumber customer.name vendor.name transaction_description @@ -296,7 +323,7 @@ SQL ct.name ILIKE ? OR o.transaction_description ILIKE ? )| for @tokens; - push @values, ("%$_%")x4 for @tokens; + push @values, (like($_))x4 for @tokens; } my ($cvar_where, @cvar_values) = CVar->build_filter_query('module' => 'CT', @@ -805,7 +832,7 @@ sub load_periodic_invoice_config { if ($config_obj) { my $config = { map { $_ => $config_obj->$_ } qw(active terminated periodicity order_value_periodicity start_date_as_date end_date_as_date first_billing_date_as_date extend_automatically_by ar_chart_id - print printer_id copies direct_debit) }; + print printer_id copies direct_debit send_email email_recipient_contact_id email_recipient_address email_sender email_subject email_body) }; $form->{periodic_invoices_config} = YAML::Dump($config); } }