Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision ba0fb69c

Von Sven Schöling vor mehr als 12 Jahren hinzugefügt

  • ID ba0fb69ce21dd281a09d91418785fa87203f9e6c
  • Vorgänger 9414d575
  • Nachfolger a1ee1265

sellprice information test commit

Unterschiede anzeigen:

SL/DB/Manager/Order.pm
10 10
__PACKAGE__->make_manager_methods;
11 11

  
12 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';
13
  my $class  = shift;
14
  my $type   = lc(shift || '');
15
  my $prefix = shift || '';
16

  
17
  return (and => [ "!${prefix}customer_id" => undef,         "${prefix}quotation" => 1                       ]) if $type eq 'sales_quotation';
18
  return (and => [ "!${prefix}vendor_id"   => undef,         "${prefix}quotation" => 1                       ]) if $type eq 'request_quotation';
19
  return (and => [ "!${prefix}customer_id" => undef, or => [ "${prefix}quotation" => 0, "${prefix}quotation" => undef ] ]) if $type eq 'sales_order';
20
  return (and => [ "!${prefix}vendor_id"   => undef, or => [ "${prefix}quotation" => 0, "${prefix}quotation" => undef ] ]) if $type eq 'purchase_order';
20 21

  
21 22
  die "Unknown type $type";
22 23
}

Auch abrufbar als: Unified diff