Feat(MySQL): Database population with data for Kitchen project.

This commit is contained in:
2024-11-11 14:56:55 +00:00
parent db15a7f8fc
commit 88ccfe592a
26 changed files with 591 additions and 280 deletions

133
app.log.1
View File

@@ -1,10 +1,9 @@
Server Error: 'Product_Variation_Type' object has no attribute 'name' Request: 127.0.0.1 GET http /store/stock_items? Host: 127.0.0.1:5000
Request: 127.0.0.1 GET http /store/permutations? 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 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: 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-Language: en-GB,en;q=0.5
Accept-Encoding: gzip, deflate, br, zstd Accept-Encoding: gzip, deflate, br, zstd
@@ -19,64 +18,86 @@ Priority: u=0, i
Upgrade-Insecure-Requests: 1 Upgrade-Insecure-Requests: 1
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: same-origin
Sec-Fetch-User: ?1
Sec-Gpc: 1
Priority: u=0, i
Request data: b''
Traceback: Traceback (most recent call last): 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 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( 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 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) cursor.execute(statement, parameters)
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\MySQLdb\cursors.py", line 179, in execute File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\MySQLdb\cursors.py", line 179, in execute
Sec-Fetch-User: ?1 res = self._query(mogrified_query)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Sec-Gpc: 1 File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\MySQLdb\cursors.py", line 330, in _query
db.query(q)
Priority: u=0, i 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:
Request data: b''
Traceback: Traceback (most recent call last): 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 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() rv = self.dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 865, in 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] 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 File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\controllers\store\stock_item.py", line 40, in stock_items
return render_template('pages/store/_product_permutations.html', model = model) model = Model_View_Store_Stock_Item(form_filters)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\templating.py", line 150, in render_template File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\models\model_view_store_stock_item.py", line 93, in __init__
return _render(app, template, context) self.storage_locations = self.get_many_storage_location(False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\templating.py", line 131, in _render 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
rv = template.render(context) storage_locations = DataStore_Store_Base().get_many_storage_location(get_inactive)
^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\jinja2\environment.py", line 1304, in render 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
self.environment.handle_exception() result = self.db_procedure_execute(_m_db_storage_location, argument_dict_list_storage_location)
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\datastores\datastore_base.py", line 95, in db_procedure_execute
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 result = db.session.execute(proc_string, argument_dict_list)
{% extends 'layouts/layout.html' %} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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 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 raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
{% block page_body %}{% endblock %} 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\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\templates\pages\store\_product_permutations.html", line 131, in block 'page_body' File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\default.py", line 924, in do_execute
{% include 'components/store/_row_product_permutation.html' %} cursor.execute(statement, parameters)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\templates\components\store\_row_product_permutation.html", line 94, in top-level template code
{% include 'components/store/_preview_product_permutation_variations.html' %}
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\templates\components\store\_preview_product_permutation_variations.html", line 5, in top-level template code
{% set str_variations = variation_tree.to_preview_str() %}
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\business_objects\store\product_variation_tree.py", line 145, in to_preview_str
preview_str += f'{variation_type.name}: {variation_type.variations[0].name}'
^^^^^^^^^^^^^^^^^^^
AttributeError: 'Product_Variation_Type' object has no attribute 'name'
config_env: development
config_env: development
Server Error: 'variation_type' is undefined
Request: 127.0.0.1 GET http /store/permutations? Host: 127.0.0.1:5000

112
app.log.2
View File

@@ -1,57 +1,10 @@
Traceback: Traceback (most recent call last): Server Error: 'NoneType' object has no attribute 'to_json'
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request Request: 127.0.0.1 GET http /store/stock_items? Host: 127.0.0.1:5000
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 149, in block 'page_body'
var products = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.category_list.get_list_products()) | 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\product.py", line 347, in to_json
self.ATTR_ID_PRODUCT_PERMUTATION: [permutation.to_json() for permutation in self.permutations],
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\business_objects\store\product_permutation.py", line 305, in to_json
self.FLAG_PRODUCT_VARIATIONS: [variation_type.to_json() for variation_type in self.variation_tree.get_product_variation_types()],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get_product_variation_types'
config_env: development
config_env: development
config_env: development
config_env: development
Server Error: 'Product_Variation_Tree' object has no attribute 'get_product_variations'
Request: 127.0.0.1 GET http /store/permutations? 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 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: 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-Language: en-GB,en;q=0.5
Accept-Encoding: gzip, deflate, br, zstd Accept-Encoding: gzip, deflate, br, zstd
@@ -72,26 +25,45 @@ Traceback: Traceback (most recent call last):
Sec-Fetch-Site: same-origin Sec-Fetch-Site: same-origin
Sec-Fetch-User: ?1 Sec-Fetch-User: ?1
Sec-Gpc: 1 Sec-Gpc: 1
Priority: u=0, i Priority: u=0, i
Request data: b'' Request data: b''
Traceback: Traceback (most recent call last): 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 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() rv = self.dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 865, in 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] 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 43, in permutations File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\controllers\store\stock_item.py", line 45, in stock_items
model = Model_View_Store_Product_Permutation(form_filters) 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' 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 }}; 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))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

122
app.log.3
View File

@@ -1,11 +1,60 @@
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 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 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: 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-Language: en-GB,en;q=0.5
Accept-Encoding: gzip, deflate, br, zstd Accept-Encoding: gzip, deflate, br, zstd
Referer: http://127.0.0.1:5000/store/stock_items Referer: http://127.0.0.1:5000/store/stock_items
@@ -24,44 +73,37 @@ Traceback: Traceback (most recent call last):
Sec-Fetch-Site: same-origin Sec-Fetch-Site: same-origin
Sec-Fetch-User: ?1 Sec-Fetch-User: ?1
Sec-Gpc: 1 Sec-Gpc: 1
Priority: u=0, i Priority: u=0, i
Request data: b'' Request data: b''
Traceback: Traceback (most recent call last): 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 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() rv = self.dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 865, in 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] 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 File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\templates\layouts\layout.html", line 354, in top-level template code
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 54, in __init__
self.category_list_filters, errors_filters = datastore_store.get_many_product(Parameters_Product.get_default())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\datastores\datastore_store_base.py", line 133, in get_many_product
category_list.add_product_image(new_image)
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\business_objects\store\product_category.py", line 366, in add_product_image
self.categories[index_category].add_product_image(image)
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\business_objects\store\product_category.py", line 129, in add_product_image
self.products[index_product].add_product_image(image)
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\business_objects\store\product.py", line 286, in add_product_image
index_permutation = self.permutation_index[image.id_permutation] # self.get_index_permutation_from_id(image.id_permutation)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
KeyError: 1
config_env: development
config_env: development
config_env: development
config_env: development
Server Error: 'NoneType' object has no attribute 'get_product_variation_types'
Request: 127.0.0.1 GET http /store/permutations? Host: 127.0.0.1:5000

View File

@@ -54,6 +54,7 @@ class Address(db.Model, Base):
address = cls() address = cls()
address.id_address = query_row[1] address.id_address = query_row[1]
address.id_region = query_row[2] address.id_region = query_row[2]
return address
@classmethod @classmethod
def from_DB_stock_item(cls, query_row): def from_DB_stock_item(cls, query_row):
address = cls() address = cls()
@@ -81,7 +82,7 @@ class Address(db.Model, Base):
return { return {
**self.get_shared_json_attributes(self), **self.get_shared_json_attributes(self),
self.ATTR_ID_ADDRESS: self.id_address, self.ATTR_ID_ADDRESS: self.id_address,
self.FLAG_REGION: self.region.to_json(), self.FLAG_REGION: None if self.region is None else self.region.to_json(),
self.FLAG_POSTCODE: self.postcode, self.FLAG_POSTCODE: self.postcode,
self.FLAG_ADDRESS_LINE_1: self.address_line_1, self.FLAG_ADDRESS_LINE_1: self.address_line_1,
self.FLAG_ADDRESS_LINE_2: self.address_line_2, self.FLAG_ADDRESS_LINE_2: self.address_line_2,

View File

@@ -76,7 +76,7 @@ class Plant(db.Model, Store_Base):
self.ATTR_ID_PLANT: self.id_plant, self.ATTR_ID_PLANT: self.id_plant,
self.FLAG_CODE: self.code, self.FLAG_CODE: self.code,
self.FLAG_NAME: self.name, self.FLAG_NAME: self.name,
self.FLAG_ADDRESS: self.address.to_json(), self.FLAG_ADDRESS: None if self.address is None else self.address.to_json(),
self.ATTR_ID_USER_MANAGER: self.id_user_manager, self.ATTR_ID_USER_MANAGER: self.id_user_manager,
self.FLAG_ACTIVE: 1 if av.input_bool(self.active, self.FLAG_ACTIVE, f'{self.__class__.__name__}.to_json') else 0 self.FLAG_ACTIVE: 1 if av.input_bool(self.active, self.FLAG_ACTIVE, f'{self.__class__.__name__}.to_json') else 0
} }

View File

@@ -43,9 +43,9 @@ class Storage_Location(db.Model, Store_Base):
location.id_location = query_row[0] location.id_location = query_row[0]
location.id_plant = query_row[1] location.id_plant = query_row[1]
location.plant = Plant.from_DB_storage_location(query_row) location.plant = Plant.from_DB_storage_location(query_row)
location.code = query_row[2] location.code = query_row[4]
location.name = query_row[3] location.name = query_row[5]
location.active = query_row[4] location.active = query_row[6]
return location return location
@classmethod @classmethod
def from_DB_stock_item(cls, query_row): def from_DB_stock_item(cls, query_row):

View File

@@ -20,9 +20,11 @@ from business_objects.store.delivery_option import Delivery_Option
from business_objects.region import Region from business_objects.region import Region
from business_objects.store.discount import Discount from business_objects.store.discount import Discount
from business_objects.store.order import Order from business_objects.store.order import Order
from business_objects.store.plant import Plant
from business_objects.store.product import Product, Product_Permutation, Parameters_Product from business_objects.store.product import Product, Product_Permutation, Parameters_Product
from business_objects.sql_error import SQL_Error from business_objects.sql_error import SQL_Error
from business_objects.store.stock_item import Stock_Item from business_objects.store.stock_item import Stock_Item
from business_objects.store.storage_location import Storage_Location
from business_objects.user import User, User_Filters, User_Permission_Evaluation from business_objects.user import User, User_Filters, User_Permission_Evaluation
from business_objects.store.product_variation import Product_Variation, Parameters_Product_Variation from business_objects.store.product_variation import Product_Variation, Parameters_Product_Variation
from business_objects.store.product_variation_type import Product_Variation_Type from business_objects.store.product_variation_type import Product_Variation_Type
@@ -194,13 +196,66 @@ class DataStore_Store_Base(DataStore_Base):
index_comma = msg_error_availability.find(',') index_comma = msg_error_availability.find(',')
ids_permutation.append(msg_error_availability[:index_comma]) ids_permutation.append(msg_error_availability[:index_comma])
return ids_permutation return ids_permutation
@classmethod @classmethod
def get_many_currency(cls): def get_many_plant(cls, get_inactive = False):
_m = 'DataStore_Store_Base.get_many_plant'
_m_db_plant = 'p_shop_get_many_plant'
argument_dict_list_plant = {
'a_get_inactive_plant': 1 if get_inactive else 0
}
Helper_App.console_log(f'executing {_m_db_plant}')
result = cls.db_procedure_execute(_m_db_plant, argument_dict_list_plant)
cursor = result.cursor
Helper_App.console_log('data received')
# cursor.nextset()
result_set_1 = cursor.fetchall()
plants = []
for row in result_set_1:
plant = Plant.from_DB_plant(row)
plants.append(plant)
Helper_App.console_log(f'plants: {plants}')
DataStore_Store_Base.db_cursor_clear(cursor)
cursor.close()
return plants
@classmethod
def get_many_storage_location(self, get_inactive = False):
_m = 'DataStore_Store_Base.get_many_storage_location'
_m_db_storage_location = 'p_shop_get_many_storage_location'
argument_dict_list_storage_location = {
'a_get_inactive_storage_location': 1 if get_inactive else 0
}
Helper_App.console_log(f'executing {_m_db_storage_location}')
result = self.db_procedure_execute(_m_db_storage_location, argument_dict_list_storage_location)
cursor = result.cursor
Helper_App.console_log('data received')
# cursor.nextset()
result_set_1 = cursor.fetchall()
storage_locations = []
for row in result_set_1:
storage_location = Storage_Location.from_DB_storage_location(row)
storage_locations.append(storage_location)
Helper_App.console_log(f'storage_locations: {storage_locations}')
DataStore_Store_Base.db_cursor_clear(cursor)
cursor.close()
return storage_locations
@classmethod
def get_many_currency(cls, get_inactive = False):
_m = 'DataStore_Store_Base.get_many_currency' _m = 'DataStore_Store_Base.get_many_currency'
_m_db_currency = 'p_shop_get_many_currency' _m_db_currency = 'p_shop_get_many_currency'
argument_dict_list_currency = { argument_dict_list_currency = {
'a_get_inactive_currency': 0 'a_get_inactive_currency': 1 if get_inactive else 0
} }
Helper_App.console_log(f'executing {_m_db_currency}') Helper_App.console_log(f'executing {_m_db_currency}')
@@ -220,12 +275,12 @@ class DataStore_Store_Base(DataStore_Base):
return currencies return currencies
@classmethod @classmethod
def get_many_region(cls): def get_many_region(cls, get_inactive = False):
_m = 'DataStore_Store_Base.get_many_region' _m = 'DataStore_Store_Base.get_many_region'
_m_db_region = 'p_shop_get_many_region' _m_db_region = 'p_shop_get_many_region'
argument_dict_list_region = { argument_dict_list_region = {
'a_get_inactive_currency': 0 'a_get_inactive_region': 1 if get_inactive else 0
} }
Helper_App.console_log(f'executing {_m_db_region}') Helper_App.console_log(f'executing {_m_db_region}')
@@ -246,10 +301,10 @@ class DataStore_Store_Base(DataStore_Base):
return regions return regions
@classmethod @classmethod
def get_many_region_and_currency(cls): def get_many_region_and_currency(cls, get_inactive_currency = False, get_inactive_region = False):
_m = 'DataStore_Store_Base.get_many_region_and_currency' _m = 'DataStore_Store_Base.get_many_region_and_currency'
currencies = cls.get_many_currency() currencies = cls.get_many_currency(get_inactive_currency)
regions = cls.get_many_region() regions = cls.get_many_region(get_inactive_region)
return regions, currencies return regions, currencies
@classmethod @classmethod

View File

@@ -492,6 +492,12 @@ class Model_View_Store(Model_View_Base):
# validation conducted by server # validation conducted by server
return DataStore_User().get_many_user_order(self.info_user['sub'], ids_order, n_order_max, id_checkout_session) return DataStore_User().get_many_user_order(self.info_user['sub'], ids_order, n_order_max, id_checkout_session)
def get_many_plant(self, get_inactive = False):
plants = DataStore_Store_Base().get_many_plant(get_inactive)
return plants
def get_many_storage_location(self, get_inactive = False):
storage_locations = DataStore_Store_Base().get_many_storage_location(get_inactive)
return storage_locations
def get_many_currency(self): def get_many_currency(self):
currencies = DataStore_Store_Base().get_many_currency() currencies = DataStore_Store_Base().get_many_currency()
return currencies return currencies

View File

@@ -33,6 +33,8 @@ class Model_View_Store_Stock_Item(Model_View_Store):
filters_stock_item: Filters_Stock_Item filters_stock_item: Filters_Stock_Item
form_filters: Filters_Stock_Item = None form_filters: Filters_Stock_Item = None
list_options_product: list = None list_options_product: list = None
plants: list = None
storage_locations: list = None
units_measurement: list = None units_measurement: list = None
units_measurement_time: list = None units_measurement_time: list = None
variations: list = None variations: list = None
@@ -87,6 +89,8 @@ class Model_View_Store_Stock_Item(Model_View_Store):
self.units_measurement_time = [unit_measurement for unit_measurement in self.units_measurement if unit_measurement.is_unit_of_time] self.units_measurement_time = [unit_measurement for unit_measurement in self.units_measurement if unit_measurement.is_unit_of_time]
self.currencies = self.get_many_currency() self.currencies = self.get_many_currency()
self.currency_options = [currency.to_json_option() for currency in self.currencies] self.currency_options = [currency.to_json_option() for currency in self.currencies]
self.plants = self.get_many_plant(False)
self.storage_locations = self.get_many_storage_location(False)
@classmethod @classmethod
def save_stock_items(cls, comment, list_stock_items): def save_stock_items(cls, comment, list_stock_items):

View File

@@ -173,10 +173,14 @@ DROP TABLE IF EXISTS Shop_Variation_Audit;
DROP TABLE IF EXISTS Shop_Variation; DROP TABLE IF EXISTS Shop_Variation;
DROP TABLE IF EXISTS Shop_Product_Variation_Type_Link_Audit; DROP TABLE IF EXISTS Shop_Product_Variation_Type_Link_Audit;
DROP TABLE IF EXISTS Shop_Product_Variation_Type_Link; DROP TABLE IF EXISTS Shop_Product_Variation_Type_Link;
DROP TABLE IF EXISTS Shop_Product_Variation_Temp;
DROP TABLE IF EXISTS Shop_Product_Variation;
DROP TABLE IF EXISTS Shop_Variation_Type_Temp; DROP TABLE IF EXISTS Shop_Variation_Type_Temp;
DROP TABLE IF EXISTS Shop_Variation_Type_Audit; DROP TABLE IF EXISTS Shop_Variation_Type_Audit;
DROP TABLE IF EXISTS Shop_Variation_Type; DROP TABLE IF EXISTS Shop_Variation_Type;
DROP TABLE IF EXISTS Shop_Product_Variation_Type_Temp;
DROP TABLE IF EXISTS Shop_Product_Variation_Type;
DROP TABLE IF EXISTS Shop_Product_Permutation_Temp; DROP TABLE IF EXISTS Shop_Product_Permutation_Temp;
DROP TABLE IF EXISTS Shop_Product_Permutation_Audit; DROP TABLE IF EXISTS Shop_Product_Permutation_Audit;
@@ -1475,9 +1479,9 @@ CREATE TABLE IF NOT EXISTS Shop_Variation_Type_Audit (
SELECT CONCAT('WARNING: Table ', TABLE_NAME, ' already exists.') AS msg_warning FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'Shop_Variation_Type_Temp'; SELECT CONCAT('WARNING: Table ', TABLE_NAME, ' already exists.') AS msg_warning FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'Shop_Variation_Type_Temp';
CREATE TABLE IF NOT EXISTS Shop_Variation_Type_Temp ( CREATE TABLE IF NOT EXISTS Shop_Variation_Type_Temp (
id_temp INT NOT NULL PRIMARY KEY id_temp INT NOT NULL PRIMARY KEY AUTO_INCREMENT
, id_type INT NOT NULL , id_type INT NOT NULL
, id_type_temp INT NOT NULL -- , id_type_temp INT NOT NULL
, code VARCHAR(50) , code VARCHAR(50)
, name VARCHAR(255) , name VARCHAR(255)
, name_plural VARCHAR(256) , name_plural VARCHAR(256)
@@ -1536,10 +1540,12 @@ CREATE TABLE IF NOT EXISTS Shop_Variation_Audit (
# Variations Temp # Variations Temp
-- DROP TABLE partsltd_prod.Shop_Variation_Temp;
SELECT CONCAT('WARNING: Table ', TABLE_NAME, ' already exists.') AS msg_warning FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'Shop_Variation_Temp'; SELECT CONCAT('WARNING: Table ', TABLE_NAME, ' already exists.') AS msg_warning FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'Shop_Variation_Temp';
CREATE TABLE Shop_Variation_Temp ( CREATE TABLE Shop_Variation_Temp (
id_temp INT NOT NULL PRIMARY KEY id_temp INT NOT NULL PRIMARY KEY AUTO_INCREMENT
, id_variation INT NOT NULL , id_variation INT NOT NULL
, id_type INT NOT NULL , id_type INT NOT NULL
, code VARCHAR(50) , code VARCHAR(50)
@@ -11219,10 +11225,10 @@ DELIMITER ;;
CALL p_shop_get_many_product_variation ( CALL p_shop_get_many_product_variation (
1 # 'auth0|6582b95c895d09a70ba10fef', # a_id_user 1 # 'auth0|6582b95c895d09a70ba10fef', # a_id_user
, 1 # a_get_all_variation_type , 1 # a_get_all_variation_type
, 0 # a_get_inactive_variation_type , 1 # a_get_inactive_variation_type
, '' # a_ids_variation_type , '' # a_ids_variation_type
, 1 # a_get_all_variation , 1 # a_get_all_variation
, 0 # a_get_inactive_variation , 1 # a_get_inactive_variation
, '' # a_ids_variation , '' # a_ids_variation
, 0 # a_debug , 0 # a_debug
); );
@@ -11613,6 +11619,8 @@ BEGIN
; ;
END IF; END IF;
-- Duplicate Variation Type Ids
-- Duplicate Variation Ids
-- Duplicate Variation Type Codes -- Duplicate Variation Type Codes
-- Duplicate Variation Codes -- Duplicate Variation Codes
@@ -11683,7 +11691,7 @@ BEGIN
-- Transaction -- Transaction
IF NOT EXISTS (SELECT * FROM tmp_Msg_Error) THEN IF NOT EXISTS (SELECT * FROM tmp_Msg_Error) THEN
START TRANSACTION; START TRANSACTION;
INSERT INTO Shop_Sales_And_Purchasing_Change_Set ( INSERT INTO Shop_Product_Change_Set (
comment comment
, updated_last_by , updated_last_by
, updated_last_on , updated_last_on
@@ -11768,6 +11776,7 @@ BEGIN
, VT.display_order = t_VT.display_order , VT.display_order = t_VT.display_order
, VT.created_on = t_VT.created_on , VT.created_on = t_VT.created_on
, VT.created_by = t_VT.created_by , VT.created_by = t_VT.created_by
, VT.id_change_set = v_id_change_set
; ;
UPDATE partsltd_prod.Shop_Variation V UPDATE partsltd_prod.Shop_Variation V
@@ -11781,6 +11790,7 @@ BEGIN
, V.display_order = t_V.display_order , V.display_order = t_V.display_order
, V.created_on = t_V.created_on , V.created_on = t_V.created_on
, V.created_by = t_V.created_by , V.created_by = t_V.created_by
, V.id_change_set = v_id_change_set
; ;
DELETE VT_T DELETE VT_T
@@ -11853,7 +11863,7 @@ BEGIN
INSERT INTO partsltd_prod.Shop_Variation_Type_Temp ( INSERT INTO partsltd_prod.Shop_Variation_Type_Temp (
id_type id_type
, id_type_temp -- , id_type_temp
, code , code
, name , name
, name_plural , name_plural
@@ -11861,10 +11871,10 @@ BEGIN
, active , active
, GUID , GUID
) )
/* Test 1 - Insert */ /* Test 1 - Insert
VALUES ( VALUES (
-1 -1
, -1 -- , -1
, 'SIZE' , 'SIZE'
, 'Size' , 'Size'
, 'Sizes' , 'Sizes'
@@ -11872,11 +11882,19 @@ BEGIN
, 1 , 1
, v_guid , v_guid
) )
/* Test 2: Alter
SELECT
FROM partsltd_prod.Shop_Variation_Type
WHERE id_order = 6
*/ */
/* Test 2: Alter */
SELECT
id_type
-- , id_type AS id_type_temp
, code
, name
, name_plural
, display_order
, active
, v_guid AS GUID
FROM partsltd_prod.Shop_Variation_Type
WHERE id_type = 1
; ;
INSERT INTO partsltd_prod.Shop_Variation_Temp ( INSERT INTO partsltd_prod.Shop_Variation_Temp (
@@ -11888,7 +11906,7 @@ BEGIN
, active , active
, GUID , GUID
) )
/* Test 1 - Insert */ /* Test 1 - Insert
VALUES ( VALUES (
-1 -- id_variation -1 -- id_variation
, -1 -- id_type , -1 -- id_type
@@ -11898,11 +11916,38 @@ BEGIN
, 1 -- active , 1 -- active
, v_guid -- , v_guid --
) )
/* Test 2: Alter
SELECT
FROM partsltd_prod.Shop_Variation
WHERE id_order = 6
*/ */
/* Test 3 - Insert
VALUES (
-1 -- id_variation
, 1 -- id_type
, 'SILVER' -- code
, 'Silver' -- name
, 10 -- display_order
, 1 -- active
, 'NIPS' -- v_guid --
);
*/
/* Test 2: Alter */
SELECT
id_variation
, id_type
, code
, name
, display_order
, active
, v_guid AS GUID
FROM partsltd_prod.Shop_Variation
WHERE id_variation = 2
UNION
SELECT
-1 -- id_variation
, 1 -- id_type
, 'GREEN' -- code
, 'Green' -- name
, 3 -- display_order
, 1 -- active
, v_guid --
; ;
COMMIT; COMMIT;
@@ -11918,7 +11963,7 @@ BEGIN
; ;
CALL partsltd_prod.p_shop_save_product_variation ( CALL partsltd_prod.p_shop_save_product_variation (
'Test save Variations' -- comment 'Test save Variations - add + edit' -- comment
, v_guid -- guid , v_guid -- guid
, 1 -- id_user , 1 -- id_user
, 1 -- debug , 1 -- debug
@@ -11964,6 +12009,9 @@ delete
from shop_variation_type from shop_variation_type
where id_type = -1 where id_type = -1
; ;
Cannot add or update a child row: a foreign key constraint fails (`partsltd_prod`.`shop_variation_type`, CONSTRAINT `FK_Shop_Variation_Type_id_change_set` FOREIGN KEY (`id_change_set`) REFERENCES `shop_product_change_set` (`id_change_set`))
*/ */
-- Clear previous proc -- Clear previous proc
@@ -22403,6 +22451,78 @@ INSERT INTO Shop_Storage_Location (
) )
VALUES VALUES
(1, 'K-F-1', 'Kitchen Fridge 1') (1, 'K-F-1', 'Kitchen Fridge 1')
, (1, 'K-AHL-M-B', 'Kitchen - Above Hob Left Medial - Bottom')
, (1, 'K-AHL-M-M', 'Kitchen - Above Hob Left Medial - Middle')
, (1, 'K-AHL-M-T', 'Kitchen - Above Hob Left Medial - Top')
, (1, 'K-AHL-L-B', 'Kitchen - Above Hob Left Lateral - Bottom')
, (1, 'K-AHL-L-M', 'Kitchen - Above Hob Left Lateral - Middle')
, (1, 'K-AHL-L-T', 'Kitchen - Above Hob Left Lateral - Top')
, (1, 'K-AHR-M-B', 'Kitchen - Above Hob Left Medial - Bottom')
, (1, 'K-AHR-M-M', 'Kitchen - Above Hob Left Medial - Middle')
, (1, 'K-AHR-M-T', 'Kitchen - Above Hob Left Medial - Top')
, (1, 'K-AHL-M-B', 'Kitchen - Above Hob Left Medial - Bottom')
, (1, 'K-AHL-M-M', 'Kitchen - Above Hob Left Medial - Middle')
, (1, 'K-AHL-M-T', 'Kitchen - Above Hob Left Medial - Top')
, (1, 'K-AHL-L-B', 'Kitchen - Above Hob Left Lateral - Bottom')
, (1, 'K-AHL-L-M', 'Kitchen - Above Hob Left Lateral - Middle')
, (1, 'K-AHL-L-T', 'Kitchen - Above Hob Left Lateral - Top')
, (1, 'K-AHL-XL-B', 'Kitchen - Above Hob Left Extra Lateral - Bottom')
, (1, 'K-AHL-XL-M', 'Kitchen - Above Hob Left Extra Lateral - Middle')
, (1, 'K-AHL-XL-T', 'Kitchen - Above Hob Left Extra Lateral - Top')
, (1, 'K-BS-B', 'Kitchen - Below Sink - Bottom')
, (1, 'K-BS-T', 'Kitchen - Below Sink - Top')
, (1, 'K-LO-B', 'Kitchen - Left of Oven - Bottom')
, (1, 'K-LO-T', 'Kitchen - Left of Oven - Top')
, (1, 'K-RO-M-B', 'Kitchen - Right of Oven - Medial - Bottom')
, (1, 'K-RO-M-M', 'Kitchen - Right of Oven - Medial - Middle')
, (1, 'K-RO-M-T', 'Kitchen - Right of Oven - Medial - Top')
, (1, 'K-RO-L-B', 'Kitchen - Right of Oven - Lateral - Bottom')
, (1, 'K-RO-L-T', 'Kitchen - Right of Oven - Lateral - Top')
, (1, 'K-BBB-B', 'Kitchen - Below Breakfast Bar - Bottom')
, (1, 'K-BBB-T', 'Kitchen - Below Breakfast Bar - Top')
, (1, 'K-BSL-M-B', 'Kitchen - Bekow Sink Left - Medial - Bottom')
, (1, 'K-BSL-M-T', 'Kitchen - Bekow Sink Left - Medial - Top')
, (1, 'K-BSL-L-B', 'Kitchen - Bekow Sink Left - Lateral - Bottom')
, (1, 'K-BSL-L-T', 'Kitchen - Bekow Sink Left - Lateral - Top')
, (1, 'K-ASL-M-B', 'Kitchen - Above Sink Left - Medial - Bottom')
, (1, 'K-ASL-M-M', 'Kitchen - Above Sink Left - Medial - Middle')
, (1, 'K-ASL-M-T', 'Kitchen - Above Sink Left - Medial - Top')
, (1, 'K-ASL-L-B', 'Kitchen - Above Sink Left - Lateral - Bottom')
, (1, 'K-ASL-L-M', 'Kitchen - Above Sink Left - Lateral - Middle')
, (1, 'K-ASL-L-T', 'Kitchen - Above Sink Left - Lateral - Top')
, (1, 'K-ASL-XL-B', 'Kitchen - Above Sink Left - Extra Lateral - Bottom')
, (1, 'K-ASL-XL-M', 'Kitchen - Above Sink Left - Extra Lateral - Middle')
, (1, 'K-ASL-XL-T', 'Kitchen - Above Sink Left - Extra Lateral - Top')
, (1, 'K-T-B', 'Kitchen - Tower - Bottom')
, (1, 'K-T-LM', 'Kitchen - Tower - Lower Middle')
, (1, 'K-T-UM', 'Kitchen - Tower - Upper Middle')
, (1, 'K-T-T', 'Kitchen - Tower - Top')
, (1, 'K-FJ-MEAT', 'Kitchen - Fridge - Meat Drawer')
, (1, 'K-FJ-VEG', 'Kitchen - Fridge - Vegetables Drawer')
, (1, 'K-FJ-CHEESE', 'Kitchen - Fridge - Cheese Drawer')
, (1, 'K-FJ-S-B', 'Kitchen - Fridge - Shelf - Bottom')
, (1, 'K-FJ-S-LM', 'Kitchen - Fridge - Shelf - Lower Middle')
, (1, 'K-FJ-S-UM', 'Kitchen - Fridge - Shelf - Upper Middle')
, (1, 'K-FJ-S-T', 'Kitchen - Fridge - Shelf - Top')
, (1, 'K-FJ-DG-B', 'Kitchen - Door Shelf (Guarded) - Bottom')
, (1, 'K-FJ-DG-LM', 'Kitchen - Door Shelf (Guarded) - Lower Middle')
, (1, 'K-FJ-DG-UM', 'Kitchen - Door Shelf (Guarded) - Upper Middle')
, (1, 'K-FJ-DG-T', 'Kitchen - Door Shelf (Guarded) - Top')
, (1, 'K-FJ-DU', 'Kitchen - Door Shelf (Unguarded)')
, (1, 'K-FZ-DRAWER-B', 'Kitchen - Freezer - Drawer - Bottom')
, (1, 'K-FZ-DRAWER-T', 'Kitchen - Freezer - Drawer - Top')
, (1, 'K-FZ-DRAWER-I', 'Kitchen - Freezer - Drawer - Ice')
, (1, 'K-FZ-S-B', 'Kitchen - Freezer - Shelf - Bottom')
, (1, 'K-FZ-S-M', 'Kitchen - Freezer - Shelf - Middle')
, (1, 'K-FZ-S-T', 'Kitchen - Freezer - Shelf - Top')
, (1, 'K-FZ-DOOR-XL', 'Kitchen - Freezer - Door - Extra Low')
, (1, 'K-FZ-DOOR-L', 'Kitchen - Freezer - Door - Lower')
, (1, 'K-FZ-DOOR-LM', 'Kitchen - Freezer - Door - Lower Middle')
, (1, 'K-FZ-DOOR-UM', 'Kitchen - Freezer - Door - Upper Middle')
, (1, 'K-FZ-DOOR-U', 'Kitchen - Freezer - Door - Upper')
, (1, 'K-FZ-DOOR-XU', 'Kitchen - Freezer - Door - Extra Up')
, (1, 'K-AFF', 'Kitchen - Above Fridge-Freezer')
, (1, 'K-CT', 'Kitchen - Counter Top')
; ;
/* /*

View File

@@ -12,7 +12,7 @@ BEGIN
SET a_get_inactive_storage_location = IFNULL(a_get_inactive_storage_location, 0); SET a_get_inactive_storage_location = IFNULL(a_get_inactive_storage_location, 0);
SELECT SELECT
SL.id_storage_location SL.id_location
, P.id_plant , P.id_plant
, P.id_address , P.id_address
, A.id_region , A.id_region

View File

@@ -157,6 +157,7 @@ BEGIN
END // END //
DELIMITER ;; DELIMITER ;;
/*
CALL partsltd_prod.p_shop_save_product_variation_test (); CALL partsltd_prod.p_shop_save_product_variation_test ();
DELETE FROM partsltd_prod.Shop_Variation_Type_Temp; DELETE FROM partsltd_prod.Shop_Variation_Type_Temp;
@@ -164,7 +165,6 @@ DELETE FROM partsltd_prod.Shop_Variation_Temp;
DROP TABLE IF EXISTS tmp_Msg_Error; DROP TABLE IF EXISTS tmp_Msg_Error;
/*
delete from shop_variation_audit delete from shop_variation_audit
where id_variation = 3 where id_variation = 3

View File

@@ -109,6 +109,78 @@ INSERT INTO Shop_Storage_Location (
) )
VALUES VALUES
(1, 'K-F-1', 'Kitchen Fridge 1') (1, 'K-F-1', 'Kitchen Fridge 1')
, (1, 'K-AHL-M-B', 'Kitchen - Above Hob Left Medial - Bottom')
, (1, 'K-AHL-M-M', 'Kitchen - Above Hob Left Medial - Middle')
, (1, 'K-AHL-M-T', 'Kitchen - Above Hob Left Medial - Top')
, (1, 'K-AHL-L-B', 'Kitchen - Above Hob Left Lateral - Bottom')
, (1, 'K-AHL-L-M', 'Kitchen - Above Hob Left Lateral - Middle')
, (1, 'K-AHL-L-T', 'Kitchen - Above Hob Left Lateral - Top')
, (1, 'K-AHR-M-B', 'Kitchen - Above Hob Left Medial - Bottom')
, (1, 'K-AHR-M-M', 'Kitchen - Above Hob Left Medial - Middle')
, (1, 'K-AHR-M-T', 'Kitchen - Above Hob Left Medial - Top')
, (1, 'K-AHL-M-B', 'Kitchen - Above Hob Left Medial - Bottom')
, (1, 'K-AHL-M-M', 'Kitchen - Above Hob Left Medial - Middle')
, (1, 'K-AHL-M-T', 'Kitchen - Above Hob Left Medial - Top')
, (1, 'K-AHL-L-B', 'Kitchen - Above Hob Left Lateral - Bottom')
, (1, 'K-AHL-L-M', 'Kitchen - Above Hob Left Lateral - Middle')
, (1, 'K-AHL-L-T', 'Kitchen - Above Hob Left Lateral - Top')
, (1, 'K-AHL-XL-B', 'Kitchen - Above Hob Left Extra Lateral - Bottom')
, (1, 'K-AHL-XL-M', 'Kitchen - Above Hob Left Extra Lateral - Middle')
, (1, 'K-AHL-XL-T', 'Kitchen - Above Hob Left Extra Lateral - Top')
, (1, 'K-BS-B', 'Kitchen - Below Sink - Bottom')
, (1, 'K-BS-T', 'Kitchen - Below Sink - Top')
, (1, 'K-LO-B', 'Kitchen - Left of Oven - Bottom')
, (1, 'K-LO-T', 'Kitchen - Left of Oven - Top')
, (1, 'K-RO-M-B', 'Kitchen - Right of Oven - Medial - Bottom')
, (1, 'K-RO-M-M', 'Kitchen - Right of Oven - Medial - Middle')
, (1, 'K-RO-M-T', 'Kitchen - Right of Oven - Medial - Top')
, (1, 'K-RO-L-B', 'Kitchen - Right of Oven - Lateral - Bottom')
, (1, 'K-RO-L-T', 'Kitchen - Right of Oven - Lateral - Top')
, (1, 'K-BBB-B', 'Kitchen - Below Breakfast Bar - Bottom')
, (1, 'K-BBB-T', 'Kitchen - Below Breakfast Bar - Top')
, (1, 'K-BSL-M-B', 'Kitchen - Bekow Sink Left - Medial - Bottom')
, (1, 'K-BSL-M-T', 'Kitchen - Bekow Sink Left - Medial - Top')
, (1, 'K-BSL-L-B', 'Kitchen - Bekow Sink Left - Lateral - Bottom')
, (1, 'K-BSL-L-T', 'Kitchen - Bekow Sink Left - Lateral - Top')
, (1, 'K-ASL-M-B', 'Kitchen - Above Sink Left - Medial - Bottom')
, (1, 'K-ASL-M-M', 'Kitchen - Above Sink Left - Medial - Middle')
, (1, 'K-ASL-M-T', 'Kitchen - Above Sink Left - Medial - Top')
, (1, 'K-ASL-L-B', 'Kitchen - Above Sink Left - Lateral - Bottom')
, (1, 'K-ASL-L-M', 'Kitchen - Above Sink Left - Lateral - Middle')
, (1, 'K-ASL-L-T', 'Kitchen - Above Sink Left - Lateral - Top')
, (1, 'K-ASL-XL-B', 'Kitchen - Above Sink Left - Extra Lateral - Bottom')
, (1, 'K-ASL-XL-M', 'Kitchen - Above Sink Left - Extra Lateral - Middle')
, (1, 'K-ASL-XL-T', 'Kitchen - Above Sink Left - Extra Lateral - Top')
, (1, 'K-T-B', 'Kitchen - Tower - Bottom')
, (1, 'K-T-LM', 'Kitchen - Tower - Lower Middle')
, (1, 'K-T-UM', 'Kitchen - Tower - Upper Middle')
, (1, 'K-T-T', 'Kitchen - Tower - Top')
, (1, 'K-FJ-MEAT', 'Kitchen - Fridge - Meat Drawer')
, (1, 'K-FJ-VEG', 'Kitchen - Fridge - Vegetables Drawer')
, (1, 'K-FJ-CHEESE', 'Kitchen - Fridge - Cheese Drawer')
, (1, 'K-FJ-S-B', 'Kitchen - Fridge - Shelf - Bottom')
, (1, 'K-FJ-S-LM', 'Kitchen - Fridge - Shelf - Lower Middle')
, (1, 'K-FJ-S-UM', 'Kitchen - Fridge - Shelf - Upper Middle')
, (1, 'K-FJ-S-T', 'Kitchen - Fridge - Shelf - Top')
, (1, 'K-FJ-DG-B', 'Kitchen - Door Shelf (Guarded) - Bottom')
, (1, 'K-FJ-DG-LM', 'Kitchen - Door Shelf (Guarded) - Lower Middle')
, (1, 'K-FJ-DG-UM', 'Kitchen - Door Shelf (Guarded) - Upper Middle')
, (1, 'K-FJ-DG-T', 'Kitchen - Door Shelf (Guarded) - Top')
, (1, 'K-FJ-DU', 'Kitchen - Door Shelf (Unguarded)')
, (1, 'K-FZ-DRAWER-B', 'Kitchen - Freezer - Drawer - Bottom')
, (1, 'K-FZ-DRAWER-T', 'Kitchen - Freezer - Drawer - Top')
, (1, 'K-FZ-DRAWER-I', 'Kitchen - Freezer - Drawer - Ice')
, (1, 'K-FZ-S-B', 'Kitchen - Freezer - Shelf - Bottom')
, (1, 'K-FZ-S-M', 'Kitchen - Freezer - Shelf - Middle')
, (1, 'K-FZ-S-T', 'Kitchen - Freezer - Shelf - Top')
, (1, 'K-FZ-DOOR-XL', 'Kitchen - Freezer - Door - Extra Low')
, (1, 'K-FZ-DOOR-L', 'Kitchen - Freezer - Door - Lower')
, (1, 'K-FZ-DOOR-LM', 'Kitchen - Freezer - Door - Lower Middle')
, (1, 'K-FZ-DOOR-UM', 'Kitchen - Freezer - Door - Upper Middle')
, (1, 'K-FZ-DOOR-U', 'Kitchen - Freezer - Door - Upper')
, (1, 'K-FZ-DOOR-XU', 'Kitchen - Freezer - Door - Extra Up')
, (1, 'K-AFF', 'Kitchen - Above Fridge-Freezer')
, (1, 'K-CT', 'Kitchen - Counter Top')
; ;
/* /*

View File

@@ -9,6 +9,12 @@
justify-content: normal; justify-content: normal;
} }
#tableMain select, #tableMain input, #tableMain textarea, #tableMain div {
box-sizing: border-box;
width: 100%;
height: 100%;
}
#tableMain thead tr th, #tableMain tbody tr td { #tableMain thead tr th, #tableMain tbody tr td {
width: 20vh; width: 20vh;
min-width: 20vh; min-width: 20vh;

View File

@@ -68,7 +68,6 @@ body {
} }
*{ *{
/*box-sizing: border-box; */
margin: 0; margin: 0;
} }

View File

@@ -20,16 +20,18 @@ th, td {
#tableMain thead tr th.product_variations.collapsed, #tableMain tbody tr td.product_variations.collapsed { #tableMain thead tr th.product_variations.collapsed, #tableMain tbody tr td.product_variations.collapsed {
width: 10vh; width: 10vh;
min-width: 10vh; min-width: 10vh;
display: table-cell !important;
} }
#tableMain thead tr th.product_variations, #tableMain tbody tr td.product_variations { #tableMain thead tr th.product_variations, #tableMain tbody tr td.product_variations {
width: 20vh; width: 24vh;
min-width: 20vh; min-width: 24vh;
} }
#tableMain tbody tr td.product_variations table thead tr th, #tableMain tbody tr td.product_variations table tbody tr td { #tableMain tbody tr td.product_variations table thead tr th.product_variation_type, #tableMain tbody tr td.product_variations table tbody tr td.product_variation_type,
#tableMain tbody tr td.product_variations table thead tr th.product_variation, #tableMain tbody tr td.product_variations table tbody tr td.product_variation {
width: 8vh; width: 8vh;
min-width: 8vh; min-width: 8vh;
} }
#tableMain tbody tr td.product_variations table thead tr th:last-of-type, #tableMain tbody tr td.product_variations table tbody tr td:last-of-type { #tableMain tbody tr td.product_variations table thead tr th.add, #tableMain tbody tr td.product_variations table tbody tr td.delete {
width: 4vh; width: 4vh;
min-width: 4vh; min-width: 4vh;
} }
@@ -43,25 +45,27 @@ th, td {
min-width: 11vh; min-width: 11vh;
} }
#tableMain thead tr th.cost_local_vat_excl, #tableMain tbody tr td.cost_local_vat_excl, #tableMain thead tr th.cost_unit_local_vat_excl, #tableMain tbody tr td.cost_unit_local_vat_excl,
#tableMain thead tr th.cost_local_vat_incl, #tableMain tbody tr td.cost_local_vat_incl { #tableMain thead tr th.cost_unit_local_vat_incl, #tableMain tbody tr td.cost_unit_local_vat_incl {
width: 9vh; width: 9vh;
min-width: 9vh; min-width: 9vh;
} }
#tableMain thead tr th.storage-location.collapsed, #tableMain tbody tr td.storage-location.collapsed { #tableMain thead tr th.storage_location.collapsed, #tableMain tbody tr td.storage_location.collapsed {
width: 10vh; width: 10vh;
min-width: 10vh; min-width: 10vh;
} }
#tableMain thead tr th.storage-location, #tableMain tbody tr td.storage-location { #tableMain thead tr th.storage_location, #tableMain tbody tr td.storage_location {
width: 20vh; width: 20vh;
min-width: 20vh; min-width: 20vh;
} }
#tableMain tbody tr td.storage-location table thead tr th, #tableMain tbody tr td.storage-location table tbody tr td { #tableMain tbody tr td.storage_location table thead tr th,
#tableMain tbody tr td.storage_location table tbody tr td {
width: 8vh; width: 8vh;
min-width: 8vh; min-width: 8vh;
} }
#tableMain tbody tr td.storage-location table thead tr th:last-of-type, #tableMain tbody tr td.storage-location table tbody tr td:last-of-type { #tableMain tbody tr td.storage_location table thead tr th:last-of-type,
#tableMain tbody tr td.storage_location table tbody tr td:last-of-type {
width: 4vh; width: 4vh;
min-width: 4vh; min-width: 4vh;
} }

View File

@@ -68,7 +68,6 @@ body {
} }
*{ *{
/*box-sizing: border-box; */
margin: 0; margin: 0;
} }
@@ -708,6 +707,12 @@ form.filter button.save, form.filter button.button-cancel {
justify-content: normal; justify-content: normal;
} }
#tableMain select, #tableMain input, #tableMain textarea {
box-sizing: border-box;
width: 100%;
height: 100%;
}
#tableMain thead tr th, #tableMain tbody tr td { #tableMain thead tr th, #tableMain tbody tr td {
width: 20vh; width: 20vh;
min-width: 20vh; min-width: 20vh;

View File

@@ -77,16 +77,18 @@ th, td {
#tableMain thead tr th.product_variations.collapsed, #tableMain tbody tr td.product_variations.collapsed { #tableMain thead tr th.product_variations.collapsed, #tableMain tbody tr td.product_variations.collapsed {
width: 10vh; width: 10vh;
min-width: 10vh; min-width: 10vh;
display: table-cell !important;
} }
#tableMain thead tr th.product_variations, #tableMain tbody tr td.product_variations { #tableMain thead tr th.product_variations, #tableMain tbody tr td.product_variations {
width: 20vh; width: 24vh;
min-width: 20vh; min-width: 24vh;
} }
#tableMain tbody tr td.product_variations table thead tr th, #tableMain tbody tr td.product_variations table tbody tr td { #tableMain tbody tr td.product_variations table thead tr th.product_variation_type, #tableMain tbody tr td.product_variations table tbody tr td.product_variation_type,
#tableMain tbody tr td.product_variations table thead tr th.product_variation, #tableMain tbody tr td.product_variations table tbody tr td.product_variation {
width: 8vh; width: 8vh;
min-width: 8vh; min-width: 8vh;
} }
#tableMain tbody tr td.product_variations table thead tr th:last-of-type, #tableMain tbody tr td.product_variations table tbody tr td:last-of-type { #tableMain tbody tr td.product_variations table thead tr th.add, #tableMain tbody tr td.product_variations table tbody tr td.delete {
width: 4vh; width: 4vh;
min-width: 4vh; min-width: 4vh;
} }
@@ -100,25 +102,27 @@ th, td {
min-width: 11vh; min-width: 11vh;
} }
#tableMain thead tr th.cost_local_vat_excl, #tableMain tbody tr td.cost_local_vat_excl, #tableMain thead tr th.cost_unit_local_vat_excl, #tableMain tbody tr td.cost_unit_local_vat_excl,
#tableMain thead tr th.cost_local_vat_incl, #tableMain tbody tr td.cost_local_vat_incl { #tableMain thead tr th.cost_unit_local_vat_incl, #tableMain tbody tr td.cost_unit_local_vat_incl {
width: 9vh; width: 9vh;
min-width: 9vh; min-width: 9vh;
} }
#tableMain thead tr th.storage-location.collapsed, #tableMain tbody tr td.storage-location.collapsed { #tableMain thead tr th.storage_location.collapsed, #tableMain tbody tr td.storage_location.collapsed {
width: 10vh; width: 10vh;
min-width: 10vh; min-width: 10vh;
} }
#tableMain thead tr th.storage-location, #tableMain tbody tr td.storage-location { #tableMain thead tr th.storage_location, #tableMain tbody tr td.storage_location {
width: 20vh; width: 20vh;
min-width: 20vh; min-width: 20vh;
} }
#tableMain tbody tr td.storage-location table thead tr th, #tableMain tbody tr td.storage-location table tbody tr td { #tableMain tbody tr td.storage_location table thead tr th,
#tableMain tbody tr td.storage_location table tbody tr td {
width: 8vh; width: 8vh;
min-width: 8vh; min-width: 8vh;
} }
#tableMain tbody tr td.storage-location table thead tr th:last-of-type, #tableMain tbody tr td.storage-location table tbody tr td:last-of-type { #tableMain tbody tr td.storage_location table thead tr th:last-of-type,
#tableMain tbody tr td.storage_location table tbody tr td:last-of-type {
width: 4vh; width: 4vh;
min-width: 4vh; min-width: 4vh;
} }

View File

@@ -2347,7 +2347,7 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) {
if (!isPopState) { if (!isPopState) {
base_table_superPropGet(TableBasePage, "sharedInitialize", this, 3)([]); base_table_superPropGet(TableBasePage, "sharedInitialize", this, 3)([]);
this.hookupFilters(); this.hookupFilters();
this.hookupButtonsAddSaveCancel(); this.hookupButtonsSaveCancel();
this.hookupTableMain(); this.hookupTableMain();
OverlayConfirm.hookup(function () { OverlayConfirm.hookup(function () {
if (isSinglePageApp) { if (isSinglePageApp) {
@@ -2461,8 +2461,8 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) {
}); });
} }
}, { }, {
key: "hookupButtonsAddSaveCancel", key: "hookupButtonsSaveCancel",
value: function hookupButtonsAddSaveCancel() { value: function hookupButtonsSaveCancel() {
this.hookupButtonSave(); this.hookupButtonSave();
this.hookupButtonCancel(); this.hookupButtonCancel();
this.toggleShowButtonsSaveCancel(false); this.toggleShowButtonsSaveCancel(false);
@@ -4969,7 +4969,7 @@ var PageStoreProductPermutations = /*#__PURE__*/function (_TableBasePage) {
this.hookupSubscriptionFields(); this.hookupSubscriptionFields();
this.hookupIdStripeProductInputs(); this.hookupIdStripeProductInputs();
this.hookupExpirationFields(); this.hookupExpirationFields();
this.hookupActiveCheckboxes(); this.hookupFieldsActive();
} }
}, { }, {
key: "hookupFieldsProductCategory", key: "hookupFieldsProductCategory",
@@ -5144,11 +5144,6 @@ var PageStoreProductPermutations = /*#__PURE__*/function (_TableBasePage) {
value: function hookupCountIntervalExpirationUnsealedInputs() { value: function hookupCountIntervalExpirationUnsealedInputs() {
this.hookupChangeHandlerTableCellsWhenNotCollapsed("change", idTableMain + ' td.' + flagCountUnitMeasurementIntervalExpirationUnsealed + ' input'); this.hookupChangeHandlerTableCellsWhenNotCollapsed("change", idTableMain + ' td.' + flagCountUnitMeasurementIntervalExpirationUnsealed + ' input');
} }
}, {
key: "hookupActiveCheckboxes",
value: function hookupActiveCheckboxes() {
this.hookupChangeHandlerTableCells(idTableMain + ' td.' + flagActive + ' input');
}
}, { }, {
key: "leave", key: "leave",
value: function leave() { value: function leave() {
@@ -5811,7 +5806,7 @@ var PageStoreStockItems = /*#__PURE__*/function (_TableBasePage) {
this.hookupSealingInputs(); this.hookupSealingInputs();
this.hookupExpirationDateInputs(); this.hookupExpirationDateInputs();
this.hookupConsumationInputs(); this.hookupConsumationInputs();
this.hookupActiveCheckboxes(); this.hookupFieldsActive();
} }
}, { }, {
key: "hookupProductCategoryFields", key: "hookupProductCategoryFields",
@@ -5826,16 +5821,17 @@ var PageStoreStockItems = /*#__PURE__*/function (_TableBasePage) {
value: function hookupProductFields() { value: function hookupProductFields() {
this.hookupTableCellDdlPreviews(idTableMain + ' td.' + flagProduct, Utils.getListFromDict(products)); this.hookupTableCellDdlPreviews(idTableMain + ' td.' + flagProduct, Utils.getListFromDict(products));
} }
}, {
key: "handleClickProductPermutationVariationsPreview", /*
value: function handleClickProductPermutationVariationsPreview(event, element) { handleClickProductPermutationVariationsPreview(event, element) {
var row = DOM.getRowFromElement(element); let row = DOM.getRowFromElement(element);
var tdProduct = row.querySelector('td.' + flagProduct); let tdProduct = row.querySelector('td.' + flagProduct);
var idProduct = DOM.getElementValueCurrent(tdProduct); let idProduct = DOM.getElementValueCurrent(tdProduct);
var product = products[idProduct]; let product = products[idProduct];
if (!product[flagHasVariations]) return; if (!product[flagHasVariations]) return;
stock_items_superPropGet(PageStoreStockItems, "handleClickProductPermutationVariationsPreview", this, 3)([event, element]); super.handleClickProductPermutationVariationsPreview(event, element);
} }
*/
}, { }, {
key: "handleClickButtonProductPermutationVariationsAdd", key: "handleClickButtonProductPermutationVariationsAdd",
value: function handleClickButtonProductPermutationVariationsAdd(event, element) { value: function handleClickButtonProductPermutationVariationsAdd(event, element) {
@@ -5865,7 +5861,7 @@ var PageStoreStockItems = /*#__PURE__*/function (_TableBasePage) {
key: "hookupStorageLocationFields", key: "hookupStorageLocationFields",
value: function hookupStorageLocationFields() { value: function hookupStorageLocationFields() {
var _this3 = this; var _this3 = this;
this.hookupEventHandler("click", idTableMain + ' td.' + flagStorageLocation, function (event, element) { this.hookupEventHandler("click", idTableMain + ' td.' + flagStorageLocation + ' div', function (event, element) {
return _this3.handleClickStorageLocationPreview(event, element); return _this3.handleClickStorageLocationPreview(event, element);
}); });
} }
@@ -5877,7 +5873,7 @@ var PageStoreStockItems = /*#__PURE__*/function (_TableBasePage) {
var idPlant = element.getAttribute(attrIdPlant); var idPlant = element.getAttribute(attrIdPlant);
var idStorageLocation = element.getAttribute(attrIdStorageLocation); var idStorageLocation = element.getAttribute(attrIdStorageLocation);
var tblStorageLocation = document.createElement("table"); var tblStorageLocation = document.createElement("table");
tblStorageLocation.classList.add(flagProductVariations); tblStorageLocation.classList.add(flagStorageLocation);
var thead = document.createElement("thead"); var thead = document.createElement("thead");
var thPlant = document.createElement("th"); var thPlant = document.createElement("th");
thPlant.textContent = 'Plant'; thPlant.textContent = 'Plant';
@@ -5892,8 +5888,9 @@ var PageStoreStockItems = /*#__PURE__*/function (_TableBasePage) {
var plant, optionPlantJson, optionPlant, storageLocation, optionStorageLocationJson, optionStorageLocation; var plant, optionPlantJson, optionPlant, storageLocation, optionStorageLocationJson, optionStorageLocation;
var plantKeys = Object.keys(plants); var plantKeys = Object.keys(plants);
var storageLocationKeys = Object.keys(storageLocations); var storageLocationKeys = Object.keys(storageLocations);
var plantJson = plants[idPlant]; debugger;
var storageLocationJson = storageLocations[idStorageLocation]; var plantJson = idPlant != null ? plants[idPlant] : stock_items_defineProperty({}, attrIdPlant, null);
var storageLocationJson = idStorageLocation != null ? storageLocations[idStorageLocation] : stock_items_defineProperty({}, attrIdStorageLocation, null);
var tdPlant = document.createElement("td"); var tdPlant = document.createElement("td");
tdPlant.classList.add(flagPlant); tdPlant.classList.add(flagPlant);
DOM.setElementAttributesValuesCurrentAndPrevious(tdPlant, plantJson[attrIdPlant]); DOM.setElementAttributesValuesCurrentAndPrevious(tdPlant, plantJson[attrIdPlant]);
@@ -5907,7 +5904,10 @@ var PageStoreStockItems = /*#__PURE__*/function (_TableBasePage) {
ddlPlant.appendChild(optionPlant); ddlPlant.appendChild(optionPlant);
plantKeys.forEach(function (plantKey) { plantKeys.forEach(function (plantKey) {
plant = plants[plantKey]; plant = plants[plantKey];
optionPlantJson = BusinessObjects.getOptionJsonFromObjectJson(objectJson = plant, valueSelected = plantJson[attrIdPlant]); optionPlantJson = BusinessObjects.getOptionJsonFromObjectJson(plant,
// objectJson
plantJson[attrIdPlant] // valueSelected
);
optionPlant = DOM.createOption(optionPlantJson); optionPlant = DOM.createOption(optionPlantJson);
if (_verbose) { if (_verbose) {
console.log("optionPlant: ", optionPlant); console.log("optionPlant: ", optionPlant);
@@ -5925,9 +5925,12 @@ var PageStoreStockItems = /*#__PURE__*/function (_TableBasePage) {
console.log("optionStorageLocation: ", optionStorageLocation); console.log("optionStorageLocation: ", optionStorageLocation);
} }
ddlStorageLocation.appendChild(optionStorageLocation); ddlStorageLocation.appendChild(optionStorageLocation);
StorageLocationKeys.forEach(function (StorageLocationKey) { storageLocationKeys.forEach(function (StorageLocationKey) {
storageLocation = StorageLocations[StorageLocationKey]; storageLocation = storageLocations[StorageLocationKey];
optionStorageLocationJson = BusinessObjects.getOptionJsonFromObjectJson(objectJson = storageLocation, valueSelected = storageLocationJson[attrIdStorageLocation]); optionStorageLocationJson = BusinessObjects.getOptionJsonFromObjectJson(storageLocation,
// objectJson
storageLocationJson[attrIdStorageLocation] // valueSelected
);
optionStorageLocation = DOM.createOption(optionStorageLocationJson); optionStorageLocation = DOM.createOption(optionStorageLocationJson);
if (_verbose) { if (_verbose) {
console.log("optionStorageLocation: ", optionStorageLocation); console.log("optionStorageLocation: ", optionStorageLocation);
@@ -5941,9 +5944,9 @@ var PageStoreStockItems = /*#__PURE__*/function (_TableBasePage) {
trBody.appendChild(tdStorageLocation); trBody.appendChild(tdStorageLocation);
tbody.appendChild(trBody); tbody.appendChild(trBody);
tblStorageLocation.appendChild(tbody); tblStorageLocation.appendChild(tbody);
var parent = element.parentElement; var tdParent = DOM.getCellFromElement(element);
parent.innerHTML = ''; tdParent.innerHTML = '';
parent.appendChild(tblStorageLocation); tdParent.appendChild(tblStorageLocation);
if (_verbose) { if (_verbose) {
console.log("tblStorageLocation: ", tblStorageLocation); console.log("tblStorageLocation: ", tblStorageLocation);
} }
@@ -6036,11 +6039,6 @@ var PageStoreStockItems = /*#__PURE__*/function (_TableBasePage) {
value: function hookupDateConsumedInputs() { value: function hookupDateConsumedInputs() {
this.hookupChangeHandlerTableCellsWhenNotCollapsed("change", idTableMain + ' td.' + flagDateConsumed + ' input'); this.hookupChangeHandlerTableCellsWhenNotCollapsed("change", idTableMain + ' td.' + flagDateConsumed + ' input');
} }
}, {
key: "hookupActiveCheckboxes",
value: function hookupActiveCheckboxes() {
this.hookupChangeHandlerTableCells(idTableMain + ' td.' + flagActive + ' input');
}
}, { }, {
key: "leave", key: "leave",
value: function leave() { value: function leave() {

View File

@@ -49,7 +49,7 @@ export default class TableBasePage extends BasePage {
if (!isPopState) { if (!isPopState) {
super.sharedInitialize(); super.sharedInitialize();
this.hookupFilters(); this.hookupFilters();
this.hookupButtonsAddSaveCancel(); this.hookupButtonsSaveCancel();
this.hookupTableMain(); this.hookupTableMain();
OverlayConfirm.hookup(() => { OverlayConfirm.hookup(() => {
if (isSinglePageApp) { if (isSinglePageApp) {
@@ -139,7 +139,7 @@ export default class TableBasePage extends BasePage {
}) })
.catch(error => console.error('Error:', error)); .catch(error => console.error('Error:', error));
} }
hookupButtonsAddSaveCancel() { hookupButtonsSaveCancel() {
this.hookupButtonSave(); this.hookupButtonSave();
this.hookupButtonCancel(); this.hookupButtonCancel();
this.toggleShowButtonsSaveCancel(false); this.toggleShowButtonsSaveCancel(false);

View File

@@ -211,7 +211,7 @@ export default class PageStoreProductPermutations extends TableBasePage {
this.hookupSubscriptionFields(); this.hookupSubscriptionFields();
this.hookupIdStripeProductInputs(); this.hookupIdStripeProductInputs();
this.hookupExpirationFields(); this.hookupExpirationFields();
this.hookupActiveCheckboxes(); this.hookupFieldsActive();
} }
hookupFieldsProductCategory() { hookupFieldsProductCategory() {
this.hookupTableCellDdlPreviews( this.hookupTableCellDdlPreviews(
@@ -338,9 +338,6 @@ export default class PageStoreProductPermutations extends TableBasePage {
hookupCountIntervalExpirationUnsealedInputs(){ hookupCountIntervalExpirationUnsealedInputs(){
this.hookupChangeHandlerTableCellsWhenNotCollapsed("change", idTableMain + ' td.' + flagCountUnitMeasurementIntervalExpirationUnsealed + ' input'); this.hookupChangeHandlerTableCellsWhenNotCollapsed("change", idTableMain + ' td.' + flagCountUnitMeasurementIntervalExpirationUnsealed + ' input');
} }
hookupActiveCheckboxes(){
this.hookupChangeHandlerTableCells(idTableMain + ' td.' + flagActive + ' input');
}
leave() { leave() {
super.leave(); super.leave();

View File

@@ -143,7 +143,7 @@ export default class PageStoreStockItems extends TableBasePage {
this.hookupSealingInputs(); this.hookupSealingInputs();
this.hookupExpirationDateInputs(); this.hookupExpirationDateInputs();
this.hookupConsumationInputs(); this.hookupConsumationInputs();
this.hookupActiveCheckboxes(); this.hookupFieldsActive();
} }
hookupProductCategoryFields() { hookupProductCategoryFields() {
this.hookupTableCellDdlPreviews( this.hookupTableCellDdlPreviews(
@@ -156,6 +156,7 @@ export default class PageStoreStockItems extends TableBasePage {
this.hookupTableCellDdlPreviews(idTableMain + ' td.' + flagProduct, Utils.getListFromDict(products)); this.hookupTableCellDdlPreviews(idTableMain + ' td.' + flagProduct, Utils.getListFromDict(products));
} }
/*
handleClickProductPermutationVariationsPreview(event, element) { handleClickProductPermutationVariationsPreview(event, element) {
let row = DOM.getRowFromElement(element); let row = DOM.getRowFromElement(element);
let tdProduct = row.querySelector('td.' + flagProduct); let tdProduct = row.querySelector('td.' + flagProduct);
@@ -164,6 +165,7 @@ export default class PageStoreStockItems extends TableBasePage {
if (!product[flagHasVariations]) return; if (!product[flagHasVariations]) return;
super.handleClickProductPermutationVariationsPreview(event, element); super.handleClickProductPermutationVariationsPreview(event, element);
} }
*/
handleClickButtonProductPermutationVariationsAdd(event, element) { handleClickButtonProductPermutationVariationsAdd(event, element) {
let row = DOM.getRowFromElement(element); let row = DOM.getRowFromElement(element);
let tbody = row.querySelector('tbody'); let tbody = row.querySelector('tbody');
@@ -186,7 +188,7 @@ export default class PageStoreStockItems extends TableBasePage {
hookupStorageLocationFields(){ hookupStorageLocationFields(){
this.hookupEventHandler( this.hookupEventHandler(
"click", "click",
idTableMain + ' td.' + flagStorageLocation, idTableMain + ' td.' + flagStorageLocation + ' div',
(event, element) => this.handleClickStorageLocationPreview(event, element) (event, element) => this.handleClickStorageLocationPreview(event, element)
); );
} }
@@ -195,7 +197,7 @@ export default class PageStoreStockItems extends TableBasePage {
let idPlant = element.getAttribute(attrIdPlant); let idPlant = element.getAttribute(attrIdPlant);
let idStorageLocation = element.getAttribute(attrIdStorageLocation); let idStorageLocation = element.getAttribute(attrIdStorageLocation);
let tblStorageLocation = document.createElement("table"); let tblStorageLocation = document.createElement("table");
tblStorageLocation.classList.add(flagProductVariations); tblStorageLocation.classList.add(flagStorageLocation);
let thead = document.createElement("thead"); let thead = document.createElement("thead");
let thPlant = document.createElement("th"); let thPlant = document.createElement("th");
thPlant.textContent = 'Plant'; thPlant.textContent = 'Plant';
@@ -212,8 +214,13 @@ export default class PageStoreStockItems extends TableBasePage {
let plantKeys = Object.keys(plants); let plantKeys = Object.keys(plants);
let storageLocationKeys = Object.keys(storageLocations); let storageLocationKeys = Object.keys(storageLocations);
let plantJson = plants[idPlant]; debugger;
let storageLocationJson = storageLocations[idStorageLocation]; let plantJson = idPlant != null ? plants[idPlant] : {
[attrIdPlant]: null,
};
let storageLocationJson = idStorageLocation != null ? storageLocations[idStorageLocation] : {
[attrIdStorageLocation]: null,
};
let tdPlant = document.createElement("td"); let tdPlant = document.createElement("td");
tdPlant.classList.add(flagPlant); tdPlant.classList.add(flagPlant);
@@ -230,8 +237,8 @@ export default class PageStoreStockItems extends TableBasePage {
plantKeys.forEach((plantKey) => { plantKeys.forEach((plantKey) => {
plant = plants[plantKey]; plant = plants[plantKey];
optionPlantJson = BusinessObjects.getOptionJsonFromObjectJson( optionPlantJson = BusinessObjects.getOptionJsonFromObjectJson(
objectJson = plant, plant, // objectJson
valueSelected = plantJson[attrIdPlant] plantJson[attrIdPlant] // valueSelected
); );
optionPlant = DOM.createOption(optionPlantJson); optionPlant = DOM.createOption(optionPlantJson);
if (_verbose) { console.log("optionPlant: ", optionPlant); } if (_verbose) { console.log("optionPlant: ", optionPlant); }
@@ -250,11 +257,11 @@ export default class PageStoreStockItems extends TableBasePage {
if (_verbose) { console.log("optionStorageLocation: ", optionStorageLocation); } if (_verbose) { console.log("optionStorageLocation: ", optionStorageLocation); }
ddlStorageLocation.appendChild(optionStorageLocation); ddlStorageLocation.appendChild(optionStorageLocation);
StorageLocationKeys.forEach((StorageLocationKey) => { storageLocationKeys.forEach((StorageLocationKey) => {
storageLocation = StorageLocations[StorageLocationKey]; storageLocation = storageLocations[StorageLocationKey];
optionStorageLocationJson = BusinessObjects.getOptionJsonFromObjectJson( optionStorageLocationJson = BusinessObjects.getOptionJsonFromObjectJson(
objectJson = storageLocation, storageLocation, // objectJson
valueSelected = storageLocationJson[attrIdStorageLocation] storageLocationJson[attrIdStorageLocation] // valueSelected
); );
optionStorageLocation = DOM.createOption(optionStorageLocationJson); optionStorageLocation = DOM.createOption(optionStorageLocationJson);
if (_verbose) { console.log("optionStorageLocation: ", optionStorageLocation); } if (_verbose) { console.log("optionStorageLocation: ", optionStorageLocation); }
@@ -269,9 +276,9 @@ export default class PageStoreStockItems extends TableBasePage {
tbody.appendChild(trBody); tbody.appendChild(trBody);
tblStorageLocation.appendChild(tbody); tblStorageLocation.appendChild(tbody);
let parent = element.parentElement; let tdParent = DOM.getCellFromElement(element);
parent.innerHTML = ''; tdParent.innerHTML = '';
parent.appendChild(tblStorageLocation); tdParent.appendChild(tblStorageLocation);
if (_verbose) { console.log("tblStorageLocation: ", tblStorageLocation); } if (_verbose) { console.log("tblStorageLocation: ", tblStorageLocation); }
this.hookupChangeHandlerTableCells(idTableMain + ' td.' + flagPlant + ' select', (event, element) => { this.handleChangeStoragePlantDdl(event, element); }); this.hookupChangeHandlerTableCells(idTableMain + ' td.' + flagPlant + ' select', (event, element) => { this.handleChangeStoragePlantDdl(event, element); });
this.hookupChangeHandlerTableCells(idTableMain + ' td.' + flagStorageLocation + ' select', (event, element) => { this.handleChangeStorageLocationDdl(event, element); }); this.hookupChangeHandlerTableCells(idTableMain + ' td.' + flagStorageLocation + ' select', (event, element) => { this.handleChangeStorageLocationDdl(event, element); });
@@ -342,10 +349,6 @@ export default class PageStoreStockItems extends TableBasePage {
this.hookupChangeHandlerTableCellsWhenNotCollapsed("change", idTableMain + ' td.' + flagDateConsumed + ' input'); this.hookupChangeHandlerTableCellsWhenNotCollapsed("change", idTableMain + ' td.' + flagDateConsumed + ' input');
} }
hookupActiveCheckboxes(){
this.hookupChangeHandlerTableCells(idTableMain + ' td.' + flagActive + ' input');
}
leave() { leave() {
super.leave(); super.leave();
} }

View File

@@ -116,10 +116,12 @@
#} #}
var currencies = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.currencies) | tojson | safe }}; var currencies = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.currencies) | tojson | safe }};
var plants = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.plants) | 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 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 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 }}; var productVariations = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.variations) | tojson | safe }};
var productVariationTypes = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.variation_types) | tojson | safe }}; var productVariationTypes = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.variation_types) | tojson | safe }};
var storageLocations = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.storage_locations) | tojson | safe }};
{# {#
var unitMeasurements = {{ units_measurement_dict | tojson | safe }}; var unitMeasurements = {{ units_measurement_dict | tojson | safe }};
var unitMeasurementsTime = {{ units_measurement_time_dict | tojson | safe }}; var unitMeasurementsTime = {{ units_measurement_time_dict | tojson | safe }};