1 package SL::DB::Manager::PurchaseInvoice;
5 use SL::DB::Helper::Manager;
6 use base qw(SL::DB::Helper::Manager);
8 sub object_class { 'SL::DB::PurchaseInvoice' }
10 __PACKAGE__->make_manager_methods;
14 my $type = lc(shift || '');
16 return (or => [ invoice => 0, invoice => undef ]) if $type eq 'ap_transaction';
17 return (and => [ invoice => 1, or => [ storno => 0, storno => undef ] ]) if $type eq 'invoice';
18 return (and => [ invoice => 1, storno => 1 ]) if $type =~ m/(?:invoice_)?storno/;
20 die "Unknown type $type";