diff --git a/bin/controls/Discounts.js b/bin/controls/Discounts.js index 5119fd09fafbc84b20040378bf0a894a01ad3266..b3016e45b3440b993583c0929ce02234584c5163 100644 --- a/bin/controls/Discounts.js +++ b/bin/controls/Discounts.js @@ -55,11 +55,11 @@ define('package/quiqqer/discount/bin/controls/Discounts', [ * event : on create */ $onCreate: function () { - var self = this; this.setAttributes({ - title: QUILocale.get(lg, 'discount.panel.title') + title: QUILocale.get(lg, 'discount.panel.title'), + icon : 'fa fa-cart-arrow-down' }); // buttons @@ -311,7 +311,7 @@ define('package/quiqqer/discount/bin/controls/Discounts', [ if (parseInt(entry.discount_type) === Discounts.DISCOUNT_TYPE_CURRENCY) { entry.discountTypeText = '€'; } - + result.data[i] = entry; } diff --git a/composer.json b/composer.json index 2faa963c6f3a344d31ec25835fcc8e1f18f99181..c7af9e78d3bdebf84ac9f9f2ef8e36e7fda39c36 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "quiqqer/discount", "type": "quiqqer-plugin", "description": "Discounts", - "version": "dev-master", + "version": "dev-dev", "license": "", "authors": [ { diff --git a/src/QUI/ERP/Discount/EventHandling.php b/src/QUI/ERP/Discount/EventHandling.php index 629882b24900d877f0cbf38b8b97b3490c2451c3..fda602eadf375404bf9a28db00cee44b1f555e92 100644 --- a/src/QUI/ERP/Discount/EventHandling.php +++ b/src/QUI/ERP/Discount/EventHandling.php @@ -146,6 +146,12 @@ public static function onQuiqqerProductsCalcListProduct( $userDiscounts = array_filter($userDiscounts, function ($Discount) { /* @var $Discount Discount */ + + // don't use manuel usage type + if ((int)$Discount->getAttribute('usage_type') === Handler::DISCOUNT_USAGE_TYPE_MANUEL) { + return false; + } + return $Discount->getAttribute('scope') == Handler::DISCOUNT_SCOPE_EVERY_PRODUCT; }); @@ -206,6 +212,12 @@ public static function onQuiqqerProductsCalcList( $userDiscounts = array_filter($userDiscounts, function ($Discount) { /* @var $Discount Discount */ + + // don't use manuel usage type + if ((int)$Discount->getAttribute('usage_type') === Handler::DISCOUNT_USAGE_TYPE_MANUEL) { + return false; + } + return $Discount->getAttribute('scope') == Handler::DISCOUNT_SCOPE_TOTAL; });