Kundenspezifische Artikelpreise: Reihenfolge/sortorder berücksichtigen
authorBernd Bleßmann <bernd@kivitendo-premium.de>
Fri, 7 Feb 2020 11:10:51 +0000 (12:10 +0100)
committerBernd Bleßmann <bernd@kivitendo-premium.de>
Fri, 7 Feb 2020 11:17:49 +0000 (12:17 +0100)
SL/DB/Part.pm
templates/webpages/part/_customerprices.html

index db3a266..581b468 100644 (file)
@@ -80,7 +80,8 @@ __PACKAGE__->meta->add_relationships(
 __PACKAGE__->meta->initialize;
 
 __PACKAGE__->attr_html('notes');
-__PACKAGE__->attr_sorted({ unsorted => 'makemodels', position => 'sortorder' });
+__PACKAGE__->attr_sorted({ unsorted => 'makemodels',     position => 'sortorder' });
+__PACKAGE__->attr_sorted({ unsorted => 'customerprices', position => 'sortorder' });
 
 __PACKAGE__->before_save('_before_save_set_partnumber');
 
index 49f32c3..b9ffd47 100644 (file)
@@ -19,7 +19,7 @@
         </thead>
         <tbody id="customerprice_rows">
         [% SET listrow = 0 %]
-        [%- FOREACH customerprice = SELF.part.customerprices %]
+        [%- FOREACH customerprice = SELF.part.customerprices_sorted %]
         [% listrow = listrow + 1 %]
         [% PROCESS 'part/_customerprice_row.html' customerprice=customerprice listrow=listrow %]
         [%- END %]