Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 57008bc3

Von Bernd Bleßmann vor 8 Monaten hinzugefügt

  • ID 57008bc3297edf35fc5d67f8ca9acbe6e5664127
  • Vorgänger cd424304
  • Nachfolger 6859be4f

S:D:Order: weitere Methoden für Vorgängerbelege

Unterschiede anzeigen:

SL/DB/Order.pm
820 820
  }
821 821
}
822 822

  
823
sub preceding_sales_order_intakes {
824
  my ($self) = @_;
825

  
826
  my @lrs = ();
827
  if ($self->id) {
828
    @lrs = grep { $_->record_type eq SALES_ORDER_INTAKE_TYPE() } @{$self->linked_records(from => 'SL::DB::Order')};
829
  } else {
830
    if ('SL::DB::Order' eq $self->{RECORD_TYPE_REF()}) {
831
      my $order = SL::DB::Order->load_cached($self->{RECORD_ID()});
832
      push @lrs, $order if $order->record_type eq SALES_ORDER_INTAKE_TYPE();
833
    }
834
  }
835

  
836
  return \@lrs;
837
}
838

  
823 839
sub preceding_purchase_orders {
824 840
  my ($self) = @_;
825 841

  
......
836 852
  return \@lrs;
837 853
}
838 854

  
855
sub preceding_purchase_quotation_intakes {
856
  my ($self) = @_;
857

  
858
  my @lrs = ();
859
  if ($self->id) {
860
    @lrs = grep { $_->record_type eq PURCHASE_QUOTATION_INTAKE_TYPE() } @{$self->linked_records(from => 'SL::DB::Order', recursive => 1)};
861
  } else {
862
    if ('SL::DB::Order' eq $self->{RECORD_TYPE_REF()}) {
863
      my $order = SL::DB::Order->load_cached($self->{RECORD_ID()});
864
      push @lrs, $order if $order->record_type eq PURCHASE_QUOTATION_INTAKE_TYPE();
865
    }
866
  }
867

  
868
  return \@lrs;
869
}
870

  
871
sub preceding_request_quotations {
872
  my ($self) = @_;
873

  
874
  my @lrs = ();
875
  if ($self->id) {
876
    @lrs = grep { $_->record_type eq REQUEST_QUOTATION_TYPE() } @{$self->linked_records(from => 'SL::DB::Order', recursive => 1)};
877
  } else {
878
    if ('SL::DB::Order' eq $self->{RECORD_TYPE_REF()}) {
879
      my $order = SL::DB::Order->load_cached($self->{RECORD_ID()});
880
      push @lrs, $order if $order->record_type eq REQUEST_QUOTATION_TYPE();
881
    }
882
  }
883

  
884
  return \@lrs;
885
}
886

  
839 887
sub type_data {
840 888
  SL::DB::Helper::TypeDataProxy->new(ref $_[0], $_[0]->type);
841 889
}

Auch abrufbar als: Unified diff