diff --git a/bin/backend/controls/shippingRules/Rule.html b/bin/backend/controls/shippingRules/Rule.html index 9e45a8b29de933105ff514dc5e105ecfcd77af9c..ecf93df976c4c474eb13bed4d5f4cd3ba7c6f6d0 100644 --- a/bin/backend/controls/shippingRules/Rule.html +++ b/bin/backend/controls/shippingRules/Rule.html @@ -44,7 +44,9 @@ <span class="field-container-item" title="{{discountDescription}}"> {{discountTitle}} </span> - <span class="field-container-field field-container-field-no-padding"> + <span class="field-container-field field-container-field-no-padding" + style="display: flex;" + > <select name="discount_type" class="field-container-field" style="width: 40%" > @@ -62,8 +64,10 @@ step="0.01" name="discount" class="field-container-field" - style="width: 59%" /> + <button disabled name="calc" class="qui-button" style="width: 50px;"> + <span class="fa fa-calculator"></span> + </button> </span> </label> </td> diff --git a/bin/backend/controls/shippingRules/Rule.js b/bin/backend/controls/shippingRules/Rule.js index 0e8acd75731131cd2d553bd3f01582d4e62e098f..d04b7caab8494d70cca1cbc3fe2524f5e98e57f6 100644 --- a/bin/backend/controls/shippingRules/Rule.js +++ b/bin/backend/controls/shippingRules/Rule.js @@ -160,6 +160,36 @@ define('package/quiqqer/shipping/bin/backend/controls/shippingRules/Rule', [ Tbody.getElements('input').set('disabled', false); }).then(function () { return ControlUtils.parse(self.getElm()); + }).then(function () { + var CalcButton = self.getElm().getElement('[name="calc"]'); + var Discount = self.getElm().getElement('[name="discount"]'); + + CalcButton.disabled = false; + CalcButton.title = QUILocale.get('quiqqer/erp', 'control.window.price.brutto.title'); + + CalcButton.addEvent('click', function () { + var Fa = CalcButton.getElement('.fa'); + + Fa.addClass('fa-spinner'); + Fa.addClass('fa-spin'); + Fa.removeClass('fa-calculator'); + + require([ + 'package/quiqqer/erp/bin/backend/controls/articles/windows/PriceBrutto' + ], function (PriceBruttoWindow) { + new PriceBruttoWindow({ + events: { + onSubmit: function (Win, value) { + Discount.value = value; + } + } + }).open(); + + Fa.removeClass('fa-spinner'); + Fa.removeClass('fa-spin'); + Fa.addClass('fa-calculator'); + }); + }); }).then(function () { ElementsUtils.simulateEvent( self.getElm().getElement('.usage-table thead .data-table-toggle'),