diff --git a/app.log.1 b/app.log.1 index c8827163..9d60fb31 100644 --- a/app.log.1 +++ b/app.log.1 @@ -1,9 +1,10 @@ -Request: 127.0.0.1 GET http /store/stock_items? Host: 127.0.0.1:5000 +Server Error: 'order' is undefined +Request: 127.0.0.1 GET http /store/manufacturing_purchase_orders?active=true&date_from=&date_to= Host: 127.0.0.1:5000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8 Accept-Language: en-GB,en;q=0.5 Accept-Encoding: gzip, deflate, br, zstd -Referer: http://127.0.0.1:5000/store/stock_items +Referer: http://127.0.0.1:5000/store/manufacturing_purchase_orders Dnt: 1 Connection: keep-alive Cookie: session=.eJytVlnzokgS_yoTRsw8tTY3-I_omPUCRUFB5HohCgqkuOUQcba_-xba090PM3tErKFYVZlk_rLy_GMCujYua9SE8NKE9eTjj0kACg_AHBVe05Z1OPlo6y789NNx92J8n4Y5QNnkYxLCHtRwliMIs7AtiyZHbfyP60idBWU--TSJUN20BcixwIkRQjjgMwS9oKvrsAgGD4YR6LJ28lF0WfYi1eEVlcVfEN4AyO9rbzSCwHJf___kWIHy52wgzFlIzAFP-IAkojAaFTbeC7F3D2sUoRBOPiKQNeGLgoog62AIPXNh_ND6thOTm67Cqn42vunqbwYpf9o9PY-GT77i-2rqyGvLNCwwXRB4GvoszUOf8Sma4aM5iCDPBYAGfsBAjgwYBkQjxO6bG0AQhE3zXUI4yLEvBeiI5BTYO3RYyZmfK-N-qSQXSidUdYd6BGz1uUtKBLY6EWwV7jDMU9d2Wr-AMXjuejVxMzdxy6OUMT5iyWBgY2jrpbJiE58i7ruCmM2yYR07BymE20hQltPHzAY9BQ5hOOzkRxAuTpDfXPcBf1k5WqwkR7Pzbmia7hQa3oZpxisnehCEqiwqLNObAzdvJG9nZ-fl9rjyjuyFcKfF5tjXTqG5BwJJ0cUs_eXtcSMYLQMFeZUOmmYe2cUmhsxG7rWkCfa5LW7OMbewDZgF5Wmf7kuFAVAMH1YfXwGFhFt89_VrMqUV0hC0Y5prvM3Ep6FYnWMPLabZahk3tkPvXdJJ85vqhY7DlGtIOf0wn9bLpa4_uav0kM3W8LeOH9JFGCy1WFRvuju9IQSyA9_4oi2ea49doPVD3YBeXhUaH2e6mapphD8VEDtVX9erjXNMTnpJ80fBuSnlNmF4Mr1uzQXTi8fDvCr4mamrZsoB1ScEw7rtnXK7aOMrDoPwUaE6bDyAQ5DkaYKlBZ4hfpwjHBQCxxDEKwv-IkrOl-eOVNGu2RU6G6x23C6tbHOF93lbueO-MO-h7V70lGH8RL672ytppuJBEWNSH-T5DAvrgKXWfi627hm_kJsppMTBXbEtsPTUl0zCp9inb2UEeAlmY9-6jMozdwvjINc6TEtd6ZFBad4FFFlBKV64FBkDq-8cat6OIRtIWQK35vDWERNwu3wekXDHoVkEuUg5th4H6B2eju3GUBKHw_PydNdqriQaoaxhqhrYWMphVMkZVEqNlXXAqE8duWuHONHKXF1fe7nYzQMpyN01WcKt3gfD5amdL4OO8C9XU5wOP6dCpqRYVy4Sji0_ZUOWXEvrAoktRszQXqYYV-aK8xiOl5nseoylVYxNq6zFi7JOOcXYcUqy6NRkR1ijI3KzdaysGdPTtXQay00POVm5kt64tn73C7UFWL8mwRffIVfv_vnHezbtZkGe5cAy011S5Y71eLrn_0PKY3sce5SJcRHwFtr6w0hJW6NiA9jxw3jim8pEzkxjW7PE7JxW3CVPxxJUObaGjsmGVp4LAvvgqa43I15mDDjFCJ7KWmOOa4VQMM6ANtGoA-siwHopqMmFUfIdq1oKczTMVFlnsfpcIsfY9G5u5q_YoLIXLjiQB42a67CQGWDLJyeraJcUKD3TCTNnVZDN-3Mi5gYOfoyrw3GZvOIpc4twuzyqWUUGhTzArfwEKXwopk6PpY5Y0ftSbp4N78ie3YpSRjuNtKF2REzu-ao-S_paR5vBH7RtqnJSdMYu4pfirlxCkzUXIHxKp1ogqelq6kVRcjuTlFzsiUQPs3XkWNJpfbBbfi8AckvkLmE0XlFFmtXpzVEn6bO5BzVdbC3y0TgU0THzm8F14uZeMqIBVHqeeO5GmhtHK6UYQyCHRcI30y6trekuue0HizkfdG5FMEkxZzyRmMY6cuim5S7DihrurFwXSb8ZiL1U-CIuyYfFpRZYjznQvtCtuRNvIunsOewRy3oKnV4fUL9cZXsqOxfafNke79Hl_mgAjFJyoWngXq7tYR-ZnPpQROoiOMF0X516m1tSJojP7F0HvGSO9asJymrsjPhZIPhLVZcRysJf3vPCp8mrYHnt8OJZhqDGTe_d-1ARla_-1-HmPLlKydDeVMVaxWf0uB15Stee5tbCFy_LOL8n_8sI8jetH5fUd41lBIFmxrHiz6LLsNT7oGmwgrhtq-bj82cY3qdFD1KK4Lgw4mIBPYpZ18xe08eo6jPW9W0w-M-gChSk_455ZCmLYKSb10elci6emOq2bhLpRho9JlcoaLtxUPuOsJlda3AHLahfcN7LzywN6YhiGIKHLMXykcBEFB8AgsedxYcc83vzhRGI3-ov1fU3-OUl61d68Ssl4m8Aix_24f1bZINXIZxVxcvjaHRYP92vSu1eP1B99N3-6nGi0ZqFkniVTEaHF2Pn_zezWldB0OJpbHTGhCIoZkqSU4I0iPkHSX1QxIyjGHfy9evXfwErYp4O.ZySbdA.IOzQ4B0k8HNh-01pbYKqF3sN8jI @@ -18,86 +19,75 @@ Priority: u=0, i Request data: b'' Traceback: Traceback (most recent call last): - File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\base.py", line 1967, in _exec_single_context - self.dialect.do_execute( - File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\default.py", line 924, in do_execute - cursor.execute(statement, parameters) - File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\MySQLdb\cursors.py", line 179, in execute - res = self._query(mogrified_query) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\MySQLdb\cursors.py", line 330, in _query - db.query(q) - File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\MySQLdb\connections.py", line 261, in query - _mysql.connection.query(self, query) -MySQLdb.OperationalError: (1054, "Unknown column 'SL.id_storage_location' in 'field list'") - -The above exception was the direct cause of the following exception: - -Traceback (most recent call last): File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request rv = self.dispatch_request() ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 865, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\controllers\store\stock_item.py", line 40, in stock_items - model = Model_View_Store_Stock_Item(form_filters) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\models\model_view_store_stock_item.py", line 93, in __init__ - self.storage_locations = self.get_many_storage_location(False) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\models\model_view_store.py", line 499, in get_many_storage_location - storage_locations = DataStore_Store_Base().get_many_storage_location(get_inactive) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\datastores\datastore_store_base.py", line 236, in get_many_storage_location - result = self.db_procedure_execute(_m_db_storage_location, argument_dict_list_storage_location) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\datastores\datastore_base.py", line 95, in db_procedure_execute - result = db.session.execute(proc_string, argument_dict_list) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\orm\scoping.py", line 778, in execute - return self._proxied.execute( - ^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\orm\session.py", line 2351, in execute - return self._execute_internal( + File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\controllers\store\manufacturing_purchase_order.py", line 43, in manufacturing_purchase_orders + return render_template('pages/store/_manufacturing_purchase_orders.html', model = model, datetime = datetime) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\templating.py", line 150, in render_template + return _render(app, template, context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\templating.py", line 131, in _render + rv = template.render(context) + ^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\jinja2\environment.py", line 1304, in render + self.environment.handle_exception() + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\jinja2\environment.py", line 939, in handle_exception + raise rewrite_traceback_stack(source=source) + File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\templates\pages\store\_manufacturing_purchase_orders.html", line 1, in top-level template code + {% extends 'layouts/layout.html' %} + ^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\templates\layouts\layout.html", line 354, in top-level template code + {% block page_body %}{% endblock %} + ^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\templates\pages\store\_manufacturing_purchase_orders.html", line 62, in block 'page_body' + {% include 'components/store/_row_manufacturing_purchase_order.html' %} + ^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\templates\components\store\_row_manufacturing_purchase_order.html", line 40, in top-level template code + + ^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\jinja2\environment.py", line 487, in getattr + return getattr(obj, attribute) ^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\orm\session.py", line 2245, in _execute_internal - result = conn.execute( - ^^^^^^^^^^^^^ - File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\base.py", line 1418, in execute - return meth( - ^^^^^ - File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\sql\elements.py", line 515, in _execute_on_connection - return connection._execute_clauseelement( - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\base.py", line 1640, in _execute_clauseelement - ret = self._execute_context( - ^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\base.py", line 1846, in _execute_context - return self._exec_single_context( - ^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\base.py", line 1986, in _exec_single_context - self._handle_dbapi_exception( - File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\base.py", line 2353, in _handle_dbapi_exception - raise sqlalchemy_exception.with_traceback(exc_info[2]) from e - File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\base.py", line 1967, in _exec_single_context - self.dialect.do_execute( - File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\default.py", line 924, in do_execute - cursor.execute(statement, parameters) - File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\MySQLdb\cursors.py", line 179, in execute - res = self._query(mogrified_query) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\MySQLdb\cursors.py", line 330, in _query - db.query(q) - File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\MySQLdb\connections.py", line 261, in query - _mysql.connection.query(self, query) -sqlalchemy.exc.OperationalError: (MySQLdb.OperationalError) (1054, "Unknown column 'SL.id_storage_location' in 'field list'") -[SQL: CALL p_shop_get_many_storage_location(%s)] -[parameters: (0,)] -(Background on this error at: https://sqlalche.me/e/20/e3q8) +jinja2.exceptions.UndefinedError: 'order' is undefined config_env: development -Server Error: (MySQLdb.OperationalError) (1054, "Unknown column 'SL.id_storage_location' in 'field list'") -[SQL: CALL p_shop_get_many_storage_location(%s)] -[parameters: (0,)] +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: production +config_env: production +Server Error: (MySQLdb.OperationalError) (1054, "Unknown column 'v_id_permission_manufacturing' in 'where clause'") +[SQL: CALL p_shop_get_many_manufacturing_purchase_order(%s, %s, %s, %s, %s, %s, %s, %s)] +[parameters: (0, True, True, '', '', None, None, 0)] (Background on this error at: https://sqlalche.me/e/20/e3q8) +Request: 127.0.0.1 GET http /store/manufacturing_purchase_orders?active=true&date_from=&date_to= Host: 127.0.0.1:5000 +User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:132.0) Gecko/20100101 Firefox/132.0 +Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 +Accept-Language: en-GB,en;q=0.5 +Accept-Encoding: gzip, deflate, br, zstd +Referer: http://127.0.0.1:5000/store/manufacturing_purchase_orders?active=true&date_from=&date_to= +Dnt: 1 +Connection: keep-alive +Upgrade-Insecure-Requests: 1 +Sec-Fetch-Dest: document +Sec-Fetch-Mode: navigate +Sec-Fetch-Site: same-origin +Sec-Gpc: 1 +Priority: u=0, i + + +Request data: b'' diff --git a/app.log.2 b/app.log.2 index 419f8830..7d33755e 100644 --- a/app.log.2 +++ b/app.log.2 @@ -1,4 +1,3 @@ -Server Error: 'NoneType' object has no attribute 'to_json' Request: 127.0.0.1 GET http /store/stock_items? Host: 127.0.0.1:5000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8 @@ -19,51 +18,159 @@ Priority: u=0, i Request data: b'' Traceback: Traceback (most recent call last): + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\base.py", line 1967, in _exec_single_context + self.dialect.do_execute( + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\default.py", line 924, in do_execute + cursor.execute(statement, parameters) + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\MySQLdb\cursors.py", line 179, in execute + res = self._query(mogrified_query) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\MySQLdb\cursors.py", line 330, in _query + db.query(q) + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\MySQLdb\connections.py", line 261, in query + _mysql.connection.query(self, query) +MySQLdb.OperationalError: (1054, "Unknown column 'SL.id_storage_location' in 'field list'") + +The above exception was the direct cause of the following exception: + +Traceback (most recent call last): File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request rv = self.dispatch_request() ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 865, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\controllers\store\stock_item.py", line 45, in stock_items - return render_template('pages/store/_stock_items.html', model = model, datetime = datetime) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\templating.py", line 150, in render_template - return _render(app, template, context) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\templating.py", line 131, in _render - rv = template.render(context) - ^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\jinja2\environment.py", line 1304, in render - self.environment.handle_exception() - File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\jinja2\environment.py", line 939, in handle_exception - raise rewrite_traceback_stack(source=source) - File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\templates\pages\store\_stock_items.html", line 1, in top-level template code - {% extends 'layouts/layout.html' %} - ^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\templates\layouts\layout.html", line 354, in top-level template code - {% block page_body %}{% endblock %} - ^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\templates\pages\store\_stock_items.html", line 119, in block 'page_body' - var plants = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.plants) | tojson | safe }}; - ^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\models\model_view_base.py", line 358, in convert_list_objects_to_dict_json_by_attribute_key_default - return Model_View_Base.convert_list_objects_to_dict_json_by_attribute_key(list_objects, getattr(obj_class, obj_class.FLAG_NAME_ATTR_OPTION_VALUE)) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\models\model_view_base.py", line 346, in convert_list_objects_to_dict_json_by_attribute_key - return {getattr(obj, key): obj.to_json() for obj in list_objects} - ^^^^^^^^^^^^^ - File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\business_objects\store\plant.py", line 79, in to_json - self.FLAG_ADDRESS: None if self.address is None else self.address.to_json(), - ^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\business_objects\address.py", line 85, in to_json - self.FLAG_REGION: self.region.to_json(), - ^^^^^^^^^^^^^^^^^^^ -AttributeError: 'NoneType' object has no attribute 'to_json' - -config_env: development -config_env: development -Server Error: (MySQLdb.OperationalError) (1054, "Unknown column 'SL.id_storage_location' in 'field list'") + File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\controllers\store\stock_item.py", line 40, in stock_items + model = Model_View_Store_Stock_Item(form_filters) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\models\model_view_store_stock_item.py", line 93, in __init__ + self.storage_locations = self.get_many_storage_location(False) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\models\model_view_store.py", line 499, in get_many_storage_location + storage_locations = DataStore_Store_Base().get_many_storage_location(get_inactive) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\datastores\datastore_store_base.py", line 236, in get_many_storage_location + result = self.db_procedure_execute(_m_db_storage_location, argument_dict_list_storage_location) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\datastores\datastore_base.py", line 95, in db_procedure_execute + result = db.session.execute(proc_string, argument_dict_list) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\orm\scoping.py", line 778, in execute + return self._proxied.execute( + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\orm\session.py", line 2351, in execute + return self._execute_internal( + ^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\orm\session.py", line 2245, in _execute_internal + result = conn.execute( + ^^^^^^^^^^^^^ + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\base.py", line 1418, in execute + return meth( + ^^^^^ + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\sql\elements.py", line 515, in _execute_on_connection + return connection._execute_clauseelement( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\base.py", line 1640, in _execute_clauseelement + ret = self._execute_context( + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\base.py", line 1846, in _execute_context + return self._exec_single_context( + ^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\base.py", line 1986, in _exec_single_context + self._handle_dbapi_exception( + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\base.py", line 2353, in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\base.py", line 1967, in _exec_single_context + self.dialect.do_execute( + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\default.py", line 924, in do_execute + cursor.execute(statement, parameters) + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\MySQLdb\cursors.py", line 179, in execute + res = self._query(mogrified_query) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\MySQLdb\cursors.py", line 330, in _query + db.query(q) + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\MySQLdb\connections.py", line 261, in query + _mysql.connection.query(self, query) +sqlalchemy.exc.OperationalError: (MySQLdb.OperationalError) (1054, "Unknown column 'SL.id_storage_location' in 'field list'") [SQL: CALL p_shop_get_many_storage_location(%s)] [parameters: (0,)] (Background on this error at: https://sqlalche.me/e/20/e3q8) + +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development +config_env: development diff --git a/app.log.3 b/app.log.3 index c7267aae..c8827163 100644 --- a/app.log.3 +++ b/app.log.3 @@ -1,52 +1,3 @@ -Traceback: Traceback (most recent call last): - File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request - rv = self.dispatch_request() - ^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 865, in dispatch_request - return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return] - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\controllers\store\product_permutation.py", line 47, in permutations - return render_template('pages/store/_product_permutations.html', model = model) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\templating.py", line 150, in render_template - return _render(app, template, context) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\templating.py", line 131, in _render - rv = template.render(context) - ^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\jinja2\environment.py", line 1304, in render - self.environment.handle_exception() - File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\jinja2\environment.py", line 939, in handle_exception - raise rewrite_traceback_stack(source=source) - File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\templates\pages\store\_product_permutations.html", line 1, in top-level template code - {% extends 'layouts/layout.html' %} - ^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\templates\layouts\layout.html", line 354, in top-level template code - {% block page_body %}{% endblock %} - ^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\templates\pages\store\_product_permutations.html", line 134, in block 'page_body' - {% include 'components/store/_row_product_permutation.html' %} - ^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\templates\components\store\_row_product_permutation.html", line 168, in top-level template code - {% set active = variation_type.active %} - ^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\jinja2\environment.py", line 487, in getattr - return getattr(obj, attribute) - ^^^^^^^^^^^^^^^^^^^^^^^ -jinja2.exceptions.UndefinedError: 'variation_type' is undefined - -config_env: development -config_env: development -config_env: development -config_env: development -config_env: development -config_env: development -config_env: development -config_env: development -config_env: development -config_env: development -config_env: development -Server Error: 'NoneType' object has no attribute 'to_json' Request: 127.0.0.1 GET http /store/stock_items? Host: 127.0.0.1:5000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8 @@ -67,43 +18,86 @@ Priority: u=0, i Request data: b'' Traceback: Traceback (most recent call last): + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\base.py", line 1967, in _exec_single_context + self.dialect.do_execute( + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\default.py", line 924, in do_execute + cursor.execute(statement, parameters) + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\MySQLdb\cursors.py", line 179, in execute + res = self._query(mogrified_query) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\MySQLdb\cursors.py", line 330, in _query + db.query(q) + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\MySQLdb\connections.py", line 261, in query + _mysql.connection.query(self, query) +MySQLdb.OperationalError: (1054, "Unknown column 'SL.id_storage_location' in 'field list'") + +The above exception was the direct cause of the following exception: + +Traceback (most recent call last): File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request rv = self.dispatch_request() ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 865, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\controllers\store\stock_item.py", line 45, in stock_items - return render_template('pages/store/_stock_items.html', model = model, datetime = datetime) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\templating.py", line 150, in render_template - return _render(app, template, context) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\templating.py", line 131, in _render - rv = template.render(context) - ^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\jinja2\environment.py", line 1304, in render - self.environment.handle_exception() - File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\jinja2\environment.py", line 939, in handle_exception - raise rewrite_traceback_stack(source=source) - File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\templates\pages\store\_stock_items.html", line 1, in top-level template code - {% extends 'layouts/layout.html' %} - ^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\templates\layouts\layout.html", line 354, in top-level template code - {% block page_body %}{% endblock %} - ^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\templates\pages\store\_stock_items.html", line 119, in block 'page_body' - var plants = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.plants) | tojson | safe }}; - ^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\models\model_view_base.py", line 358, in convert_list_objects_to_dict_json_by_attribute_key_default - return Model_View_Base.convert_list_objects_to_dict_json_by_attribute_key(list_objects, getattr(obj_class, obj_class.FLAG_NAME_ATTR_OPTION_VALUE)) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\models\model_view_base.py", line 346, in convert_list_objects_to_dict_json_by_attribute_key - return {getattr(obj, key): obj.to_json() for obj in list_objects} - ^^^^^^^^^^^^^ - File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\business_objects\store\plant.py", line 79, in to_json - self.FLAG_ADDRESS: self.address.to_json(), - ^^^^^^^^^^^^^^^^^^^^ -AttributeError: 'NoneType' object has no attribute 'to_json' + File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\controllers\store\stock_item.py", line 40, in stock_items + model = Model_View_Store_Stock_Item(form_filters) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\models\model_view_store_stock_item.py", line 93, in __init__ + self.storage_locations = self.get_many_storage_location(False) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\models\model_view_store.py", line 499, in get_many_storage_location + storage_locations = DataStore_Store_Base().get_many_storage_location(get_inactive) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\datastores\datastore_store_base.py", line 236, in get_many_storage_location + result = self.db_procedure_execute(_m_db_storage_location, argument_dict_list_storage_location) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\datastores\datastore_base.py", line 95, in db_procedure_execute + result = db.session.execute(proc_string, argument_dict_list) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\orm\scoping.py", line 778, in execute + return self._proxied.execute( + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\orm\session.py", line 2351, in execute + return self._execute_internal( + ^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\orm\session.py", line 2245, in _execute_internal + result = conn.execute( + ^^^^^^^^^^^^^ + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\base.py", line 1418, in execute + return meth( + ^^^^^ + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\sql\elements.py", line 515, in _execute_on_connection + return connection._execute_clauseelement( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\base.py", line 1640, in _execute_clauseelement + ret = self._execute_context( + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\base.py", line 1846, in _execute_context + return self._exec_single_context( + ^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\base.py", line 1986, in _exec_single_context + self._handle_dbapi_exception( + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\base.py", line 2353, in _handle_dbapi_exception + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\base.py", line 1967, in _exec_single_context + self.dialect.do_execute( + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\default.py", line 924, in do_execute + cursor.execute(statement, parameters) + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\MySQLdb\cursors.py", line 179, in execute + res = self._query(mogrified_query) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\MySQLdb\cursors.py", line 330, in _query + db.query(q) + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\MySQLdb\connections.py", line 261, in query + _mysql.connection.query(self, query) +sqlalchemy.exc.OperationalError: (MySQLdb.OperationalError) (1054, "Unknown column 'SL.id_storage_location' in 'field list'") +[SQL: CALL p_shop_get_many_storage_location(%s)] +[parameters: (0,)] +(Background on this error at: https://sqlalche.me/e/20/e3q8) config_env: development +Server Error: (MySQLdb.OperationalError) (1054, "Unknown column 'SL.id_storage_location' in 'field list'") +[SQL: CALL p_shop_get_many_storage_location(%s)] +[parameters: (0,)] +(Background on this error at: https://sqlalche.me/e/20/e3q8) diff --git a/business_objects/store/manufacturing_purchase_order.py b/business_objects/store/manufacturing_purchase_order.py index 26444fcb..67896d15 100644 --- a/business_objects/store/manufacturing_purchase_order.py +++ b/business_objects/store/manufacturing_purchase_order.py @@ -228,8 +228,8 @@ class Manufacturing_Purchase_Order_Product_Link(db.Model, Store_Base): link.id_unit_latency_manufacture = json[cls.ATTR_ID_UNIT_MEASUREMENT_LATENCY_MANUFACTURE] link.latency_manufacture = json[cls.FLAG_LATENCY_MANUFACTURE] link.display_order = json[cls.FLAG_DISPLAY_ORDER] - link.cost_unit_local_VAT_excl = json[cls.FLAG_COST_UNIT_LOCAL_VAT_EXCL] - link.cost_unit_local_VAT_incl = json[cls.FLAG_COST_UNIT_LOCAL_VAT_INCL] + link.cost_unit_local_VAT_excl = json.get(cls.FLAG_COST_UNIT_LOCAL_VAT_EXCL, None) + link.cost_unit_local_VAT_incl = json.get(cls.FLAG_COST_UNIT_LOCAL_VAT_INCL, None) link.active = json[cls.FLAG_ACTIVE] return link @@ -292,7 +292,7 @@ class Manufacturing_Purchase_Order_Product_Link_Temp(db.Model, Store_Base): id_temp: int = db.Column(db.Integer, primary_key=True, autoincrement=True) id_link: int = db.Column(db.Integer) id_order: int = db.Column(db.Integer) - id_category: int = db.Column(db.Integer) + # id_category: int = db.Column(db.Integer) id_product: int = db.Column(db.Integer) id_permutation: int = db.Column(db.Integer) csv_list_variations: str = db.Column(db.String) @@ -318,7 +318,7 @@ class Manufacturing_Purchase_Order_Product_Link_Temp(db.Model, Store_Base): row = cls() row.id_link = manufacturing_purchase_order_product_link.id_link row.id_order = manufacturing_purchase_order_product_link.id_order - row.id_category = manufacturing_purchase_order_product_link.id_category + # row.id_category = manufacturing_purchase_order_product_link.id_category row.id_product = manufacturing_purchase_order_product_link.id_product row.id_permutation = manufacturing_purchase_order_product_link.id_permutation row.csv_list_variations = manufacturing_purchase_order_product_link.csv_id_pairs_variation @@ -340,7 +340,6 @@ class Manufacturing_Purchase_Order_Product_Link_Temp(db.Model, Store_Base): return f''' id_link: {self.id_link} id_order: {self.id_order} -id_category: {self.id_category} id_product: {self.id_product} id_permutation: {self.id_permutation} csv_list_variations: {self.csv_list_variations} diff --git a/models/__pycache__/model_view_base.cpython-312.pyc b/models/__pycache__/model_view_base.cpython-312.pyc index 698e530d..03807932 100644 Binary files a/models/__pycache__/model_view_base.cpython-312.pyc and b/models/__pycache__/model_view_base.cpython-312.pyc differ diff --git a/models/model_view_base.py b/models/model_view_base.py index e87b5904..be0ca7a5 100644 --- a/models/model_view_base.py +++ b/models/model_view_base.py @@ -100,6 +100,7 @@ class Model_View_Base(BaseModel, ABC): FLAG_NAME_ATTR_OPTION_TEXT: ClassVar[str] = Base.FLAG_NAME_ATTR_OPTION_TEXT FLAG_NAME_ATTR_OPTION_VALUE: ClassVar[str] = Base.FLAG_NAME_ATTR_OPTION_VALUE FLAG_NAME_PLURAL: ClassVar[str] = Base.FLAG_NAME_PLURAL + # FLAG_NAME_SINGULAR: ClassVar[str] = Base.FLAG_NAME_SINGULAR FLAG_NAV_ADMIN_HOME: ClassVar[str] = 'navAdminHome' FLAG_NAV_ADMIN_STORE_STRIPE_PRICES: ClassVar[str] = 'navAdminStoreStripePrices' FLAG_NAV_ADMIN_STORE_STRIPE_PRODUCTS: ClassVar[str] = 'navAdminStoreStripeProducts' diff --git a/static/MySQL/7415_p_shop_save_manufacturing_purchase_order.sql b/static/MySQL/7415_p_shop_save_manufacturing_purchase_order.sql index 010acf13..b5f3d20c 100644 --- a/static/MySQL/7415_p_shop_save_manufacturing_purchase_order.sql +++ b/static/MySQL/7415_p_shop_save_manufacturing_purchase_order.sql @@ -114,7 +114,7 @@ BEGIN , price_total_local_VAT_incl FLOAT NULL , has_order BIT NULL , is_new BIT NOT NULL - , name_error VARCHAR(1000) NOT NULL + , name_error VARCHAR(1000) NULL ); CREATE TEMPORARY TABLE IF NOT EXISTS tmp_Msg_Error ( @@ -170,7 +170,6 @@ BEGIN , price_unit_local_VAT_incl , has_order , is_new - , name_error ) SELECT IFNULL(MPOPL_T.id_link, 0) AS id_link diff --git a/static/MySQL/7416_p_shop_get_many_manufacturing_purchase_order.sql b/static/MySQL/7416_p_shop_get_many_manufacturing_purchase_order.sql index 1bc33d5c..dead2110 100644 --- a/static/MySQL/7416_p_shop_get_many_manufacturing_purchase_order.sql +++ b/static/MySQL/7416_p_shop_get_many_manufacturing_purchase_order.sql @@ -282,13 +282,13 @@ BEGIN VALUES ( v_id_type_error_no_permission , v_code_type_error_no_permission - , CONCAT('You do not have view permissions for ', (SELECT name FROM partsltd_prod.Shop_Permission WHERE id_permission = v_id_permission_manufacturing LIMIT 1)) + , CONCAT('You do not have view permissions for ', IFNULL((SELECT IFNULL(name, '(No Permission Name)') FROM partsltd_prod.Shop_Permission WHERE id_permission LIKE CONCAT('%', v_ids_permission_manufacturing_purchase_order, '%') LIMIT 1), '(No Permissions Found)')) ) ; END IF; IF EXISTS ( SELECT * FROM tmp_Msg_Error LIMIT 1 ) THEN - DELETE FROM tmp_Manufacturing_Purchase_Order_Product_Link; + -- DELETE FROM tmp_Manufacturing_Purchase_Order_Product_Link; DELETE FROM tmp_Manufacturing_Purchase_Order; END IF; @@ -339,6 +339,8 @@ BEGIN SELECT MPOPL.id_link , MPOPL.id_order + , P.id_category + , P.id_product , MPOPL.id_permutation , fn_shop_get_product_permutation_name(MPOPL.id_permutation) AS name_permutation , fn_shop_get_product_permutation_variations_csv(MPOPL.id_permutation) AS csv_id_pairs_variation @@ -354,7 +356,9 @@ BEGIN , MPOPL.price_unit_local_VAT_incl , MPOPL.active FROM tmp_Manufacturing_Purchase_Order t_MPO - INNER JOIN partsltd_prod.Shop_Manufacturing_Purchase_Order_Product_Link MPOPL ON t_MPO.id_order = MPOPL.id_order + INNER JOIN partsltd_prod.Shop_Manufacturing_Purchase_Order_Product_Link MPOPL ON t_MPO.id_order = MPOPL.id_order + LEFT JOIN partsltd_prod.Shop_Product_Permutation PP ON MPOPL.id_permutation = PP.id_permutation + LEFT JOIN partsltd_prod.Shop_Product P ON PP.id_product = P.id_product ; # Errors @@ -384,9 +388,9 @@ DELIMITER ;; /* CALL p_shop_get_many_manufacturing_purchase_order ( - 1 # a_id_user + 0 # a_id_user , 1 # a_get_all_order - , 0 # a_get_inactive_order + , 1 # a_get_inactive_order , '' # a_ids_order , '' # a_ids_permutation , NULL # a_date_from diff --git a/static/dist/js/main.bundle.js b/static/dist/js/main.bundle.js index 8a3891ca..251cce80 100644 --- a/static/dist/js/main.bundle.js +++ b/static/dist/js/main.bundle.js @@ -2211,6 +2211,73 @@ var BusinessObjects = /*#__PURE__*/function () { }]); }(); +;// CONCATENATED MODULE: ./static/js/lib/business_objects/store/product_permutation.js +function product_permutation_typeof(o) { "@babel/helpers - typeof"; return product_permutation_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, product_permutation_typeof(o); } +function product_permutation_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } +function product_permutation_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, product_permutation_toPropertyKey(o.key), o); } } +function product_permutation_createClass(e, r, t) { return r && product_permutation_defineProperties(e.prototype, r), t && product_permutation_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } +function product_permutation_toPropertyKey(t) { var i = product_permutation_toPrimitive(t, "string"); return "symbol" == product_permutation_typeof(i) ? i : i + ""; } +function product_permutation_toPrimitive(t, r) { if ("object" != product_permutation_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != product_permutation_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } +var ProductPermutation = /*#__PURE__*/function () { + function ProductPermutation() { + product_permutation_classCallCheck(this, ProductPermutation); + } + return product_permutation_createClass(ProductPermutation, null, [{ + key: "getProductVariationsFromIdCsv", + value: function getProductVariationsFromIdCsv(csvVariations) { + var productVariations = []; + if (!csvVariations) return productVariations; + var variationPairs = csvVariations.split(','); + if (variationPairs.length == 0) return productVariations; + var parts; + variationPairs.forEach(function (variationPair) { + parts = variationPair.split(':'); + if (parts.length == 2) { + var productVariationType = productVariationTypes[parts[0]]; + productVariationType[flagProductVariations].some(function (productVariation) { + if (productVariation[attrIdProductVariation] == parts[1]) { + productVariations.push([productVariationType, productVariation]); + return true; + } + return false; + }); + } + }); + return productVariations; + } + }, { + key: "getProductVariationsPreviewFromIdCsv", + value: function getProductVariationsPreviewFromIdCsv(csvVariations) { + var variationPairs = ProductPermutation.getProductVariationsFromIdCsv(csvVariations); + var preview = ''; + if (variationPairs.length == 0) return preview; + var variationType, variation; + variationPairs.forEach(function (variationPair) { + if (preview.length > 0) { + preview += '\n'; + } + variationType = variationPair[0]; + variation = variationPair[1]; + preview += variationType[flagName] + ': ' + variation[flagName]; + }); + return preview; + } + }, { + key: "getProductVariationsIdCsvFromVariationTypeList", + value: function getProductVariationsIdCsvFromVariationTypeList(variationTypeList) { + var csvVariations = ''; + if (Validation.isEmpty(variationTypeList)) return csvVariations; + variationTypeList.forEach(function (variationType) { + if (csvVariations.length > 0) { + csvVariations += ','; + } + csvVariations += variationType[attrIdProductVariationType] + ':' + variationType[flagProductVariations][0][attrIdProductVariation]; + }); + return csvVariations; + } + }]); +}(); + ;// CONCATENATED MODULE: ./static/js/lib/utils.js function utils_typeof(o) { "@babel/helpers - typeof"; return utils_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, utils_typeof(o); } function utils_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } @@ -3378,6 +3445,19 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) { value: function hookupCurrencyFields() { this.hookupTableCellDdlPreviews(idTableMain + ' td.' + flagCurrency, Utils.getListFromDict(currencies)); } + }, { + key: "createTdActive", + value: function createTdActive(isActive) { + var tdActive = document.createElement("td"); + tdActive.classList.add(flagActive); + var buttonActive = document.createElement("button"); + buttonActive.classList.add(flagActive); + buttonActive.classList.add(isActive ? flagDelete : flagAdd); + buttonActive.textContent = isActive ? 'x' : '+'; + DOM.setElementAttributesValuesCurrentAndPrevious(buttonActive, isActive); + tdActive.appendChild(buttonActive); + return tdActive; + } }, { key: "leave", value: function leave() { @@ -4068,6 +4148,7 @@ function manufacturing_purchase_orders_toPrimitive(t, r) { if ("object" != manuf + var PageStoreManufacturingPurchaseOrders = /*#__PURE__*/function (_TableBasePage) { function PageStoreManufacturingPurchaseOrders(router) { var _this; @@ -4104,7 +4185,7 @@ var PageStoreManufacturingPurchaseOrders = /*#__PURE__*/function (_TableBasePage var inputPriceTotalLocalVatExcl = row.querySelector('td.' + flagPriceTotalLocalVatExcl + ' input'); var inputPriceTotalLocalVatIncl = row.querySelector('td.' + flagPriceTotalLocalVatIncl + ' input'); var trsPurchaseOrderItem = row.querySelectorAll('tr.' + flagOrderItems); - var checkboxActive = row.querySelector('td.' + flagActive + ' textarea'); + var buttonActive = row.querySelector(':scope > td.' + flagActive + ' button'); var jsonRow = {}; jsonRow[attrIdManufacturingPurchaseOrder] = row.getAttribute(attrIdManufacturingPurchaseOrder); jsonRow[attrIdCurrency] = DOM.getElementAttributeValueCurrent(tdCurrency); @@ -4119,7 +4200,7 @@ var PageStoreManufacturingPurchaseOrders = /*#__PURE__*/function (_TableBasePage }); } jsonRow[flagOrderItems] = orderItems; - jsonRow[flagActive] = DOM.getElementAttributeValueCurrent(checkboxActive); + jsonRow[flagActive] = buttonActive.classList.contains(flagDelete); return jsonRow; } }, { @@ -4132,8 +4213,10 @@ var PageStoreManufacturingPurchaseOrders = /*#__PURE__*/function (_TableBasePage var tdUnitQuantity = tr.querySelector('td.' + flagUnitMeasurementQuantity); var inputQuantityUsed = tr.querySelector('td.' + flagQuantityUsed + ' input'); var inputQuantityProduced = tr.querySelector('td.' + flagQuantityProduced + ' input'); + var tdUnitMeasurementLatencyManufacture = tr.querySelector('td.' + flagUnitMeasurementLatencyManufacture); var inputLatencyManufacture = tr.querySelector('td.' + flagLatencyManufacture + ' input'); - var checkboxActive = tr.querySelector('td.' + flagActive + ' input'); + debugger; + var buttonActive = tr.querySelector(':scope > td.' + flagActive + ' button'); var jsonRow = {}; jsonRow[attrIdManufacturingPurchaseOrder] = tr.getAttribute(attrIdManufacturingPurchaseOrder); jsonRow[attrIdManufacturingPurchaseOrderProductLink] = tr.getAttribute(attrIdManufacturingPurchaseOrderProductLink); @@ -4144,8 +4227,9 @@ var PageStoreManufacturingPurchaseOrders = /*#__PURE__*/function (_TableBasePage jsonRow[attrIdUnitMeasurementQuantity] = DOM.getElementAttributeValueCurrent(tdUnitQuantity); jsonRow[flagQuantityUsed] = DOM.getElementAttributeValueCurrent(inputQuantityUsed); jsonRow[flagQuantityProduced] = DOM.getElementAttributeValueCurrent(inputQuantityProduced); + jsonRow[attrIdUnitMeasurementLatencyManufacture] = DOM.getElementAttributeValueCurrent(tdUnitMeasurementLatencyManufacture); jsonRow[flagLatencyManufacture] = DOM.getElementAttributeValueCurrent(inputLatencyManufacture); - jsonRow[flagActive] = DOM.getElementAttributeValueCurrent(checkboxActive); + jsonRow[flagActive] = buttonActive.classList.contains(flagDelete); return jsonRow; } }, { @@ -4205,9 +4289,10 @@ var PageStoreManufacturingPurchaseOrders = /*#__PURE__*/function (_TableBasePage } this.toggleColumnHeaderCollapsed(flagOrderItems, false); element.classList.remove(flagCollapsed); + debugger; var row = DOM.getRowFromElement(element); var idManufacturingPurchaseOrder = row.getAttribute(attrIdManufacturingPurchaseOrder); - var manufacturingPurchaseOrderProductLinksList = idManufacturingPurchaseOrder > 0 ? manufacturingPurchaseOrderProductLinks[idManufacturingPurchaseOrder] : []; + var manufacturingPurchaseOrder = idManufacturingPurchaseOrder > 0 ? manufacturingPurchaseOrders[idManufacturingPurchaseOrder] : manufacturing_purchase_orders_defineProperty({}, flagOrderItems, []); var tblOrderItems = document.createElement("table"); tblOrderItems.classList.add(flagOrderItems); var thead = document.createElement("thead"); @@ -4283,7 +4368,7 @@ var PageStoreManufacturingPurchaseOrders = /*#__PURE__*/function (_TableBasePage thead.appendChild(tr); tblOrderItems.appendChild(thead); var tbody = document.createElement("tbody"); - manufacturingPurchaseOrderProductLinksList.forEach(function (orderItem, index) { + manufacturingPurchaseOrder[flagOrderItems].forEach(function (orderItem, index) { _this4.addRowManufacturingPurchaseOrderItem(tbody, orderItem); }); tblOrderItems.appendChild(tbody); @@ -4303,6 +4388,7 @@ var PageStoreManufacturingPurchaseOrders = /*#__PURE__*/function (_TableBasePage if (_verbose) { console.log("addRowManufacturingPurchaseOrderItem: ", orderItem); } + debugger; var tdDisplayOrder = document.createElement("td"); tdDisplayOrder.classList.add(flagDisplayOrder); var inputDisplayOrder = document.createElement("input"); @@ -4317,7 +4403,8 @@ var PageStoreManufacturingPurchaseOrders = /*#__PURE__*/function (_TableBasePage var divCategory = document.createElement("div"); divCategory.classList.add(flagProductCategory); // DOM.setElementAttributesValuesCurrentAndPrevious(divCategory, orderItem[attrIdProductCategory]); - divCategory.textContent = orderItem[flagProductCategory]; + var productCategory = productCategories[orderItem[attrIdProductCategory]]; + divCategory.textContent = BusinessObjects.getObjectText(productCategory); tdCategory.appendChild(divCategory); var tdProduct = document.createElement("td"); tdProduct.classList.add(flagProduct); @@ -4325,7 +4412,8 @@ var PageStoreManufacturingPurchaseOrders = /*#__PURE__*/function (_TableBasePage var divProduct = document.createElement("div"); divProduct.classList.add(flagProduct); // DOM.setElementAttributesValuesCurrentAndPrevious(divProduct, orderItem[attrIdProduct]); - divProduct.textContent = orderItem[flagProduct]; + var product = products[orderItem[attrIdProduct]]; + divProduct.textContent = BusinessObjects.getObjectText(product); tdProduct.appendChild(divProduct); var tdVariations = document.createElement("td"); tdVariations.classList.add(flagProductVariations); @@ -4334,7 +4422,8 @@ var PageStoreManufacturingPurchaseOrders = /*#__PURE__*/function (_TableBasePage var divVariations = document.createElement("div"); divVariations.classList.add(flagProductVariations); // DOM.setElementAttributesValuesCurrentAndPrevious(divVariations, orderItem[attrIdProductVariation]); - divVariations.textContent = orderItem[flagProductVariations]; + var variationsText = ProductPermutation.getProductVariationsPreviewFromIdCsv(orderItem[flagProductVariations]); + divVariations.textContent = variationsText; tdVariations.appendChild(divVariations); var tdUnitQuantity = document.createElement("td"); tdUnitQuantity.classList.add(flagUnitMeasurementQuantity); @@ -4342,20 +4431,22 @@ var PageStoreManufacturingPurchaseOrders = /*#__PURE__*/function (_TableBasePage var divUnitQuantity = document.createElement("div"); divUnitQuantity.classList.add(flagUnitMeasurementQuantity); // DOM.setElementValuesCurrentAndPrevious(divUnitQuantity, orderItem[flagUnitMeasurementQuantity]); + var unitQuantity = unitMeasurements[orderItem[attrIdUnitMeasurementQuantity]]; + divUnitQuantity.textContent = BusinessObjects.getObjectText(unitQuantity); tdUnitQuantity.appendChild(divUnitQuantity); var tdQuantityUsed = document.createElement("td"); tdQuantityUsed.classList.add(flagQuantityUsed); var inputQuantityUsed = document.createElement("input"); inputQuantityUsed.classList.add(flagQuantityUsed); inputQuantityUsed.type = 'number'; - DOM.setElementAttributesValuesCurrentAndPrevious(inputQuantityUsed, orderItem[flagQuantityUsed]); + DOM.setElementValuesCurrentAndPrevious(inputQuantityUsed, orderItem[flagQuantityUsed]); tdQuantityUsed.appendChild(inputQuantityUsed); var tdQuantityProduced = document.createElement("td"); tdQuantityProduced.classList.add(flagQuantityProduced); var inputQuantityProduced = document.createElement("input"); inputQuantityProduced.classList.add(flagQuantityProduced); inputQuantityProduced.type = 'number'; - DOM.setElementAttributesValuesCurrentAndPrevious(inputQuantityProduced, orderItem[flagQuantityProduced]); + DOM.setElementValuesCurrentAndPrevious(inputQuantityProduced, orderItem[flagQuantityProduced]); tdQuantityProduced.appendChild(inputQuantityProduced); /* @@ -4395,6 +4486,8 @@ var PageStoreManufacturingPurchaseOrders = /*#__PURE__*/function (_TableBasePage var divUnitMeasurementLatencyManufacture = document.createElement("div"); divUnitMeasurementLatencyManufacture.classList.add(flagUnitMeasurementLatencyManufacture); // DOM.setElementValuesCurrentAndPrevious(divUnitMeasurementLatencyManufacture, orderItem[flagUnitMeasurementLatencyManufacture]); + var unitMeasurementLatencyManufacture = unitMeasurementsTime[orderItem[attrIdUnitMeasurementLatencyManufacture]]; + divUnitMeasurementLatencyManufacture.textContent = BusinessObjects.getObjectText(unitMeasurementLatencyManufacture); tdUnitMeasurementLatencyManufacture.appendChild(divUnitMeasurementLatencyManufacture); var tdLatencyManufacture = document.createElement("td"); tdLatencyManufacture.classList.add(flagLatencyManufacture); @@ -4402,21 +4495,9 @@ var PageStoreManufacturingPurchaseOrders = /*#__PURE__*/function (_TableBasePage inputLatencyManufacture.classList.add(flagLatencyManufacture); inputLatencyManufacture.type = 'number'; inputLatencyManufacture.step = 1; - DOM.setElementAttributesValuesCurrentAndPrevious(inputLatencyManufacture, orderItem[flagLatencyManufacture]); + DOM.setElementValuesCurrentAndPrevious(inputLatencyManufacture, orderItem[flagLatencyManufacture]); tdLatencyManufacture.appendChild(inputLatencyManufacture); - var tdActive = document.createElement("td"); - tdActive.classList.add(flagActive); - var checkboxActive = document.createElement("input"); - checkboxActive.classList.add(flagActive); - checkboxActive.type = 'checkbox'; - DOM.setElementValuesCurrentAndPrevious(checkboxActive, orderItem[flagActive]); - tdActive.appendChild(checkboxActive); - var tdDelete = document.createElement("td"); - tdDelete.classList.add(flagDelete); - var buttonDelete = document.createElement("button"); - buttonDelete.classList.add(flagDelete); - buttonDelete.textContent = 'x'; - tdDelete.appendChild(buttonDelete); + var tdActive = this.createTdActive(orderItem[flagActive]); var tr = document.createElement("tr"); tr.classList.add(flagOrderItems); tr.setAttribute(attrIdManufacturingPurchaseOrder, orderItem[attrIdManufacturingPurchaseOrder]); @@ -4437,7 +4518,6 @@ var PageStoreManufacturingPurchaseOrders = /*#__PURE__*/function (_TableBasePage tr.appendChild(tdUnitMeasurementLatencyManufacture); tr.appendChild(tdLatencyManufacture); tr.appendChild(tdActive); - tr.appendChild(tdDelete); tbody.appendChild(tr); } }, { @@ -4692,7 +4772,7 @@ var PageStoreProductCategories = /*#__PURE__*/function (_TableBasePage) { var textareaName = row.querySelector('td.' + flagName + ' textarea'); var textareaDescription = row.querySelector('td.' + flagDescription + ' textarea'); var tdAccessLevel = row.querySelector('td.' + flagAccessLevel); - var inputActive = row.querySelector('td.' + flagActive + ' input[type="checkbox"]'); + var buttonActive = row.querySelector(':scope > td.' + flagActive + ' button'); var jsonCategory = {}; jsonCategory[attrIdProductCategory] = row.getAttribute(attrIdProductCategory); jsonCategory[flagCode] = DOM.getElementAttributeValueCurrent(textareaCode); @@ -4700,7 +4780,7 @@ var PageStoreProductCategories = /*#__PURE__*/function (_TableBasePage) { jsonCategory[flagDescription] = DOM.getElementAttributeValueCurrent(textareaDescription); // jsonCategory[flagAccessLevelRequired] = tdAccessLevel.getAttribute(flagAccessLevelRequired); jsonCategory[attrIdAccessLevel] = DOM.getElementAttributeValueCurrent(tdAccessLevel); - jsonCategory[flagActive] = DOM.getElementAttributeValueCurrent(inputActive); + jsonCategory[flagActive] = buttonActive.classList.contains(flagDelete); jsonCategory[flagDisplayOrder] = DOM.getElementAttributeValueCurrent(sliderDisplayOrder); return jsonCategory; } @@ -4938,7 +5018,7 @@ var PageStoreProductPermutations = /*#__PURE__*/function (_TableBasePage) { var checkboxDoesExpireFasterOnceUnsealed = row.querySelector('td.' + flagDoesExpireFasterOnceUnsealed + ' input'); var inputCountIntervalExpirationUnsealed = row.querySelector('td.' + flagCountUnitMeasurementIntervalExpirationUnsealed + ' input'); var tdUnitMeasurementIntervalExpirationUnsealed = row.querySelector('td.' + flagUnitMeasurementIntervalExpirationUnsealed); - var checkboxActive = row.querySelector('td.' + flagActive + ' input'); + var buttonActive = row.querySelector(':scope > td.' + flagActive + ' button'); var jsonRow = {}; jsonRow[attrIdProductPermutation] = row.getAttribute(attrIdProductPermutation); jsonRow[attrIdProductCategory] = tdProductCategory.getAttribute(attrValueCurrent); @@ -4963,7 +5043,7 @@ var PageStoreProductPermutations = /*#__PURE__*/function (_TableBasePage) { jsonRow[flagDoesExpireFasterOnceUnsealed] = checkboxDoesExpireFasterOnceUnsealed.getAttribute(attrValueCurrent); jsonRow[flagCountUnitMeasurementIntervalExpirationUnsealed] = inputCountIntervalExpirationUnsealed.getAttribute(attrValueCurrent); jsonRow[flagUnitMeasurementIntervalExpirationUnsealed] = tdUnitMeasurementIntervalExpirationUnsealed.getAttribute(attrValueCurrent); - jsonRow[flagActive] = checkboxActive.getAttribute(attrValueCurrent); + jsonRow[flagActive] = buttonActive.classList.contains(flagDelete); return jsonRow; } }, { @@ -5292,7 +5372,7 @@ var PageStoreProducts = /*#__PURE__*/function (_TableBasePage) { // let tdProductVariations = row.querySelector('td.' + flagProductVariations); var inputHasVariations = row.querySelector('td.' + flagHasVariations + ' input[type="checkbox"]'); var tdAccessLevel = row.querySelector('td.' + flagAccessLevel); - var inputActive = row.querySelector('td.' + flagActive + ' input[type="checkbox"]'); + var buttonActive = row.querySelector(':scope > td.' + flagActive + ' button'); var jsonProduct = {}; jsonProduct[attrIdProduct] = row.getAttribute(attrIdProduct); jsonProduct[attrIdProductCategory] = DOM.getElementAttributeValueCurrent(tdProductCategory); @@ -5302,7 +5382,7 @@ var PageStoreProducts = /*#__PURE__*/function (_TableBasePage) { jsonProduct[flagHasVariations] = DOM.getElementAttributeValueCurrent(inputHasVariations); // jsonProduct[flagAccessLevelRequired] = tdAccessLevel.getAttribute(flagAccessLevelRequired); jsonProduct[attrIdAccessLevel] = DOM.getElementAttributeValueCurrent(tdAccessLevel); - jsonProduct[flagActive] = DOM.getElementAttributeValueCurrent(inputActive); + jsonProduct[flagActive] = buttonActive.classList.contains(flagDelete); jsonProduct[flagDisplayOrder] = DOM.getElementAttributeValueCurrent(sliderDisplayOrder); return jsonProduct; } @@ -5434,7 +5514,7 @@ var PageStoreProductVariations = /*#__PURE__*/function (_TableBasePage) { var textareaName = row.querySelector('td.' + flagName + ' textarea'); var textareaNamePlural = row.querySelector('td.' + flagNamePlural + ' textarea'); var tdProductVariations = row.querySelector('td.' + flagProductVariations); - var buttonActive = row.querySelector('td.' + flagActive + ' button'); + var buttonActive = row.querySelector(':scope > td.' + flagActive + ' button'); var jsonRow = {}; jsonRow[attrIdProductVariationType] = row.getAttribute(attrIdProductVariationType); if (validation_Validation.isEmpty(jsonRow[attrIdProductVariationType])) jsonRow[attrIdProductVariationType] = -1; @@ -5464,7 +5544,7 @@ var PageStoreProductVariations = /*#__PURE__*/function (_TableBasePage) { var textareaCode = tr.querySelector('td.' + flagCode + ' textarea'); var textareaName = tr.querySelector('td.' + flagName + ' textarea'); // let checkboxActive = tr.querySelector('td.' + flagActive + ' input'); - var buttonActive = tr.querySelector('td.' + flagActive + ' button'); + var buttonActive = tr.querySelector(':scope > td.' + flagActive + ' button'); var jsonRow = {}; jsonRow[attrIdProductVariation] = tr.getAttribute(attrIdProductVariation); if (validation_Validation.isEmpty(jsonRow[attrIdProductVariation])) jsonRow[attrIdProductVariation] = -1 - indexRow; @@ -5596,14 +5676,7 @@ var PageStoreProductVariations = /*#__PURE__*/function (_TableBasePage) { textareaName.classList.add(flagName); DOM.setElementValuesCurrentAndPrevious(textareaName, productVariation[flagName]); tdName.appendChild(textareaName); - var tdActive = document.createElement("td"); - tdActive.classList.add(flagActive); - var buttonActive = document.createElement("button"); - buttonActive.classList.add(flagActive); - buttonActive.classList.add(productVariation[flagActive] ? flagDelete : flagAdd); - buttonActive.textContent = productVariation[flagActive] ? 'x' : '+'; - DOM.setElementAttributesValuesCurrentAndPrevious(buttonActive, productVariation[flagActive]); - tdActive.appendChild(buttonActive); + var tdActive = this.createTdActive(productVariation[flagActive]); var tr = document.createElement("tr"); tr.classList.add(flagProductVariation); tr.setAttribute(attrIdProductVariationType, productVariation[attrIdProductVariationType]); @@ -5776,7 +5849,7 @@ var PageStoreStockItems = /*#__PURE__*/function (_TableBasePage) { var inputDateExpiration = row.querySelector('td.' + flagDateExpiration + ' input'); var inputIsConsumed = row.querySelector('td.' + flagIsConsumed + ' input'); var inputDateConsumed = row.querySelector('td.' + flagDateConsumed + ' input'); - var checkboxActive = row.querySelector('td.' + flagActive + ' input'); + var buttonActive = row.querySelector(':scope > td.' + flagActive + ' button'); var jsonRow = {}; jsonRow[attrIdStockItem] = row.getAttribute(attrIdStockItem); jsonRow[attrIdProductPermutation] = tdProductVariations.getAttribute(attrIdProductPermutation); @@ -5795,7 +5868,7 @@ var PageStoreStockItems = /*#__PURE__*/function (_TableBasePage) { jsonRow[flagDateExpiration] = DOM.getElementAttributeValueCurrent(inputDateExpiration); jsonRow[flagIsConsumed] = DOM.getElementAttributeValueCurrent(inputIsConsumed); jsonRow[flagDateConsumed] = DOM.getElementAttributeValueCurrent(inputDateConsumed); - jsonRow[flagActive] = checkboxActive.getAttribute(attrValueCurrent); + jsonRow[flagActive] = buttonActive.classList.contains(flagDelete); return jsonRow; } }, { @@ -6151,7 +6224,7 @@ var PageStoreSuppliers = /*#__PURE__*/function (_TableBasePage) { var textareaEmail = row.querySelector('td.' + flagEmail + ' textarea'); var textareaWebsite = row.querySelector('td.' + flagWebsite + ' textarea'); var tdCurrency = row.querySelector('td.' + flagCurrency); - var checkboxActive = row.querySelector('td.' + flagActive + ' input[type="checkbox"]'); + var buttonActive = row.querySelector(':scope > td.' + flagActive + ' button'); var jsonRow = {}; jsonRow[attrIdSupplier] = row.getAttribute(attrIdSupplier); jsonRow[flagNameCompany] = DOM.getElementAttributeValueCurrent(textareaNameCompany); @@ -6164,7 +6237,7 @@ var PageStoreSuppliers = /*#__PURE__*/function (_TableBasePage) { jsonRow[flagEmail] = DOM.getElementAttributeValueCurrent(textareaEmail); jsonRow[flagWebsite] = DOM.getElementAttributeValueCurrent(textareaWebsite); jsonRow[attrIdCurrency] = DOM.getElementAttributeValueCurrent(tdCurrency); - jsonRow[flagActive] = DOM.getElementAttributeValueCurrent(checkboxActive); + jsonRow[flagActive] = buttonActive.classList.contains(flagDelete); return jsonRow; } }, { @@ -6366,19 +6439,7 @@ var PageStoreSuppliers = /*#__PURE__*/function (_TableBasePage) { }); DOM.setElementValuesCurrentAndPrevious(ddlRegion, region[attrIdRegion]); tdRegion.appendChild(ddlRegion); - var tdActive = document.createElement("td"); - tdActive.classList.add(flagActive); - var checkboxActive = document.createElement("input"); - checkboxActive.classList.add(flagActive); - checkboxActive.type = 'checkbox'; - DOM.setElementValuesCurrentAndPrevious(checkboxActive, supplierAddress[flagActive]); - tdActive.appendChild(checkboxActive); - var tdDelete = document.createElement("td"); - tdDelete.classList.add(flagDelete); - var buttonDelete = document.createElement("button"); - buttonDelete.classList.add(flagDelete); - buttonDelete.textContent = 'x'; - tdDelete.appendChild(buttonDelete); + var tdActive = this.createTdActive(supplierAddress[flagActive]); var tr = document.createElement("tr"); tr.setAttribute(attrIdSupplierAddress, supplierAddress[attrIdSupplierAddress]); tr.setAttribute(attrIdSupplier, supplierAddress[attrIdSupplier]); @@ -6389,7 +6450,6 @@ var PageStoreSuppliers = /*#__PURE__*/function (_TableBasePage) { tr.appendChild(tdCounty); tr.appendChild(tdRegion); tr.appendChild(tdActive); - tr.appendChild(tdDelete); tbody.appendChild(tr); } }, { @@ -6532,67 +6592,6 @@ var PageStoreSuppliers = /*#__PURE__*/function (_TableBasePage) { suppliers_defineProperty(PageStoreSuppliers, "hash", hashPageStoreSuppliers); suppliers_defineProperty(PageStoreSuppliers, "attrIdRowObject", attrIdSupplier); -;// CONCATENATED MODULE: ./static/js/lib/business_objects/store/product_permutation.js -function product_permutation_typeof(o) { "@babel/helpers - typeof"; return product_permutation_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, product_permutation_typeof(o); } -function product_permutation_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } -function product_permutation_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, product_permutation_toPropertyKey(o.key), o); } } -function product_permutation_createClass(e, r, t) { return r && product_permutation_defineProperties(e.prototype, r), t && product_permutation_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } -function product_permutation_toPropertyKey(t) { var i = product_permutation_toPrimitive(t, "string"); return "symbol" == product_permutation_typeof(i) ? i : i + ""; } -function product_permutation_toPrimitive(t, r) { if ("object" != product_permutation_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != product_permutation_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } -var ProductPermutation = /*#__PURE__*/function () { - function ProductPermutation() { - product_permutation_classCallCheck(this, ProductPermutation); - } - return product_permutation_createClass(ProductPermutation, null, [{ - key: "getProductVariationsFromIdCsv", - value: function getProductVariationsFromIdCsv(csvVariations) { - var productVariations = []; - if (!csvVariations) return productVariations; - var variationPairs = csvVariations.split(','); - if (variationPairs.length == 0) return productVariations; - var parts; - variationPairs.forEach(function (variationPair) { - parts = variationPair.split(':'); - if (parts.length == 2) { - var productVariationType = productVariationTypes[parts[0]]; - var productVariation = productVariations[parts[1]]; - if (productVariationType && productVariation) { - productVariations.push([productVariationType, productVariation]); - } - } - }); - return productVariations; - } - }, { - key: "getProductVariationsPreviewFromIdCsv", - value: function getProductVariationsPreviewFromIdCsv(csvVariations) { - var variations = ProductPermutation.getProductVariationsFromIdCsv(csvVariations); - var preview = ''; - if (variations.length == 0) return preview; - variations.forEach(function (variation) { - if (preview.length > 0) { - preview += '\n'; - } - preview += variation[0] + ': ' + variation[1] + ', '; - }); - return preview; - } - }, { - key: "getProductVariationsIdCsvFromVariationTypeList", - value: function getProductVariationsIdCsvFromVariationTypeList(variationTypeList) { - var csvVariations = ''; - if (Validation.isEmpty(variationTypeList)) return csvVariations; - variationTypeList.forEach(function (variationType) { - if (csvVariations.length > 0) { - csvVariations += ','; - } - csvVariations += variationType[attrIdProductVariationType] + ':' + variationType[flagProductVariations][0][attrIdProductVariation]; - }); - return csvVariations; - } - }]); -}(); - ;// CONCATENATED MODULE: ./static/js/pages/store/supplier_purchase_orders.js function supplier_purchase_orders_typeof(o) { "@babel/helpers - typeof"; return supplier_purchase_orders_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, supplier_purchase_orders_typeof(o); } function supplier_purchase_orders_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } @@ -6655,7 +6654,7 @@ var PageStoreSupplierPurchaseOrders = /*#__PURE__*/function (_TableBasePage) { var inputCostTotalLocalVatExcl = row.querySelector('td.' + flagCostTotalLocalVatExcl + ' input'); var inputCostTotalLocalVatIncl = row.querySelector('td.' + flagCostTotalLocalVatIncl + ' input'); var trsPurchaseOrderItem = row.querySelectorAll('tr.' + flagOrderItems); - var checkboxActive = row.querySelector('td.' + flagActive + ' input[type="checkbox"]'); + var buttonActive = tr.querySelector(':scope > td.' + flagActive + ' button'); var jsonRow = {}; jsonRow[attrIdSupplierPurchaseOrder] = row.getAttribute(attrIdSupplierPurchaseOrder); jsonRow[attrIdSupplier] = DOM.getElementAttributeValueCurrent(tdSupplier); @@ -6670,7 +6669,7 @@ var PageStoreSupplierPurchaseOrders = /*#__PURE__*/function (_TableBasePage) { }); } jsonRow[flagOrderItems] = orderItems; - jsonRow[flagActive] = DOM.getElementAttributeValueCurrent(checkboxActive); + jsonRow[flagActive] = buttonActive.classList.contains(flagDelete); return jsonRow; } }, { @@ -6686,7 +6685,7 @@ var PageStoreSupplierPurchaseOrders = /*#__PURE__*/function (_TableBasePage) { var inputCostTotalLocalVatExcl = tr.querySelector('td.' + flagCostTotalLocalVatExcl + ' input'); var inputCostTotalLocalVatIncl = tr.querySelector('td.' + flagCostTotalLocalVatIncl + ' input'); var inputLatencyDeliveryDays = tr.querySelector('td.' + flagLatencyDeliveryDays + ' input'); - var checkboxActive = tr.querySelector('td.' + flagActive + ' input'); + var buttonActive = tr.querySelector(':scope > td.' + flagActive + ' button'); var jsonRow = {}; jsonRow[attrIdSupplierPurchaseOrder] = tr.getAttribute(attrIdSupplierPurchaseOrder); jsonRow[attrIdSupplierPurchaseOrderProductLink] = tr.getAttribute(attrIdSupplierPurchaseOrderProductLink); @@ -6700,7 +6699,7 @@ var PageStoreSupplierPurchaseOrders = /*#__PURE__*/function (_TableBasePage) { jsonRow[flagCostTotalLocalVatExcl] = DOM.getElementAttributeValueCurrent(inputCostTotalLocalVatExcl); jsonRow[flagCostTotalLocalVatIncl] = DOM.getElementAttributeValueCurrent(inputCostTotalLocalVatIncl); jsonRow[flagLatencyDeliveryDays] = DOM.getElementAttributeValueCurrent(inputLatencyDeliveryDays); - jsonRow[flagActive] = DOM.getElementAttributeValueCurrent(checkboxActive); + jsonRow[flagActive] = buttonActive.classList.contains(flagDelete); return jsonRow; } }, { @@ -6961,19 +6960,7 @@ var PageStoreSupplierPurchaseOrders = /*#__PURE__*/function (_TableBasePage) { inputLatencyDeliveryDays.step = 1; DOM.setElementValuesCurrentAndPrevious(inputLatencyDeliveryDays, orderItem[flagLatencyDeliveryDays]); tdLatencyDeliveryDays.appendChild(inputLatencyDeliveryDays); - var tdActive = document.createElement("td"); - tdActive.classList.add(flagActive); - var checkboxActive = document.createElement("input"); - checkboxActive.classList.add(flagActive); - checkboxActive.type = 'checkbox'; - DOM.setElementValuesCurrentAndPrevious(checkboxActive, orderItem[flagActive]); - tdActive.appendChild(checkboxActive); - var tdDelete = document.createElement("td"); - tdDelete.classList.add(flagDelete); - var buttonDelete = document.createElement("button"); - buttonDelete.classList.add(flagDelete); - buttonDelete.textContent = 'x'; - tdDelete.appendChild(buttonDelete); + var tdActive = this.createTdActive(orderItem[flagActive]); var tr = document.createElement("tr"); tr.classList.add(flagOrderItems); tr.setAttribute(attrIdSupplierPurchaseOrder, orderItem[attrIdSupplierPurchaseOrder]); @@ -6991,7 +6978,6 @@ var PageStoreSupplierPurchaseOrders = /*#__PURE__*/function (_TableBasePage) { tr.appendChild(tdCostUnitLocalVatIncl); tr.appendChild(tdLatencyDeliveryDays); tr.appendChild(tdActive); - tr.appendChild(tdDelete); tbody.appendChild(tr); } }, { diff --git a/static/js/lib/business_objects/store/product_permutation.js b/static/js/lib/business_objects/store/product_permutation.js index ed168b82..ee5323d4 100644 --- a/static/js/lib/business_objects/store/product_permutation.js +++ b/static/js/lib/business_objects/store/product_permutation.js @@ -11,23 +11,29 @@ export default class ProductPermutation { parts = variationPair.split(':'); if (parts.length == 2) { let productVariationType = productVariationTypes[parts[0]]; - let productVariation = productVariations[parts[1]]; - if (productVariationType && productVariation) { - productVariations.push([productVariationType, productVariation]); - } + productVariationType[flagProductVariations].some((productVariation) => { + if (productVariation[attrIdProductVariation] == parts[1]) { + productVariations.push([productVariationType, productVariation]); + return true; + } + return false; + }); } }); return productVariations; } static getProductVariationsPreviewFromIdCsv(csvVariations) { - let variations = ProductPermutation.getProductVariationsFromIdCsv(csvVariations); + let variationPairs = ProductPermutation.getProductVariationsFromIdCsv(csvVariations); let preview = ''; - if (variations.length == 0) return preview; - variations.forEach((variation) => { + if (variationPairs.length == 0) return preview; + let variationType, variation; + variationPairs.forEach((variationPair) => { if (preview.length > 0) { preview += '\n'; } - preview += variation[0] + ': ' + variation[1] + ', '; + variationType = variationPair[0]; + variation = variationPair[1]; + preview += variationType[flagName] + ': ' + variation[flagName]; }); return preview; } diff --git a/static/js/pages/base_table.js b/static/js/pages/base_table.js index 6e020e8d..cf7cf1c5 100644 --- a/static/js/pages/base_table.js +++ b/static/js/pages/base_table.js @@ -919,6 +919,18 @@ export default class TableBasePage extends BasePage { hookupCurrencyFields() { this.hookupTableCellDdlPreviews(idTableMain + ' td.' + flagCurrency, Utils.getListFromDict(currencies)); } + + createTdActive(isActive) { + let tdActive = document.createElement("td"); + tdActive.classList.add(flagActive); + let buttonActive = document.createElement("button"); + buttonActive.classList.add(flagActive); + buttonActive.classList.add(isActive ? flagDelete : flagAdd); + buttonActive.textContent = isActive ? 'x' : '+'; + DOM.setElementAttributesValuesCurrentAndPrevious(buttonActive, isActive); + tdActive.appendChild(buttonActive); + return tdActive; + } leave() { if (this.constructor === TableBasePage) { diff --git a/static/js/pages/store/manufacturing_purchase_orders.js b/static/js/pages/store/manufacturing_purchase_orders.js index 5bc6c7e6..d03325a4 100644 --- a/static/js/pages/store/manufacturing_purchase_orders.js +++ b/static/js/pages/store/manufacturing_purchase_orders.js @@ -3,6 +3,7 @@ import API from "../../api.js"; import BusinessObjects from "../../lib/business_objects/business_objects.js"; import DOM from "../../dom.js"; import Events from "../../lib/events.js"; +import ProductPermutation from "../../lib/business_objects/store/product_permutation.js"; import TableBasePage from "../base_table.js"; import Utils from "../../lib/utils.js"; import Validation from "../../lib/validation.js"; @@ -38,7 +39,7 @@ export default class PageStoreManufacturingPurchaseOrders extends TableBasePage let inputPriceTotalLocalVatExcl = row.querySelector('td.' + flagPriceTotalLocalVatExcl + ' input'); let inputPriceTotalLocalVatIncl = row.querySelector('td.' + flagPriceTotalLocalVatIncl + ' input'); let trsPurchaseOrderItem = row.querySelectorAll('tr.' + flagOrderItems); - let checkboxActive = row.querySelector('td.' + flagActive + ' textarea'); + let buttonActive = row.querySelector(':scope > td.' + flagActive + ' button'); let jsonRow = {}; jsonRow[attrIdManufacturingPurchaseOrder] = row.getAttribute(attrIdManufacturingPurchaseOrder); @@ -54,7 +55,7 @@ export default class PageStoreManufacturingPurchaseOrders extends TableBasePage }); } jsonRow[flagOrderItems] = orderItems; - jsonRow[flagActive] = DOM.getElementAttributeValueCurrent(checkboxActive); + jsonRow[flagActive] = buttonActive.classList.contains(flagDelete); return jsonRow; } getJsonRowOrderItem(tr) { @@ -65,8 +66,9 @@ export default class PageStoreManufacturingPurchaseOrders extends TableBasePage let tdUnitQuantity = tr.querySelector('td.' + flagUnitMeasurementQuantity); let inputQuantityUsed = tr.querySelector('td.' + flagQuantityUsed + ' input'); let inputQuantityProduced = tr.querySelector('td.' + flagQuantityProduced + ' input'); + let tdUnitMeasurementLatencyManufacture = tr.querySelector('td.' + flagUnitMeasurementLatencyManufacture); let inputLatencyManufacture = tr.querySelector('td.' + flagLatencyManufacture + ' input'); - let checkboxActive = tr.querySelector('td.' + flagActive + ' input'); + let buttonActive = tr.querySelector(':scope > td.' + flagActive + ' button'); let jsonRow = {}; jsonRow[attrIdManufacturingPurchaseOrder] = tr.getAttribute(attrIdManufacturingPurchaseOrder); @@ -78,8 +80,9 @@ export default class PageStoreManufacturingPurchaseOrders extends TableBasePage jsonRow[attrIdUnitMeasurementQuantity] = DOM.getElementAttributeValueCurrent(tdUnitQuantity); jsonRow[flagQuantityUsed] = DOM.getElementAttributeValueCurrent(inputQuantityUsed); jsonRow[flagQuantityProduced] = DOM.getElementAttributeValueCurrent(inputQuantityProduced); + jsonRow[attrIdUnitMeasurementLatencyManufacture] = DOM.getElementAttributeValueCurrent(tdUnitMeasurementLatencyManufacture); jsonRow[flagLatencyManufacture] = DOM.getElementAttributeValueCurrent(inputLatencyManufacture); - jsonRow[flagActive] = DOM.getElementAttributeValueCurrent(checkboxActive); + jsonRow[flagActive] = buttonActive.classList.contains(flagDelete); return jsonRow; } @@ -125,10 +128,11 @@ export default class PageStoreManufacturingPurchaseOrders extends TableBasePage if (_verbose) { console.log("click order items preview"); } this.toggleColumnHeaderCollapsed(flagOrderItems, false); element.classList.remove(flagCollapsed); - let row = DOM.getRowFromElement(element); let idManufacturingPurchaseOrder = row.getAttribute(attrIdManufacturingPurchaseOrder); - let manufacturingPurchaseOrderProductLinksList = idManufacturingPurchaseOrder > 0 ? manufacturingPurchaseOrderProductLinks[idManufacturingPurchaseOrder] : []; + let manufacturingPurchaseOrder = idManufacturingPurchaseOrder > 0 ? manufacturingPurchaseOrders[idManufacturingPurchaseOrder] : { + [flagOrderItems]: [], + }; let tblOrderItems = document.createElement("table"); tblOrderItems.classList.add(flagOrderItems); let thead = document.createElement("thead"); @@ -207,7 +211,7 @@ export default class PageStoreManufacturingPurchaseOrders extends TableBasePage tblOrderItems.appendChild(thead); let tbody = document.createElement("tbody"); - manufacturingPurchaseOrderProductLinksList.forEach((orderItem, index) => { + manufacturingPurchaseOrder[flagOrderItems].forEach((orderItem, index) => { this.addRowManufacturingPurchaseOrderItem(tbody, orderItem); }); tblOrderItems.appendChild(tbody); @@ -221,7 +225,6 @@ export default class PageStoreManufacturingPurchaseOrders extends TableBasePage } addRowManufacturingPurchaseOrderItem(tbody, orderItem) { // productVariationTypeOptions, productVariationOptions, productCategoryOptions, productOptions, unitMeasurementOptions, if (_verbose) { console.log("addRowManufacturingPurchaseOrderItem: ", orderItem); } - let tdDisplayOrder = document.createElement("td"); tdDisplayOrder.classList.add(flagDisplayOrder); let inputDisplayOrder = document.createElement("input"); @@ -237,7 +240,8 @@ export default class PageStoreManufacturingPurchaseOrders extends TableBasePage let divCategory = document.createElement("div"); divCategory.classList.add(flagProductCategory); // DOM.setElementAttributesValuesCurrentAndPrevious(divCategory, orderItem[attrIdProductCategory]); - divCategory.textContent = orderItem[flagProductCategory]; + let productCategory = productCategories[orderItem[attrIdProductCategory]]; + divCategory.textContent = BusinessObjects.getObjectText(productCategory); tdCategory.appendChild(divCategory); let tdProduct = document.createElement("td"); @@ -246,7 +250,8 @@ export default class PageStoreManufacturingPurchaseOrders extends TableBasePage let divProduct = document.createElement("div"); divProduct.classList.add(flagProduct); // DOM.setElementAttributesValuesCurrentAndPrevious(divProduct, orderItem[attrIdProduct]); - divProduct.textContent = orderItem[flagProduct]; + let product = products[orderItem[attrIdProduct]]; + divProduct.textContent = BusinessObjects.getObjectText(product); tdProduct.appendChild(divProduct); let tdVariations = document.createElement("td"); @@ -256,7 +261,8 @@ export default class PageStoreManufacturingPurchaseOrders extends TableBasePage let divVariations = document.createElement("div"); divVariations.classList.add(flagProductVariations); // DOM.setElementAttributesValuesCurrentAndPrevious(divVariations, orderItem[attrIdProductVariation]); - divVariations.textContent = orderItem[flagProductVariations]; + let variationsText = ProductPermutation.getProductVariationsPreviewFromIdCsv(orderItem[flagProductVariations]); + divVariations.textContent = variationsText; tdVariations.appendChild(divVariations); let tdUnitQuantity = document.createElement("td"); @@ -265,6 +271,8 @@ export default class PageStoreManufacturingPurchaseOrders extends TableBasePage let divUnitQuantity = document.createElement("div"); divUnitQuantity.classList.add(flagUnitMeasurementQuantity); // DOM.setElementValuesCurrentAndPrevious(divUnitQuantity, orderItem[flagUnitMeasurementQuantity]); + let unitQuantity = unitMeasurements[orderItem[attrIdUnitMeasurementQuantity]]; + divUnitQuantity.textContent = BusinessObjects.getObjectText(unitQuantity); tdUnitQuantity.appendChild(divUnitQuantity); let tdQuantityUsed = document.createElement("td"); @@ -272,7 +280,7 @@ export default class PageStoreManufacturingPurchaseOrders extends TableBasePage let inputQuantityUsed = document.createElement("input"); inputQuantityUsed.classList.add(flagQuantityUsed); inputQuantityUsed.type = 'number'; - DOM.setElementAttributesValuesCurrentAndPrevious(inputQuantityUsed, orderItem[flagQuantityUsed]); + DOM.setElementValuesCurrentAndPrevious(inputQuantityUsed, orderItem[flagQuantityUsed]); tdQuantityUsed.appendChild(inputQuantityUsed); let tdQuantityProduced = document.createElement("td"); @@ -280,7 +288,7 @@ export default class PageStoreManufacturingPurchaseOrders extends TableBasePage let inputQuantityProduced = document.createElement("input"); inputQuantityProduced.classList.add(flagQuantityProduced); inputQuantityProduced.type = 'number'; - DOM.setElementAttributesValuesCurrentAndPrevious(inputQuantityProduced, orderItem[flagQuantityProduced]); + DOM.setElementValuesCurrentAndPrevious(inputQuantityProduced, orderItem[flagQuantityProduced]); tdQuantityProduced.appendChild(inputQuantityProduced); /* @@ -323,6 +331,8 @@ export default class PageStoreManufacturingPurchaseOrders extends TableBasePage let divUnitMeasurementLatencyManufacture = document.createElement("div"); divUnitMeasurementLatencyManufacture.classList.add(flagUnitMeasurementLatencyManufacture); // DOM.setElementValuesCurrentAndPrevious(divUnitMeasurementLatencyManufacture, orderItem[flagUnitMeasurementLatencyManufacture]); + let unitMeasurementLatencyManufacture = unitMeasurementsTime[orderItem[attrIdUnitMeasurementLatencyManufacture]]; + divUnitMeasurementLatencyManufacture.textContent = BusinessObjects.getObjectText(unitMeasurementLatencyManufacture); tdUnitMeasurementLatencyManufacture.appendChild(divUnitMeasurementLatencyManufacture); let tdLatencyManufacture = document.createElement("td"); @@ -331,23 +341,10 @@ export default class PageStoreManufacturingPurchaseOrders extends TableBasePage inputLatencyManufacture.classList.add(flagLatencyManufacture); inputLatencyManufacture.type = 'number'; inputLatencyManufacture.step = 1; - DOM.setElementAttributesValuesCurrentAndPrevious(inputLatencyManufacture, orderItem[flagLatencyManufacture]); + DOM.setElementValuesCurrentAndPrevious(inputLatencyManufacture, orderItem[flagLatencyManufacture]); tdLatencyManufacture.appendChild(inputLatencyManufacture); - let tdActive = document.createElement("td"); - tdActive.classList.add(flagActive); - let checkboxActive = document.createElement("input"); - checkboxActive.classList.add(flagActive); - checkboxActive.type = 'checkbox'; - DOM.setElementValuesCurrentAndPrevious(checkboxActive, orderItem[flagActive]); - tdActive.appendChild(checkboxActive); - - let tdDelete = document.createElement("td"); - tdDelete.classList.add(flagDelete); - let buttonDelete = document.createElement("button"); - buttonDelete.classList.add(flagDelete); - buttonDelete.textContent = 'x'; - tdDelete.appendChild(buttonDelete); + let tdActive = this.createTdActive(orderItem[flagActive]); let tr = document.createElement("tr"); tr.classList.add(flagOrderItems); @@ -369,7 +366,6 @@ export default class PageStoreManufacturingPurchaseOrders extends TableBasePage tr.appendChild(tdUnitMeasurementLatencyManufacture); tr.appendChild(tdLatencyManufacture); tr.appendChild(tdActive); - tr.appendChild(tdDelete); tbody.appendChild(tr); } hookupFieldsOrderItemDisplayOrder() { diff --git a/static/js/pages/store/product_categories.js b/static/js/pages/store/product_categories.js index 45b1ba1e..510bae4c 100644 --- a/static/js/pages/store/product_categories.js +++ b/static/js/pages/store/product_categories.js @@ -71,7 +71,7 @@ export default class PageStoreProductCategories extends TableBasePage { let textareaName = row.querySelector('td.' + flagName + ' textarea'); let textareaDescription = row.querySelector('td.' + flagDescription + ' textarea'); let tdAccessLevel = row.querySelector('td.' + flagAccessLevel); - let inputActive = row.querySelector('td.' + flagActive + ' input[type="checkbox"]'); + let buttonActive = row.querySelector(':scope > td.' + flagActive + ' button'); let jsonCategory = {}; jsonCategory[attrIdProductCategory] = row.getAttribute(attrIdProductCategory); @@ -80,7 +80,7 @@ export default class PageStoreProductCategories extends TableBasePage { jsonCategory[flagDescription] = DOM.getElementAttributeValueCurrent(textareaDescription); // jsonCategory[flagAccessLevelRequired] = tdAccessLevel.getAttribute(flagAccessLevelRequired); jsonCategory[attrIdAccessLevel] = DOM.getElementAttributeValueCurrent(tdAccessLevel); - jsonCategory[flagActive] = DOM.getElementAttributeValueCurrent(inputActive); + jsonCategory[flagActive] = buttonActive.classList.contains(flagDelete); jsonCategory[flagDisplayOrder] = DOM.getElementAttributeValueCurrent(sliderDisplayOrder); return jsonCategory; } diff --git a/static/js/pages/store/product_permutations.js b/static/js/pages/store/product_permutations.js index e7212414..31beebfb 100644 --- a/static/js/pages/store/product_permutations.js +++ b/static/js/pages/store/product_permutations.js @@ -147,7 +147,7 @@ export default class PageStoreProductPermutations extends TableBasePage { let checkboxDoesExpireFasterOnceUnsealed = row.querySelector('td.' + flagDoesExpireFasterOnceUnsealed + ' input'); let inputCountIntervalExpirationUnsealed = row.querySelector('td.' + flagCountUnitMeasurementIntervalExpirationUnsealed + ' input'); let tdUnitMeasurementIntervalExpirationUnsealed = row.querySelector('td.' + flagUnitMeasurementIntervalExpirationUnsealed); - let checkboxActive = row.querySelector('td.' + flagActive + ' input'); + let buttonActive = row.querySelector(':scope > td.' + flagActive + ' button'); let jsonRow = {}; jsonRow[attrIdProductPermutation] = row.getAttribute(attrIdProductPermutation); @@ -173,7 +173,7 @@ export default class PageStoreProductPermutations extends TableBasePage { jsonRow[flagDoesExpireFasterOnceUnsealed] = checkboxDoesExpireFasterOnceUnsealed.getAttribute(attrValueCurrent); jsonRow[flagCountUnitMeasurementIntervalExpirationUnsealed] = inputCountIntervalExpirationUnsealed.getAttribute(attrValueCurrent); jsonRow[flagUnitMeasurementIntervalExpirationUnsealed] = tdUnitMeasurementIntervalExpirationUnsealed.getAttribute(attrValueCurrent); - jsonRow[flagActive] = checkboxActive.getAttribute(attrValueCurrent); + jsonRow[flagActive] = buttonActive.classList.contains(flagDelete); return jsonRow; } initialiseRowNew(tbody, row) { diff --git a/static/js/pages/store/product_variations.js b/static/js/pages/store/product_variations.js index cf889033..a94a8c12 100644 --- a/static/js/pages/store/product_variations.js +++ b/static/js/pages/store/product_variations.js @@ -38,7 +38,7 @@ export default class PageStoreProductVariations extends TableBasePage { let textareaName = row.querySelector('td.' + flagName + ' textarea'); let textareaNamePlural = row.querySelector('td.' + flagNamePlural + ' textarea'); let tdProductVariations = row.querySelector('td.' + flagProductVariations); - let buttonActive = row.querySelector('td.' + flagActive + ' button'); + let buttonActive = row.querySelector(':scope > td.' + flagActive + ' button'); let jsonRow = {}; jsonRow[attrIdProductVariationType] = row.getAttribute(attrIdProductVariationType); @@ -69,7 +69,7 @@ export default class PageStoreProductVariations extends TableBasePage { let textareaCode = tr.querySelector('td.' + flagCode + ' textarea'); let textareaName = tr.querySelector('td.' + flagName + ' textarea'); // let checkboxActive = tr.querySelector('td.' + flagActive + ' input'); - let buttonActive = tr.querySelector('td.' + flagActive + ' button'); + let buttonActive = tr.querySelector(':scope > td.' + flagActive + ' button'); let jsonRow = {}; jsonRow[attrIdProductVariation] = tr.getAttribute(attrIdProductVariation); @@ -192,14 +192,7 @@ export default class PageStoreProductVariations extends TableBasePage { DOM.setElementValuesCurrentAndPrevious(textareaName, productVariation[flagName]); tdName.appendChild(textareaName); - let tdActive = document.createElement("td"); - tdActive.classList.add(flagActive); - let buttonActive = document.createElement("button"); - buttonActive.classList.add(flagActive); - buttonActive.classList.add(productVariation[flagActive] ? flagDelete : flagAdd); - buttonActive.textContent = productVariation[flagActive] ? 'x' : '+'; - DOM.setElementAttributesValuesCurrentAndPrevious(buttonActive, productVariation[flagActive]); - tdActive.appendChild(buttonActive); + let tdActive = this.createTdActive(productVariation[flagActive]); let tr = document.createElement("tr"); tr.classList.add(flagProductVariation); diff --git a/static/js/pages/store/products.js b/static/js/pages/store/products.js index 840d2d98..736b026f 100644 --- a/static/js/pages/store/products.js +++ b/static/js/pages/store/products.js @@ -72,7 +72,7 @@ export default class PageStoreProducts extends TableBasePage { // let tdProductVariations = row.querySelector('td.' + flagProductVariations); let inputHasVariations = row.querySelector('td.' + flagHasVariations + ' input[type="checkbox"]'); let tdAccessLevel = row.querySelector('td.' + flagAccessLevel); - let inputActive = row.querySelector('td.' + flagActive + ' input[type="checkbox"]'); + let buttonActive = row.querySelector(':scope > td.' + flagActive + ' button'); let jsonProduct = {}; jsonProduct[attrIdProduct] = row.getAttribute(attrIdProduct); @@ -83,7 +83,7 @@ export default class PageStoreProducts extends TableBasePage { jsonProduct[flagHasVariations] = DOM.getElementAttributeValueCurrent(inputHasVariations); // jsonProduct[flagAccessLevelRequired] = tdAccessLevel.getAttribute(flagAccessLevelRequired); jsonProduct[attrIdAccessLevel] = DOM.getElementAttributeValueCurrent(tdAccessLevel); - jsonProduct[flagActive] = DOM.getElementAttributeValueCurrent(inputActive); + jsonProduct[flagActive] = buttonActive.classList.contains(flagDelete); jsonProduct[flagDisplayOrder] = DOM.getElementAttributeValueCurrent(sliderDisplayOrder); return jsonProduct; } diff --git a/static/js/pages/store/stock_items.js b/static/js/pages/store/stock_items.js index fc34b9c3..673ea379 100644 --- a/static/js/pages/store/stock_items.js +++ b/static/js/pages/store/stock_items.js @@ -84,7 +84,7 @@ export default class PageStoreStockItems extends TableBasePage { let inputDateExpiration = row.querySelector('td.' + flagDateExpiration + ' input'); let inputIsConsumed = row.querySelector('td.' + flagIsConsumed + ' input'); let inputDateConsumed = row.querySelector('td.' + flagDateConsumed + ' input'); - let checkboxActive = row.querySelector('td.' + flagActive + ' input'); + let buttonActive = row.querySelector(':scope > td.' + flagActive + ' button'); let jsonRow = {}; jsonRow[attrIdStockItem] = row.getAttribute(attrIdStockItem); @@ -104,7 +104,7 @@ export default class PageStoreStockItems extends TableBasePage { jsonRow[flagDateExpiration] = DOM.getElementAttributeValueCurrent(inputDateExpiration); jsonRow[flagIsConsumed] = DOM.getElementAttributeValueCurrent(inputIsConsumed); jsonRow[flagDateConsumed] = DOM.getElementAttributeValueCurrent(inputDateConsumed); - jsonRow[flagActive] = checkboxActive.getAttribute(attrValueCurrent); + jsonRow[flagActive] = buttonActive.classList.contains(flagDelete); return jsonRow; } initialiseRowNew(tbody, row) { diff --git a/static/js/pages/store/supplier_purchase_orders.js b/static/js/pages/store/supplier_purchase_orders.js index 412e57fc..5ea1c014 100644 --- a/static/js/pages/store/supplier_purchase_orders.js +++ b/static/js/pages/store/supplier_purchase_orders.js @@ -38,7 +38,7 @@ export default class PageStoreSupplierPurchaseOrders extends TableBasePage { let inputCostTotalLocalVatExcl = row.querySelector('td.' + flagCostTotalLocalVatExcl + ' input'); let inputCostTotalLocalVatIncl = row.querySelector('td.' + flagCostTotalLocalVatIncl + ' input'); let trsPurchaseOrderItem = row.querySelectorAll('tr.' + flagOrderItems); - let checkboxActive = row.querySelector('td.' + flagActive + ' input[type="checkbox"]'); + let buttonActive = tr.querySelector(':scope > td.' + flagActive + ' button'); let jsonRow = {}; jsonRow[attrIdSupplierPurchaseOrder] = row.getAttribute(attrIdSupplierPurchaseOrder); @@ -54,7 +54,7 @@ export default class PageStoreSupplierPurchaseOrders extends TableBasePage { }); } jsonRow[flagOrderItems] = orderItems; - jsonRow[flagActive] = DOM.getElementAttributeValueCurrent(checkboxActive); + jsonRow[flagActive] = buttonActive.classList.contains(flagDelete); return jsonRow; } getJsonRowOrderItem(tr) { @@ -68,7 +68,7 @@ export default class PageStoreSupplierPurchaseOrders extends TableBasePage { let inputCostTotalLocalVatExcl = tr.querySelector('td.' + flagCostTotalLocalVatExcl + ' input'); let inputCostTotalLocalVatIncl = tr.querySelector('td.' + flagCostTotalLocalVatIncl + ' input'); let inputLatencyDeliveryDays = tr.querySelector('td.' + flagLatencyDeliveryDays + ' input'); - let checkboxActive = tr.querySelector('td.' + flagActive + ' input'); + let buttonActive = tr.querySelector(':scope > td.' + flagActive + ' button'); let jsonRow = {}; jsonRow[attrIdSupplierPurchaseOrder] = tr.getAttribute(attrIdSupplierPurchaseOrder); @@ -83,7 +83,7 @@ export default class PageStoreSupplierPurchaseOrders extends TableBasePage { jsonRow[flagCostTotalLocalVatExcl] = DOM.getElementAttributeValueCurrent(inputCostTotalLocalVatExcl); jsonRow[flagCostTotalLocalVatIncl] = DOM.getElementAttributeValueCurrent(inputCostTotalLocalVatIncl); jsonRow[flagLatencyDeliveryDays] = DOM.getElementAttributeValueCurrent(inputLatencyDeliveryDays); - jsonRow[flagActive] = DOM.getElementAttributeValueCurrent(checkboxActive); + jsonRow[flagActive] = buttonActive.classList.contains(flagDelete); return jsonRow; } @@ -340,20 +340,7 @@ export default class PageStoreSupplierPurchaseOrders extends TableBasePage { DOM.setElementValuesCurrentAndPrevious(inputLatencyDeliveryDays, orderItem[flagLatencyDeliveryDays]); tdLatencyDeliveryDays.appendChild(inputLatencyDeliveryDays); - let tdActive = document.createElement("td"); - tdActive.classList.add(flagActive); - let checkboxActive = document.createElement("input"); - checkboxActive.classList.add(flagActive); - checkboxActive.type = 'checkbox'; - DOM.setElementValuesCurrentAndPrevious(checkboxActive, orderItem[flagActive]); - tdActive.appendChild(checkboxActive); - - let tdDelete = document.createElement("td"); - tdDelete.classList.add(flagDelete); - let buttonDelete = document.createElement("button"); - buttonDelete.classList.add(flagDelete); - buttonDelete.textContent = 'x'; - tdDelete.appendChild(buttonDelete); + let tdActive = this.createTdActive(orderItem[flagActive]); let tr = document.createElement("tr"); tr.classList.add(flagOrderItems); @@ -372,7 +359,6 @@ export default class PageStoreSupplierPurchaseOrders extends TableBasePage { tr.appendChild(tdCostUnitLocalVatIncl); tr.appendChild(tdLatencyDeliveryDays); tr.appendChild(tdActive); - tr.appendChild(tdDelete); tbody.appendChild(tr); } hookupFieldsOrderItemDisplayOrder() { diff --git a/static/js/pages/store/suppliers.js b/static/js/pages/store/suppliers.js index 8201d3f3..b7c49ddf 100644 --- a/static/js/pages/store/suppliers.js +++ b/static/js/pages/store/suppliers.js @@ -41,7 +41,7 @@ export default class PageStoreSuppliers extends TableBasePage { let textareaEmail = row.querySelector('td.' + flagEmail + ' textarea'); let textareaWebsite = row.querySelector('td.' + flagWebsite + ' textarea'); let tdCurrency = row.querySelector('td.' + flagCurrency); - let checkboxActive = row.querySelector('td.' + flagActive + ' input[type="checkbox"]'); + let buttonActive = row.querySelector(':scope > td.' + flagActive + ' button'); let jsonRow = {}; jsonRow[attrIdSupplier] = row.getAttribute(attrIdSupplier); @@ -55,7 +55,7 @@ export default class PageStoreSuppliers extends TableBasePage { jsonRow[flagEmail] = DOM.getElementAttributeValueCurrent(textareaEmail); jsonRow[flagWebsite] = DOM.getElementAttributeValueCurrent(textareaWebsite); jsonRow[attrIdCurrency] = DOM.getElementAttributeValueCurrent(tdCurrency); - jsonRow[flagActive] = DOM.getElementAttributeValueCurrent(checkboxActive); + jsonRow[flagActive] = buttonActive.classList.contains(flagDelete); return jsonRow; } getSupplierAddressesFromRow(row) { @@ -250,20 +250,7 @@ export default class PageStoreSuppliers extends TableBasePage { DOM.setElementValuesCurrentAndPrevious(ddlRegion, region[attrIdRegion]); tdRegion.appendChild(ddlRegion); - let tdActive = document.createElement("td"); - tdActive.classList.add(flagActive); - let checkboxActive = document.createElement("input"); - checkboxActive.classList.add(flagActive); - checkboxActive.type = 'checkbox'; - DOM.setElementValuesCurrentAndPrevious(checkboxActive, supplierAddress[flagActive]); - tdActive.appendChild(checkboxActive); - - let tdDelete = document.createElement("td"); - tdDelete.classList.add(flagDelete); - let buttonDelete = document.createElement("button"); - buttonDelete.classList.add(flagDelete); - buttonDelete.textContent = 'x'; - tdDelete.appendChild(buttonDelete); + let tdActive = this.createTdActive(supplierAddress[flagActive]); let tr = document.createElement("tr"); tr.setAttribute(attrIdSupplierAddress, supplierAddress[attrIdSupplierAddress]); @@ -275,7 +262,6 @@ export default class PageStoreSuppliers extends TableBasePage { tr.appendChild(tdCounty); tr.appendChild(tdRegion); tr.appendChild(tdActive); - tr.appendChild(tdDelete); tbody.appendChild(tr); } hookupAddressPostcodeInputs() { diff --git a/templates/layouts/layout.html b/templates/layouts/layout.html index d3a21e70..d728221c 100644 --- a/templates/layouts/layout.html +++ b/templates/layouts/layout.html @@ -127,6 +127,7 @@ var flagNameAttrOptionText = "{{ model.FLAG_NAME_ATTR_OPTION_TEXT}}"; var flagNameAttrOptionValue = "{{ model.FLAG_NAME_ATTR_OPTION_VALUE }}"; var flagNamePlural = "{{ model.FLAG_NAME_PLURAL }}"; + {# var flagNameSingular = "{{ model.FLAG_NAME_SINGULAR }}"; #} var flagNavAdminHome = "{{ model.FLAG_NAV_ADMIN_HOME }}"; var flagNavAdminStoreStripePrices = "{{ model.FLAG_NAV_ADMIN_STORE_STRIPE_PRICES }}"; var flagNavAdminStoreStripeProducts = "{{ model.FLAG_NAV_ADMIN_STORE_STRIPE_PRODUCTS }}"; diff --git a/templates/pages/store/_manufacturing_purchase_orders.html b/templates/pages/store/_manufacturing_purchase_orders.html index 3282634a..53e664a2 100644 --- a/templates/pages/store/_manufacturing_purchase_orders.html +++ b/templates/pages/store/_manufacturing_purchase_orders.html @@ -58,7 +58,7 @@ {% set is_blank_row = False %} - {% for manufacturing_purchase_order in model.manufacturing_purchase_orders %} + {% for order in model.manufacturing_purchase_orders %} {% include 'components/store/_row_manufacturing_purchase_order.html' %} {% endfor %} @@ -76,7 +76,7 @@ var currencies = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.currencies) | tojson | safe }}; var flagQuantityProduced = "{{ model.FLAG_QUANTITY_PRODUCED }}"; var flagQuantityUsed = "{{ model.FLAG_QUANTITY_USED }}"; - var manufacturing_purchase_orders = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.manufacturing_purchase_orders) | tojson | safe }}; + var manufacturingPurchaseOrders = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.manufacturing_purchase_orders) | tojson | safe }}; var products = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.category_list_filters.get_list_products()) | tojson | safe }}; var productCategories = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.category_list_filters.categories) | tojson | safe }}; var productVariations = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.variations) | tojson | safe }};