Artikel-Klassifizierung: "Preis separat ausweisen"
[kivitendo-erp.git] / SL / DB / PartClassification.pm
1
2 package SL::DB::PartClassification;
3
4 use strict;
5
6 use SL::DB::MetaSetup::PartClassification;
7 use SL::DB::Manager::PartClassification;
8
9 __PACKAGE__->meta->initialize;
10
11 # check if the description and abbreviation is present
12 #
13 sub validate {
14   my ($self) = @_;
15
16   my @errors;
17   push @errors, $::locale->text('The description is missing.')  if !$self->description;
18   push @errors, $::locale->text('The abbreviation is missing.') if !$self->abbreviation;
19
20   return @errors;
21 }
22
23
24
25 1;
26
27 __END__
28
29 =encoding utf-8
30
31 =head1 NAME
32
33 SL::DB::PartClassification
34
35 =head1 SYNOPSIS
36
37 Additional to the article types "part", "assembly", "service" and "assortement"
38 the parts classification specifies other ortogonal attributes
39
40 =head1 DESCRIPTION
41
42 The primary attributes are the rule
43 of the article as "used_for_sales" or "used_for_purchase".
44
45 Another attribute is "report_separate". This attribute may be used for some additional costs like
46 transport, packaging. These article are reported separate in the list of an invoice if
47 the print template is using the variables <%separate_XXX_subtotal%>  and XXX is the shortcut of the parts classification.
48 The variables <%non_separate_subtotal%> has the sum of all other parts of an invoice.
49 (See also LaTeX Documentation).
50
51 Additional other attributes may follow
52
53 To see this attributes in a short way there are shortcuts of one (or two characters, if needed for compare )
54 which may be translated in the specified language
55
56 The type of the article is also as shortcut available, so this combined type and classification shortcut
57 is used short as "Type"
58
59 English type shortcuts are 'P','A','S'
60 German  type shortcuts are 'W','E','D'
61 The can set in the language-files
62
63 To get the localized abbreviations you can use L<SL::Presenter::Part> .
64
65 =head1 METHODS
66
67 =head2 validate
68
69  $self->validate();
70
71 check if the description and abbreviation is present
72
73
74 =head1 AUTHOR
75
76 Martin Helmling E<lt>martin.helmling@opendynamic.deE<gt>
77
78
79 =cut