X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FManager%2FOrder.pm;h=ff8ece29fa0159fcda07df1d27b1629ba7d548ce;hb=d001c791676ec85371465f557cf21e72b09319a4;hp=451a43aafb3bd84b1779834cf71a4ef23f21ba7a;hpb=6cf3f7762efd40bee49a2b8f11bb4ab6915d9071;p=kivitendo-erp.git diff --git a/SL/DB/Manager/Order.pm b/SL/DB/Manager/Order.pm index 451a43aaf..ff8ece29f 100644 --- a/SL/DB/Manager/Order.pm +++ b/SL/DB/Manager/Order.pm @@ -2,21 +2,22 @@ package SL::DB::Manager::Order; use strict; -use SL::DB::Helpers::Manager; -use base qw(SL::DB::Helpers::Manager); +use SL::DB::Helper::Manager; +use base qw(SL::DB::Helper::Manager); sub object_class { 'SL::DB::Order' } __PACKAGE__->make_manager_methods; sub type_filter { - my $class = shift; - my $type = lc(shift || ''); - - return (and => [ '!customer_id' => undef, quotation => 1 ]) if $type eq 'sales_quotation'; - return (and => [ '!vendor_id' => undef, quotation => 1 ]) if $type eq 'request_quotation'; - return (and => [ '!customer_id' => undef, or => [ quotation => 0, quotation => undef ] ]) if $type eq 'sales_order'; - return (and => [ '!vendor_id' => undef, or => [ quotation => 0, quotation => undef ] ]) if $type eq 'purchase_order'; + my $class = shift; + my $type = lc(shift || ''); + my $prefix = shift || ''; + + return (and => [ "!${prefix}customer_id" => undef, "${prefix}quotation" => 1 ]) if $type eq 'sales_quotation'; + return (and => [ "!${prefix}vendor_id" => undef, "${prefix}quotation" => 1 ]) if $type eq 'request_quotation'; + return (and => [ "!${prefix}customer_id" => undef, or => [ "${prefix}quotation" => 0, "${prefix}quotation" => undef ] ]) if $type eq 'sales_order'; + return (and => [ "!${prefix}vendor_id" => undef, or => [ "${prefix}quotation" => 0, "${prefix}quotation" => undef ] ]) if $type eq 'purchase_order'; die "Unknown type $type"; }