X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FPartClassification.pm;h=c02c8b36d89cd2acd81d4ff77b330a2b392bc824;hb=0ebb8f829ac2d23b65e8d993c7d03aa0b172b637;hp=73f11da3ce6770986e60ae8ee443b095f9d7a9e0;hpb=65d2537d658b99b005a18c6663bc1293b41a1d83;p=kivitendo-erp.git diff --git a/SL/DB/PartClassification.pm b/SL/DB/PartClassification.pm index 73f11da3c..c02c8b36d 100644 --- a/SL/DB/PartClassification.pm +++ b/SL/DB/PartClassification.pm @@ -7,6 +7,7 @@ use SL::DB::MetaSetup::PartClassification; use SL::DB::Manager::PartClassification; __PACKAGE__->meta->initialize; +__PACKAGE__->before_delete('can_be_deleted'); # check if the description and abbreviation is present # @@ -20,7 +21,12 @@ sub validate { return @errors; } +sub can_be_deleted { + my ($self) = @_; + # The first five part classifications must not be deleted. + return defined($self->id) && ($self->id >= 5); +} 1; @@ -42,6 +48,12 @@ the parts classification specifies other ortogonal attributes The primary attributes are the rule of the article as "used_for_sales" or "used_for_purchase". +Another attribute is "report_separate". This attribute may be used for some additional costs like +transport, packaging. These article are reported separate in the list of an invoice if +the print template is using the variables <%separate_XXX_subtotal%> and XXX is the shortcut of the parts classification. +The variables <%non_separate_subtotal%> has the sum of all other parts of an invoice. +(See also LaTeX Documentation). + Additional other attributes may follow To see this attributes in a short way there are shortcuts of one (or two characters, if needed for compare )