1 package SL::DB::Manager::Order;
5 use SL::DB::Helper::Manager;
6 use base qw(SL::DB::Helper::Manager);
8 sub object_class { 'SL::DB::Order' }
10 __PACKAGE__->make_manager_methods;
14 my $type = lc(shift || '');
16 return (and => [ '!customer_id' => undef, quotation => 1 ]) if $type eq 'sales_quotation';
17 return (and => [ '!vendor_id' => undef, quotation => 1 ]) if $type eq 'request_quotation';
18 return (and => [ '!customer_id' => undef, or => [ quotation => 0, quotation => undef ] ]) if $type eq 'sales_order';
19 return (and => [ '!vendor_id' => undef, or => [ quotation => 0, quotation => undef ] ]) if $type eq 'purchase_order';
21 die "Unknown type $type";