Newer
Older
/**
* @module package/quiqqer/erp/bin/backend/controls/articles/BruttoCalcButton
* @author www.pcsgde (Henning Leutz)
*/
define('package/quiqqer/erp/bin/backend/controls/articles/BruttoCalcButton', [
'qui/QUI',
'qui/controls/Control',
'package/quiqqer/products/bin/controls/fields/windows/PriceBrutto',
], function (QUI, QUIButton, PriceBruttoWindow) {
"use strict";
return new Class({
Type : 'package/quiqqer/erp/bin/backend/controls/articles/BruttoCalcButton',
Extends: QUIButton,
Binds: [
'openBruttoWindow'
],
options: {
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
},
initialize: function (options) {
this.parent(options);
},
create: function () {
this.$Elm = new Element('button');
this.$Elm.set('data-quiid', this.getId());
this.$Elm.set('data-qui', 'package/quiqqer/erp/bin/backend/controls/articles/BruttoCalcButton');
this.$Elm.set('html', '<span class="fa fa-calculator"></span>');
this.$Elm.addClass('qui-button');
this.$Elm.addEvent('click', (e) => {
e.stop();
this.openBruttoWindow();
});
return this.$Elm;
},
openBruttoWindow: function () {
const Price = this.getAttribute('Price');
new PriceBruttoWindow({
events: {
onOpen: function (Win) {
Win.getContent().set('html', '');
},
onSubmit: (Win, value) => {
Price.value = value;
}
}
}).open();
}
});
});