X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FCT.pm;h=91fe2c022f8213a6442f24612a4d801f31c60ad3;hb=4311578257aa2e5808580def7e80a38d493646b0;hp=d9a7ac704508930d5521299ccb2d1a36587037fd;hpb=93a4e424476aae2551b2d070133cd42d5d2f3d52;p=kivitendo-erp.git diff --git a/SL/CT.pm b/SL/CT.pm index d9a7ac704..91fe2c022 100644 --- a/SL/CT.pm +++ b/SL/CT.pm @@ -101,10 +101,6 @@ sub populate_drop_down_boxes { $query = qq|SELECT id, description FROM business ORDER BY id|; $form->{all_business} = selectall_hashref_query($form, $dbh, $query); - # get tax zones - $query = qq|SELECT id, description FROM tax_zones|; - $form->{TAXZONE} = selectall_hashref_query($form, $dbh, $query); - # get shipto address $query = qq|SELECT shipto_id, shiptoname, shiptodepartment_1 | . @@ -624,6 +620,17 @@ sub search { $form->{l_invnumber} = $form->{l_ordnumber} = $form->{l_quonumber} = ""; } + if ($form->{obsolete} eq "Y") { + $where .= qq| AND obsolete|; + } elsif ($form->{obsolete} eq "N") { + $where .= qq| AND NOT obsolete|; + } + + if ($form->{business_id}) { + $where .= qq| AND (business_id = ?)|; + push(@values, conv_i($form->{business_id})); + } + my $query = qq|SELECT ct.*, b.description AS business | . qq|FROM $cv ct | .