Index: /changelog
===================================================================
--- /changelog	(revision 8506)
+++ /changelog	(revision 8507)
@@ -1,3 +1,3 @@
-#4.0.0 / 5259
+4.0.0 / 5259
  - Feature - Produktbilder - Mehrfacher Upload mÃ¶glich
  - Feature - Produktbilder - Bilder unter /wpsg verschoben (!)
@@ -656,4 +656,5 @@
 - Feature: GutscheinÃŒbersicht neue Spalte "Produkte"
 - Feature: Exportprofile/Statistik - Export von KÃ€ufen
+- Feature: Exportprofile/Staffelpreise - Export von minimalen Brutto-/Netto Produktpreis
 - Bugfix: Exportprofile - Problem mit Feld "Anzahl Produkte" korrigiert
 - Bugfix: Datumsformatierung mit IntlDateFormatter
Index: /mods/wpsg_mod_scaleprice.class.php
===================================================================
--- /mods/wpsg_mod_scaleprice.class.php	(revision 8506)
+++ /mods/wpsg_mod_scaleprice.class.php	(revision 8507)
@@ -403,5 +403,53 @@
 			
 		} // public function loadProduktArray(&$product_data)
-		 		
+
+		public function wpsg_mod_export_loadFields(&$arFields) {
+
+			$arFields[20]['fields']['scaleprice_min_produkt_preis_brutto'] = __('minimaler Produktpreis (Brutto)', 'wpsg');
+			$arFields[20]['fields']['scaleprice_min_produkt_preis_netto'] = __('minimaler Produktpreis (Netto)', 'wpsg');
+
+		}
+
+		public function wpsg_mod_export_getValue(&$return, $field_value, $o_id, $p_id, $order_product_id, $profil_separator) {
+
+			if (in_array($field_value, array('scaleprice_min_produkt_preis_brutto', 'scaleprice_min_produkt_preis_netto'))) {
+
+				if ($p_id > 0 && $this->product_has_scaleprice($p_id)) {
+
+					$min_price_backend = $this->getMinScalePrice(intval($p_id));
+
+					$oProduct = wpsg_product::getInstance($p_id);
+					$tax_value = $oProduct->getDefaultTaxValue(); // 19.00
+
+					// --> Netto
+					if ($this->shop->getBackendTaxview() == WPSG_NETTO) {
+
+						$min_price_backend_netto = $min_price_backend;
+						$min_price_backend_brutto = wpsg_calculatePreis($min_price_backend_netto, WPSG_BRUTTO, $tax_value);
+
+					}
+					else {
+
+						$min_price_backend_netto = wpsg_calculatePreis($min_price_backend, WPSG_NETTO, $tax_value);
+						$min_price_backend_brutto = $min_price_backend;
+
+					}
+
+					if ($field_value === 'scaleprice_min_produkt_preis_brutto') {
+
+						$return = $min_price_backend_brutto;
+
+					} else if ($field_value === 'scaleprice_min_produkt_preis_netto') {
+
+						$return = $min_price_backend_netto;
+
+					}
+
+				}
+
+			}
+
+		}
+
 		/* Modulfunktionen */
 
@@ -424,6 +472,6 @@
 		public function getScalePrice($oProduct, $price, $scale) {
 			
-			$arScale = $this->db->fetchAssoc("SELECT * FROM `".WPSG_TBL_SCALEPRICE."` WHERE `product_id` = '".wpsg_q($oProduct->id)."' ORDER BY `scale` ASC");
-			
+			$arScale = $this->getProductScaleAsArray($oProduct->getId());
+
 			$set_scale = false;
 			
@@ -485,4 +533,16 @@
 			
 		} // private function scaleList($product_id)
-		
+
+		public function getProductScaleAsArray(int $product_id): array {
+
+			return $this->db->fetchAssoc("SELECT * FROM `".WPSG_TBL_SCALEPRICE."` WHERE `product_id` = '".intval($product_id)."' ORDER BY `scale` ASC");
+
+		}
+
+		public function getMinScalePrice(int $product_id): float {
+
+			return floatval($this->db->fetchOne("SELECT MIN(`value`) FROM `".WPSG_TBL_SCALEPRICE."` WHERE `product_id` = '".intval($product_id)."'"));
+
+		}
+
 	} // class wpsg_mod_scaleprice extends wpsg_mod_basic
