diff --git a/bin/backend/controls/articles/ArticleSummary.css b/bin/backend/controls/articles/ArticleSummary.css index 59fcfb449e7f910624aa17ad8814383de159cb4c..fa4b256d81d2c2e39cfa49f87e1318ef1461e1ce 100644 --- a/bin/backend/controls/articles/ArticleSummary.css +++ b/bin/backend/controls/articles/ArticleSummary.css @@ -45,3 +45,16 @@ .quiqqer-erp-backend-temporaryErp-summary-total-title { width: calc(100% - 800px); } + +.quiqqer-erp-backend-temporaryErp-priceFactors { + background: #fff; + border: 1px solid #DEDEDE; + bottom: 80px; + box-shadow: 0 4px 8px 0 rgb(0 0 0 / 12%), 0 2px 4px 0 rgb(0 0 0 / 8%); + display: none; + height: 90px; + position: absolute; + right: 10px; + width: 400px; + z-index: 1000; +} diff --git a/bin/backend/controls/articles/ArticleSummary.js b/bin/backend/controls/articles/ArticleSummary.js index 14bce3f13b2fe9dad2eab5165aa78be312144a1b..25f5adcbf4f019085adc39b11cd58c7ef26bb0ff 100644 --- a/bin/backend/controls/articles/ArticleSummary.js +++ b/bin/backend/controls/articles/ArticleSummary.js @@ -37,7 +37,9 @@ define('package/quiqqer/erp/bin/backend/controls/articles/ArticleSummary', [ Binds: [ '$onInject', '$refreshArticleSelect', - 'openSummary' + 'openSummary', + 'showPriceFactors', + 'hidePriceFactors' ], initialize: function (options) { @@ -45,6 +47,8 @@ define('package/quiqqer/erp/bin/backend/controls/articles/ArticleSummary', [ this.$NettoSum = null; this.$BruttoSum = null; + this.$PriceFactors = null; + this.$PFFX = null; this.addEvents({ onInject: this.$onInject @@ -69,10 +73,16 @@ define('package/quiqqer/erp/bin/backend/controls/articles/ArticleSummary', [ labelGross : QUILocale.get(lg, 'article.summary.tpl.labelGross'), labelSums : QUILocale.get(lg, 'article.summary.tpl.labelSums'), labelVat : QUILocale.get(lg, 'article.summary.tpl.labelVat'), - }) + }), + events : { + mouseenter: this.showPriceFactors, + mouseleave: this.hidePriceFactors + } }); this.$Elm.addEvent('click', this.openSummary); + this.$PriceFactors = new Element('div.quiqqer-erp-backend-temporaryErp-priceFactors').inject(this.$Elm); + this.$PFFX = moofx(this.$PriceFactors); this.$NettoSum = this.$Elm.getElement( '.quiqqer-erp-backend-temporaryErp-summary-total .netto-value' @@ -235,7 +245,6 @@ define('package/quiqqer/erp/bin/backend/controls/articles/ArticleSummary', [ let calc = calculated.calculations; this.getCurrencyFormatter().then((Formatter) => { - if (this.getAttribute('showPosSummary')) { if (!(ArticleInstance instanceof Article)) { ArticleInstance = List.getSelectedArticle(); @@ -295,6 +304,43 @@ define('package/quiqqer/erp/bin/backend/controls/articles/ArticleSummary', [ this.$VAT.set('html', vatText); } }); + }, + + showPriceFactors: function () { + const ArticleList = this.getAttribute('List'); + + let priceFactors = ArticleList.getPriceFactors(); + let html = '<ul>'; + + for (let i = 0, len = priceFactors.length; i < len; i++) { + html = html + '<li>' + priceFactors[i].title + ' (<b>' + priceFactors[i].valueText + '</b>)</li>'; + } + + html = html + '</ul>'; + + this.$PriceFactors.set('html', html); + this.$PriceFactors.setStyle('opacity', 0); + this.$PriceFactors.setStyle('display', 'block'); + this.$PriceFactors.setStyle('bottom', 70); + + this.$PFFX.animate({ + bottom : 80, + opacity: 1 + }, { + duration: 300 + }); + }, + + hidePriceFactors: function () { + this.$PFFX.animate({ + bottom : 70, + opacity: 0 + }, { + duration: 300, + callback: () => { + this.$PriceFactors.setStyle('display', 'none'); + } + }); } }); });