{"version":3,"file":"erp-wqUNgSfi.js","sources":["../../../app/frontend/entrypoints/controllers/erp/product/overview/show/erp.ts"],"sourcesContent":["import jQuery from 'jquery/dist/jquery';\nimport * as bootstrap from 'bootstrap'\nimport Utils from '../../../../../utils'\nimport ErpProductEntity from \"../../entity\";\nimport UtilsErp from \"../../../../../utils/erp\";\n\nexport default class ErpProductErp {\n private parent: any;\n private entity = \"erp/product\";\n private toastr: any;\n\n constructor(parent: any) {\n this.parent = parent\n this.toastr = parent.toastr\n this.bindListeners();\n }\n\n getEntityData(elem: any) {\n return {...ErpProductEntity.getEntityData(elem), id: this.parent.id}\n }\n\n fixSerials(serials: any) {\n if (serials.indexOf(\",\") !== -1) {\n serials = serials.split(\",\")\n }else if (serials.indexOf(\";\") !== -1) {\n serials = serials.split(\";\")\n } else if (serials.indexOf(\" \") !== -1) {\n serials = serials.split(\" \")\n } else if (serials.indexOf(\"\\n\") !== -1) {\n serials = serials.split(\"\\n\")\n }\n serials = typeof serials === 'object' ? serials : [serials]\n return serials.filter((n: any) => n).map((s: any) => s.replace(/,/g, \"\").replace(/ /g, \"\").replace(/;/g, \"\"))\n }\n checkDimensions(warehouseLocationId: string, amount: number) {\n return true;\n }\n\n bindListeners() {\n jQuery(\"#erp_product_erp_input_warehouse_location_id\").on(\"select2:select\", (e: any) => {\n (document.querySelector(\"#erp_product_erp_input_warehouse_location_pallet_id\") as HTMLSelectElement).disabled = false\n });\n jQuery(\"#erp_product_erp_output_warehouse_location_id\").on(\"select2:select\", (e: any) => {\n (document.querySelector(\"#erp_product_erp_output_warehouse_location_pallet_id\") as HTMLSelectElement).disabled = false\n });\n\n jQuery(\"#erp_product_erp_move_warehouse_location_id\").on(\"select2:select\", (e: any) => {\n (document.querySelector(\"#erp_product_erp_move_warehouse_location_pallet_id\") as HTMLSelectElement).disabled = false\n });\n jQuery(\"#erp_product_erp_move_new_warehouse_location_id\").on(\"select2:select\", (e: any) => {\n (document.querySelector(\"#erp_product_erp_move_new_warehouse_location_pallet_id\") as HTMLSelectElement).disabled = false\n });\n (document.querySelector(\"#erp_product_erp_output_serials\") as HTMLTextAreaElement).addEventListener(\"change\", (e) => {\n const target = e.target as HTMLTextAreaElement\n target.value = this.fixSerials(target.value).join(\";\")\n });\n (document.querySelector(\"#erp_product_erp_move_serials\") as HTMLTextAreaElement).addEventListener(\"change\", (e) => {\n const target = e.target as HTMLTextAreaElement\n target.value = this.fixSerials(target.value).join(\";\")\n });\n (document.querySelector(\"#erp_product_erp_input_serials\") as HTMLTextAreaElement).addEventListener(\"change\", (e) => {\n const target = e.target as HTMLTextAreaElement\n target.value = this.fixSerials(target.value).join(\";\")\n });\n\n (document.querySelector(\"#erpProductErpInputForm\") as HTMLFormElement).addEventListener(\"submit\", async (e) => {\n e.preventDefault()\n const form = (document.querySelector(\"#erpProductErpInputForm\") as HTMLFormElement);\n\n const warehouseId = (form.querySelector(\"#erp_product_erp_input_warehouse_id option:checked\") as HTMLSelectElement)?.value;\n const warehouseLocationId = (form.querySelector(\"#erp_product_erp_input_warehouse_location_id option:checked\") as HTMLSelectElement)?.value;\n const warehouseLocationPalletId = (form.querySelector(\"#erp_product_erp_input_warehouse_location_pallet_id option:checked\") as HTMLSelectElement)?.value;\n const customerId = (form.querySelector(\"#erp_product_erp_input_customer_id option:checked\") as HTMLSelectElement)?.value;\n const amount = parseInt((form.querySelector(\"#erp_product_erp_input_amount\") as HTMLInputElement).value);\n const bestBefore = (form.querySelector(\"#erp_product_erp_input_bestBefore\") as HTMLInputElement).value;\n const comment = (form.querySelector(\"#erp_product_erp_input_comment\") as HTMLInputElement).value;\n const storedAt = (form.querySelector(\"#erp_product_erp_input_storedAt\") as HTMLInputElement).value;\n const supplierId = (form.querySelector(\"#erp_product_erp_input_supplier_id option:checked\") as HTMLSelectElement)?.value;\n const serials = this.fixSerials((form.querySelector(\"#erp_product_erp_input_serials\") as HTMLInputElement).value);\n\n\n if (!warehouseId) {\n this.toastr.error(`${Utils.translate('warehouse_location.name')} ${Utils.translate('warehouse_location.messages.warehouse_not_set')}`, `${Utils.translate('generic.error')}`)\n return\n }\n if (!warehouseLocationId) {\n this.toastr.error(`${Utils.translate('warehouse_location.name')} ${Utils.translate('warehouse_location.messages.warehouse_location_not_set')}`, `${Utils.translate('generic.error')}`)\n return\n }\n if (!amount || amount <= 0) {\n this.toastr.error(`${Utils.translate('warehouse_location.name')} ${Utils.translate('warehouse_location.messages.amount_not_set')}`, `${Utils.translate('generic.error')}`)\n return\n }\n if (serials.length !== amount && serials.length > 0) {\n this.toastr.error(`${Utils.translate('warehouse_location.name')} ${Utils.translate('warehouse_location.messages.amount_not_matching_serials')}`, `${Utils.translate('generic.error')}`)\n return\n }\n const dimCheckResult = await this.checkDimensions(warehouseLocationId, amount);\n\n let data = {\n id: null,\n productId: this.parent.id,\n warehouseId: warehouseId,\n warehouseLocationId: warehouseLocationId,\n warehousePalletId: warehouseLocationPalletId,\n customerId: customerId,\n serials: serials,\n stock: amount,\n storedAt: storedAt\n }\n await Utils.showLoader();\n await Utils.entity.upsert(data, \"erp/stocks\")\n form.reset()\n jQuery('#erp_product_erp_input_warehouse_id').val(null).trigger('change');\n jQuery('#erp_product_erp_input_warehouse_location_id').val(null).trigger('change');\n jQuery('#erp_product_erp_input_supplier_id').val(null).trigger('change');\n jQuery('#erp_product_erp_input_warehouse_location_pallet_id').val(null).trigger('change');\n (document.querySelector(\"#erp_product_erp_input_warehouse_location_pallet_id\") as HTMLSelectElement).disabled = true\n\n this.toastr.success(`${Utils.translate('warehouse_location.name')} ${Utils.translate('warehouse_location.messages.input_success')}`, `${Utils.translate('generic.success')}`)\n await this.parent.getEntity()\n });\n\n (document.querySelector(\"#erpProductErpOutputForm\") as HTMLFormElement).addEventListener(\"submit\", async (e) => {\n e.preventDefault()\n const form = (document.querySelector(\"#erpProductErpOutputForm\") as HTMLFormElement);\n\n const warehouseId = (form.querySelector(\"#erp_product_erp_output_warehouse_id option:checked\") as HTMLSelectElement)?.value;\n const warehouseLocationId = (form.querySelector(\"#erp_product_erp_output_warehouse_location_id option:checked\") as HTMLSelectElement)?.value;\n const warehouseLocationPalletId = (form.querySelector(\"#erp_product_erp_output_warehouse_location_pallet_id option:checked\") as HTMLSelectElement)?.value;\n\n const customerId = (form.querySelector(\"#erp_product_erp_output_customer_id option:checked\") as HTMLSelectElement)?.value;\n const amount = parseInt((form.querySelector(\"#erp_product_erp_output_amount\") as HTMLInputElement).value);\n const bestBefore = (form.querySelector(\"#erp_product_erp_output_bestBefore\") as HTMLInputElement).value;\n const comment = (form.querySelector(\"#erp_product_erp_output_comment\") as HTMLInputElement).value;\n const supplierId = (form.querySelector(\"#erp_product_erp_output_supplier_id option:checked\") as HTMLSelectElement)?.value;\n const serials = this.fixSerials((form.querySelector(\"#erp_product_erp_output_serials\") as HTMLInputElement).value);\n\n\n if (!warehouseId) {\n this.toastr.error(`${Utils.translate('warehouse_location.name')} ${Utils.translate('warehouse_location.messages.warehouse_not_set')}`, `${Utils.translate('generic.error')}`)\n return\n }\n if (!warehouseLocationId) {\n this.toastr.error(`${Utils.translate('warehouse_location.name')} ${Utils.translate('warehouse_location.messages.warehouse_location_not_set')}`, `${Utils.translate('generic.error')}`)\n return\n }\n if (!amount || amount <= 0) {\n this.toastr.error(`${Utils.translate('warehouse_location.name')} ${Utils.translate('warehouse_location.messages.amount_not_set')}`, `${Utils.translate('generic.error')}`)\n return\n }\n if (serials.length !== amount && serials.length > 0) {\n this.toastr.error(`${Utils.translate('warehouse_location.name')} ${Utils.translate('warehouse_location.messages.amount_not_matching_serials')}`, `${Utils.translate('generic.error')}`)\n return\n }\n await Utils.showLoader();\n const data = await UtilsErp.outputProducts({\n productId: this.parent.id,\n warehousePalletId: warehouseLocationPalletId,\n customerId: customerId,\n warehouseLocationId: warehouseLocationId,\n warehouseId: warehouseId,\n serials: serials,\n quantity: amount\n })\n const messages = [];\n if (data && data.status === 200) {\n if (data.quantity !== 0) {\n if (data.quantity !== amount) {\n messages.push(`${amount - data.quantity} successfully outsourced.`)\n }\n messages.push(`${data.quantity} products could not get outsourced.`)\n }\n if (data.serials.length !== 0) {\n messages.push(`${data.serials.join(\", \")} serials not found in warehouse.`)\n }\n }\n\n if (messages.length > 0) {\n this.toastr.warning(`${messages.join(\"
\")}`, `${Utils.translate('generic.warning')}`)\n\n } else {\n this.toastr.success(`${Utils.translate('warehouse_location.name')} ${Utils.translate('warehouse_location.messages.output_success')}`, `${Utils.translate('generic.success')}`)\n\n form.reset()\n jQuery('#erp_product_erp_output_warehouse_id').val(null).trigger('change');\n jQuery('#erp_product_erp_output_warehouse_location_id').val(null).trigger('change');\n jQuery('#erp_product_erp_output_supplier_id').val(null).trigger('change');\n jQuery('#erp_product_erp_output_warehouse_location_pallet_id').val(null).trigger('change');\n (document.querySelector(\"#erp_product_erp_output_warehouse_location_pallet_id\") as HTMLSelectElement).disabled = true\n }\n await this.parent.getEntity()\n });\n\n (document.querySelector(\"#erpProductErpMoveForm\") as HTMLFormElement).addEventListener(\"submit\", async (e) => {\n e.preventDefault()\n const form = (document.querySelector(\"#erpProductErpMoveForm\") as HTMLFormElement);\n\n const warehouseId = (form.querySelector(\"#erp_product_erp_move_warehouse_id option:checked\") as HTMLSelectElement)?.value;\n const warehouseLocationId = (form.querySelector(\"#erp_product_erp_move_warehouse_location_id option:checked\") as HTMLSelectElement)?.value;\n const warehouseLocationPalletId = (form.querySelector(\"#erp_product_erp_move_warehouse_location_pallet_id option:checked\") as HTMLSelectElement)?.value;\n\n const warehouseIdNew = (form.querySelector(\"#erp_product_erp_move_new_warehouse_id option:checked\") as HTMLSelectElement)?.value;\n const warehouseLocationIdNew = (form.querySelector(\"#erp_product_erp_move_new_warehouse_location_id option:checked\") as HTMLSelectElement)?.value;\n const warehouseLocationPalletIdNew = (form.querySelector(\"#erp_product_erp_move_new_warehouse_location_pallet_id option:checked\") as HTMLSelectElement)?.value;\n\n const amount = parseInt((form.querySelector(\"#erp_product_erp_move_amount\") as HTMLInputElement).value);\n const customerId = (form.querySelector(\"#erp_product_erp_move_customer_id option:checked\") as HTMLSelectElement)?.value;\n const newCustomerId = (form.querySelector(\"#erp_product_erp_move_new_customer_id option:checked\") as HTMLSelectElement)?.value;\n\n const serials = this.fixSerials((form.querySelector(\"#erp_product_erp_move_serials\") as HTMLInputElement).value);\n\n\n\n if (!warehouseId || !warehouseIdNew) {\n this.toastr.error(`${Utils.translate('warehouse_location.name')} ${Utils.translate('warehouse_location.messages.warehouse_not_set')}`, `${Utils.translate('generic.error')}`)\n return\n }\n if (!warehouseLocationId || !warehouseLocationIdNew) {\n this.toastr.error(`${Utils.translate('warehouse_location.name')} ${Utils.translate('warehouse_location.messages.warehouse_location_not_set')}`, `${Utils.translate('generic.error')}`)\n return\n }\n if (!amount || amount <= 0) {\n this.toastr.error(`${Utils.translate('warehouse_location.name')} ${Utils.translate('warehouse_location.messages.amount_not_set')}`, `${Utils.translate('generic.error')}`)\n return\n }\n if (serials.length !== amount && serials.length > 0) {\n this.toastr.error(`${Utils.translate('warehouse_location.name')} ${Utils.translate('warehouse_location.messages.amount_not_matching_serials')}`, `${Utils.translate('generic.error')}`)\n return\n }\n\n await Utils.showLoader();\n const data = await UtilsErp.moveProducts({\n productId: this.parent.id,\n warehousePalletId: warehouseLocationPalletId,\n newWarehousePalletId: warehouseLocationPalletIdNew,\n customerId: customerId,\n newCustomerId: newCustomerId,\n warehouseLocationId: warehouseLocationId,\n newWarehouseLocationId: warehouseLocationIdNew,\n warehouseId: warehouseId,\n newWarehouseId: warehouseIdNew,\n serials: serials,\n quantity: amount\n })\n const messages = [];\n if (data && data.status === 200) {\n if (data.quantity !== 0) {\n if (data.quantity !== amount) {\n messages.push(`${amount - data.quantity} successfully moved.`)\n }\n messages.push(`${data.quantity} products could not get moved.`)\n }\n if (data.serials.length !== 0) {\n messages.push(`${data.serials.join(\", \")} serials not found in warehouse.`)\n }\n }\n\n if (messages.length > 0) {\n this.toastr.warning(`${messages.join(\"
\")}`, `${Utils.translate('generic.warning')}`)\n } else {\n form.reset();\n await Utils.hideLoader();\n jQuery('#erp_product_erp_move_warehouse_id').val(null).trigger('change');\n jQuery('#erp_product_erp_move_warehouse_location_id').val(null).trigger('change');\n jQuery('#erp_product_erp_move_new_warehouse_id').val(null).trigger('change');\n jQuery('#erp_product_erp_move_new_warehouse_location_id').val(null).trigger('change');\n jQuery('#erp_product_erp_move_warehouse_location_pallet_id').val(null).trigger('change');\n jQuery('#erp_product_erp_move_new_warehouse_location_pallet_id').val(null).trigger('change');\n (document.querySelector(\"#erp_product_erp_move_warehouse_location_pallet_id\") as HTMLSelectElement).disabled = true;\n (document.querySelector(\"#erp_product_erp_move_new_warehouse_location_pallet_id\") as HTMLSelectElement).disabled = true;\n\n this.toastr.success(`${Utils.translate('warehouse_location.name')} ${Utils.translate('warehouse_location.messages.move_success')}`, `${Utils.translate('generic.success')}`)\n }\n await this.parent.getEntity()\n });\n\n }\n\n onCreateNewElement(data: any, entity: any) {\n if (entity === \"erp/warehouse_location_pallets\") {\n let val = (document.querySelector(\"#erp_product_erp_input_warehouse_location_id option:checked\") as HTMLSelectElement)?.value\n if (!val) {\n val = (document.querySelector(\"#erp_product_erp_move_new_warehouse_location_id option:checked\") as HTMLSelectElement)?.value\n }\n return {\n warehouse_location_id: val\n }\n } else{\n return {}\n }\n }\n onSelectGetFilterOptions(elem: any) {\n if (elem.getAttribute(\"id\") === \"erp_product_erp_input_warehouse_location_id\") {\n return {\n warehouse_id: (document.querySelector(\"#erp_product_erp_input_warehouse_id option:checked\") as HTMLSelectElement)?.value\n }\n } else if (elem.getAttribute(\"id\") === \"erp_product_erp_input_supplier_id\") {\n return {\n product_id: this.parent.id\n }\n } else if (elem.getAttribute(\"id\") === \"erp_product_erp_input_warehouse_location_pallet_id\") {\n return {\n warehouse_location_id: (document.querySelector(\"#erp_product_erp_input_warehouse_location_id option:checked\") as HTMLSelectElement)?.value\n }\n } else if (elem.getAttribute(\"id\") === \"erp_product_erp_output_warehouse_location_pallet_id\") {\n return {\n warehouse_location_id: (document.querySelector(\"#erp_product_erp_output_warehouse_location_id option:checked\") as HTMLSelectElement)?.value\n }\n } else if (elem.getAttribute(\"id\") === \"erp_product_erp_move_warehouse_location_pallet_id\") {\n return {\n warehouse_location_id: (document.querySelector(\"#erp_product_erp_move_warehouse_location_id option:checked\") as HTMLSelectElement)?.value\n }\n } else if (elem.getAttribute(\"id\") === \"erp_product_erp_move_new_warehouse_location_pallet_id\") {\n return {\n warehouse_location_id: (document.querySelector(\"#erp_product_erp_move_new_warehouse_location_id option:checked\") as HTMLSelectElement)?.value\n }\n } else if (elem.getAttribute(\"id\") === \"erp_product_erp_output_warehouse_id\") {\n return {\n product_id: this.parent.id,\n }\n } else if (elem.getAttribute(\"id\") === \"erp_product_erp_output_warehouse_location_id\") {\n return {\n warehouse_id: (document.querySelector(\"#erp_product_erp_output_warehouse_id option:checked\") as HTMLSelectElement)?.value,\n product_id: this.parent.id,\n }\n\n } else if (elem.getAttribute(\"id\") === \"erp_product_erp_output_customer_id\") {\n const customerId = (document.querySelector(\"#erp_product_erp_output_customer_id option:checked\") as HTMLSelectElement)?.value\n const warehouseLocationId = (document.querySelector(\"#erp_product_erp_output_warehouse_location_id option:checked\") as HTMLSelectElement)?.value\n return {\n customer_id: customerId,\n }\n\n } else if (elem.getAttribute(\"id\") === \"erp_product_erp_move_warehouse_id\") {\n return {\n product_id: this.parent.id,\n }\n } else if (elem.getAttribute(\"id\") === \"erp_product_erp_move_warehouse_location_id\") {\n return {\n warehouse_id: (document.querySelector(\"#erp_product_erp_move_warehouse_id option:checked\") as HTMLSelectElement)?.value,\n product_id: this.parent.id\n }\n\n } else if (elem.getAttribute(\"id\") === \"erp_product_erp_move_new_warehouse_location_id\") {\n return {\n warehouse_id: (document.querySelector(\"#erp_product_erp_move_new_warehouse_id option:checked\") as HTMLSelectElement)?.value,\n }\n }\n return {}\n }\n\n async update(data: any) {\n await Utils.updateElements(data, '', (document.querySelector(\"#erp_product_erp\") as HTMLElement))\n }\n}"],"names":[],"mappings":";;;;;;AAM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