Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision a794ea45

Von Tamino Steinert vor etwa 1 Jahr hinzugefügt

  • ID a794ea45d8d304179e722692d7c5c7a862958dc7
  • Vorgänger ac86eb65
  • Nachfolger 84346ba1

DB::Order: Funktionen angepasst (kein Angebotsflag)

Unterschiede anzeigen:

SL/DB/Manager/Order.pm
4 4

  
5 5
use parent qw(SL::DB::Helper::Manager);
6 6

  
7
use SL::DB::Order::TypeData qw(:types);
7 8
use SL::DB::Helper::Paginated;
8 9
use SL::DB::Helper::Sorted;
9 10
use SL::DB::Helper::Filtered;
10 11

  
12
use List::MoreUtils qw(any);
13

  
11 14
sub object_class { 'SL::DB::Order' }
12 15

  
13 16
__PACKAGE__->make_manager_methods;
......
28 31
  my $type   = lc(shift || '');
29 32
  my $prefix = shift || '';
30 33

  
31
  return (and => [ "!${prefix}customer_id" => undef,         "${prefix}quotation" => 1                       ]) if $type eq 'sales_quotation';
32
  return (and => [ "!${prefix}vendor_id"   => undef,         "${prefix}quotation" => 1                       ]) if $type eq 'request_quotation';
33
  return (and => [ "!${prefix}customer_id" => undef, or => [ "${prefix}quotation" => 0, "${prefix}quotation" => undef ] ]) if $type eq 'sales_order';
34
  return (and => [ "!${prefix}vendor_id"   => undef, or => [ "${prefix}quotation" => 0, "${prefix}quotation" => undef ] ]) if $type eq 'purchase_order';
34
  return ("${prefix}record_type" => $type) if( any {$type eq $_} (
35
      SALES_ORDER_TYPE(),
36
      SALES_QUOTATION_TYPE(),
37
      PURCHASE_ORDER_TYPE(),
38
      REQUEST_QUOTATION_TYPE(),
39
    ));
35 40

  
36 41
  die "Unknown type $type";
37 42
}

Auch abrufbar als: Unified diff