- my $where = "1 = 1";
-
- if ($form->{partsgroup}) {
- $var = $form->like(lc $form->{partsgroup});
- $where .= " AND lower(g.partsgroup) LIKE '$var'";
+ $dbh->disconnect;
+
+ $main::lxdebug->leave_sub();
+}
+
+##########################
+# get pricegroups from database
+#
+sub pricegroups {
+ $main::lxdebug->enter_sub();
+
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ my ($where, @values);
+
+ if ($form->{pricegroup}) {
+ $where .= qq| AND pricegroup ILIKE ?|;
+ push(@values, '%' . $form->{pricegroup} . '%');