Verzeichnis SL/DB/Helpers in SL/DB/Helper umbenannt (Konsistenz)
[kivitendo-erp.git] / SL / DB / Manager / Order.pm
1 package SL::DB::Manager::Order;
2
3 use strict;
4
5 use SL::DB::Helper::Manager;
6 use base qw(SL::DB::Helper::Manager);
7
8 sub object_class { 'SL::DB::Order' }
9
10 __PACKAGE__->make_manager_methods;
11
12 sub type_filter {
13   my $class = shift;
14   my $type  = lc(shift || '');
15
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';
20
21   die "Unknown type $type";
22 }
23
24 1;