/*
 * ATTENTION: An "eval-source-map" devtool has been used.
 * This devtool is neither made for production nor for readable output files.
 * It uses "eval()" calls to create a separate source file with attached SourceMaps in the browser devtools.
 * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
 * or disable the default devtool with "devtool: false".
 * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
 */
/******/ (() => { // webpackBootstrap
/******/ 	var __webpack_modules__ = ({

/***/ "./resources/js/moduleJs/moduleBase.js":
/*!*********************************************!*\
  !*** ./resources/js/moduleJs/moduleBase.js ***!
  \*********************************************/
/***/ (() => {

eval("function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar ModuleBase = /*#__PURE__*/function () {\n  function ModuleBase(options, data) {\n    _classCallCheck(this, ModuleBase);\n\n    _defineProperty(this, \"Opts\", {\n      testMode: false,\n      CSSSelectorContainer: '',\n      CSSSelectorForm: '',\n      token: null,\n      URL: {\n        getDataTableContent: null,\n        checkReadyToSend: null,\n        index: null,\n        show: null,\n        edit: null,\n        create: null,\n        store: null,\n        update: null,\n        destroy: null\n      },\n      dataTable: {\n        orderDirective: [1, 'asc'],\n        CSSSelector: null,\n        advanceSearchParameter: {}\n      }\n    });\n\n    _defineProperty(this, \"data\", null);\n\n    _defineProperty(this, \"root\", this);\n\n    this.Opts.CSSSelectorContainer = '.container' + this.constructor.name;\n    this.Opts.CSSSelectorForm = '.' + this.constructor.name + 'Form';\n    this.Opts.dataTable.CSSSelector = this.Opts.CSSSelectorContainer + ' .dataTable';\n    this.root = this;\n\n    if (data !== \"undefined\" || data != null) {\n      this.data = data;\n    }\n\n    if (options != null) {\n      $.extend(this.Opts, options);\n    }\n  }\n\n  _createClass(ModuleBase, [{\n    key: \"init\",\n    value: function init(options, data) {\n      if (data !== \"undefined\" || data != null) {\n        this.data = data;\n      }\n\n      if (options != null) {\n        $.extend(this.Opts, options);\n      }\n    }\n  }, {\n    key: \"datatableRowActionButtonClick\",\n    value: function datatableRowActionButtonClick(event, rootObj, options) {\n      debug('call ModuleBase.datatableRowActionButtonClick');\n      debug(rootObj);\n      var node = $(event[0].currentTarget);\n      var row = $(rootObj.Opts.dataTable.CSSSelector).DataTable().row(node.parents('tr'));\n      var rowData = row.data();\n      var actionName = 'datatableRowAction' + node.data('buttontype').capitalize();\n\n      if (typeof rootObj[actionName] === \"function\") {\n        return rootObj[actionName](rowData, node);\n      }\n    }\n  }, {\n    key: \"datatableRowActionAttachment\",\n    value: function datatableRowActionAttachment(rowData, node, options) {\n      debug('call ModuleBase.datatableRowActionAttachment ');\n      var fileName = 'downloadedFile';\n\n      if (typeof options.defaultFileName !== \"undefined\") {\n        fileName = options.defaultFileName;\n      }\n\n      if (rowData.fileUrl) {\n        if (rowData.fileName) {\n          fileName = rowData.fileName;\n        }\n\n        $.ajax({\n          url: rowData.fileUrl,\n          method: 'GET',\n          xhrFields: {\n            responseType: 'blob'\n          },\n          success: function success(data) {\n            var a = document.createElement('a');\n            var url = window.URL.createObjectURL(data);\n            a.href = url;\n            a.download = fileName;\n            document.body.append(a);\n            a.click();\n            a.remove();\n            window.URL.revokeObjectURL(url);\n          }\n        });\n      } else {\n        Toast.create(\"Hiba!\", 'Nincs csatolt fájl!', TOAST_STATUS.DANGER, 10000);\n      }\n    }\n  }, {\n    key: \"datatableRowActionView\",\n    value: function datatableRowActionView(rowData, node, rootObj, options) {\n      debug('call ModuleBase.datatableRowActionView');\n      var ajaxUrl = rootObj.Opts.URL.show.replace('%id%', rowData.id);\n      /*\n              console.log(Opts.URL);\n      */\n\n      console.log(ajaxUrl);\n      APP.loadMainContent(ajaxUrl, rootObj.initViewShow);\n      console.log('ModuleBase.datatableRowActionEdit End');\n    }\n  }]);\n\n  return ModuleBase;\n}();\n\nwindow.ModuleBase = ModuleBase;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 10444 characters]\n//# sourceURL=webpack-internal:///./resources/js/moduleJs/moduleBase.js\n");

/***/ }),

/***/ "./resources/js/moduleJs/order.js":
/*!****************************************!*\
  !*** ./resources/js/moduleJs/order.js ***!
  \****************************************/
/***/ (() => {

eval("function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nwindow.OrderModulDefault = {\n  actionFunction: function actionFunction() {}\n};\n\nvar DataModelOrder = /*#__PURE__*/function (_DataModel) {\n  _inherits(DataModelOrder, _DataModel);\n\n  var _super = _createSuper(DataModelOrder);\n\n  /*\r\n   * Constructor\r\n   */\n  function DataModelOrder(data, options) {\n    var _this;\n\n    _classCallCheck(this, DataModelOrder);\n\n    _this = _super.call(this, data, options);\n\n    if (typeof _this.productSelected === \"undefined\") {\n      _this.productSelected = {};\n    }\n\n    if (typeof _this.productComment === \"undefined\") {\n      _this.productComment = {};\n    }\n\n    console.log(_this.constructor.name + ' constructor called');\n    return _this;\n  }\n\n  return DataModelOrder;\n}(DataModel);\n\n;\nwindow.DataModelOrder = DataModelOrder;\n\nwindow.Stepper = function () {\n  /*\r\n   * Variables accessible\r\n   * in the class\r\n   */\n  var Opts = {\n    complete: ['supplier'],\n    available: ['supplier', 'parameter', 'productSelect', 'invoice', 'send'],\n    enable: ['supplier', 'invoice'],\n    load: [],\n    excludeLoaded: ['invoice', 'send'],\n    loaded: [],\n    active: false,\n    URL: {\n      create: ''\n    },\n    UrlData: false,\n    onAfterLoad: function onAfterLoad() {},\n    onAfterActivate: function onAfterActivate() {},\n    autoCallback: {\n      'invoice': {\n        onAfterActivate: function onAfterActivate() {}\n      },\n      'send': {\n        onAfterActivate: function onAfterActivate() {}\n      }\n    },\n    nowLoaded: false\n  };\n  var root = this;\n  /*\r\n   * Constructor\r\n   */\n\n  this.construct = function (options) {\n    $.extend(Opts, options);\n  };\n\n  this.getOpts = function () {\n    return Opts;\n  };\n\n  this.setOpts = function (options) {\n    $.extend(Opts, options);\n  };\n\n  this.init = function (options) {\n    $.extend(Opts, options);\n    debug(Opts);\n    $('.step').each(function () {\n      var stepName = $(this).data('stepname');\n\n      if (Opts.complete.includes(stepName)) {\n        root.setCompleted(stepName);\n      }\n\n      if (Opts.enable.includes(stepName)) {\n        root.setEnabled(stepName);\n      }\n\n      if (Opts.load.includes(stepName)) {\n        root.loadStepContent(stepName);\n      }\n\n      if (Opts.active === stepName) {\n        root.setActive(stepName);\n      }\n    });\n    root.bindClickAction();\n  };\n\n  this.bindClickAction = function () {\n    var stepClickButtons = $('.stepClick');\n    stepClickButtons.off('click');\n    stepClickButtons.on('click', root.stepClick);\n  };\n\n  this.setCompleted = function (stepName) {\n    console.log(stepName + ' completed');\n    $('.step[data-stepName=\"' + stepName + '\"]').addClass('completed');\n  };\n\n  this.unsetCompleted = function (stepName) {\n    console.log(stepName + ' Uncompleted');\n    $('.step[data-stepName=\"' + stepName + '\"]').removeClass('completed');\n    Opts.complete = arrayRemove(Opts.complete, stepName);\n  };\n\n  this.unsetEnabled = function (stepName) {\n    console.log(stepName + ' Un enabled');\n    $('.click' + stepName).contents().unwrap();\n    Opts.enable = arrayRemove(Opts.enable, stepName);\n  };\n\n  this.setEnabled = function (stepName) {\n    console.log(stepName + ' enabled');\n    var stepItem = $('.step[data-stepName=\"' + stepName + '\"]');\n    stepItem.html('<a class=\"stepClick click' + stepName + '\" data-stepName=\"' + stepName + '\" href=\"#\">' + stepItem.html() + '</a>');\n    root.bindClickAction(); //$('.stepClick').click(root.stepClick);\n  };\n\n  this.addEnabled = function (stepName) {\n    if (!Opts.enable.includes(stepName)) {\n      Opts.enable.push(stepName);\n    }\n\n    root.setEnabled(stepName);\n  };\n\n  this.addCompleted = function (stepName) {\n    if (!Opts.complete.includes(stepName)) {\n      Opts.complete.push(stepName);\n    }\n\n    root.setCompleted(stepName);\n    root.bindClickAction();\n  };\n\n  this.loadStepContent = function (stepName) {\n    var data = {\n      'type': stepName\n    };\n    $.extend(data, Opts.UrlData);\n    $.ajax({\n      async: true,\n      type: \"GET\",\n      url: Opts.URL.create,\n      data: data,\n      cache: false,\n      success: function success(result) {\n        var container = $('.SC' + stepName.capitalize());\n\n        if ($.inArray(stepName, Opts.excludeLoaded) == -1) {\n          Opts.loaded.push(stepName);\n        } else {\n          console.log('excluded View');\n        }\n\n        container.html(result);\n\n        if (Opts.nowLoaded) {\n          Opts.nowLoaded(stepName);\n        }\n\n        Opts.onAfterLoad();\n      }\n    });\n  };\n\n  this.clearLoaded = function () {\n    Opts.loaded = ['supplier'];\n    $('.stepContainer').each(function () {\n      /*\r\n                  console.log(this.classList);\r\n                  console.log(this.classList.contains('SCSupplier'));\r\n                  console.log($(this).attr('class'));\r\n      */\n      if (!this.classList.contains('SCSupplier')) {\n        $(this).html('');\n      }\n    });\n  };\n\n  this.setActiveFinish = function (stepName) {\n    var container = $('.SC' + stepName.capitalize());\n\n    if (stepName === 'productSelect') {\n      $('.containerStepper').addClass('activeSideBar');\n    } else {\n      $('.containerStepper').removeClass('activeSideBar');\n    }\n\n    debug('setActiveFinish show:' + stepName);\n    container.show();\n    Opts.nowLoaded = false;\n    root.active = stepName;\n    Opts.onAfterActivate();\n\n    if (typeof Opts.autoCallback[stepName] !== 'undefined') {\n      Opts.autoCallback[stepName].onAfterActivate();\n    }\n  };\n\n  this.setActive = function (stepName) {\n    $('.stepContainer').hide();\n\n    if (!Opts.loaded.includes(stepName)) {\n      root.loadStepContent(stepName);\n      Opts.nowLoaded = this.setActiveFinish;\n    } else {\n      this.setActiveFinish(stepName);\n    }\n  };\n\n  this.stepClick = function (event) {\n    event.preventDefault();\n    var stepName = $(event.currentTarget).data('stepname');\n    console.log('setActive:' + stepName);\n    root.setActive(stepName);\n  };\n};\n\nwindow.OrderModule = function () {\n  /*\r\n   * Variables accessible\r\n   * in the class\r\n   */\n  var Opts = {\n    testMode: false,\n    needStepper: true,\n    CSSSelectorForm: '.orderParameterForm',\n    defaultDeliveryDate: '',\n    dataSyncPauseTime: 500,\n    token: null,\n    URL: {\n      root: null,\n      getDataTableContentProductList: null,\n      checkReadyToSend: null,\n      index: null,\n      show: null,\n      edit: null,\n      create: null,\n      store: null,\n      update: null,\n      destroy: null,\n      toggleFavorites: null\n    }\n  };\n  var PublicVar = {};\n  var PublicVar2 = {\n    'asd': '21'\n  };\n  var ApiToken = null;\n  var Order = null;\n  var root = this;\n  var viewInicialized = [];\n\n  this.setOpts = function (options) {\n    $.extend(Opts, options);\n  };\n\n  this.getOpts = function () {\n    return Opts;\n  };\n\n  this.clickOrderEdit = function (data) {\n    debug('clickEdit');\n    debug(data);\n    var ajaxUrl = Opts.URL.edit.replace('%id%', data.id);\n    APP.loadMainContent(ajaxUrl);\n    /*        let ajaxData={};\r\n            ajaxData._token=Opts.token;\r\n            $.extend(ajaxData,Order);\r\n            let ajaxUrl=Opts.URL.edit.replace('%id%',data.id);\r\n            $.ajax({\r\n                url: ajaxUrl,\r\n                method:'GET',\r\n                data:ajaxData,\r\n                success:function (response) {\r\n                    if(response.success){\r\n                        let orderData=response.data;\r\n                        orderData.supplierId=orderData.supplier_id;\r\n                        delete(orderData.supplier_id);\r\n                        root.initOrder(orderData);\r\n                        root.initStepper();\r\n                        //root.afterOrderSetSupplierOk(data.data);\r\n                    }\r\n                }\r\n            });*/\n  };\n\n  this.afterOrderDeleted = function (data) {\n    if (data.success == true) {\n      debug('Order delete success');\n      APP.loadMainContent(Opts.URL.index);\n    } else {\n      Toast.create(\"Error deleted !\", '', TOAST_STATUS.DANGER, 5000);\n    }\n  };\n\n  this.clickOrderDeleteConfirmed = function (event) {\n    debug('clickOrderDeleteConfirmed');\n    debug(event);\n    debug(event.data);\n    $('#dialogModal').modal('hide');\n    var ajaxData = {};\n    ajaxData._token = Opts.token;\n    var ajaxUrl = Opts.URL.destroy.replace('%id%', event.data.id);\n    $.ajax({\n      url: ajaxUrl,\n      data: ajaxData,\n      method: \"DELETE\",\n      success: root.afterOrderDeleted //error:ajaxErrorHandler\n\n    });\n  };\n\n  this.initViewOrderSelect = function () {\n    debug('called initViewOrderSelect ');\n    $('.ordersSelectTable button').off('click');\n    $('.ordersSelectTable button').on('click', function () {\n      var action = $(this).data('action');\n      var orderId = $($(this).closest('tr')[0]).data('orderid');\n      debug(action);\n      debug(orderId);\n\n      if (action == 'delete') {\n        $('#dialogModal').on('show.bs.modal', function (event) {\n          // If necessary, you could initiate an AJAX request here (and then do the updating in a callback).\n          // Update the modal's content. We'll use jQuery here, but you could use a data binding library or other methods instead.\n          var modal = $(this);\n          modal.find('.modal-title').text('Megerősítés ');\n          modal.find('.modal-body').text('Biztosan törli a megrendelést?');\n          modal.find('.buttonYes').off('click');\n          modal.find('.buttonYes').on('click', {\n            id: orderId\n          }, root.clickOrderDeleteConfirmed);\n        });\n        $('#dialogModal').modal('show');\n      } else {\n        root.clickOrderEdit({\n          id: orderId\n        });\n      }\n    });\n    $('.buttonNew').off('click');\n    $('.buttonNew').on('click', function () {\n      APP.loadMainContent(Opts.URL.index, 'force=true');\n    });\n  };\n\n  this.initStepper = function () {\n    debug(Order.getData());\n    viewInicialized = [];\n    $('.statusNamePlace').text('Nincs elküldve');\n    $('.statusNamePlace').addClass('statusBlink');\n    root.setDeliveryDate('-');\n    root.setSupplier('-');\n    var unEnabled = ['parameter', 'productSelect', 'invoice', 'send'];\n    $.each(unEnabled, function (index, value) {\n      root.Stepper.unsetEnabled(value);\n      root.Stepper.unsetCompleted(value);\n    });\n    debug(root.Stepper.getOpts()['available']);\n    debug(Order.getData()['orderStatus']);\n    var stepActive = 'supplier';\n    var stepComplete = ['supplier'];\n    var stepEnable = [];\n\n    var stepOnAfterActivate = function stepOnAfterActivate() {};\n\n    var avalaibleSteps = root.Stepper.getOpts()['available'];\n    var stepUrlData = false;\n    var stepAutoCallback = [];\n\n    var _iterator = _createForOfIteratorHelper(avalaibleSteps),\n        _step;\n\n    try {\n      for (_iterator.s(); !(_step = _iterator.n()).done;) {\n        var _stepName = _step.value;\n        stepOnAfterActivate = this['initView' + _stepName.capitalize()];\n        var item = {};\n        item['onAfterActivate'] = stepOnAfterActivate;\n        stepAutoCallback[_stepName] = item;\n      }\n    } catch (err) {\n      _iterator.e(err);\n    } finally {\n      _iterator.f();\n    }\n\n    debug(stepAutoCallback);\n    debug(Order.getData()['id']);\n\n    if (Order.getData()['id'] > 0) {\n      debug('hajra');\n      debug(Order.getData());\n\n      if (Order.getData()['deliveryDate']) {\n        root.setDeliveryDate(Order.getData()['deliveryDate']);\n        /*\r\n        @todo: weekly-t beallitani\r\n         */\n      }\n\n      if (Order.getData()['supplierName']) {\n        root.setSupplier(Order.getData()['supplierName']);\n      }\n\n      stepUrlData = {\n        'supplierId': Order.supplierId,\n        id: Order.id\n      };\n\n      var _iterator2 = _createForOfIteratorHelper(avalaibleSteps),\n          _step2;\n\n      try {\n        for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n          var stepName = _step2.value;\n          console.log(stepName);\n          stepComplete.push(stepName);\n          stepEnable.push(stepName);\n\n          if (Order.getData()['orderStatus'] == stepName) {\n            stepActive = stepName;\n            /*\r\n            debug('initView'+stepName.capitalize());\r\n            if(stepName!=='invoice' && stepName!=='send'){\r\n                stepOnAfterActivate=this['initView'+stepName.capitalize()];\r\n            }else{\r\n                stepOnAfterActivate=function (){};\r\n            }\r\n            */\n\n            break;\n          }\n        }\n        /*\r\n                    //refactored for loop\r\n                    var BreakException = {};\r\n                    try {\r\n                        avalaibleSteps.forEach(function(stepName) {\r\n                            console.log(stepName);\r\n                            stepComplete.push(stepName);\r\n                            stepEnable.push(stepName);\r\n                            if(Order.getData()['orderStatus']==stepName){\r\n                                stepActive=stepName;\r\n                                throw BreakException;\r\n                            }\r\n        \r\n                        });\r\n                    } catch (e) {\r\n                        if (e !== BreakException) throw e;\r\n                    }*/\n\n      } catch (err) {\n        _iterator2.e(err);\n      } finally {\n        _iterator2.f();\n      }\n    }\n\n    root.Stepper.init({\n      complete: stepComplete,\n      enable: stepEnable,\n      loaded: [],\n      active: stepActive,\n      URL: {\n        create: Opts.URL.create\n      },\n      UrlData: stepUrlData,\n      onAfterActivate: stepOnAfterActivate,\n      autoCallback: stepAutoCallback\n      /*{\r\n          invoice: {\r\n              onAfterActivate:root.initViewInvoice\r\n          },\r\n          send: {\r\n              onAfterActivate:root.initViewSend\r\n          },\r\n        }*/\n\n    });\n  };\n\n  this.initOrder = function (data) {\n    Order = new DataModelOrder(data);\n  };\n\n  this.init = function (options) {\n    debug('OrderModul init called');\n    $.extend(Opts, window.OrderModulDefault, options);\n    Order = new DataModelOrder();\n\n    if (Opts.needStepper) {\n      if (typeof this.Stepper == 'undefined') {\n        this.Stepper = new Stepper();\n      }\n    }\n\n    if (Opts.testMode) {\n      return root.testMode();\n    }\n  };\n\n  this.setSupplier = function (supplierName, supplierId) {\n    if (supplierName) {\n      $('.supplierNamePlace').text(supplierName);\n    }\n\n    if (supplierId) {\n      Order.setData({\n        supplierId: supplierId\n      });\n      root.Stepper.setOpts({\n        'UrlData': {\n          'supplierId': supplierId\n        }\n      });\n    }\n  };\n\n  this.setDeliveryDate = function (dateText, dateTextTo) {\n    var dateTextHuman = dateText.replaceAll('-', '.') + '.';\n\n    if (dateTextHuman.length < 5) {\n      $('.deliveryDatePlace').text(dateText);\n      return;\n    }\n\n    if (dateTextTo) {\n      dateTextHuman += ' - ' + dateTextTo.replaceAll('-', '.') + '.';\n    }\n\n    $(Opts.CSSSelectorForm + ' .selectedDateText').text(dateTextHuman);\n    $('.deliveryDatePlace').text(dateTextHuman);\n    $(Opts.CSSSelectorForm + ' input[name=\"deliveryDate\"]').val(dateText);\n  };\n\n  this.getData = function () {\n    return Order;\n  };\n\n  this.setSupplierCompleted = function () {\n    console.log('bingo');\n    root.initViewParameter();\n  };\n\n  this.afterOrderSetSupplierOk = function (data) {\n    Toast.create(\"Supplier selected !\", data.supplier.name, TOAST_STATUS.INFO, 5000);\n    root.setSupplier(data.supplier.name, data.supplier.id);\n    Order.setData({\n      id: data.id\n    });\n    root.Stepper.setOpts({\n      'UrlData': {\n        'supplierId': Order.supplierId,\n        id: Order.id\n      }\n    }); //root.Stepper.setOpts({onAfterLoad:root.setSupplierCompleted})\n\n    root.Stepper.setEnabled('parameter');\n    root.Stepper.addCompleted('parameter');\n    root.Stepper.setCompleted('parameter');\n    root.Stepper.setActive('parameter');\n  };\n\n  this.initViewSupplier = function () {\n    debug('call initViewSupplier');\n    root.Stepper.setOpts({\n      onAfterLoad: function onAfterLoad() {}\n    });\n    $('.supplierItem').off('click');\n    $('.supplierItem').on('click', function (event) {\n      console.log(Order.getData());\n      event.preventDefault();\n      var supplierId = $(event.currentTarget).data('id');\n      var supplierName = $(event.currentTarget).find('h5.card-title').text();\n\n      if (typeof Order.supplierId == 'undefined') {\n        //new order\n        var ajaxData = {};\n        ajaxData._token = Opts.token;\n        ajaxData.supplierId = supplierId;\n        ajaxData.storeType = 'supplierSelect';\n        $.extend(ajaxData, Order);\n        $.ajax({\n          url: Opts.URL.store,\n          method: 'POST',\n          data: ajaxData,\n          success: function success(data) {\n            if (data.success) {\n              root.afterOrderSetSupplierOk(data.data);\n            }\n          }\n        }); //Order.setData({supplierId:supplierId});\n      } else {\n        //ide kellene egy jo kis kerdes\n        if (Order.supplierId != supplierId) {\n          Toast.create(\"Supplier change to!\", supplierName, TOAST_STATUS.WARNING, 5000);\n          root.Stepper.clearLoaded();\n          Order = new DataModelOrder(); //Order.setData({supplierId:supplierId});\n        }\n      }\n\n      return;\n      console.log('-----------');\n      console.log(root.Stepper.getOpts());\n      console.log('-----------'); //$('.supplierNamePlace').text(supplierName);\n\n      root.setSupplier(supplierName, supplierId);\n      console.log(supplierName); //@todo:ide kell egy mentes!\n      //@todo:mentes eredemenyekeppen lehet valtani\n\n      event.preventDefault();\n      root.Stepper.setOpts({\n        onAfterLoad: root.setSupplierCompleted\n      });\n      root.Stepper.setEnabled('parameter');\n      root.Stepper.addCompleted('parameter');\n      root.Stepper.setCompleted('parameter');\n      root.Stepper.setActive('parameter');\n    });\n  };\n\n  this.checkContactNameField = function () {\n    var CSSSelectorForm = '.orderParameterForm';\n    var node = $(CSSSelectorForm + ' input[name=contactName]');\n\n    if (node.val().length < 2) {\n      node.removeClass('is-valid');\n      node.addClass('is-invalid');\n      return false;\n    } else {\n      node.addClass('is-valid');\n      node.removeClass('is-invalid');\n      return true;\n    }\n  };\n\n  this.sendOrderDataToServer = function (updateType, callback, errorCallback) {\n    var ajaxData = {};\n    var ajaxUrl = Opts.URL.store;\n    var ajaxMethod = \"POST\";\n\n    if (Order.id) {\n      ajaxUrl = Opts.URL.update.replace('%id%', Order.id); //ajaxMethod=\"PUT\";\n      //ajaxData=new FormData($(CSSSelectorForm)[0]);\n\n      ajaxData._method = 'PUT';\n    }\n\n    ajaxData._token = Opts.token;\n    ajaxData.updateType = updateType;\n    $.extend(ajaxData, Order);\n    debug(Order);\n    debug(ajaxData);\n    debug('ajaxUrl:' + ajaxUrl);\n    ajaxData = jsonToFormData(ajaxData);\n    $.ajax({\n      url: ajaxUrl,\n      data: ajaxData,\n      type: ajaxMethod,\n      contentType: false,\n      processData: false,\n      success: function success(data) {\n        debug('ajax returned data');\n        debug(data);\n\n        if (data.success) {\n          //root.afterOrderSetSupplierOk(data.data);\n          callback(data);\n        }\n      },\n      error: function error(xhr, ajaxOptions, thrownError) {\n        ajaxErrorHandler(xhr, ajaxOptions, thrownError);\n\n        if (typeof errorCallback != 'undefined') {\n          errorCallback(xhr.responseJSON);\n        }\n      }\n    });\n  };\n\n  this.afterOrderSetParameterOk = function (data) {\n    debug('called afterOrderSetParameterOk');\n    root.Stepper.setOpts({\n      'UrlData': {\n        'supplierId': Order.supplierId,\n        'id': Order.id\n      }\n    }); //root.Stepper.setOpts({onAfterLoad:root.setParameterCompleted})\n\n    root.Stepper.setEnabled('productSelect');\n    root.Stepper.addCompleted('productSelect');\n    root.Stepper.setCompleted('productSelect');\n    root.Stepper.setActive('productSelect');\n  };\n\n  this.selectCurrentWeek = function () {\n    console.error('selectCurrentWeek');\n    console.error($('.ui-datepicker').find('.ui-datepicker-current-day a'));\n    $('.ui-datepicker').find('.ui-datepicker-current-selected-weekday a').addClass('ui-state-active');\n  };\n\n  this.weekHover = function () {\n    console.error('hover Active');\n    $('.ui-datepicker-calendar tr').off('mousemove');\n    $('.ui-datepicker-calendar tr').off('mouseleave');\n    $('.ui-datepicker-calendar tr').on('mousemove', function () {\n      $(this).find('td a').addClass('ui-state-hover');\n    });\n    $('.ui-datepicker-calendar tr').on('mouseleave', function () {\n      $(this).find('td a').removeClass('ui-state-hover');\n    });\n  };\n\n  this.weekHoverSlow = function () {\n    console.error('weekHoverSlow');\n\n    if ($('.ui-datepicker-calendar tr').length < 1) {\n      setTimeout(root.weekHoverSlow, 1);\n      return;\n    }\n\n    root.weekHover();\n  };\n\n  this.initDatePicker = function (type) {\n    console.error('asdasdadad');\n    console.log('tipus' + type);\n    var CSSSelectorForm = '.orderParameterForm';\n    var startDate = new Date('1900-01-01');\n    var endDate = new Date('1900-01-02');\n    $(CSSSelectorForm + ' .datePicker').datepicker(\"destroy\");\n\n    if (type == 'weekly') {\n      $(CSSSelectorForm + ' .datePicker').datepicker({\n        showOtherMonths: true,\n        selectOtherMonths: true,\n        showWeek: true,\n        dateFormat: 'yy-mm-dd',\n        firstDay: 1,\n        minDate: new Date(),\n        afterShow: function afterShow(dateText, inst) {\n          root.weekHover();\n          root.selectCurrentWeek();\n        },\n        onSelect: function onSelect(dateText, inst) {\n          var date = $(this).datepicker('getDate');\n          startDate = new getMonday(date);\n          endDate = new Date(date.getFullYear(), date.getMonth(), date.getDate() - date.getDay() + 7);\n          root.setDeliveryDate($.datepicker.formatDate('yy-mm-dd', startDate), $.datepicker.formatDate('yy-mm-dd', endDate));\n        },\n        beforeShow: function beforeShow() {\n          console.group('beforeShow');\n          console.log(startDate);\n          console.log(endDate); //root.weekHoverSlow();\n\n          console.groupEnd();\n        },\n        beforeShowDay: function beforeShowDay(date) {\n          console.group('beforeShowDay');\n          console.log(date.toLocaleDateString('hu-Hu'));\n          var cssClass = '';\n\n          if (date >= startDate && date <= endDate) {\n            console.error(date.toLocaleDateString('hu-Hu'));\n            cssClass = 'ui-datepicker-current-selected-weekday'; //cssClass = 'ui-state-active';\n          }\n\n          console.log(cssClass);\n          console.groupEnd();\n          return [true, cssClass];\n        },\n        onChangeMonthYear: function onChangeMonthYear(year, month, inst) {//root.selectCurrentWeek();\n        }\n      });\n    } else {\n      $(CSSSelectorForm + ' .datePicker').datepicker({\n        dateFormat: 'yy-mm-dd',\n        minDate: new Date(),\n        onSelect: function onSelect(dateText) {\n          $(CSSSelectorForm + ' .selectedDateText').text(dateText);\n          $('.deliveryDatePlace').text(dateText.replaceAll('-', '.') + '.');\n          $(CSSSelectorForm + ' input[name=\"deliveryDate\"]').val(dateText);\n        }\n      });\n    }\n  };\n\n  this.callChangeOrderType = function () {\n    console.log(this);\n    console.log(this.value);\n    root.initDatePicker(this.value); //enum('daily', 'weekly')\n\n    /*let CSSSelectorForm='.orderParameterForm';\r\n    let node=$(CSSSelectorForm+' input[name=contactName]');\r\n    if(node.val().length<2){\r\n        node.removeClass('is-valid');\r\n        node.addClass('is-invalid');\r\n        return false;\r\n    }else{\r\n        node.addClass('is-valid');\r\n        node.removeClass('is-invalid');\r\n        return true;\r\n    }\r\n    */\n  };\n\n  this.initViewParameter = function () {\n    debug('call initViewParameter');\n    root.Stepper.setOpts({\n      onAfterLoad: function onAfterLoad() {}\n    });\n    var CSSSelectorForm = '.orderParameterForm';\n    $(CSSSelectorForm + ' .datePickerClick').click(function () {\n      $(CSSSelectorForm + ' .datePicker').datepicker('show');\n    });\n    $(CSSSelectorForm + ' .orderParameterDeliveryAddress').select2({}).show();\n    $(CSSSelectorForm + ' input[name=contactName]').off('blur');\n    $(CSSSelectorForm + ' input[name=contactName]').off('keyup');\n    $(CSSSelectorForm + ' input[name=contactName]').on('blur', root.checkContactNameField);\n    $(CSSSelectorForm + ' input[name=contactName]').on('keyup', root.checkContactNameField);\n    $(CSSSelectorForm + ' input[name=orderType]').off('change');\n    $(CSSSelectorForm + ' input[name=orderType]').on('change', root.callChangeOrderType);\n    $(CSSSelectorForm + ' .orderParameterNextButton').off('click');\n\n    if (Order.getData()['id'] > 0) {\n      if (Order.getData()['orderType'] == 'weekly') {\n        root.initDatePicker(Order.getData()['orderType']);\n        $(CSSSelectorForm + \" input[name=orderType][value=\" + Order.getData()['orderType'] + \"]\").prop('checked', true);\n        var endDate = new Date(Order.getData()['deliveryDate']);\n        endDate.setDate(endDate.getDate() + 6);\n        root.setDeliveryDate(Order.getData()['deliveryDate'], $.datepicker.formatDate('yy-mm-dd', endDate));\n        root.initDatePicker('weekly');\n      } else {\n        if (Order.getData()['deliveryDate']) {\n          root.setDeliveryDate(Order.getData()['deliveryDate']);\n        }\n\n        root.initDatePicker('daily');\n      }\n\n      if (Order.getData()['contactName']) {\n        $(CSSSelectorForm + ' input[name=contactName]').val(Order.getData()['contactName']);\n      }\n\n      if (Order.getData()['note']) {\n        $(CSSSelectorForm + ' textarea[name=note]').val(Order.getData()['note']);\n      }\n\n      if (Order.getData()['deliveryAddressId']) {\n        console.log($(CSSSelectorForm + ' select[name=deliveryAddressId]'));\n        $(CSSSelectorForm + ' select[name=deliveryAddressId]').val(Order.getData()['deliveryAddressId']);\n      }\n\n      if (Order.getData()['customNotificationEmail']) {\n        console.log($(CSSSelectorForm + ' select[name=customNotificationEmail]'));\n        $(CSSSelectorForm + ' select[name=customNotificationEmail]').val(Order.getData()['customNotificationEmail']);\n      }\n    } else {\n      root.initDatePicker('daily');\n    }\n\n    $(CSSSelectorForm + ' .orderParameterDeliveryAddress').select2({}).show();\n    $(CSSSelectorForm + ' .orderParameterCustomNotificationEmail').select2({}).show();\n    $(CSSSelectorForm).submit(function (event) {\n      event.preventDefault();\n\n      if ($(CSSSelectorForm)[0].checkValidity() === false) {\n        debug('validaton false');\n        event.stopPropagation();\n        return;\n      } else {\n        debug('validaton ok'); //do your ajax submition here\n      }\n\n      $('.deliveryDatePlace').text($(CSSSelectorForm + ' input[name=deliveryDate]').val().replaceAll('-', '.') + '.');\n      Order.setData({\n        contactName: $(CSSSelectorForm + ' input[name=contactName]').val(),\n        note: $(CSSSelectorForm + ' textarea[name=note]').val(),\n        orderType: $(CSSSelectorForm + ' input:checked[name=orderType]').val(),\n        deliveryDate: $(CSSSelectorForm + ' input[name=deliveryDate]').val(),\n        deliveryAddressId: $(CSSSelectorForm + ' select[name=deliveryAddressId]').val(),\n        deliveryAddress: $(CSSSelectorForm + ' select[name=deliveryAddress]').val(),\n        customNotificationEmail: $(CSSSelectorForm + ' select[name=customNotificationEmail]').val()\n      });\n      console.group('parameter form submit');\n      console.error($(CSSSelectorForm + ' input:checked[name=orderType]').val());\n      console.error($(CSSSelectorForm + ' input[name=deliveryDate]').val());\n      debug(Order.getData());\n      console.groupEnd();\n      root.sendOrderDataToServer('parameter', root.afterOrderSetParameterOk);\n    });\n  };\n\n  this.blank = function () {};\n\n  this.setParameterCompleted = function () {\n    console.log('setParameterCompleted called');\n    root.Stepper.setOpts({\n      onAfterLoad: function onAfterLoad() {}\n    }); //root.initViewProductSelect()\n  };\n\n  this.bindRowFavoritesAction = function () {\n    $('.buttonItemFavorites').off('click');\n    $('.buttonItemFavorites').on('click', function () {\n      var productId = $(this).data('id');\n      console.log(productId);\n      var ajaxUrl = Opts.URL.toggleFavorites.replace('%id%', productId);\n      var ajaxData = {};\n      ajaxData._token = Opts.token;\n      var button = this;\n      console.log(ajaxUrl);\n      $.ajax({\n        url: ajaxUrl,\n        method: 'POST',\n        data: ajaxData,\n        success: function success(response) {\n          if (response.success) {\n            if (response.status) {\n              console.log('true');\n              $(button).addClass('btn-warning');\n              $(button).removeClass('btn-light');\n            } else {\n              $(button).removeClass('btn-warning');\n              $(button).addClass('btn-light');\n              console.log('false');\n            }\n          }\n        }\n      });\n      /*\r\n                          $(this).toggleClass('btn-warning');\r\n                          $(this).toggleClass('btn-light');\r\n      */\n    });\n  };\n\n  this.bindRowDescriptionAction = function () {\n    $('textarea.orderItemComment').on('change', function () {\n      var comment = $(this).val();\n      var productId = $(this).data('id');\n      var productComment = Order.getData('productComment');\n\n      if (productComment !== null) {\n        if (typeof productComment[productId] == 'undefined' && comment.length === 0) {\n          return;\n        }\n\n        if (productComment[productId] === comment) {\n          return;\n        }\n      }\n\n      productComment[productId] = comment;\n\n      if (comment.length === 0) {\n        delete Order.productComment[productId];\n      }\n\n      Order.productComment = productComment;\n      queueAjax.push(Date.now());\n      root.syncOrderDataToServer();\n    });\n  };\n\n  this.productSelectDatatablesRowFormatter = function (d) {\n    // `d` is the original data object for the row\n\n    /**\r\n    @todo: felszedni es updatelni az adott termek memojat az orderban\r\n     */\n    console.group('productSelectDatatablesRowFormatter');\n    console.log(d);\n    var templateData = d;\n    templateData.comment = ''; //        debug(Order);\n\n    if (Order.productComment && Order.productComment !== null) {\n      debug(_typeof(Order.productComment[d.id]));\n\n      if (typeof Order.productComment[d.id] != 'undefined' && Order.productComment[d.id].length > 0) {\n        templateData.comment = Order.productComment[d.id];\n      }\n    }\n    /** @typedef {boolean} d.favorites */\n\n\n    if (d.favorites === true) {\n      templateData.btnFavoritesClass = 'btn-warning';\n    } else {\n      templateData.btnFavoritesClass = 'btn-light';\n    }\n\n    var template = $('template[data-name=\"orderProductSelectDetails\"]').html();\n    templateData.weekly = false;\n\n    if (Order.getData().orderType === 'weekly') {\n      templateData.weekly = true;\n      /*\r\n      \r\n                  templateData.weeklyDay=[\r\n                      {\"index\":1,\"name\":\"Hétfő\"},\r\n                  {\"index\":2,\"name\":\"Kedd\"},\r\n                  {\"index\":3,\"name\":\"Szerda\"},\r\n                  {\"index\":4,\"name\":\"Csütörtök\"},\r\n                  {\"index\":5,\"name\":\"Péntek\"},\r\n                  {\"index\":6,\"name\":\"Szombat\"},\r\n                  {\"index\":7,\"name\":\"Vasárnap\"},\r\n                  ];\r\n      \r\n                  templateData.weeklyDay=[\r\n                      {\"index\":2,\"name\":\"Hétfő\" },\r\n                      {\"name\":\"Kedd\"},\r\n                      {\"name\":\"Szerda\"},\r\n                      {\"name\":\"Csütörtök\"},\r\n                      {\"name\":\"Péntek\"},\r\n                      {\"name\":\"Szombat\"},\r\n                      {\"name\":\"Vasárnap\"}\r\n                  ];\r\n      */\n    }\n\n    var productSelected = Order.getData('productSelected');\n\n    if (typeof productSelected[d.id] != 'undefined') {\n      templateData.itemQuantity = productSelected[d.id];\n    }\n\n    console.log(['templateData', templateData]);\n    var oldTags = Mustache.tags;\n    Mustache.tags = [\"~!\", \"!~\"];\n\n    if (templateData['specification'] == 'false' || templateData['specification'] == false) {\n      templateData.specificationClass = 'd-none';\n    }\n\n    templateData.pictureImg = '';\n\n    if (templateData['picture'] == 'false' || templateData['picture'] == false) {\n      templateData.pictureClass = 'd-none';\n    } else {\n      templateData.pictureImg = '<img src= \"' + templateData['picture'] + '\" class=\"productPicture\" ></img>';\n    }\n\n    console.log('templateData', templateData); //templateData['aa_specification']=false;\n\n    var render = Mustache.render(template, templateData);\n    Mustache.tags = oldTags;\n    console.groupEnd();\n    return render;\n    /*\r\n    solution before template\r\n            return '<table cellpadding=\"5\" cellspacing=\"0\" border=\"0\" style=\"padding-left:50px;\">'+\r\n                '<tr>'+\r\n                '<td>Info:</td>'+\r\n                '<td>'+d.note+'</td>'+\r\n                '</tr>'+\r\n                '<tr>'+\r\n                '<td>hooreyca :</td>'+\r\n                '<td><span style=\"padding-right: 2em;\">'+d.hooreycaId+'</span>' +\r\n    \r\n                '<button type=\"button\"\\n' +\r\n                '        data-id=\"'+d.id+'\"\\n' +\r\n                '        class=\"buttonItemFavorites btn '+btnFavoritesClass+'\">\\n' +\r\n                '    <i class=\"bi bi-star-fill pr-2\" aria-hidden=\"true\"></i>\\n' +\r\n                '    Kedvenc\\n' +\r\n                '</button>' +\r\n                '</td>'+\r\n                '</tr>'+\r\n                /!*\r\n                            '<tr>'+\r\n                            '<td>Extension number:</td>'+\r\n                            '<td>'+d.extn+'</td>'+\r\n                            '</tr>'+\r\n                *!/\r\n                '<tr>'+\r\n                '<td>Info:</td>'+\r\n                '<td>'+d.note+'</td>'+\r\n                '</tr>'+\r\n                '<tr>'+\r\n                '<td>Megjegyzés:</td>'+\r\n                '<td><textarea class=\"orderItemComment\" data-id=\"'+d.id+'\">'+comment+'</textarea></td>'+\r\n                '</tr>'+\r\n                /!*\r\n                *!/\r\n                '</table>';\r\n    */\n  };\n\n  this.setDatatableHeaderText = function (text) {\n    $('.tableHeaderText').text(text);\n  };\n\n  this.getTreePathName = function (node) {\n    var res = '';\n    var items = $(node).parents('li').toArray();\n    items.shift();\n    items.reverse();\n\n    for (var item in items) {\n      console.log($(items[item]).children('a.categoryItem'));\n\n      if ($(items[item]).children('a.categoryItem').length > 0) {\n        res += $(items[item]).children('a.categoryItem').text() + '/';\n      }\n    }\n\n    res += $(node).text();\n    console.log(res);\n    return res;\n  };\n\n  var selectedProductGroup = null;\n  var dataTableSearchStr = null;\n  var dataTableSearchKrel = false;\n\n  this.searchProductByString = function (filterStr) {\n    if (filterStr.length > 0) {\n      root.setDatatableHeaderText('Termékek szűrve:' + filterStr);\n    } else {\n      root.setDatatableHeaderText('');\n    }\n\n    dataTableSearchStr = filterStr;\n    $('.dataTableOrderProductSelect').DataTable().ajax.reload();\n  };\n\n  this.clickSearchProduct = function () {\n    debug(this);\n    var filterStr = $('.sidebar-search input[name=searchValue]').val();\n    debug(filterStr);\n    root.searchProductByString(filterStr);\n  };\n\n  this.clickFavoritesProduct = function () {\n    debug('clickFavoritesProduct');\n    root.setDatatableHeaderText('Termékek szűrve: kedvencek');\n    dataTableSearchStr = '**favorites**';\n    $('.dataTableOrderProductSelect').DataTable().ajax.reload();\n  };\n\n  this.clickOftenProduct = function () {\n    debug('clickOftenProduct');\n    root.setDatatableHeaderText('Termékek szűrve: gyakran vásárolt');\n    dataTableSearchStr = '**often**';\n    $('.dataTableOrderProductSelect').DataTable().ajax.reload();\n  };\n\n  this.clickSpecialOffer = function () {\n    debug('clickSpecialOffer');\n    root.setDatatableHeaderText('Termékek szűrve: Akciós termékek');\n    dataTableSearchStr = '**specialOffer**';\n    $('.dataTableOrderProductSelect').DataTable().ajax.reload();\n  };\n\n  this.clickLastProduct = function () {\n    debug('clickLastProduct');\n    root.setDatatableHeaderText('Termékek szűrve: utoljára vásárolt');\n    dataTableSearchStr = '**last**';\n    $('.dataTableOrderProductSelect').DataTable().ajax.reload();\n  };\n\n  this.clickWeeklyProduct = function () {\n    debug('clickWeeklyProduct');\n    root.setDatatableHeaderText('Termékek szűrve: Heti termékek');\n    dataTableSearchStr = '**weekly**';\n    $('.dataTableOrderProductSelect').DataTable().ajax.reload();\n  };\n\n  this.clickKrelProduct = function () {\n    debug('clickKrelProduct'); //root.setDatatableHeaderText('Termékek szűrve: Heti termékek');\n    //dataTableSearchStr='**weekly**';\n    //$('.dataTableOrderProductSelect').DataTable().ajax.reload();\n\n    $(this).parent().toggleClass('krelActive');\n    dataTableSearchKrel = !dataTableSearchKrel;\n    $('.dataTableOrderProductSelect').DataTable().ajax.reload();\n  };\n\n  this.productSelectDataTableColumnDefs = function () {\n    return [{\n      \"width\": \"10px\",\n      \"targets\": 0\n    }, {\n      \"className\": \"dt-left\",\n      \"targets\": 1\n    }, //                { \"width\": \"120px\", \"targets\": 1 },\n    {\n      \"width\": \"28px\",\n      \"targets\": 2\n    }, {\n      \"width\": \"41px\",\n      \"targets\": 3\n    }, {\n      \"width\": \"76px\",\n      \"targets\": 4\n    }, {\n      \"width\": \"55px\",\n      \"targets\": 5\n    }, {\n      \"width\": \"70px\",\n      \"targets\": 6\n    }, {\n      \"width\": \"54px\",\n      \"targets\": 7\n    }, {\n      \"width\": \"57px\",\n      \"targets\": 8\n    }, {\n      \"width\": \"42px\",\n      \"targets\": 9\n    }, {\n      \"width\": \"100px\",\n      \"targets\": 10\n    }, {\n      \"className\": \"dt-center\",\n      \"targets\": \"_all\"\n    }];\n  };\n\n  this.productSelectDataTableColumn = function () {\n    var columnData = [{\n      \"className\": 'details-control',\n      \"orderable\": false,\n      \"data\": null,\n      \"defaultContent\": ''\n    }, {\n      \"data\": \"name\"\n    }, {\n      \"data\": \"krel\"\n    }, {\n      \"data\": \"packing\"\n    }, {\n      \"data\": \"unitValue\"\n    }, {\n      \"data\": \"productUnit\"\n    }, {\n      \"data\": \"sellerUnit\"\n    }, {\n      \"data\": \"unitMultiplier\"\n    }, {\n      \"data\": \"amountUnit\"\n    }, {\n      \"data\": \"price\"\n    }];\n    var actionColumn = {\n      \"className\": 'details-control2',\n      \"orderable\": false,\n      \"data\": null,\n      \"width\": \"80px\",\n      \"defaultContent\": ''\n    };\n\n    if (Order.getData('orderType') == 'daily') {\n      actionColumn.defaultContent = '<input type=\"number\" value=\"0\" min=\"0\" max=\"9999\" step=\"1\" data-decimals=\"1\"  class=\"form-control-sm inputNumberSpinner\" style=\"width: 1em;\" \"/>'\n      /*\r\n                          \"defaultContent\":'<div class=\"input-group input-group-sm \">' +\r\n                              '<button style=\"min-width: 1.5rem\" class=\"btn-sm btn-decrement btn-outline-secondary btn-minus\" type=\"button\">' +\r\n                              '<strong>−</strong></button>' +\r\n                              '<input type=\"text\" inputmode=\"decimal\" style=\"text-align: center\" class=\"form-control \" placeholder=\"\">' +\r\n                              '<button style=\"min-width: 1.5rem\" class=\"btn-sm btn-increment btn-outline-secondary btn-plus\" type=\"button\">' +\r\n                              '<strong>+</strong></button>' +\r\n                              '</div>'\r\n      */\n      ;\n    }\n\n    columnData.push(actionColumn);\n    return columnData;\n  };\n\n  this.getDatatables = function (orderType) {\n    console.error(orderType);\n    var table = $('.dataTableOrderProductSelect').DataTable({\n      language: {\n        url: '//cdn.datatables.net/plug-ins/1.10.24/i18n/Hungarian.json'\n      },\n      //\"ajax\": \"{{asset('exapmle2.json')}}\",\n      \"ajax\": {\n        url: Opts.URL.getDataTableContentProductList,\n        data: function data(_data) {\n          _data.searchStr = dataTableSearchStr;\n          _data.krel = dataTableSearchKrel;\n          _data.groupId = selectedProductGroup;\n          _data.supplierId = Order.supplierId;\n          _data.deliveryDate = Order.deliveryDate;\n        }\n      },\n      buttons: {\n        buttons: []\n      },\n      \"columnDefs\": root.productSelectDataTableColumnDefs(),\n      \"columns\": root.productSelectDataTableColumn(),\n      \"order\": [[1, 'asc']]\n    });\n    return table;\n  };\n\n  this.productSelectDataTableDrawDT = function (e) {\n    //debug( 'Table draw complete: '+new Date().getTime() );\n    //$('td:contains(\"*\")').html('<i class=\"bi bi-check-circle-fill\"></i>');\n    $(\"td\").filter(function () {\n      return $(this).text() === '*';\n    }).html('<i class=\"bi bi-check-circle-fill\"></i>');\n\n    if (Order.getData().orderType == 'daily') {\n      $(\"input[type='number'].inputNumberSpinner\").inputSpinner({\n        template: '<div class=\"input-group ${groupClass}\">' + '<button style=\"min-width: ${buttonsWidth}\" class=\"btn btn-sm btn-decrement ${buttonsClass}\" type=\"button\">${decrementButton}</button>' + //'<input type=\"text\" inputmode=\"decimal\" style=\"text-align: ${textAlign}\" class=\"productQuantity form-control\"/>' +\n        '<input type=\"text\" step=\"0.1\" data-decimals=\"2\" style=\"text-align: ${textAlign}\" class=\"productQuantity form-control\"/>' + '<button style=\"min-width: ${buttonsWidth}\" class=\"btn btn-sm btn-increment ${buttonsClass}\" type=\"button\">${incrementButton}</button>' + '</div>',\n        buttonsWidth: \"0.5rem\",\n        groupClass: \"\",\n        // css class of the resulting input-group\n        buttonsClass: \"btn-outline-secondary\"\n      });\n    }\n\n    root.bindWeakUserHelper();\n    /*\r\n    ----------------------------------------------------------\r\n    change order quantity\r\n     */\n\n    $(\".dataTableOrderProductSelect .details-control2 input[type=text]\").off('change');\n    $(\".dataTableOrderProductSelect .details-control2 input[type=text]\").on('change', function (e) {\n      var quantity = $(this).val();\n      quantity = quantity.replace(',', '.');\n      quantity = parseFloat(quantity);\n      var rowData = $('.dataTableOrderProductSelect').DataTable().row($(this).closest('tr')).data();\n      root.orderItemsChange(rowData, quantity);\n    });\n    $(\".dataTableOrderProductSelect .details-control2 input[type=text]\").each(function () {\n      //debug('ez a function2')\n      var quantity = $(this).val();\n      var rowData = $('.dataTableOrderProductSelect').DataTable().row($(this).closest('tr')).data();\n\n      if (Order.productSelected[rowData.id]) {\n        debug(rowData);\n        debug($($(this).closest('tr').find('input[type=number]')[0]));\n        debug(Order.productSelected[rowData.id]);\n        var quantityCurrent = Order.productSelected[rowData.id];\n\n        if (typeof quantityCurrent != 'string') {\n          quantityCurrent += '';\n        }\n\n        $($(this).closest('tr').find('input[type=number]')[0]).val(quantityCurrent.replace(',', '.'));\n      }\n    });\n    $(\".dataTableOrderProductSelect .details-control2 button\").off('click');\n    $(\".dataTableOrderProductSelect .details-control2 button\").on('click', function () {\n      // debug('.details-control2 button click ')\n      // debug(this);\n      $(this).parent().find('input[type=text]').trigger('change');\n    });\n  };\n\n  this.initViewProductSelect = function () {\n    var functionName = 'initViewProductSelect';\n    console.log(functionName + ' called');\n\n    if (viewInicialized.includes(functionName)) {\n      return;\n    } //debug(Object.getOwnPropertyNames(root));\n\n\n    root.setDatatableHeaderText('');\n    root.Stepper.setOpts({\n      onAfterActivate: function onAfterActivate() {}\n    }); //@note: be kell kapcsolni az elonezetet\n\n    root.Stepper.addCompleted('invoice');\n    root.Stepper.addEnabled('invoice');\n    var CSSSelectorForm = '.orderParameterForm'; //console.log(Opts.URL.getDataTableContentProductList);change\n\n    debug(CSSSelectorForm + ' .fa-search');\n    $('.sidebar-search .fa-search').off('click');\n    $('.sidebar-search .fa-search').on('click', root.clickSearchProduct);\n    $('a.sidebar.favorites').off('click');\n    $('a.sidebar.favorites').on('click', root.clickFavoritesProduct);\n    $('a.sidebar.often').off('click');\n    $('a.sidebar.often').on('click', root.clickOftenProduct);\n    $('a.sidebar.last').off('click');\n    $('a.sidebar.last').on('click', root.clickLastProduct);\n    $('a.sidebar.weekly').off('click');\n    $('a.sidebar.weekly').on('click', root.clickWeeklyProduct);\n    $('a.sidebar.krel').off('click');\n    $('a.sidebar.krel').on('click', root.clickKrelProduct);\n    $('a.sidebar.specialOffer').off('click');\n    $('a.sidebar.specialOffer').on('click', root.clickSpecialOffer);\n    $('.sidebar-search input[name=searchValue]').off('keypress');\n    $('.sidebar-search input[name=searchValue]').on('keypress', function (event) {\n      if (event.which == 13) {\n        event.preventDefault();\n      }\n\n      if ($(this).val().length >= 2) {\n        root.searchProductByString($(this).val() + event.key);\n      }\n    });\n    $('.sidebar-search input[name=searchValue]').off('keyup ');\n    $('.sidebar-search input[name=searchValue]').on('keyup ', function (event) {\n      if ($(this).val().length == 0) {\n        root.searchProductByString($(this).val());\n      }\n    });\n    $('.sidebar-wrapper .sidebar-menu .sidebar-dropdown .sidebar-submenu li a.categoryItem.clickable').off('click');\n    $('.sidebar-wrapper .sidebar-menu .sidebar-dropdown .sidebar-submenu li a.categoryItem.clickable').on('click', function () {\n      var groupId = $(this).data('id');\n      selectedProductGroup = groupId;\n      dataTableSearchStr = null;\n      console.log(groupId);\n      console.log(root.getTreePathName(this));\n      root.setDatatableHeaderText(root.getTreePathName(this));\n      /*\r\n                      let ajaxData={\r\n                          'groupId':groupId,\r\n                          'supplier_id':Order.supplierId,\r\n                      };\r\n                      //$('.dataTableOrderProductSelect').DataTable().ajax.data(ajaxData).load();\r\n      \r\n      */\n\n      /*\r\n                      let ajaxUrl=Opts.URL.getDataTableContentProductList+'?groupId='+groupId+'&supplier_id='+Order.supplierId;\r\n                      $('.dataTableOrderProductSelect').DataTable().ajax.url(ajaxUrl).load();\r\n      */\n\n      $('.dataTableOrderProductSelect').DataTable().ajax.reload();\n    });\n    var table = root.getDatatables(Order.getData('orderType'));\n    $('.dataTableOrderProductSelect').on('init.dt', function () {\n      console.log('Table initialisation complete: ' + new Date().getTime());\n    }).dataTable();\n    $('.dataTableOrderProductSelect').on('draw.dt', root.productSelectDataTableDrawDT).dataTable(); //$('.dataTableOrderProductSelect').on( 'draw.dt',  ).dataTable();\n\n    $('.dataTableOrderProductSelect').on('xhr.dt', function () {\n      debug('Table xhr complete: ' + new Date().getTime());\n    }).dataTable(); //$(\"input[type='number'].inputNumberSpinner\").inputSpinner();\n\n    /*\r\n    ----------------------------------------------------------\r\n     Add event listener for opening and closing details\r\n     */\n\n    $('.dataTableOrderProductSelect tbody').on('click', 'td.details-control', function () {\n      var tr = $(this).closest('tr');\n      var row = table.row(tr);\n\n      if (row.child.isShown()) {\n        // This row is already open - close it\n        row.child.hide();\n        tr.removeClass('shown');\n      } else {\n        // Open this row\n        row.child(root.productSelectDatatablesRowFormatter(row.data())).show();\n        tr.addClass('shown');\n        root.bindProductDetailsAction();\n      }\n    });\n    viewInicialized.push(functionName);\n  };\n\n  this.bindProductDetailsAction = function () {\n    root.bindRowDescriptionAction();\n    root.bindRowFavoritesAction();\n\n    if (Order.getData()['orderType'] == 'weekly') {\n      root.bindOrderItemWeekQuantity();\n    }\n  };\n\n  this.bindWeakUserHelper = function () {\n    $(\"input.inputNumberSpinner\").off(\"focus\");\n    $(\"input.inputNumberSpinner\").on(\"focus\", function () {\n      var quantity = $(this).val();\n      quantity = quantity.replace(',', '.');\n      quantity = parseFloat(quantity);\n\n      if (quantity === 0) {\n        $(this).val('');\n      }\n    });\n    $(\"input[type=text].inputNumberSpinner\").off(\"keypress\");\n    $(\"input[type=text].inputNumberSpinner\").on(\"keypress\", function (event) {\n      if (event.which == 13) {\n        //                console.error('enter pressed');\n        var actualItem = this;\n        var items = $(\"input[type=text].inputNumberSpinner\");\n        items.each(function (item) {\n          //                    console.log(this);\n          if (this == actualItem) {\n            //                        console.error(item);\n            if (item + 1 <= items.length) {\n              //                            console.error(items[item+1]);\n              $(items[item + 1]).focus();\n            }\n\n            return false;\n          }\n        });\n      }\n    });\n  };\n\n  this.bindOrderItemWeekQuantity = function () {\n    $(\"input.productSelectDayQuantity\").off('change');\n    $(\"input.productSelectDayQuantity\").on('change', function () {\n      console.log(this.name);\n      console.log(this.value);\n      console.log($(this).data('dayindex'));\n      var rowData = null;\n      var rowNode = $($(this).closest('table.orderProductSelectRowDetailsTable').closest('tr')).prev();\n      rowData = $('.dataTableOrderProductSelect').DataTable().row(rowNode).data();\n      console.log(rowData);\n      var quantity = $(this).val();\n      quantity = quantity.replace(',', '.');\n      quantity = parseFloat(quantity);\n      console.log(rowData.id);\n      root.orderItemsChange(rowData, quantity, $(this).data('dayindex')); //            root.orderItemsChange\n      //orderItemsChange\n      //quantity[1683][1]\n    });\n  };\n\n  this.afterSyncOrderDataToServer = function (data) {\n    //root.toggleEnableSend();\n    //console.log('most vegzett. ennyit kiszed'+batchNum);\n    for (var i = 0; i < queueAjax.length; i++) {\n      console.log('shiftel');\n      queueAjax.shift();\n    } //console.log('remaining left '+queueAjax.length);\n\n\n    setTimeout(function () {\n      syncDoing = false;\n      root.syncOrderDataToServer();\n    }, Opts.dataSyncPauseTime);\n  };\n\n  var queueAjax = [];\n  var syncDoing = false;\n\n  this.syncOrderDataToServer = function () {\n    //debug(queueAjax);\n    if (syncDoing) {\n      //debug('sync in progress....');\n      return false;\n    }\n\n    if (queueAjax.length < 1) {\n      return;\n    }\n\n    syncDoing = true;\n    root.sendOrderDataToServer('productSelect', root.afterSyncOrderDataToServer);\n    return;\n  };\n\n  this.orderItemsChange = function (ItemData, quantity, dayIndex) {\n    /*\r\n            debug('-----------------');\r\n            debug(ItemData);\r\n            debug(quantity);\r\n            debug(Order.getData('productSelected'));\r\n            debug('-----------------');\r\n    \r\n    */\n    if (isNaN(quantity)) {\n      quantity = 0;\n    }\n\n    var productSelected = Order.getData('productSelected');\n    console.group('orderItemsChange');\n    console.log(['productSelected', productSelected]);\n    console.log(['ItemData', ItemData]);\n    console.log(['ItemData.id', ItemData.id]);\n    console.log(['quantity', quantity]);\n    console.log(['dayIndex', dayIndex]);\n    console.log(productSelected[ItemData.id]);\n    var productSelectedItem = productSelected[ItemData.id];\n    /*\r\n    ha 0 ertek jon es nem is volt akkor hamar kiugratjuk\r\n     */\n\n    if (quantity == 0) {\n      console.error('quantity==0');\n\n      if (typeof productSelectedItem == 'undefined') {\n        console.error('itt lep1');\n        console.groupEnd();\n        return;\n      }\n\n      if (dayIndex) {\n        console.log('van dayIndex');\n\n        if (typeof productSelected[ItemData.id][dayIndex] == 'undefined') {\n          console.log(['productSelectedItem', productSelectedItem]);\n          console.error('itt lep2');\n          console.groupEnd();\n          return;\n        }\n      }\n    }\n    /*\r\n    ha azonos az ertek kiugrunk\r\n     */\n\n\n    if (dayIndex) {\n      if (typeof productSelected[ItemData.id] != 'undefined' && typeof productSelected[ItemData.id][dayIndex] != 'undefined') {\n        if (productSelected[ItemData.id][dayIndex] == quantity) {\n          console.error('azonos napi');\n          console.groupEnd();\n          return;\n        }\n      }\n    } else {\n      if (productSelected[ItemData.id] == quantity) {\n        console.error('azonos');\n        console.groupEnd();\n        return;\n      }\n    }\n\n    if (quantity == 0) {\n      if (dayIndex) {\n        delete Order.productSelected[ItemData.id][dayIndex];\n        delete productSelected[ItemData.id][dayIndex];\n      } else {\n        delete Order.productSelected[ItemData.id];\n        delete productSelected[ItemData.id];\n      }\n    } else {\n      /*\r\n      ha van ertek erteket adunk!\r\n       */\n      if (dayIndex) {\n        if (typeof productSelected[ItemData.id] == 'undefined') {\n          productSelected[ItemData.id] = [];\n        }\n\n        console.log('set quantity productSelected[ItemData.id][dayIndex]', quantity);\n        productSelected[ItemData.id][dayIndex] = quantity;\n      } else {\n        productSelected[ItemData.id] = quantity;\n        console.log('set quantity productSelected[ItemData.id]', quantity);\n      }\n    }\n\n    console.log(['productSelected', productSelected]);\n    Order.productSelected = productSelected;\n    console.groupEnd();\n    queueAjax.push(Date.now());\n    root.syncOrderDataToServer();\n    return;\n\n    if (productSelected[ItemData.id] == quantity) {\n      debug('itt lep12');\n      console.groupEnd();\n      return;\n    }\n\n    productSelected[ItemData.id] = quantity;\n\n    if (quantity == 0) {\n      delete Order.productSelected[ItemData.id];\n    }\n\n    Order.productSelected = productSelected;\n    console.groupEnd();\n    return;\n    queueAjax.push(Date.now());\n    root.syncOrderDataToServer();\n    /*\r\n    debug(Order.getData('productSelected'));\r\n    debug('*******************');\r\n    */\n  };\n\n  this.initViewInvoice = function () {\n    root.Stepper.setOpts({\n      onAfterLoad: function onAfterLoad() {}\n    });\n\n    if (Object.keys(Order.productSelected).length > 0) {\n      root.Stepper.addCompleted('send');\n      root.Stepper.addEnabled('send');\n    }\n\n    var styleStr = '<link rel=\"stylesheet\" href=\"' + Opts.URL.root + '/css/invoice.css\">';\n    $('table.invoice button.printButton').off('click');\n    $('table.invoice button.printButton').on('click', function () {\n      window.print();\n      return;\n      var newWin = window.open(\"\");\n      newWin.document.write(styleStr);\n      var print = $('table.invoice').clone();\n      print.find('button.printButton').remove(); //            newWin.document.write($('table.invoice').prop('outerHTML'));\n\n      newWin.document.write(print.prop('outerHTML'));\n      newWin.print();\n      newWin.close();\n    });\n  };\n\n  this.resetOrder = function () {\n    root.init();\n    root.setDeliveryDate('-');\n    root.setSupplier('-');\n  };\n\n  this.afterOrderSendOk = function (data) {\n    Toast.create(\"Sent!\", 'Order Sent', TOAST_STATUS.INFO, 5000);\n    $('.buttonOrderSend').off('click');\n    $('.buttonOrderSend').prop('disabled', true);\n    $('.statusNamePlace').removeClass('statusBlink');\n    $('.statusNamePlace').text('elküldve');\n    $('.buttonOrderSending').toggleClass('d-none');\n    $('.buttonOrderSendOk').toggleClass('d-none');\n    $('div.invoiceContainer').html(data.retHTML); //root.resetOrder();\n  };\n\n  this.afterOrderSendError = function (data) {\n    $('.buttonOrderSend').toggleClass('d-none');\n    $('.buttonOrderSending').toggleClass('d-none');\n    $.each(APP.OrderModule.Stepper.getOpts().available, function (index, value) {\n      APP.OrderModule.Stepper.setEnabled(value);\n      APP.OrderModule.Stepper.setCompleted(value);\n    });\n  };\n\n  this.initViewSend = function () {\n    console.log('initViewSend called 2');\n    root.Stepper.setOpts({\n      onAfterLoad: function onAfterLoad() {}\n    });\n    $('.buttonOrderSend').off('click');\n    $('.buttonOrderSend').on('click', function () {\n      console.log('Send buton clicked'); //@todo: datasynchere and callback\n\n      $('.buttonOrderSend').toggleClass('d-none');\n      $('.buttonOrderSending').toggleClass('d-none');\n      /**\r\n       * PM158\r\n       */\n\n      $.each(APP.OrderModule.Stepper.getOpts().available, function (index, value) {\n        root.Stepper.unsetEnabled(value);\n        root.Stepper.unsetCompleted(value);\n      });\n      /**\r\n         */\n\n      root.sendOrderDataToServer('send', root.afterOrderSendOk, root.afterOrderSendError);\n      /*            let ajaxData={};\r\n                  ajaxData._token=Opts.token;\r\n                  ajaxData.send=true;\r\n                  $.extend(ajaxData,Order);\r\n                  $.ajax({\r\n                     url: Opts.URL.store,\r\n                      method:'POST',\r\n                      data:ajaxData,\r\n                      success:function (data) {\r\n                          if(data.success){\r\n                              root.afterOrderSendOk(data);\r\n                          }\r\n                      }\r\n                  });*/\n    });\n  };\n\n  this.testModeSend = function () {};\n\n  this.testMode = function () {\n    console.log('testMode called ');\n    Order.setData({\n      id: 234,\n      supplierId: 7,\n      productSelected: {\n        116: 3,\n        293: 2\n      },\n      contactName: 'Contact Name',\n      note: 'Note',\n      type: 'daily',\n      deliveryDate: Opts.defaultDeliveryDate,\n      deliveryAddress: 12\n    });\n    console.log(Order.getData());\n    console.log('*******************'); //root.Stepper.setOpts({'UrlData':{'supplierId':supplierId}});\n\n    root.Stepper.setOpts({\n      'UrlData': {\n        'supplierId': Order.supplierId,\n        id: Order.id\n      }\n    });\n    this.Stepper.init({\n      URL: {\n        create: Opts.URL.create\n      },\n\n      /*\r\n      csupasz az elejerol\r\n                  complete:['supplier'],\r\n                  enable: ['supplier'],\r\n                  active: 'supplier',\r\n                  onAfterActivate:this.initViewSupplier,\r\n      \r\n      product select\r\n                  complete:['supplier','parameter','productSelect'],\r\n                  enable: ['supplier','parameter','productSelect'],\r\n                  active: 'productSelect',\r\n                  onAfterActivate:this.initViewProductSelect,\r\n      \r\n      fullos\r\n                  complete:['supplier','parameter','productSelect','invoice'],\r\n                  enable: ['supplier','parameter','productSelect','invoice','send'],\r\n                  active: 'productSelect',\r\n                  onAfterActivate:this.initViewProductSelect,\r\n      \r\n      send\r\n                  complete:['supplier','parameter','productSelect','invoice','send'],\r\n                  enable: ['supplier','parameter','productSelect','invoice','send'],\r\n                  active: 'send',\r\n                  onAfterActivate:this.initViewProductSelect,\r\n      \r\n      */\n      complete: ['supplier', 'parameter', 'productSelect'],\n      enable: ['supplier', 'parameter', 'productSelect'],\n      active: 'productSelect',\n      onAfterActivate: this.initViewProductSelect,\n      autoCallback: {\n        invoice: {\n          onAfterActivate: root.initViewInvoice\n        },\n        send: {\n          onAfterActivate: root.initViewSend\n        }\n      }\n    });\n    console.log('*******************');\n  };\n\n  this.toggleEnableSend = function () {\n    console.log('toggleEnableSend called');\n    var ajaxUrl = Opts.URL.checkReadyToSend.replace('%id%', Order.id);\n    $.ajax({\n      url: ajaxUrl,\n      success: function success(data) {\n        if (data.success) {\n          if (data.readyToSend) {\n            root.Stepper.addCompleted('send');\n            /*\r\n                                    root.Stepper.addCompleted('invoice');\r\n                                    root.Stepper.addEnabled('invoice');\r\n            */\n\n            root.Stepper.addEnabled('send');\n          } else {\n            root.Stepper.unsetCompleted('send');\n            /*\r\n                                    root.Stepper.unsetCompleted('invoice');\r\n                                    root.Stepper.unsetEnabled('invoice');\r\n            */\n\n            root.Stepper.unsetEnabled('send');\n          }\n        }\n\n        console.log(data);\n      }\n    });\n  };\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 171808 characters]\n//# sourceURL=webpack-internal:///./resources/js/moduleJs/order.js\n");

/***/ }),

/***/ "./resources/js/moduleJs/orderArchive.js":
/*!***********************************************!*\
  !*** ./resources/js/moduleJs/orderArchive.js ***!
  \***********************************************/
/***/ (() => {

eval("function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _get(target, property, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }\n\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nif (typeof window.DataModelOrderArchive === \"undefined\") {\n  window.OrderArchiveModulDefault = {\n    actionFunction: function actionFunction() {}\n  };\n\n  var _DataModelOrderArchive = /*#__PURE__*/function (_DataModel) {\n    _inherits(_DataModelOrderArchive, _DataModel);\n\n    var _super = _createSuper(_DataModelOrderArchive);\n\n    /*\n     * Constructor\n     */\n    function _DataModelOrderArchive(data, options) {\n      var _this;\n\n      _classCallCheck(this, _DataModelOrderArchive);\n\n      _this = _super.call(this, data, options);\n\n      if (typeof _this.items === \"undefined\") {\n        _this.items = {};\n      }\n\n      console.log(_this.constructor.name + ' constructor called');\n      return _this;\n    }\n\n    return _DataModelOrderArchive;\n  }(DataModel);\n\n  ;\n  window.DataModelOrderArchive = _DataModelOrderArchive;\n}\n\nif (typeof window.OrderArchiveModule === \"undefined\") {\n  var OrderArchiveModule = /*#__PURE__*/function (_ModuleBase) {\n    _inherits(OrderArchiveModule, _ModuleBase);\n\n    var _super2 = _createSuper(OrderArchiveModule);\n\n    function OrderArchiveModule(options, data) {\n      var _this2;\n\n      _classCallCheck(this, OrderArchiveModule);\n\n      _this2 = _super2.call(this, options, data);\n\n      if (data !== \"undefined\" || data != null) {} else {\n        _this2.data = new DataModelOrderArchive();\n      }\n\n      _this2.dataTable = null;\n      _this2.Opts.dataTable.advanceSearchParameter = {\n        deliveryDateFrom: null,\n        deliveryDateTo: null,\n        profitCenterId: null,\n        supplierId: null\n      };\n      return _this2;\n    }\n\n    _createClass(OrderArchiveModule, [{\n      key: \"datatableRowActionAttachment\",\n      value: function datatableRowActionAttachment(rowData, node) {\n        debug('call datatableRowActionAttachment');\n\n        _get(_getPrototypeOf(OrderArchiveModule.prototype), \"datatableRowActionAttachment\", this).call(this, rowData, node, {\n          defaultFileName: \"order\"\n        });\n      }\n    }, {\n      key: \"datatableRowActionView\",\n      value: function datatableRowActionView(rowData, node) {\n        debug('call datatableRowActionView');\n\n        _get(_getPrototypeOf(OrderArchiveModule.prototype), \"datatableRowActionView\", this).call(this, rowData, node, APP.OrderArchiveModule);\n\n        console.log('datatableRowActionEdit End');\n      }\n    }, {\n      key: \"datatableRowActionButtonClick\",\n      value: function datatableRowActionButtonClick(event) {\n        debug('datatableRowActionButtonClick');\n\n        _get(_getPrototypeOf(OrderArchiveModule.prototype), \"datatableRowActionButtonClick\", this).call(this, event, APP.OrderArchiveModule);\n      }\n      /*\n      datatableRowActionButtonClick (event){\n          debug('datatableRowActionButtonClick');\n          let node=$(event[0].currentTarget);\n          let row=$(dataTableCSSSelector).DataTable().row(node.parents('tr'));\n          let rowData=row.data();\n          let actionName='datatableRowAction'+node.data('buttontype').capitalize();\n          if (typeof root[actionName] === \"function\") {\n              return root[actionName](rowData,node)\n          }\n      }\n      */\n\n    }, {\n      key: \"datatableRowActionEdit\",\n      value: function datatableRowActionEdit(rowData, node) {\n        console.log('datatableRowActionEdit Called'); //Opts.onAfterInitViewDetails=root.autofillDetails;\n\n        var ajaxUrl = this.Opts.URL.edit.replace('%id%', rowData.id);\n        console.log(this.Opts.URL);\n        console.log(ajaxUrl);\n        /*\n        */\n\n        APP.loadMainContent(ajaxUrl);\n        console.log('datatableRowActionEdit End');\n      }\n    }, {\n      key: \"initViewShow\",\n      value: function initViewShow() {\n        debug('call initViewShow');\n        var root = APP.OrderArchiveModule;\n        var styleStr = '<link rel=\"stylesheet\" href=\"' + root.Opts.URL.root + '/css/invoice.css\">';\n        $('table.invoice button.printButton').off('click');\n        $('table.invoice button.printButton').on('click', function () {\n          window.print();\n          return;\n          var newWin = window.open(\"\");\n          newWin.document.write(styleStr);\n          var print = $('table.invoice').clone();\n          print.find('button.printButton').remove(); //            newWin.document.write($('table.invoice').prop('outerHTML'));\n\n          newWin.document.write(print.prop('outerHTML'));\n          newWin.print(); //                newWin.close();\n        });\n      }\n    }, {\n      key: \"datatableCustomHeadButtonClickCallBack\",\n      value: function datatableCustomHeadButtonClickCallBack() {\n        console.info('hello itt vagyok');\n        $('.advanceSearchModal').modal('show');\n      }\n    }, {\n      key: \"initAdvancedSearch\",\n      value: function initAdvancedSearch() {\n        console.log('initAdvancedSearch');\n        window.datePickerTarget = '';\n        $('.deliveryDateFrom,.deliveryDateTo').datepicker({\n          dateFormat: 'yy-mm-dd',\n          //minDate:new Date(),\n          onSelect: function onSelect(dateText) {\n            debug('target:' + window.datePickerTarget);\n            $('.' + window.datePickerTarget + 'SelectedDateText').text(dateText);\n            debug($(' input[name=\"' + window.datePickerTarget + '\"]'));\n            $(' input[name=\"' + window.datePickerTarget + '\"]').val(dateText);\n          }\n        });\n        $('.datePickerClick').click(function () {\n          debug($(this).data('target'));\n          datePickerTarget = $(this).data('target'); //$('.datePicker .'+datePickerTarget).datepicker('show');\n\n          $('.' + datePickerTarget).datepicker('show');\n        });\n        $(\".selectProfitCenter,.selectSupplier\").select2({\n          maximumSelectionLength: 1\n        });\n        /*\n        stored advanceSearchParameter restoring\n        */\n\n        var advanceFiltered = false;\n        $.each(this.Opts.dataTable.advanceSearchParameter, function (k, v) {\n          if (v != null) {\n            advanceFiltered = true;\n            console.log(k + ' > ' + v);\n            $('.advanceSearchModal input[name=' + k + '],.advanceSearchModal select[name=' + k + ']').val(v).trigger('change');\n            $('.' + k + 'SelectedDateText').text(v);\n          }\n        });\n\n        if (advanceFiltered) {\n          $('.dt-button.btn-advanceSearchParameter').addClass('btn-success');\n        }\n        /*\n        clearing advanceSearchParameter\n        */\n\n\n        $('.advanceSearchModal .buttonClear').off('click');\n        $('.advanceSearchModal .buttonClear').on('click', function () {\n          $('.advanceSearchModal input,.advanceSearchModal select').val('').trigger('change');\n          $('.SelectedDateText').text('\\xa0');\n          var root = APP.OrderArchiveModule;\n          $.each(root.Opts.dataTable.advanceSearchParameter, function (k, v) {\n            root.Opts.dataTable.advanceSearchParameter[k] = null;\n          });\n          $('.dt-button.btn-advanceSearchParameter').removeClass('btn-success');\n          var dataTableCSSSelector = root.Opts.CSSSelectorContainer + ' .dataTable';\n          $(dataTableCSSSelector).DataTable().ajax.reload();\n          $('.advanceSearchModal').modal('hide');\n        });\n        /*\n        process advanceSearchParameter\n        */\n\n        $('.advanceSearchModal .buttonSave').off('click');\n        $('.advanceSearchModal .buttonSave').on('click', function () {\n          console.log('clicked advanced search ');\n          var root = APP.OrderArchiveModule;\n          var dataSearch = $('.advanceSearchModalForm').find('input,select').serializeArray();\n          console.log(dataSearch);\n          console.log(root.Opts);\n          console.log(root.Opts.dataTable.advanceSearchParameter);\n          $.each(root.Opts.dataTable.advanceSearchParameter, function (k, v) {\n            root.Opts.dataTable.advanceSearchParameter[k] = null;\n          });\n          $.each(dataSearch, function (k, item) {\n            console.log(item['name']);\n            console.log(item['value']);\n\n            if (typeof root.Opts.dataTable.advanceSearchParameter[item['name']] != 'undefined' && item['value'].length > 0) {\n              root.Opts.dataTable.advanceSearchParameter[item['name']] = item['value'];\n            }\n          });\n          console.log(root.Opts.dataTable.advanceSearchParameter);\n          var dataTableCSSSelector = root.Opts.CSSSelectorContainer + ' .dataTable';\n          $(dataTableCSSSelector).DataTable().ajax.reload();\n          $('.dt-button.btn-advanceSearchParameter').addClass('btn-success');\n          $('.advanceSearchModal').modal('hide');\n        });\n      }\n    }, {\n      key: \"initViewList\",\n      value: function initViewList() {\n        var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n        debug('listview inicialization');\n\n        if (APP.IsUserAdmin) {\n          this.DtColumns = [{\n            \"data\": \"supplier_name\"\n          }, {\n            \"data\": \"deliveryDate\"\n          }, {\n            \"data\": \"profit_center.name\"\n          }, {\n            \"data\": \"deliveryAddressName\"\n          }, {\n            \"data\": \"sentTime\"\n          }, {\n            \"data\": \"humanId\"\n          }, {\n            \"data\": \"confirmed\"\n          }, null];\n        } else {\n          this.DtColumns = [{\n            \"data\": \"supplier_name\"\n          }, {\n            \"data\": \"deliveryDate\"\n          }, {\n            \"data\": \"deliveryAddressName\"\n          }, {\n            \"data\": \"sentTime\"\n          }, {\n            \"data\": \"humanId\"\n          }, {\n            \"data\": \"confirmed\"\n          }, null];\n        }\n\n        var dataTableCSSSelector = this.Opts.CSSSelectorContainer + ' .dataTable'; //\n\n        var colNum = $(dataTableCSSSelector + ' thead th').length; //buttons insert position need\n\n        APP.setOpts({\n          //datatableRowActionButtonClickCallBack:this.datatableRowActionButtonClick,\n          datatableRowActionButtonClickCallBack: this.datatableRowActionButtonClick,\n          datatableCustomHeadButtonClickCallBack: this.datatableCustomHeadButtonClickCallBack\n        });\n        var orderDirective = this.Opts.dataTable.orderDirective;\n        var advanceSearchParameter = this.Opts.dataTable.advanceSearchParameter;\n\n        if (typeof options['orderDirective'] != 'undefined') {\n          orderDirective = options['orderDirective'];\n        } //let ajaxUrl=this.Opts.URL.getDataTableContent;\n\n\n        this.dataTable = $(dataTableCSSSelector).DataTable({\n          language: {\n            url: '//cdn.datatables.net/plug-ins/1.10.24/i18n/Hungarian.json'\n          },\n          //\"ajax\": \"{{asset('exapmle2.json')}}\",\n          \"ajax\": {\n            url: this.Opts.URL.getDataTableContent,\n            data: function data(_data) {\n              _data.advanceSearchParameter = advanceSearchParameter;\n              /*\n              data.searchParam=this.Opts.dataTable.advanceSearchParameter\n                                      data.searchStr=dataTableSearchStr;\n                                      data.groupId=selectedProductGroup;\n                                      data.supplierId=Order.supplierId;\n                                      data.deliveryDate=Order.deliveryDate;\n              */\n            }\n          },\n          \"columnDefs\": [{\n            \"targets\": colNum - 1,\n            \"render\": function render(data, type, row) {\n              var buttons = APP.datatableAddRowViewButton(0, arguments);\n              buttons += APP.datatableAddRowAttachmentButton(0, arguments); //buttons+=APP.datatableAddRowEditButton(0, arguments);\n\n              if (row.canEditable) {\n                buttons += APP.datatableAddRowEditButton(0, {\n                  title: \"módosítás\"\n                });\n              }\n\n              return buttons;\n            }\n          }, {\n            \"targets\": colNum - 2,\n            \"render\": function render(data, type, row) {\n              if (row.confirmed == null) {\n                return '<span class=\"badge badge-pill badge-danger\"><i class=\"fas fa-handshake-slash\"></i></span>';\n              } else {\n                return row.confirmed;\n              }\n            }\n          }, {\n            \"targets\": 1,\n            \"render\": function render(data, type, row) {\n              row = null;\n              return type === \"sort\" ? data.latinise() : data;\n            }\n          } //{ \"visible\": false,  \"targets\": [ 0 ] }\n          ],\n          buttons: {\n            buttons: ['excel', 'pdf', {\n              extend: 'print',\n              //text: 'Print current page',\n              'title': 'title custom text',\n              'messageTop': 'Message On Top',\n              autoPrint: true\n            }, {\n              text: 'Szürők',\n              action: function action(e, dt, node, config) {\n                APP.datatableCustomHeadButtonClickCallBack();\n              },\n              className: 'btn-advanceSearchParameter'\n            }\n            /**/\n            ]\n          },\n          \"columns\": this.DtColumns,\n          \"order\": orderDirective,\n          \"stateSave\": true,\n          \"drawCallback\": function drawCallback(settings) {\n            settings = null;\n            APP.datatableAddRowAction(dataTableCSSSelector);\n          }\n        });\n        this.initAdvancedSearch();\n        debug('listview end');\n      }\n    }]);\n\n    return OrderArchiveModule;\n  }(ModuleBase);\n\n  window.OrderArchiveModule = OrderArchiveModule;\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 33452 characters]\n//# sourceURL=webpack-internal:///./resources/js/moduleJs/orderArchive.js\n");

/***/ }),

/***/ "./resources/js/moduleJs/priceList.js":
/*!********************************************!*\
  !*** ./resources/js/moduleJs/priceList.js ***!
  \********************************************/
/***/ (() => {

eval("function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _get(target, property, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }\n\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nif (typeof window.PriceListModule === \"undefined\") {\n  var PriceListModule = /*#__PURE__*/function (_ModuleBase) {\n    _inherits(PriceListModule, _ModuleBase);\n\n    var _super = _createSuper(PriceListModule);\n\n    function PriceListModule() {\n      _classCallCheck(this, PriceListModule);\n\n      return _super.apply(this, arguments);\n    }\n\n    _createClass(PriceListModule, [{\n      key: \"datatableRowActionAttachment\",\n      value: function datatableRowActionAttachment(rowData, node) {\n        debug('call datatableRowActionAttachment');\n\n        _get(_getPrototypeOf(PriceListModule.prototype), \"datatableRowActionAttachment\", this).call(this, rowData, node, {\n          defaultFileName: \"arlista.xls\"\n        });\n      }\n    }, {\n      key: \"datatableRowActionView\",\n      value: function datatableRowActionView(rowData, node) {\n        debug('call datatableRowActionView');\n      }\n    }, {\n      key: \"datatableRowActionButtonClick\",\n      value: function datatableRowActionButtonClick(event) {\n        debug('datatableRowActionButtonClick');\n        var rootObj = APP.PriceListModule;\n        var node = $(event[0].currentTarget);\n        var row = $(rootObj.Opts.dataTable.CSSSelector).DataTable().row(node.parents('tr'));\n        var rowData = row.data();\n        var actionName = 'datatableRowAction' + node.data('buttontype').capitalize();\n\n        if (typeof rootObj[actionName] === \"function\") {\n          return rootObj[actionName](rowData, node);\n        }\n      }\n    }, {\n      key: \"initViewList\",\n      value: function initViewList() {\n        var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n        debug('listview inicialization');\n        var dataTableCSSSelector = this.Opts.CSSSelectorContainer + ' .dataTable'; //\n\n        var colNum = $(dataTableCSSSelector + ' thead th').length; //buttons insert position need\n\n        APP.setOpts({\n          //datatableRowActionButtonClickCallBack:this.datatableRowActionButtonClick,\n          datatableRowActionButtonClickCallBack: this.datatableRowActionButtonClick\n        });\n        var orderDirective = this.Opts.dataTable.orderDirective;\n\n        if (typeof options['orderDirective'] != 'undefined') {\n          orderDirective = options['orderDirective'];\n        } //let ajaxUrl=this.Opts.URL.getDataTableContent;\n\n\n        $(dataTableCSSSelector).DataTable({\n          language: {\n            url: '//cdn.datatables.net/plug-ins/1.10.24/i18n/Hungarian.json'\n          },\n          //\"ajax\": \"{{asset('exapmle2.json')}}\",\n          \"ajax\": {\n            url: this.Opts.URL.getDataTableContent,\n            data: function data(_data) {\n              /*\n                                      data.searchStr=dataTableSearchStr;\n                                      data.groupId=selectedProductGroup;\n                                      data.supplierId=Order.supplierId;\n                                      data.deliveryDate=Order.deliveryDate;\n              */\n            }\n          },\n          \"columnDefs\": [{\n            \"targets\": colNum - 1,\n            \"render\": function render(data, type, row) {\n              if (row.fileUrl) {\n                var buttons = APP.datatableAddRowAttachmentButton(0, arguments);\n                return buttons;\n              } else {\n                return '';\n              }\n            }\n          }\n          /* {\n               \"targets\": 1,\n               \"render\": function ( data, type, row ) {\n                   row=null;\n                   return type === \"sort\" ? data.latinise() : data;\n               },\n           },*/\n          //{ \"visible\": false,  \"targets\": [ 0 ] }\n          ],\n          buttons: {\n            buttons: [\n              /*      'excel','pdf',\n                    {\n                        extend: 'print',\n                        //text: 'Print current page',\n                        'title': 'title custom text',\n                        'messageTop': 'Message On Top',\n                        autoPrint: true\n                    },\n              */\n\n              /**/\n            ]\n          },\n          \"columns\": [{\n            \"data\": \"id\"\n          }, {\n            \"data\": \"supplierName\"\n          }, {\n            \"data\": \"available\"\n          }, {\n            \"data\": \"created_at\"\n          }, {\n            \"data\": \"note\"\n          }, null],\n          \"order\": orderDirective,\n          //\"stateSave\": true,\n          \"drawCallback\": function drawCallback(settings) {\n            settings = null;\n            APP.datatableAddRowAction(dataTableCSSSelector);\n          }\n        });\n        debug('listview end');\n      }\n    }]);\n\n    return PriceListModule;\n  }(ModuleBase);\n\n  ;\n  window.PriceListModule = PriceListModule;\n}\n\n;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 10800 characters]\n//# sourceURL=webpack-internal:///./resources/js/moduleJs/priceList.js\n");

/***/ }),

/***/ "./resources/js/moduleJs/supplier.js":
/*!*******************************************!*\
  !*** ./resources/js/moduleJs/supplier.js ***!
  \*******************************************/
/***/ (() => {

eval("function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _get(target, property, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }\n\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nif (typeof window.SupplierModule === \"undefined\") {\n  var SupplierModule = /*#__PURE__*/function (_ModuleBase) {\n    _inherits(SupplierModule, _ModuleBase);\n\n    var _super = _createSuper(SupplierModule);\n\n    function SupplierModule() {\n      _classCallCheck(this, SupplierModule);\n\n      return _super.apply(this, arguments);\n    }\n\n    _createClass(SupplierModule, [{\n      key: \"datatableRowActionAttachment\",\n      value: function datatableRowActionAttachment(rowData, node) {\n        debug('call datatableRowActionAttachment');\n\n        _get(_getPrototypeOf(SupplierModule.prototype), \"datatableRowActionAttachment\", this).call(this, rowData, node, {\n          defaultFileName: \"arlista.xls\"\n        });\n      }\n    }, {\n      key: \"datatableRowActionView\",\n      value: function datatableRowActionView(rowData, node) {\n        debug('call datatableRowActionView');\n\n        _get(_getPrototypeOf(SupplierModule.prototype), \"datatableRowActionView\", this).call(this, rowData, node, APP.SupplierModule);\n      }\n    }, {\n      key: \"datatableRowActionButtonClick\",\n      value: function datatableRowActionButtonClick(event) {\n        debug('datatableRowActionButtonClick');\n        var rootObj = APP.SupplierModule;\n        var node = $(event[0].currentTarget);\n        var row = $(rootObj.Opts.dataTable.CSSSelector).DataTable().row(node.parents('tr'));\n        var rowData = row.data();\n        var actionName = 'datatableRowAction' + node.data('buttontype').capitalize();\n\n        if (typeof rootObj[actionName] === \"function\") {\n          return rootObj[actionName](rowData, node);\n        }\n      }\n    }, {\n      key: \"initViewShow\",\n      value: function initViewShow() {\n        $('.productCategorySelect').select2({\n          disabled: true\n        });\n        $('.serviceSelect').select2({\n          disabled: true\n        });\n        APP.SupplierModule.renderContact();\n      }\n    }, {\n      key: \"initViewList\",\n      value: function initViewList() {\n        var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n        debug('listview inicialization');\n        var dataTableCSSSelector = this.Opts.CSSSelectorContainer + ' .dataTable'; //\n\n        var colNum = $(dataTableCSSSelector + ' thead th').length; //buttons insert position need\n\n        APP.setOpts({\n          //datatableRowActionButtonClickCallBack:this.datatableRowActionButtonClick,\n          datatableRowActionButtonClickCallBack: this.datatableRowActionButtonClick\n        });\n        var orderDirective = this.Opts.dataTable.orderDirective;\n\n        if (typeof options['orderDirective'] != 'undefined') {\n          orderDirective = options['orderDirective'];\n        } //let ajaxUrl=this.Opts.URL.getDataTableContent;\n\n\n        $(dataTableCSSSelector).DataTable({\n          language: {\n            url: '//cdn.datatables.net/plug-ins/1.10.24/i18n/Hungarian.json'\n          },\n          \"ajax\": {\n            url: this.Opts.URL.getDataTableContent,\n            data: function data(_data) {}\n          },\n          \"columnDefs\": [{\n            \"targets\": colNum - 1,\n            \"render\": function render(data, type, row) {\n              var buttons = APP.datatableAddRowViewButton(0, arguments);\n              return buttons;\n            }\n          }, {\n            \"targets\": colNum - 2,\n            \"className\": \"dt-center\",\n            \"render\": function render(data, type, row) {\n              if (row.canSeeInOrder == 1) {\n                return '<i class=\"fa fa-check-circle\" style=\"color: #087756;\"></i>';\n              } else {\n                return '<i class=\"fa fa-ban\" style=\"color: #ea1031;\"></i>';\n              }\n            }\n          }],\n          buttons: {\n            buttons: []\n          },\n          \"columns\": [{\n            \"data\": \"name\"\n          }, {\n            \"data\": \"product_group\"\n          }, {\n            \"data\": \"service\"\n          }, {\n            \"data\": \"canSeeInOrder\"\n          },\n          /*\n                                  { \"data\": \"hooreycaId\" },\n                                  { \"data\": \"nameId\" },\n                                  { \"data\": \"created_at\" },\n          */\n          null],\n          \"order\": orderDirective,\n          //\"stateSave\": true,\n          \"drawCallback\": function drawCallback(settings) {\n            settings = null;\n            APP.datatableAddRowAction(dataTableCSSSelector);\n          }\n        });\n        debug('listview end');\n      }\n    }, {\n      key: \"renderContact\",\n      value: function renderContact() {\n        var rowNum = 1;\n        console.log('renderingContacts');\n        $.each(APP.Supplier.getData('contact'), function () {\n          var contactData = this;\n          contactData.rowNum = rowNum; //console.log(contactData);\n\n          var template = $('template[data-name=\"supplierContactTableRow\"]').html();\n          var render = Mustache.render(template, contactData);\n          $('.contactTable tbody').append(render);\n          rowNum++;\n        });\n      }\n    }]);\n\n    return SupplierModule;\n  }(ModuleBase);\n\n  ;\n  window.SupplierModule = SupplierModule;\n}\n\n;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 12616 characters]\n//# sourceURL=webpack-internal:///./resources/js/moduleJs/supplier.js\n");

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	
/******/ 	// startup
/******/ 	// Load entry module and return exports
/******/ 	// This entry module can't be inlined because the eval-source-map devtool is used.
/******/ 	__webpack_modules__["./resources/js/moduleJs/moduleBase.js"]();
/******/ 	__webpack_modules__["./resources/js/moduleJs/order.js"]();
/******/ 	__webpack_modules__["./resources/js/moduleJs/orderArchive.js"]();
/******/ 	__webpack_modules__["./resources/js/moduleJs/priceList.js"]();
/******/ 	var __webpack_exports__ = {};
/******/ 	__webpack_modules__["./resources/js/moduleJs/supplier.js"]();
/******/ 	
/******/ })()
;