diff --git a/app.log.1 b/app.log.1 index d9877d3f..5e4d4b7e 100644 --- a/app.log.1 +++ b/app.log.1 @@ -1,98 +1,68 @@ 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 'v_id_permission_manufacturing' in 'where clause'") - -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\manufacturing_purchase_order.py", line 40, in manufacturing_purchase_orders - model = Model_View_Store_Manufacturing_Purchase_Order(form_filters) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\models\model_view_store_manufacturing_purchase_order.py", line 50, in __init__ - self.manufacturing_purchase_orders, errors = datastore_manufacturing_purchase_order.get_many_manufacturing_purchase_order(parameters_manufacturing_purchase_order) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\datastores\datastore_store_manufacturing_purchase_order.py", line 51, in get_many_manufacturing_purchase_order - result = self.db_procedure_execute('p_shop_get_many_manufacturing_purchase_order', argument_dict) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - 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 '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) - -config_env: production -config_env: production -config_env: production -config_env: production -config_env: production -config_env: development -config_env: development -Server Error: 1 validation error for Model_View_Store_Product_Category + File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\controllers\store\product_category.py", line 56, in categories + model = Model_View_Store_Product_Category(form_filters) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\models\model_view_store_product_category.py", line 46, in __init__ + super().__init__(hash_page_current=hash_page_current, form_filters_old=form_filters_old) # filters_category=filters_category) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\models\model_view_store.py", line 232, in __init__ + super().__init__(hash_page_current=hash_page_current, **kwargs) + File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\models\model_view_base.py", line 262, in __init__ + BaseModel.__init__(self, hash_page_current=hash_page_current, **kwargs) + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\pydantic\main.py", line 193, in __init__ + self.__pydantic_validator__.validate_python(data, self_instance=self) +pydantic_core._pydantic_core.ValidationError: 1 validation error for Model_View_Store_Product_Category form_filters Field required [type=missing, input_value={'hash_page_current': '/s...pty=False, active=True)}, input_type=dict] For further information visit https://errors.pydantic.dev/2.8/v/missing -Request: 127.0.0.1 GET http /store/categories? Host: 127.0.0.1:5000 + +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 +Server Error: list object has no element 0 +Request: 127.0.0.1 GET http /store/permutations?id_category=&id_product=&is_out_of_stock=false&quantity_min=&quantity_max= 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/permutations Dnt: 1 Connection: keep-alive -Referer: http://127.0.0.1:5000/store/categories Cookie: session=.eJytVtmuo0gS_ZWWpe6ntovdcKXSjDcw2GCbHV4sIBOzg1kNPfXvk_hWd_VDzyaNZExmRhDnRGZkRPy28Lo2Kuu4gcBoYL34-G0ReMXdA3lc3Ju2rOHio607-Ouflru34ucqzL04W3wsIBi8GqzyGIAMtmXR5HEb_f0xS1dBmS9-XYRx3bSFlyODCx0CMKK1GNyDrq5hEYx3AEOvy9rFR9Fl2VtUw0dcFn8h-CSA_zG-z05gyO77_Q-GZgmfowOWowHGeWvM93AshOEM2NzfjO89rOMwhmDxEXpZA9-SuAiyDkBwNzf6D9RPP5G46SoE9Wfnm67-7pD8u99LbXZ88Q3tV1OH97ZMYYHkHAkgZABYhxgGOQwyGEOGuB_iBLEOfRKHGOkTJPQRxe77MXhBAJvmDwtwlCJfCOJLLKWeLcbnnZT5uTzPt3JiECqmKGI8xJ6tTGJSxt5RxYKjzJxHLnVtp_ULEHmTOCiJm7mJW16EjPJjGg9GOgK2Wso7OvEJrBcLbLW6iUk2Euo6LDXq0qyj1TVjFW4k61ZVlVpa5mvCyXbDpDzymuW2e-i47ZGEpHDjRHc3WaxVT9YxIa5w3Mk1TqX9wXc7mx4HLhx8Q6rK_u44uJIEl_P6TCeitDk9_fHwZLT71VwK-tnahtmrXV71UDWXm3GIBTnYBcKraNIrhh8mvHhururUAOLC2kWvbF5Dz-V8tma5Xto7EX9eDu6Bpuond7Lud04cz2JGdPU9lLh92A5PrSCO2gR7iYnau33zHjYeWoGD19ugv7O82WTV3iyLWO2Rq5S8vOVxryxrSfM2uYl8XPtBrarkmc6ZLHMCVhYxEI0J8uFVtpubQone0Cj86YJ1CaHjWNKEjZOqxfpwyjcEzh-koTeeq21zEkbtXqhn_GAS1WvfP0L4QGEAX1Vcw-buoRDE1yTOrDGWwH6sxygoWIbCsPct-Iso0YxJxJVYbMRCpYOdyIhpZZs7NM_byp3nhdlD2zXUlKL8ROrd4wM3U_4s8xGujhK3QsY6z1JqP-dbV0Mf5GYKCH50d3TrWWrqCybmE_TkWxnmvQ3TkW8ZM3jmHkEU5LcOyVJXeGVA4LqAwCsgRBuXwCPPGjqH4No5ZAMhS8DRHD8xIgwct9MlZnsUmkWQ84Rjq1EQf4anY7sREPjxPBmTu1dyOblh8h6kio6cJRxKEZxRIZRI3geUMqmxu3ewKylzyv4xSIXIBUKQu3u8BEd1CEZjumnGqMboyZUUXYc_X4VMThFWzmOOLU2SLgmudesCgS5mzsDepohX5vJcBObNTMQBcWll_YAe1UBvRtlvGFl_dJd9SlrzQeRm61hZM19P11JJZDc953jlCmrj2mrvF0rrIfybAN5651zpfe3HdzbpZkGe5Z5lpmJS5Y71mlzt_3DlkT-OPdtEvDDwhLb60lPcvhGR7tnRS5_QTmU8Y6aRfbP4TEsrxsjTOQVVjn2LL8mBlKcDftmjs9DTmS81B5ysB5OsO6O8v70uiGdAmvGMgbAwb79llcSg5FykFUumLrqZyvssUqZt7OiHwc3N_B0bRPbm5U_RybcjwyZArwvSDh6U0800Ws1S8dtkEJ4QuYoAJE93Zl4disvkHU-Fospon12BfpmHSrkclcrlgavzyjCnukf25IrMnfirbXoF5mZUGOX0FehnfGlh5335wg6u5jbeIPOSREVdewvuvrK8X4xLbyyJrjxZfUCF62UymvKZO2q167L2dHXChML8wn4R1fIGTuvjtHTLV8JIhr0BjrJN3YErqpMBG7avByBPPQ-PGZMfgLvnzjlIz9qV6-s2pCe473zeHjLSk5-0aoRFLRNbO7zZxXVoeEnjDcffOQ912Fy14zCCyjR0domBWwAAt2zynvYEGTNkcmDkgGf8lr1chdPJ1LbQxvu41bL9QV13yZRjvo2zu4x6DuwZXiHHV-JlxDvPIBNafty8Q7pzbHLzDM4nvSEFOe_Kboux-0TzAXHs-43GCkzsDih_NUFZzZUR_Rcx-KmqyzDO4E-f_cKvi3fCurfjW2cLvRoVvc_aFxdh-a5_HSrOi4eQjO1Tka1dpMWv52VNqLfJPFobD0oSut-L_6UF-RelH6XU7zmWwCicQwn196RLs9TnQtMggKhtq-bjyxcA-2UxeCmBMQwMmYiNX8Wqa1bv7mOG-oKwvjcG_5lUEQfpv1OeVcoimOXNDa8BKJ66JLNNDCznrFVIXMVB282N2h8Mm9Wj9nqv9eo3nc_hF5oEZEhQFLYGNEGvQ5YKiXXgYWt2TfmAof7WfKVY7Jf6a_X4BXx92_qZ3PxM8OgXgOKHf2j-abJBIwhWVTFXLMRoPm9Wyl_6_VGe_e1rJ22MpQi6Hc1EkUM9xJiZFTv_v-nVugp4LerG5sNYEBhBLXF8iVM6jn9Q2AfOrlhu7S6-ffv2T-GRoaE.ZzXhpA.6IaVZ-sABN4LB476tj7c1hUx5F8 Upgrade-Insecure-Requests: 1 Sec-Fetch-Dest: document @@ -104,3 +74,48 @@ 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\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 357, 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 108, 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 8, in top-level template code + {% include 'components/store/_preview_DDL_product.html' %} + ^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\templates\components\store\_preview_DDL_product.html", line 11, in top-level template code + {% for product in model.category_list_filters.categories[0].products %} + ^^^^^^^^^^^^^^^^^^^^^^^^^ + 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: list object has no element 0 + +config_env: development +Server Error: (MySQLdb.IntegrityError) (1364, "Field 'csv_id_pairs_variation' doesn't have a default value") +[SQL: CALL p_shop_get_many_product(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)] +[parameters: (1, True, False, '', True, False, '', True, False, '', False, False, '', False, 0)] +(Background on this error at: https://sqlalche.me/e/20/gkpj) diff --git a/app.log.2 b/app.log.2 index 9d60fb31..d9877d3f 100644 --- a/app.log.2 +++ b/app.log.2 @@ -1,13 +1,99 @@ -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 +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 'v_id_permission_manufacturing' in 'where clause'") + +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\manufacturing_purchase_order.py", line 40, in manufacturing_purchase_orders + model = Model_View_Store_Manufacturing_Purchase_Order(form_filters) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\models\model_view_store_manufacturing_purchase_order.py", line 50, in __init__ + self.manufacturing_purchase_orders, errors = datastore_manufacturing_purchase_order.get_many_manufacturing_purchase_order(parameters_manufacturing_purchase_order) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\datastores\datastore_store_manufacturing_purchase_order.py", line 51, in get_many_manufacturing_purchase_order + result = self.db_procedure_execute('p_shop_get_many_manufacturing_purchase_order', argument_dict) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + 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 '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) + +config_env: production +config_env: production +config_env: production +config_env: production +config_env: production +config_env: development +config_env: development +Server Error: 1 validation error for Model_View_Store_Product_Category +form_filters + Field required [type=missing, input_value={'hash_page_current': '/s...pty=False, active=True)}, input_type=dict] + For further information visit https://errors.pydantic.dev/2.8/v/missing +Request: 127.0.0.1 GET http /store/categories? 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 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 +Referer: http://127.0.0.1:5000/store/categories +Cookie: session=.eJytVtmuo0gS_ZWWpe6ntovdcKXSjDcw2GCbHV4sIBOzg1kNPfXvk_hWd_VDzyaNZExmRhDnRGZkRPy28Lo2Kuu4gcBoYL34-G0ReMXdA3lc3Ju2rOHio607-Ouflru34ucqzL04W3wsIBi8GqzyGIAMtmXR5HEb_f0xS1dBmS9-XYRx3bSFlyODCx0CMKK1GNyDrq5hEYx3AEOvy9rFR9Fl2VtUw0dcFn8h-CSA_zG-z05gyO77_Q-GZgmfowOWowHGeWvM93AshOEM2NzfjO89rOMwhmDxEXpZA9-SuAiyDkBwNzf6D9RPP5G46SoE9Wfnm67-7pD8u99LbXZ88Q3tV1OH97ZMYYHkHAkgZABYhxgGOQwyGEOGuB_iBLEOfRKHGOkTJPQRxe77MXhBAJvmDwtwlCJfCOJLLKWeLcbnnZT5uTzPt3JiECqmKGI8xJ6tTGJSxt5RxYKjzJxHLnVtp_ULEHmTOCiJm7mJW16EjPJjGg9GOgK2Wso7OvEJrBcLbLW6iUk2Euo6LDXq0qyj1TVjFW4k61ZVlVpa5mvCyXbDpDzymuW2e-i47ZGEpHDjRHc3WaxVT9YxIa5w3Mk1TqX9wXc7mx4HLhx8Q6rK_u44uJIEl_P6TCeitDk9_fHwZLT71VwK-tnahtmrXV71UDWXm3GIBTnYBcKraNIrhh8mvHhururUAOLC2kWvbF5Dz-V8tma5Xto7EX9eDu6Bpuond7Lud04cz2JGdPU9lLh92A5PrSCO2gR7iYnau33zHjYeWoGD19ugv7O82WTV3iyLWO2Rq5S8vOVxryxrSfM2uYl8XPtBrarkmc6ZLHMCVhYxEI0J8uFVtpubQone0Cj86YJ1CaHjWNKEjZOqxfpwyjcEzh-koTeeq21zEkbtXqhn_GAS1WvfP0L4QGEAX1Vcw-buoRDE1yTOrDGWwH6sxygoWIbCsPct-Iso0YxJxJVYbMRCpYOdyIhpZZs7NM_byp3nhdlD2zXUlKL8ROrd4wM3U_4s8xGujhK3QsY6z1JqP-dbV0Mf5GYKCH50d3TrWWrqCybmE_TkWxnmvQ3TkW8ZM3jmHkEU5LcOyVJXeGVA4LqAwCsgRBuXwCPPGjqH4No5ZAMhS8DRHD8xIgwct9MlZnsUmkWQ84Rjq1EQf4anY7sREPjxPBmTu1dyOblh8h6kio6cJRxKEZxRIZRI3geUMqmxu3ewKylzyv4xSIXIBUKQu3u8BEd1CEZjumnGqMboyZUUXYc_X4VMThFWzmOOLU2SLgmudesCgS5mzsDepohX5vJcBObNTMQBcWll_YAe1UBvRtlvGFl_dJd9SlrzQeRm61hZM19P11JJZDc953jlCmrj2mrvF0rrIfybAN5651zpfe3HdzbpZkGe5Z5lpmJS5Y71mlzt_3DlkT-OPdtEvDDwhLb60lPcvhGR7tnRS5_QTmU8Y6aRfbP4TEsrxsjTOQVVjn2LL8mBlKcDftmjs9DTmS81B5ysB5OsO6O8v70uiGdAmvGMgbAwb79llcSg5FykFUumLrqZyvssUqZt7OiHwc3N_B0bRPbm5U_RybcjwyZArwvSDh6U0800Ws1S8dtkEJ4QuYoAJE93Zl4disvkHU-Fospon12BfpmHSrkclcrlgavzyjCnukf25IrMnfirbXoF5mZUGOX0FehnfGlh5335wg6u5jbeIPOSREVdewvuvrK8X4xLbyyJrjxZfUCF62UymvKZO2q167L2dHXChML8wn4R1fIGTuvjtHTLV8JIhr0BjrJN3YErqpMBG7avByBPPQ-PGZMfgLvnzjlIz9qV6-s2pCe473zeHjLSk5-0aoRFLRNbO7zZxXVoeEnjDcffOQ912Fy14zCCyjR0domBWwAAt2zynvYEGTNkcmDkgGf8lr1chdPJ1LbQxvu41bL9QV13yZRjvo2zu4x6DuwZXiHHV-JlxDvPIBNafty8Q7pzbHLzDM4nvSEFOe_Kboux-0TzAXHs-43GCkzsDih_NUFZzZUR_Rcx-KmqyzDO4E-f_cKvi3fCurfjW2cLvRoVvc_aFxdh-a5_HSrOi4eQjO1Tka1dpMWv52VNqLfJPFobD0oSut-L_6UF-RelH6XU7zmWwCicQwn196RLs9TnQtMggKhtq-bjyxcA-2UxeCmBMQwMmYiNX8Wqa1bv7mOG-oKwvjcG_5lUEQfpv1OeVcoimOXNDa8BKJ66JLNNDCznrFVIXMVB282N2h8Mm9Wj9nqv9eo3nc_hF5oEZEhQFLYGNEGvQ5YKiXXgYWt2TfmAof7WfKVY7Jf6a_X4BXx92_qZ3PxM8OgXgOKHf2j-abJBIwhWVTFXLMRoPm9Wyl_6_VGe_e1rJ22MpQi6Hc1EkUM9xJiZFTv_v-nVugp4LerG5sNYEBhBLXF8iVM6jn9Q2AfOrlhu7S6-ffv2T-GRoaE.ZzXhpA.6IaVZ-sABN4LB476tj7c1hUx5F8 Upgrade-Insecure-Requests: 1 Sec-Fetch-Dest: document Sec-Fetch-Mode: navigate @@ -17,77 +103,4 @@ Sec-Gpc: 1 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\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\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) - ^^^^^^^^^^^^^^^^^^^^^^^ -jinja2.exceptions.UndefinedError: 'order' 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 -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.3 b/app.log.3 index 7d33755e..9d60fb31 100644 --- a/app.log.3 +++ b/app.log.3 @@ -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,83 +19,41 @@ 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 config_env: development @@ -109,68 +68,26 @@ 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: 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/business_objects/store/__pycache__/product.cpython-312.pyc b/business_objects/store/__pycache__/product.cpython-312.pyc index 1cc13db5..af8e7019 100644 Binary files a/business_objects/store/__pycache__/product.cpython-312.pyc and b/business_objects/store/__pycache__/product.cpython-312.pyc differ diff --git a/business_objects/store/__pycache__/product_category.cpython-312.pyc b/business_objects/store/__pycache__/product_category.cpython-312.pyc index aeefa5fa..58d7e346 100644 Binary files a/business_objects/store/__pycache__/product_category.cpython-312.pyc and b/business_objects/store/__pycache__/product_category.cpython-312.pyc differ diff --git a/business_objects/store/__pycache__/product_permutation.cpython-312.pyc b/business_objects/store/__pycache__/product_permutation.cpython-312.pyc index 3960e145..ab59f4ea 100644 Binary files a/business_objects/store/__pycache__/product_permutation.cpython-312.pyc and b/business_objects/store/__pycache__/product_permutation.cpython-312.pyc differ diff --git a/business_objects/store/product.py b/business_objects/store/product.py index 6ec5aa30..880cffb8 100644 --- a/business_objects/store/product.py +++ b/business_objects/store/product.py @@ -858,7 +858,8 @@ class Parameters_Product(Get_Many_Parameters_Base): class Product_Temp(db.Model, Store_Base): __tablename__ = 'Shop_Product_Temp' __table_args__ = { 'extend_existing': True } - id_product: int = db.Column(db.Integer, primary_key=True) + id_temp: int = db.Column(db.Integer, primary_key=True, autoincrement=True) + id_product: int = db.Column(db.Integer) id_category: int = db.Column(db.Integer) name: str = db.Column(db.String(255)) has_variations: bool = db.Column(db.Boolean) @@ -868,7 +869,8 @@ class Product_Temp(db.Model, Store_Base): guid: str = db.Column(db.BINARY(36)) # created_on: datetime = db.Column(db.DateTime) # created_by: int = db.Column(db.Integer) - + def __init__(self): + self.id_temp = None @classmethod def from_product(cls, product): row = cls() diff --git a/business_objects/store/product_category.py b/business_objects/store/product_category.py index d7e1baa4..a58f9852 100644 --- a/business_objects/store/product_category.py +++ b/business_objects/store/product_category.py @@ -479,7 +479,8 @@ class Table_Shop_Product_Category(db.Model): class Product_Category_Temp(db.Model, Store_Base): __tablename__ = 'Shop_Product_Category_Temp' __table_args__ = { 'extend_existing': True } - id_category: int = db.Column(db.Integer, primary_key=True) + id_temp: int = db.Column(db.Integer, primary_key=True, autoincrement=True) + id_category: int = db.Column(db.Integer) code: str = db.Column(db.String(50)) name: str = db.Column(db.String(255)) description: str = db.Column(db.String(4000)) @@ -489,7 +490,9 @@ class Product_Category_Temp(db.Model, Store_Base): guid: str = db.Column(db.String(36)) # created_on: datetime = db.Column(db.DateTime) # created_by: int = db.Column(db.Integer) - + def __init__(self): + super().__init__() + self.id_temp = None @classmethod def from_product_category(cls, product_category): row = cls() diff --git a/business_objects/store/product_permutation.py b/business_objects/store/product_permutation.py index dbf71e81..a15c4544 100644 --- a/business_objects/store/product_permutation.py +++ b/business_objects/store/product_permutation.py @@ -67,6 +67,7 @@ class Product_Permutation(db.Model, Store_Base): id_permutation = db.Column(db.Integer, primary_key=True) id_product = db.Column(db.Integer) id_category = db.Column(db.Integer) + csv_id_pairs_variation = db.Column(db.String(4000)) # name = db.Column(db.String(255)) description = db.Column(db.String(4000)) # price_GBP_full = db.Column(db.Float) @@ -222,7 +223,7 @@ class Product_Permutation(db.Model, Store_Base): permutation.id_product = json[cls.ATTR_ID_PRODUCT] permutation.id_category = json[cls.ATTR_ID_PRODUCT_CATEGORY] permutation.description = json[cls.FLAG_DESCRIPTION] - permutation.cost_local_VAT_excl = json[cls.FLAG_COST_UNIT_LOCAL_VAT_EXCL] + permutation.cost_local_VAT_excl = json.get(cls.FLAG_COST_UNIT_LOCAL_VAT_EXCL, None) permutation.cost_local_VAT_incl = json.get(cls.FLAG_COST_UNIT_LOCAL_VAT_INCL, None) permutation.currency_cost = Currency.from_json(json, '_cost') permutation.profit_local_min = json[cls.FLAG_PROFIT_LOCAL_MIN] @@ -254,7 +255,8 @@ class Product_Permutation(db.Model, Store_Base): permutation.has_variations = json[cls.FLAG_HAS_VARIATIONS] permutation.active = 1 if av.input_bool(json[cls.FLAG_ACTIVE], cls.FLAG_ACTIVE, _m) else 0 if permutation.has_variations: - permutation.variation_tree = Product_Variation_Tree.from_json_str(json[cls.FLAG_PRODUCT_VARIATIONS]) + permutation.csv_id_pairs_variation = json[cls.FLAG_PRODUCT_VARIATIONS] + permutation.variation_tree = Product_Variation_Tree.from_json_str(permutation.csv_id_pairs_variation) """ for jsonProductVariation in json[cls.FLAG_PRODUCT_VARIATIONS]: variation = Product_Variation.from_json(jsonProductVariation) @@ -383,6 +385,7 @@ class Product_Permutation(db.Model, Store_Base): name_plural_unit_measurement_interval_expiration_unsealed: {self.name_plural_unit_measurement_interval_expiration_unsealed} count_interval_expiration_unsealed: {self.count_interval_expiration_unsealed} has_variations: {self.has_variations} + csv_id_pairs_variation: {self.csv_id_pairs_variation} can_view: {self.can_view} can_edit: {self.can_edit} can_admin: {self.can_admin} @@ -505,8 +508,10 @@ class Permutation_Product_Variation_Link(db.Model): class Product_Permutation_Temp(db.Model, Store_Base): __tablename__: ClassVar[str] = 'Shop_Product_Permutation_Temp' __table_args__ = { 'extend_existing': True } - id_permutation: int = db.Column(db.Integer, primary_key=True) + id_temp: int = db.Column(db.Integer, primary_key=True, autoincrement=True) + id_permutation: int = db.Column(db.Integer) id_product: int = db.Column(db.Integer) + csv_id_pairs_variation: str = db.Column(db.String(4000)) description: str = db.Column(db.String(4000)) cost_local_VAT_excl: float = db.Column(db.Float) cost_local_VAT_incl: float = db.Column(db.Float) @@ -527,13 +532,16 @@ class Product_Permutation_Temp(db.Model, Store_Base): count_interval_expiration_unsealed: int = db.Column(db.Integer) active: bool = db.Column(db.Boolean) guid: str = db.Column(db.String(36)) - + def __init__(self): + super().__init__() + self.id_temp = None @classmethod def from_product_permutation(cls, product_permutation): Helper_App.console_log(f'Product_Permutation_Temp.from_product_permutation: {product_permutation}\ntype(cost local): {str(type(product_permutation.cost_local_VAT_excl))}') row = cls() row.id_permutation = product_permutation.id_permutation row.id_product = product_permutation.id_product + row.csv_id_pairs_variation = product_permutation.csv_id_pairs_variation row.description = product_permutation.description row.cost_local_VAT_excl = product_permutation.cost_local_VAT_excl if product_permutation.cost_local_VAT_excl != 'None' else None row.cost_local_VAT_incl = product_permutation.cost_local_VAT_incl if product_permutation.cost_local_VAT_incl != 'None' else None @@ -558,6 +566,7 @@ class Product_Permutation_Temp(db.Model, Store_Base): return f''' id_permutation: {self.id_permutation} id_product: {self.id_product} + csv_id_pairs_variation: {self.csv_id_pairs_variation} description: {self.description} cost_local_VAT_excl: {self.cost_local_VAT_excl} cost_local_VAT_incl: {self.cost_local_VAT_incl} diff --git a/datastores/__pycache__/datastore_store_product_permutation.cpython-312.pyc b/datastores/__pycache__/datastore_store_product_permutation.cpython-312.pyc index 0dbe636f..197a24d2 100644 Binary files a/datastores/__pycache__/datastore_store_product_permutation.cpython-312.pyc and b/datastores/__pycache__/datastore_store_product_permutation.cpython-312.pyc differ diff --git a/datastores/datastore_store_product_permutation.py b/datastores/datastore_store_product_permutation.py index 8adbe138..2d9dc6b7 100644 --- a/datastores/datastore_store_product_permutation.py +++ b/datastores/datastore_store_product_permutation.py @@ -101,5 +101,6 @@ class DataStore_Store_Product_Permutation(DataStore_Store_Base): 'a_id_user': user.id_user, 'a_debug': 0, } - cls.db_procedure_execute('p_shop_save_product_permutation', argument_dict_list) + results = cls.db_procedure_execute('p_shop_save_product_permutation', argument_dict_list) + DataStore_Store_Base.db_cursor_clear(results.cursor) Helper_App.console_log('saved product permutations') diff --git a/static/MySQL/0000_combine.sql b/static/MySQL/0000_combined.sql similarity index 96% rename from static/MySQL/0000_combine.sql rename to static/MySQL/0000_combined.sql index a1af69ec..af6c2662 100644 --- a/static/MySQL/0000_combine.sql +++ b/static/MySQL/0000_combined.sql @@ -1,3 +1,4 @@ +-- File: 0001_destroy.sql /* Clear Store DataBase */ @@ -18,6 +19,7 @@ DROP TABLE IF EXISTS tmp_Shop_Order; DROP TABLE IF EXISTS tmp_Shop_Product; DROP TABLE IF EXISTS tmp_Product; DROP TABLE IF EXISTS tmp_Product_Permutation; +DROP TABLE IF EXISTS tmp_Permutation_Variation_Link; DROP TABLE IF EXISTS tmp_Permutation; DROP TABLE IF EXISTS tmp_Shop_Product_p_shop_calc_user; DROP TABLE IF EXISTS tmp_Shop_Product_p_Shop_Calc_User; @@ -51,6 +53,7 @@ DROP TABLE IF EXISTS tmp_Manufacturing_Purchase_Order; DROP TABLE IF EXISTS tmp_Shop_Customer; DROP TABLE IF EXISTS tmp_Shop_Customer_Sale_Order_Product_Link; DROP TABLE IF EXISTS tmp_Shop_Customer_Sale_Order; +DROP TABLE IF EXISTS tmp_Get_Variation_From_Csv_Variations; # Delete old tables @@ -165,6 +168,7 @@ DROP TABLE IF EXISTS Shop_Product_Currency_Link; DROP TABLE IF EXISTS Shop_Product_Variation_Link_Audit; DROP TABLE IF EXISTS Shop_Product_Variation_Link; +DROP TABLE IF EXISTS Shop_Product_Permutation_Variation_Link_Temp; DROP TABLE IF EXISTS Shop_Product_Permutation_Variation_Link_Audit; DROP TABLE IF EXISTS Shop_Product_Permutation_Variation_Link; @@ -304,6 +308,8 @@ DROP PROCEDURE IF EXISTS p_shop_save_product_variation; DROP PROCEDURE IF EXISTS p_shop_save_product_variation_test; DROP PROCEDURE IF EXISTS p_shop_get_many_product_variation; DROP FUNCTION IF EXISTS fn_shop_get_id_product_permutation_from_variation_csv_list; +DROP FUNCTION IF EXISTS fn_shop_get_product_variations_from_id_csv_list; +DROP FUNCTION IF EXISTS fn_shop_get_product_permutation_variations_csv; DROP PROCEDURE IF EXISTS p_shop_save_stock_item; DROP PROCEDURE IF EXISTS p_shop_save_stock_item_test; DROP PROCEDURE IF EXISTS p_shop_get_many_stock_item; @@ -330,6 +336,9 @@ DROP PROCEDURE IF EXISTS p_shop_get_many_customer; DROP PROCEDURE IF EXISTS p_shop_save_customer_sales_order; DROP PROCEDURE IF EXISTS p_shop_get_many_customer_sales_order; + +-- File: 1000_tbl_Shop_Product_Change_Set.sql + # Product Change Sets @@ -342,6 +351,9 @@ CREATE TABLE Shop_Product_Change_Set ( updated_last_on DATETIME, updated_last_by VARCHAR(100) ); + +-- File: 1000_tbl_Split_Temp.sql + # Split Staging -- USE partsltd_prod; -- DROP TABLE IF EXISTS Split_Temp; @@ -354,6 +366,9 @@ CREATE TABLE Split_Temp ( , substring VARCHAR(4000) NOT NULL ); + +-- File: 1001_tbl_Shop_User_Change_Set.sql + # User Change Sets @@ -366,6 +381,9 @@ CREATE TABLE IF NOT EXISTS Shop_User_Change_Set ( updated_last_on DATETIME, updated_last_by VARCHAR(100) ); + +-- File: 1001_tbl_Split_Key_Value_Pair_Csv_Temp.sql + # Split Key Value Pair CSV Staging -- USE partsltd_prod; -- DROP TABLE IF EXISTS Split_Temp; @@ -379,6 +397,9 @@ CREATE TABLE Split_Key_Value_Pair_Csv_Temp ( , value_column VARCHAR(4000) NULL ); + +-- File: 1002_tbl_Shop_Sales_And_Purchasing_Change_Set.sql + # Sales And Purchasing Change Sets @@ -391,6 +412,9 @@ CREATE TABLE Shop_Sales_And_Purchasing_Change_Set ( updated_last_on DATETIME, updated_last_by VARCHAR(100) ); + +-- File: 1003_tbl_Shop_Access_Level.sql + # Access Levels @@ -414,6 +438,9 @@ CREATE TABLE IF NOT EXISTS Shop_Access_Level ( + +-- File: 1004_tbl_Shop_Access_Level_Audit.sql + # Access Level Audits @@ -435,6 +462,9 @@ CREATE TABLE IF NOT EXISTS Shop_Access_Level_Audit ( FOREIGN KEY (id_change_set) REFERENCES Shop_User_Change_Set(id_change_set) ); + +-- File: 1005_tbl_Msg_Error_Type.sql + # Error Message Type @@ -448,6 +478,9 @@ CREATE TABLE IF NOT EXISTS Shop_Msg_Error_Type ( description VARCHAR(1000) ); + +-- File: 1010_tbl_File_Type.sql + # File Types @@ -465,6 +498,9 @@ CREATE TABLE IF NOT EXISTS File_Type ( updated_last_by VARCHAR(100) ); + +-- File: 1011_tbl_File_Type_Audit.sql + # File Type Audit @@ -486,6 +522,9 @@ CREATE TABLE IF NOT EXISTS File_Type_Audit ( updated_last_on DATETIME, updated_last_by VARCHAR(100) ); + +-- File: 1012_tbl_Shop_General.sql + # Generic / shared properties @@ -502,6 +541,9 @@ CREATE TABLE IF NOT EXISTS Shop_General ( FOREIGN KEY (id_change_set) REFERENCES Shop_Product_Change_Set(id_change_set) ); + +-- File: 1013_tbl_Shop_General_Audit.sql + # Shop General Audits @@ -523,6 +565,9 @@ CREATE TABLE IF NOT EXISTS Shop_General_Audit ( FOREIGN KEY (id_change_set) REFERENCES Shop_Product_Change_Set(id_change_set) ); + +-- File: 1014_tbl_Shop_Image_Type.sql + # Image Types @@ -550,6 +595,9 @@ CREATE TABLE IF NOT EXISTS Shop_Image_Type ( REFERENCES Shop_Product_Change_Set(id_change_set) ); + +-- File: 1015_tbl_Shop_Image_Type_Audit.sql + # Image Type Audits @@ -571,6 +619,9 @@ CREATE TABLE IF NOT EXISTS Shop_Image_Type_Audit ( FOREIGN KEY (id_change_set) REFERENCES Shop_Product_Change_Set(id_change_set) ); + +-- File: 1100_tbl_Shop_Region.sql + # Regions SELECT CONCAT('WARNING: Table ', TABLE_NAME, ' already exists.') AS msg_warning FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'Shop_Region'; @@ -588,6 +639,9 @@ CREATE TABLE IF NOT EXISTS Shop_Region ( FOREIGN KEY (id_change_set) REFERENCES Shop_Product_Change_Set(id_change_set) ); + +-- File: 1101_tbl_Shop_Region_Audit.sql + # Region Audits @@ -609,6 +663,9 @@ CREATE TABLE IF NOT EXISTS Shop_Region_Audit ( FOREIGN KEY (id_change_set) REFERENCES Shop_Product_Change_Set(id_change_set) ); + +-- File: 1102_tbl_Shop_Region_Temp.sql + # Region Temp @@ -628,6 +685,9 @@ CREATE TABLE IF NOT EXISTS Shop_Region_Temp ( FOREIGN KEY (id_change_set) REFERENCES Shop_Product_Change_Set(id_change_set) ); + +-- File: 1103_tbl_Shop_Region_Branch.sql + # Region Branchs @@ -656,6 +716,9 @@ CREATE TABLE IF NOT EXISTS Shop_Region_Branch ( FOREIGN KEY (id_change_set) REFERENCES Shop_Product_Change_Set(id_change_set) ); + +-- File: 1104_tbl_Shop_Region_Branch_Audit.sql + # Region Audits @@ -677,6 +740,9 @@ CREATE TABLE IF NOT EXISTS Shop_Region_Branch_Audit ( FOREIGN KEY (id_change_set) REFERENCES Shop_Product_Change_Set(id_change_set) ); + +-- File: 1105_tbl_Shop_Region_Branch_Temp.sql + # Region Branch Temp @@ -691,6 +757,9 @@ CREATE TABLE IF NOT EXISTS Shop_Region_Branch_Temp ( active BIT NOT NULL DEFAULT 1, display_order INT NOT NULL ); + +-- File: 1106_tbl_Shop_Address.sql + # Addresses @@ -721,6 +790,9 @@ CREATE TABLE Shop_Address ( FOREIGN KEY (id_change_set) REFERENCES partsltd_prod.Shop_User_Change_Set(id_change_set) ); + +-- File: 1106_tbl_Shop_Plant.sql + # Plant SELECT CONCAT('WARNING: Table ', TABLE_NAME, ' already exists.') AS msg_warning FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'Shop_Plant'; @@ -743,6 +815,9 @@ CREATE TABLE IF NOT EXISTS Shop_Plant ( REFERENCES Shop_Product_Change_Set(id_change_set) ); + +-- File: 1107_tbl_Shop_Address_Audit.sql + # Address Audits SELECT CONCAT('WARNING: Table ', TABLE_NAME, ' already exists.') AS msg_warning FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'Shop_Address_Audit'; @@ -763,6 +838,9 @@ CREATE TABLE IF NOT EXISTS Shop_Address_Audit ( REFERENCES Shop_User_Change_Set(id_change_set) ON UPDATE RESTRICT ); + +-- File: 1107_tbl_Shop_Plant_Audit.sql + # Plant Audits @@ -785,6 +863,9 @@ CREATE TABLE IF NOT EXISTS Shop_Plant_Audit ( REFERENCES Shop_Product_Change_Set(id_change_set) ); + +-- File: 1108_tbl_Shop_Plant_Temp.sql + # Plant Temp @@ -801,6 +882,9 @@ CREATE TABLE IF NOT EXISTS Shop_Plant_Temp ( , guid BINARY(36) NOT NULL ); + +-- File: 1109_tbl_Shop_Storage_Location.sql + # Storage Location @@ -824,6 +908,9 @@ CREATE TABLE IF NOT EXISTS Shop_Storage_Location ( REFERENCES Shop_Product_Change_Set(id_change_set) ); + +-- File: 1110_tbl_Shop_Storage_Location_Audit.sql + # Storage Location Audits @@ -846,6 +933,9 @@ CREATE TABLE IF NOT EXISTS Shop_Storage_Location_Audit ( REFERENCES Shop_Product_Change_Set(id_change_set) ); + +-- File: 1111_tbl_Shop_Storage_Location_Temp.sql + # Storage Location Temp @@ -859,6 +949,9 @@ CREATE TABLE IF NOT EXISTS Shop_Storage_Location ( active BIT NOT NULL DEFAULT 1 ); + +-- File: 1112_tbl_Shop_Storage_Location_Branch.sql + # Storage Location Branch @@ -887,6 +980,9 @@ CREATE TABLE IF NOT EXISTS Shop_Storage_Location_Branch ( FOREIGN KEY (id_change_set) REFERENCES Shop_Product_Change_Set(id_change_set) ); + +-- File: 1113_tbl_Shop_Storage_Location_Branch_Audit.sql + # Storage Location Branch Audits @@ -909,6 +1005,9 @@ CREATE TABLE IF NOT EXISTS Shop_Storage_Location_Branch_Audit ( REFERENCES Shop_Product_Change_Set(id_change_set) ); + +-- File: 1114_tbl_Shop_Storage_Location_Branch_Temp.sql + # Storage Location Branch Temp @@ -923,6 +1022,9 @@ CREATE TABLE IF NOT EXISTS Shop_Storage_Location_Branch_Temp ( active BIT NOT NULL DEFAULT 1, display_order INT NOT NULL ); + +-- File: 1115_tbl_Shop_Currency.sql + # Currencies @@ -945,6 +1047,9 @@ CREATE TABLE IF NOT EXISTS Shop_Currency ( REFERENCES Shop_Product_Change_Set(id_change_set) ON UPDATE RESTRICT ); + +-- File: 1116_tbl_Shop_Currency_Audit.sql + # Currency Audits @@ -967,6 +1072,9 @@ CREATE TABLE IF NOT EXISTS Shop_Currency_Audit ( REFERENCES Shop_User_Change_Set(id_change_set) ON UPDATE RESTRICT ); + +-- File: 1117_tbl_Shop_Currency_Temp.sql + # Currency Temp @@ -982,6 +1090,9 @@ CREATE TABLE IF NOT EXISTS Shop_Currency_Temp ( active BIT NOT NULL DEFAULT 1, display_order INT NOT NULL ); + +-- File: 1118_tbl_Shop_Tax_Or_Surcharge.sql + # Taxes and Surcharges @@ -1020,6 +1131,9 @@ CREATE TABLE Shop_Tax_Or_Surcharge ( REFERENCES Shop_Product_Change_Set(id_change_set) ); + +-- File: 1119_tbl_Shop_Tax_Or_Surcharge_Audit.sql + # Tax Or Surcharge Audits @@ -1042,6 +1156,9 @@ CREATE TABLE IF NOT EXISTS Shop_Tax_Or_Surcharge_Audit ( REFERENCES Shop_Product_Change_Set(id_change_set) ON UPDATE RESTRICT ); + +-- File: 1120_tbl_Shop_Tax_Or_Surcharge_Temp.sql + # Taxes and Surcharges Temp @@ -1064,6 +1181,9 @@ CREATE TABLE Shop_Tax_Or_Surcharge_Temp ( display_order INT NOT NULL ); + +-- File: 1121_tbl_Shop_Unit_Measurement.sql + # Unit of Measurement @@ -1090,6 +1210,9 @@ CREATE TABLE IF NOT EXISTS Shop_Unit_Measurement ( REFERENCES Shop_Product_Change_Set(id_change_set) ); + +-- File: 1122_tbl_Shop_Unit_Measurement_Audit.sql + # Unit of Measurement Audits @@ -1112,6 +1235,9 @@ CREATE TABLE IF NOT EXISTS Shop_Unit_Measurement_Audit ( REFERENCES Shop_Product_Change_Set(id_change_set) ); + +-- File: 1124_tbl_Shop_Unit_Measurement_Conversion.sql + # Unit of Measurement Conversion @@ -1135,6 +1261,9 @@ CREATE TABLE IF NOT EXISTS Shop_Unit_Measurement_Conversion ( REFERENCES Shop_Product_Change_Set(id_change_set) ); + +-- File: 1125_tbl_Shop_Unit_Measurement_Conversion_Audit.sql + # Unit of Measurement Conversion Audits @@ -1157,6 +1286,9 @@ CREATE TABLE IF NOT EXISTS Shop_Unit_Measurement_Conversion_Audit ( REFERENCES Shop_Product_Change_Set(id_change_set) ); + +-- File: 1200_tbl_Shop_Product_Category.sql + # Categories @@ -1181,6 +1313,9 @@ CREATE TABLE IF NOT EXISTS Shop_Product_Category ( REFERENCES Shop_Product_Change_Set(id_change_set) ); + +-- File: 1201_tbl_Shop_Product_Category_Audit.sql + # Category Audits @@ -1203,6 +1338,9 @@ CREATE TABLE IF NOT EXISTS Shop_Product_Category_Audit ( REFERENCES Shop_Product_Change_Set(id_change_set) ); + +-- File: 1202_tbl_Shop_Product_Category_Temp.sql + # Categories Temp -- DROP TABLE Shop_Product_Category_Temp; @@ -1210,7 +1348,8 @@ CREATE TABLE IF NOT EXISTS Shop_Product_Category_Audit ( SELECT CONCAT('WARNING: Table ', TABLE_NAME, ' already exists.') AS msg_warning FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'Shop_Product_Category_Temp'; CREATE TABLE IF NOT EXISTS Shop_Product_Category_Temp ( - id_category INT NOT NULL + id_temp INT NOT NULL PRIMARY KEY AUTO_INCREMENT + , id_category INT NOT NULL , code VARCHAR(50) NOT NULL , name VARCHAR(255) NOT NULL , description VARCHAR(4000) NULL @@ -1223,6 +1362,9 @@ CREATE TABLE IF NOT EXISTS Shop_Product_Category_Temp ( , guid BINARY(36) NOT NULL ); + +-- File: 1203_tbl_Shop_Product.sql + # Products @@ -1271,6 +1413,9 @@ CREATE TABLE IF NOT EXISTS Shop_Product ( REFERENCES Shop_Product_Change_Set(id_change_set) ); + +-- File: 1204_tbl_Shop_Product_Audit.sql + # Products @@ -1292,6 +1437,9 @@ CREATE TABLE IF NOT EXISTS Shop_Product_Audit ( FOREIGN KEY (id_change_set) REFERENCES Shop_Product_Change_Set(id_change_set) ); + +-- File: 1205_tbl_Shop_Product_Temp.sql + # Products Temp -- DROP TABLE IF EXISTS Shop_Product_Temp; @@ -1299,7 +1447,8 @@ CREATE TABLE IF NOT EXISTS Shop_Product_Audit ( SELECT CONCAT('WARNING: Table ', TABLE_NAME, ' already exists.') AS msg_warning FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'Shop_Product_Temp'; CREATE TABLE IF NOT EXISTS Shop_Product_Temp ( - id_product INT NOT NULL + id_temp INT NOT NULL PRIMARY KEY AUTO_INCREMENT + , id_product INT NOT NULL , name VARCHAR(255) NOT NULL , id_category INT NOT NULL , has_variations BIT NOT NULL @@ -1312,6 +1461,9 @@ CREATE TABLE IF NOT EXISTS Shop_Product_Temp ( , guid BINARY(36) NOT NULL ); + +-- File: 1206_tbl_Shop_Product_Permutation.sql + # Product Permutation -- DROP TABLE partsltd_prod.Shop_Product_Permutation; @@ -1320,6 +1472,7 @@ SELECT CONCAT('WARNING: Table ', TABLE_NAME, ' already exists.') AS msg_warning CREATE TABLE IF NOT EXISTS Shop_Product_Permutation ( id_permutation INT NOT NULL AUTO_INCREMENT PRIMARY KEY, + id_permutation_temp INT NOT NULL, id_product INT NOT NULL, CONSTRAINT FK_Shop_Product_Permutation_id_product FOREIGN KEY (id_product) @@ -1372,6 +1525,9 @@ CREATE TABLE IF NOT EXISTS Shop_Product_Permutation ( REFERENCES Shop_Product_Change_Set(id_change_set) ); + +-- File: 1207_tbl_Shop_Product_Permutation_Audit.sql + # Product Permutation Audits @@ -1395,6 +1551,9 @@ CREATE TABLE IF NOT EXISTS Shop_Product_Permutation_Audit ( ON UPDATE RESTRICT ); + +-- File: 1208_tbl_Shop_Product_Permutation_Temp.sql + # Product Permutation Temp -- DROP TABLE IF EXISTS Shop_Product_Permutation_Temp; @@ -1402,8 +1561,10 @@ CREATE TABLE IF NOT EXISTS Shop_Product_Permutation_Audit ( SELECT CONCAT('WARNING: Table ', TABLE_NAME, ' already exists.') AS msg_warning FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'Shop_Product_Permutation_Temp'; CREATE TABLE IF NOT EXISTS Shop_Product_Permutation_Temp ( - id_permutation INT NOT NULL + id_temp INT NOT NULL PRIMARY KEY AUTO_INCREMENT + , id_permutation INT NOT NULL , id_product INT NOT NULL + , csv_id_pairs_variation VARCHAR(4000) NULL , description VARCHAR(4000) NOT NULL , cost_local_VAT_excl FLOAT NULL , cost_local_VAT_incl FLOAT NULL @@ -1430,6 +1591,9 @@ CREATE TABLE IF NOT EXISTS Shop_Product_Permutation_Temp ( , can_admin BIT NULL DEFAULT NULL ); + +-- File: 1209_tbl_Shop_Variation_Type.sql + # Variation Types @@ -1451,6 +1615,9 @@ CREATE TABLE IF NOT EXISTS Shop_Variation_Type ( FOREIGN KEY (id_change_set) REFERENCES Shop_Product_Change_Set(id_change_set) ); + +-- File: 1210_tbl_Shop_Variation_Type_Audit.sql + # Variation Type Audits @@ -1473,6 +1640,9 @@ CREATE TABLE IF NOT EXISTS Shop_Variation_Type_Audit ( REFERENCES Shop_Product_Change_Set(id_change_set) ); + +-- File: 1211_tbl_Shop_Variation_Type_Temp.sql + # Variation Types Temp -- DROP TABLE partsltd_prod.Shop_Variation_Type_Temp; @@ -1492,6 +1662,9 @@ CREATE TABLE IF NOT EXISTS Shop_Variation_Type_Temp ( , created_by INT , guid BINARY(36) NOT NULL ); + +-- File: 1212_tbl_Shop_Variation.sql + # Variations @@ -1522,6 +1695,9 @@ CREATE TABLE Shop_Variation ( REFERENCES partsltd_prod.Shop_Product_Change_Set(id_change_set) ); + +-- File: 1213_tbl_Shop_Variation_Audit.sql + # Variation Audits @@ -1544,6 +1720,9 @@ CREATE TABLE IF NOT EXISTS Shop_Variation_Audit ( REFERENCES Shop_Product_Change_Set(id_change_set) ); + +-- File: 1214_tbl_Shop_Variation_Temp.sql + # Variations Temp -- DROP TABLE partsltd_prod.Shop_Variation_Temp; @@ -1565,6 +1744,9 @@ CREATE TABLE Shop_Variation_Temp ( , guid BINARY(36) ); + +-- File: 1215_tbl_Shop_Product_Permutation_Variation_Link.sql + # Product Permutation Variation Link @@ -1593,6 +1775,9 @@ CREATE TABLE IF NOT EXISTS Shop_Product_Permutation_Variation_Link ( REFERENCES Shop_Product_Change_Set(id_change_set) ); + +-- File: 1216_tbl_Shop_Product_Permutation_Variation_Link_Audit.sql + # Product Permutation Variation Link Audits @@ -1615,6 +1800,28 @@ CREATE TABLE IF NOT EXISTS Shop_Product_Permutation_Variation_Link_Audit ( REFERENCES Shop_Product_Change_Set(id_change_set) ON UPDATE RESTRICT ); + +-- File: 1217_tbl_Shop_Product_Permutation_Variation_Link_Temp.sql + +# Product Permutation Variation Link + +-- DROP TABLE IF EXISTS Shop_Product_Permutation_Variation_Link_Temp; + +SELECT CONCAT('WARNING: Table ', TABLE_NAME, ' already exists.') AS msg_warning FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'Shop_Product_Permutation_Variation_Link_Temp'; + +CREATE TABLE IF NOT EXISTS Shop_Product_Permutation_Variation_Link_Temp ( + id_temp INT NOT NULL AUTO_INCREMENT PRIMARY KEY + , id_link INT NOT NULL + , id_permutation INT NOT NULL + , id_variation INT NOT NULL + , active BIT NOT NULL + , display_order INT NOT NULL + , GUID BINARY(36) NOT NULL +); + + +-- File: 1218_tbl_Shop_Stock_Item.sql + # Stock Stock Item -- DROP TABLE IF EXISTS Shop_Stock_Item; @@ -1653,6 +1860,9 @@ CREATE TABLE IF NOT EXISTS Shop_Stock_Item ( REFERENCES Shop_Product_Change_Set(id_change_set) ); + +-- File: 1219_tbl_Shop_Stock_Item_Audit.sql + # Stock Item Audits @@ -1676,6 +1886,9 @@ CREATE TABLE IF NOT EXISTS Shop_Stock_Item_Audit ( ON UPDATE RESTRICT ); + +-- File: 1220_tbl_Shop_Stock_Item_Temp.sql + # Stock Stock Item Temp DROP TABLE IF EXISTS Shop_Stock_Item_Temp; @@ -1703,6 +1916,9 @@ CREATE TABLE IF NOT EXISTS Shop_Stock_Item_Temp ( , guid BINARY(36) NOT NULL ); + +-- File: 1221_tbl_Shop_Product_Price.sql + # Product Price @@ -1734,6 +1950,9 @@ CREATE TABLE IF NOT EXISTS Shop_Product_Price ( FOREIGN KEY (id_change_set) REFERENCES Shop_Product_Change_Set(id_change_set) ); + +-- File: 1222_tbl_Shop_Product_Price_Audit.sql + # Product Price Audits @@ -1756,6 +1975,9 @@ CREATE TABLE IF NOT EXISTS Shop_Product_Price_Audit ( REFERENCES Shop_Product_Change_Set(id_change_set) ); + +-- File: 1223_tbl_Shop_Product_Price_Temp.sql + # Product Price Temp @@ -1772,6 +1994,9 @@ CREATE TABLE IF NOT EXISTS Shop_Product_Price_Temp ( id_stripe_price VARCHAR(200), active BIT NOT NULL DEFAULT 1 ); + +-- File: 1224_tbl_Shop_Product_Image.sql + # Product Permutation Images @@ -1798,6 +2023,9 @@ CREATE TABLE IF NOT EXISTS Shop_Product_Image ( FOREIGN KEY (id_change_set) REFERENCES Shop_Product_Change_Set(id_change_set) ); + +-- File: 1225_tbl_Shop_Product_Image_Audit.sql + # Product Image Audits @@ -1818,6 +2046,9 @@ CREATE TABLE IF NOT EXISTS Shop_Product_Image_Audit ( FOREIGN KEY (id_change_set) REFERENCES Shop_Product_Change_Set(id_change_set) ); + +-- File: 1227_tbl_Shop_Delivery_Option.sql + # Delivery Options @@ -1845,6 +2076,9 @@ CREATE TABLE IF NOT EXISTS Shop_Delivery_Option ( REFERENCES Shop_Product_Change_Set(id_change_set) ); + +-- File: 1228_tbl_Shop_Delivery_Option_Audit.sql + # Delivery Option Audits @@ -1866,6 +2100,9 @@ CREATE TABLE IF NOT EXISTS Shop_Delivery_Option_Audit ( FOREIGN KEY (id_change_set) REFERENCES Shop_Product_Change_Set(id_change_set) ); + +-- File: 1230_tbl_Shop_Product_Permutation_Delivery_Option_Link.sql + # Delivery Option @@ -1911,6 +2148,9 @@ CREATE TABLE IF NOT EXISTS Shop_Product_Permutation_Delivery_Option_Link ( FOREIGN KEY (id_change_set) REFERENCES Shop_Product_Change_Set(id_change_set) ); + +-- File: 1231_tbl_Shop_Product_Permutation_Delivery_Option_Link_Audit.sql + # Delivery Option Audits @@ -1932,6 +2172,9 @@ CREATE TABLE IF NOT EXISTS Shop_Product_Permutation_Delivery_Option_Link_Audit ( FOREIGN KEY (id_change_set) REFERENCES Shop_Product_Change_Set(id_change_set) ); + +-- File: 1233_tbl_Shop_Discount.sql + # Discounts @@ -1980,6 +2223,9 @@ CREATE TABLE Shop_Discount ( REFERENCES Shop_Product_Change_Set(id_change_set) ); + +-- File: 1234_tbl_Shop_Discount_Audit.sql + # Discount Audits @@ -2002,6 +2248,9 @@ CREATE TABLE IF NOT EXISTS Shop_Discount_Audit ( REFERENCES Shop_Product_Change_Set(id_change_set) ON UPDATE RESTRICT ); + +-- File: 1236_tbl_Shop_Discount_Region_Currency_Link.sql + # Discount Region Currency Link @@ -2033,6 +2282,9 @@ CREATE TABLE IF NOT EXISTS Shop_Discount_Region_Currency_Link ( FOREIGN KEY (id_change_set) REFERENCES Shop_Product_Change_Set(id_change_set) ); + +-- File: 1237_tbl_Shop_Discount_Region_Currency_Link_Audit.sql + # Discount Region Currency Link Audits @@ -2055,6 +2307,9 @@ CREATE TABLE IF NOT EXISTS Shop_Discount_Region_Currency_Link_Audit ( REFERENCES Shop_Product_Change_Set(id_change_set) ON UPDATE RESTRICT ); + +-- File: 1300_tbl_Shop_Permission_Group.sql + # Permission Groups @@ -2075,6 +2330,9 @@ CREATE TABLE IF NOT EXISTS Shop_Permission_Group ( REFERENCES Shop_User_Change_Set(id_change_set) ON UPDATE RESTRICT ); + +-- File: 1301_tbl_Shop_Permission_Group_Audit.sql + # Permission Group Audits @@ -2097,6 +2355,9 @@ CREATE TABLE IF NOT EXISTS Shop_Permission_Group_Audit ( REFERENCES Shop_User_Change_Set(id_change_set) ON UPDATE RESTRICT ); + +-- File: 1303_tbl_Shop_Permission.sql + # Permissions @@ -2125,6 +2386,9 @@ CREATE TABLE IF NOT EXISTS Shop_Permission ( FOREIGN KEY (id_change_set) REFERENCES Shop_User_Change_Set(id_change_set) ); + +-- File: 1304_tbl_Shop_Permission_Audit.sql + # Permission Audits @@ -2147,6 +2411,9 @@ CREATE TABLE IF NOT EXISTS Shop_Permission_Audit ( REFERENCES Shop_User_Change_Set(id_change_set) ON UPDATE RESTRICT ); + +-- File: 1306_tbl_Shop_Role.sql + # Roles @@ -2166,6 +2433,9 @@ CREATE TABLE IF NOT EXISTS Shop_Role ( FOREIGN KEY (id_change_set) REFERENCES Shop_User_Change_Set(id_change_set) ); + +-- File: 1307_tbl_Shop_Role_Audit.sql + # Role Audits @@ -2188,6 +2458,9 @@ CREATE TABLE Shop_Role_Audit ( REFERENCES Shop_User_Change_Set(id_change_set) ON UPDATE RESTRICT ); + +-- File: 1309_tbl_Shop_Role_Permission_Link.sql + # Role Permission link @@ -2218,6 +2491,9 @@ CREATE TABLE IF NOT EXISTS Shop_Role_Permission_Link ( FOREIGN KEY (id_change_set) REFERENCES Shop_User_Change_Set(id_change_set) ); + +-- File: 1310_tbl_Shop_Role_Permission_Link_Audit.sql + # Role Permission link Audits @@ -2239,6 +2515,9 @@ CREATE TABLE IF NOT EXISTS Shop_Role_Permission_Link_Audit ( FOREIGN KEY (id_change_set) REFERENCES Shop_User_Change_Set(id_change_set) ); + +-- File: 1312_tbl_Shop_User.sql + # Users @@ -2265,6 +2544,9 @@ CREATE TABLE IF NOT EXISTS Shop_User ( REFERENCES Shop_User_Change_Set(id_change_set) ); + +-- File: 1313_tbl_Shop_User_Audit.sql + # User Audits @@ -2287,6 +2569,9 @@ CREATE TABLE IF NOT EXISTS Shop_User_Audit ( REFERENCES Shop_User_Change_Set(id_change_set) ON UPDATE RESTRICT ); + +-- File: 1315_tbl_Shop_User_Role_Link.sql + # User Role link @@ -2312,6 +2597,9 @@ CREATE TABLE IF NOT EXISTS Shop_User_Role_Link ( FOREIGN KEY (id_change_set) REFERENCES Shop_User_Change_Set(id_change_set) ); + +-- File: 1316_tbl_Shop_User_Role_Link_Audit.sql + # User Role Link Audits @@ -2334,6 +2622,9 @@ CREATE TABLE IF NOT EXISTS Shop_User_Role_Link_Audit ( REFERENCES Shop_User_Change_Set(id_change_set) ); + +-- File: 1318_tbl_Shop_User_Address.sql + # User Addresses SELECT CONCAT('WARNING: Table ', TABLE_NAME, ' already exists.') AS msg_warning FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'Shop_User_Address'; @@ -2362,6 +2653,9 @@ CREATE TABLE Shop_User_Address ( FOREIGN KEY (id_change_set) REFERENCES Shop_User_Change_Set(id_change_set) ); + +-- File: 1319_tbl_Shop_User_Address_Audit.sql + # Address Audits SELECT CONCAT('WARNING: Table ', TABLE_NAME, ' already exists.') AS msg_warning FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'Shop_User_Address_Audit'; @@ -2382,6 +2676,9 @@ CREATE TABLE IF NOT EXISTS Shop_User_Address_Audit ( REFERENCES Shop_User_Change_Set(id_change_set) ON UPDATE RESTRICT ); + +-- File: 1321_tbl_Shop_User_Basket.sql + # User Basket (Product Link) @@ -2421,6 +2718,9 @@ CREATE TABLE IF NOT EXISTS Shop_User_Basket ( */ ); + +-- File: 1322_tbl_Shop_User_Basket_Audit.sql + # Product Basket Audits @@ -2448,6 +2748,9 @@ CREATE TABLE IF NOT EXISTS Shop_User_Basket_Audit ( */ ); + +-- File: 1397_tbl_Shop_Order_Status.sql + # User Order Types @@ -2469,6 +2772,9 @@ CREATE TABLE IF NOT EXISTS Shop_User_Order_Status ( REFERENCES Shop_User_Change_Set(id_change_set) ); + +-- File: 1398_tbl_Shop_Order_Status_Audit.sql + # Order Type Audits @@ -2490,6 +2796,9 @@ CREATE TABLE IF NOT EXISTS Shop_User_Order_Status_Audit ( FOREIGN KEY (id_change_set) REFERENCES Shop_Product_Change_Set(id_change_set) ); + +-- File: 1400_tbl_Shop_Supplier.sql + # Supplier SELECT CONCAT('WARNING: Table ', TABLE_NAME, ' already exists.') AS msg_warning FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'Shop_Supplier'; @@ -2523,6 +2832,9 @@ CREATE TABLE IF NOT EXISTS Shop_Supplier ( , id_supplier_temp INT NOT NULL ); + +-- File: 1401_tbl_Shop_Supplier_Audit.sql + # Supplier Audits @@ -2545,6 +2857,9 @@ CREATE TABLE IF NOT EXISTS Shop_Supplier_Audit ( REFERENCES Shop_User_Change_Set(id_change_set) ); + +-- File: 1402_tbl_Shop_Supplier_Temp.sql + # Supplier Staging SELECT CONCAT('WARNING: Table ', TABLE_NAME, ' already exists.') AS msg_warning FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'Shop_Supplier_Temp'; @@ -2565,6 +2880,9 @@ CREATE TABLE IF NOT EXISTS Shop_Supplier_Temp ( GUID BINARY(36) NOT NULL ); + +-- File: 1403_tbl_Shop_Supplier_Address.sql + # Supplier Addresses SELECT CONCAT('WARNING: Table ', TABLE_NAME, ' already exists.') AS msg_warning FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'Shop_Supplier_Address'; @@ -2593,6 +2911,9 @@ CREATE TABLE Shop_Supplier_Address ( FOREIGN KEY (id_change_set) REFERENCES partsltd_prod.Shop_User_Change_Set(id_change_set) ); + +-- File: 1404_tbl_Shop_Supplier_Address_Audit.sql + # Supplier Address Audits SELECT CONCAT('WARNING: Table ', TABLE_NAME, ' already exists.') AS msg_warning FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'Shop_Supplier_Address_Audit'; @@ -2613,6 +2934,9 @@ CREATE TABLE IF NOT EXISTS Shop_Supplier_Address_Audit ( REFERENCES Shop_User_Change_Set(id_change_set) ON UPDATE RESTRICT ); + +-- File: 1405_tbl_Shop_Supplier_Address_Temp.sql + # Supplier Addresses Staging SELECT CONCAT('WARNING: Table ', TABLE_NAME, ' already exists.') AS msg_warning FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'Shop_Supplier_Address_Temp'; @@ -2629,6 +2953,9 @@ CREATE TABLE Shop_Supplier_Address_Temp ( , active BIT NOT NULL DEFAULT 1 , GUID BINARY(36) NOT NULL ); + +-- File: 1409_tbl_Shop_Supplier_Purchase_Order.sql + # Supplier Purchase Order @@ -2672,6 +2999,9 @@ CREATE TABLE IF NOT EXISTS Shop_Supplier_Purchase_Order ( REFERENCES Shop_Sales_And_Purchasing_Change_Set(id_change_set) ); + +-- File: 1410_tbl_Shop_Supplier_Purchase_Order_Audit.sql + # Supplier Purchase Order Audits @@ -2694,6 +3024,9 @@ CREATE TABLE IF NOT EXISTS Shop_Supplier_Purchase_Order_Audit ( REFERENCES Shop_Sales_And_Purchasing_Change_Set(id_change_set) ); + +-- File: 1411_tbl_Shop_Supplier_Purchase_Order_Temp.sql + # Supplier Purchase Order Staging DROP TABLE IF EXISTS Shop_Supplier_Purchase_Order_Temp; @@ -2709,6 +3042,9 @@ CREATE TABLE IF NOT EXISTS Shop_Supplier_Purchase_Order_Temp ( , GUID BINARY(36) NOT NULL ); + +-- File: 1412_tbl_Shop_Supplier_Purchase_Order_Product_Link.sql + # Supplier Purchase Order Product Link @@ -2749,6 +3085,9 @@ CREATE TABLE IF NOT EXISTS Shop_Supplier_Purchase_Order_Product_Link ( REFERENCES Shop_Sales_And_Purchasing_Change_Set(id_change_set) ); + +-- File: 1413_tbl_Shop_Supplier_Purchase_Order_Product_Link_Audit.sql + # Supplier Purchase Order Product Link Audits @@ -2771,6 +3110,9 @@ CREATE TABLE IF NOT EXISTS Shop_Supplier_Purchase_Order_Product_Link_Audit ( REFERENCES Shop_Sales_And_Purchasing_Change_Set(id_change_set) ); + +-- File: 1414_tbl_Shop_Supplier_Purchase_Order_Product_Link_Temp.sql + # Supplier Purchase Order Product Link Temp @@ -2797,6 +3139,9 @@ CREATE TABLE IF NOT EXISTS Shop_Supplier_Purchase_Order_Product_Link_Temp ( , GUID BINARY(36) NOT NULL ); + +-- File: 1415_tbl_Shop_Manufacturing_Purchase_Order.sql + # Manufacturing Purchase Order SELECT CONCAT('WARNING: Table ', TABLE_NAME, ' already exists.') AS msg_warning FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'Shop_Manufacturing_Purchase_Order'; @@ -2837,6 +3182,9 @@ CREATE TABLE IF NOT EXISTS Shop_Manufacturing_Purchase_Order ( REFERENCES Shop_Sales_And_Purchasing_Change_Set(id_change_set) ); + +-- File: 1416_tbl_Shop_Manufacturing_Purchase_Order_Audit.sql + # Manufacturing Purchase Order Audits @@ -2859,6 +3207,9 @@ CREATE TABLE IF NOT EXISTS Shop_Manufacturing_Purchase_Order_Audit ( REFERENCES Shop_Sales_And_Purchasing_Change_Set(id_change_set) ); + +-- File: 1417_tbl_Shop_Manufacturing_Purchase_Order_Temp.sql + # Manufacturing Purchase Order Temp -- DROP TABLE Shop_Manufacturing_Purchase_Order_Temp @@ -2890,6 +3241,9 @@ CREATE TABLE IF NOT EXISTS Shop_Manufacturing_Purchase_Order_Temp ( GUID BINARY(36) NOT NULL ); + +-- File: 1418_tbl_Shop_Manufacturing_Purchase_Order_Product_Link.sql + # Manufacturing Purchase Order Product Link -- DROP TABLE partsltd_prod.Shop_Manufacturing_Purchase_Order_Product_Link_Audit @@ -2934,6 +3288,9 @@ CREATE TABLE IF NOT EXISTS Shop_Manufacturing_Purchase_Order_Product_Link ( REFERENCES partsltd_prod.Shop_Sales_And_Purchasing_Change_Set(id_change_set) ); + +-- File: 1419_tbl_Shop_Manufacturing_Purchase_Order_Product_Link_Audit.sql + # Manufacturing Purchase Order Product Link Audits @@ -2956,6 +3313,9 @@ CREATE TABLE IF NOT EXISTS Shop_Manufacturing_Purchase_Order_Product_Link_Audit REFERENCES Shop_Sales_And_Purchasing_Change_Set(id_change_set) ); + +-- File: 1420_tbl_Shop_Manufacturing_Purchase_Order_Product_Link_Temp.sql + # Manufacturing Purchase Order Product Link Temp -- DROP TABLE Shop_Manufacturing_Purchase_Order_Product_Link_Temp; @@ -2983,6 +3343,9 @@ CREATE TABLE IF NOT EXISTS Shop_Manufacturing_Purchase_Order_Product_Link_Temp ( price_unit_local_VAT_incl FLOAT NULL, GUID BINARY(36) NOT NULL ); + + +-- File: 1421_tbl_Shop_Customer.sql # Customer @@ -3013,6 +3376,9 @@ CREATE TABLE IF NOT EXISTS Shop_Customer ( REFERENCES Shop_Sales_And_Purchasing_Change_Set(id_change_set) ); + +-- File: 1422_tbl_Shop_Customer_Audit.sql + # Customer Audits @@ -3035,6 +3401,9 @@ CREATE TABLE IF NOT EXISTS Shop_Customer_Audit ( REFERENCES Shop_Sales_And_Purchasing_Change_Set(id_change_set) ); + +-- File: 1424_tbl_Shop_Customer_Sales_Order.sql + # Customer Sales Purchase Order @@ -3070,6 +3439,9 @@ CREATE TABLE IF NOT EXISTS Shop_Customer_Sales_Order ( REFERENCES Shop_Sales_And_Purchasing_Change_Set(id_change_set) ); + +-- File: 1425_tbl_Shop_Customer_Sales_Order_Audit.sql + # Customer Sales Order Audits @@ -3092,6 +3464,9 @@ CREATE TABLE IF NOT EXISTS Shop_Customer_Sales_Order_Audit ( REFERENCES Shop_Sales_And_Purchasing_Change_Set(id_change_set) ); + +-- File: 1427_tbl_Shop_Customer_Sales_Order_Product_Link.sql + # Customer Sales Order Product Link @@ -3130,6 +3505,9 @@ CREATE TABLE IF NOT EXISTS Shop_Customer_Sales_Order_Product_Link ( REFERENCES Shop_Sales_And_Purchasing_Change_Set(id_change_set) ); + +-- File: 1428_tbl_Shop_Customer_Sales_Order_Product_Link_Audit.sql + # Customer Sales Order Product Link Audits @@ -3152,6 +3530,9 @@ CREATE TABLE IF NOT EXISTS Shop_Customer_Sales_Order_Product_Link_Audit ( REFERENCES Shop_Sales_And_Purchasing_Change_Set(id_change_set) ); + +-- File: 1429_tbl_Shop_Customer_Sales_Order_Product_Link_Temp.sql + # Customer Sales Order Product Link Temp @@ -3186,6 +3567,9 @@ CREATE TABLE IF NOT EXISTS Shop_Customer_Sales_Order_Product_Link_Temp ( active BIT NOT NULL ); + +-- File: 1500_tbl_Shop_Calc_User_Temp.sql + # Calc User Staging -- USE partsltd_prod; -- DROP TABLE IF EXISTS Shop_Calc_User_Temp; @@ -3211,6 +3595,9 @@ CREATE TABLE Shop_Calc_User_Temp ( can_edit BIT, can_admin BIT ); + +-- File: 3000_tri_Shop_Access_Level.sql + # Shop Access Level @@ -3270,6 +3657,9 @@ BEGIN END // DELIMITER ;; + +-- File: 3000_tri_Shop_Product_Change_Set.sql + # Product Change Set @@ -3290,6 +3680,9 @@ BEGIN END // DELIMITER ;; + +-- File: 3001_tri_Shop_User_Change_Set.sql + # Shop User Change Set @@ -3310,6 +3703,9 @@ BEGIN END IF; END // DELIMITER ;; + +-- File: 3002_tri_Shop_Sales_And_Purchasing_Change_Set.sql + # Product Change Set @@ -3330,6 +3726,9 @@ BEGIN END // DELIMITER ;; + +-- File: 3010_tri_File_Type.sql + # File Type @@ -3373,6 +3772,9 @@ BEGIN END // DELIMITER ;; + +-- File: 3011_tri_File_Type_Audit.sql + # File Type Audits @@ -3400,6 +3802,9 @@ BEGIN SET NEW.updated_last_by = CURRENT_USER(); END // DELIMITER ;; + +-- File: 3012_tri_Shop_General.sql + # Shop General @@ -3440,6 +3845,9 @@ BEGIN ; END // DELIMITER ;; + +-- File: 3014_tri_Shop_Image_Type.sql + # Shop Image Type @@ -3504,6 +3912,9 @@ BEGIN ; END // DELIMITER ;; + +-- File: 3100_tri_Shop_Region.sql + # Shop Delivery Region @@ -3559,6 +3970,9 @@ BEGIN END // DELIMITER ;; + +-- File: 3103_tri_Shop_Region_Branch.sql + # Shop Region Branch @@ -3612,6 +4026,9 @@ BEGIN END // DELIMITER ;; + +-- File: 3106_tri_Shop_Address.sql + # Shop Address @@ -3678,6 +4095,9 @@ BEGIN ; END // DELIMITER ;; + +-- File: 3109_tri_Shop_Storage_Location.sql + # Shop Storage Location @@ -3733,6 +4153,9 @@ BEGIN END // DELIMITER ;; + +-- File: 3115_tri_Shop_Currency.sql + # Shop Currency @@ -3795,6 +4218,9 @@ BEGIN ; END // DELIMITER ;; + +-- File: 3118_tri_Shop_Tax_Or_Surcharge.sql + # Shop Tax_Or_Surcharge @@ -3870,6 +4296,9 @@ END // DELIMITER ;; + +-- File: 3200_tri_Shop_Category.sql + # Shop Category @@ -3931,6 +4360,9 @@ BEGIN END // DELIMITER ;; + +-- File: 3203_tri_Shop_Product.sql + # Shop Product @@ -4101,6 +4533,9 @@ BEGIN END // DELIMITER ;; + +-- File: 3206_tri_Shop_Product_Permutation.sql + # Shop Product Permutation @@ -4264,6 +4699,9 @@ BEGIN END // DELIMITER ;; + +-- File: 3209_tri_Shop_Variation_Type.sql + # Shop Variation Type @@ -4324,6 +4762,9 @@ BEGIN END // DELIMITER ;; + +-- File: 3212_tri_Shop_Variation.sql + # Shop Variation @@ -4387,6 +4828,9 @@ BEGIN END // DELIMITER ;; + +-- File: 3215_tri_Shop_Product_Permutation_Variation_Link.sql + # Shop Product Permutation Variation Link @@ -4443,6 +4887,9 @@ BEGIN ; END // DELIMITER ;; + +-- File: 3218_tri_Shop_Stock_Item.sql + # Shop Product Permutation @@ -4534,6 +4981,9 @@ BEGIN END // DELIMITER ;; + +-- File: 3221_tri_Shop_Product_Price.sql + # Shop Product Currency Link @@ -4621,6 +5071,9 @@ BEGIN END // DELIMITER ;; + +-- File: 3224_tri_Shop_Product_Image.sql + # Shop Image @@ -4693,6 +5146,9 @@ BEGIN ; END // DELIMITER ;; + +-- File: 3227_tri_Shop_Delivery_Option.sql + # Shop Delivery Option Type @@ -4765,6 +5221,9 @@ BEGIN ; END // DELIMITER ;; + +-- File: 3230_tri_Shop_Product_Permutation_Delivery_Option_Link.sql + # Shop Product Delivery Option Link @@ -4843,6 +5302,9 @@ BEGIN ; END // DELIMITER ;; + +-- File: 3233_tri_Shop_Discount.sql + # Shop Discount @@ -4926,6 +5388,9 @@ END // DELIMITER ;; + +-- File: 3236_tri_Shop_Discount_Region_Currency_Link.sql + # Shop Discount Region Currency Link @@ -4978,6 +5443,9 @@ BEGIN ; END // DELIMITER ;; + +-- File: 3300_tri_Shop_Permission_Group.sql + # Shop Permission Group @@ -5032,6 +5500,9 @@ BEGIN ; END // DELIMITER ;; + +-- File: 3303_tri_Shop_Permission.sql + # Shop Permission @@ -5094,6 +5565,9 @@ BEGIN ; END // DELIMITER ;; + +-- File: 3306_tri_Shop_Role.sql + # Shop Role @@ -5149,6 +5623,9 @@ BEGIN END // DELIMITER ;; + +-- File: 3309_tri_Shop_Role_Permission_Link.sql + # Shop Role Permission Link @@ -5206,6 +5683,9 @@ BEGIN END // DELIMITER ;; + +-- File: 3312_tri_Shop_User.sql + # Shop User @@ -5284,6 +5764,9 @@ BEGIN ; END // DELIMITER ;; + +-- File: 3315_tri_Shop_User_Role_Link.sql + # Shop User Role Link @@ -5326,6 +5809,9 @@ BEGIN ; END // DELIMITER ;; + +-- File: 3318_tri_Shop_User_Address.sql + # Shop Address @@ -5400,6 +5886,9 @@ BEGIN ; END // DELIMITER ;; + +-- File: 3321_tri_Shop_User_Basket.sql + # Shop Product Variation Link @@ -5454,6 +5943,9 @@ BEGIN ; END // DELIMITER ;; + +-- File: 3324_tri_Shop_User_Order_Status.sql + # Shop User Order Type @@ -5512,6 +6004,9 @@ BEGIN ; END // DELIMITER ;; + +-- File: 3400_tri_Shop_Supplier.sql + # Shop Supplier @@ -5593,6 +6088,9 @@ BEGIN END // DELIMITER ;; + +-- File: 3403_tri_Shop_Supplier_Address.sql + # Shop Supplier Address DROP TRIGGER IF EXISTS before_insert_Shop_Supplier_Address; @@ -5657,6 +6155,9 @@ BEGIN ; END // DELIMITER ;; + +-- File: 3403_tri_Shop_Unit_Measurement.sql + # Shop Unit of Measurement @@ -5733,6 +6234,9 @@ END // DELIMITER ;; + +-- File: 3406_tri_Shop_Unit_Of_Measurement_Conversion.sql + # Shop Unit of Measurement Conversion @@ -5797,6 +6301,9 @@ END // DELIMITER ;; + +-- File: 3409_tri_Shop_Supplier_Purchase_Order.sql + # Shop Supplier Purchase Order @@ -5875,6 +6382,9 @@ END // DELIMITER ;; + +-- File: 3412_tri_Shop_Supplier_Purchase_Order_Product_Link.sql + # Shop Supplier Purchase Order Product Link @@ -5968,6 +6478,9 @@ BEGIN END // DELIMITER ;; + +-- File: 3415_tri_Shop_Manufacturing_Purchase_Order.sql + # Shop Manufacturing Purchase Order @@ -6039,6 +6552,9 @@ BEGIN END // DELIMITER ;; + +-- File: 3418_tri_Shop_Manufacturing_Purchase_Order_Product_Link.sql + # Shop Manufacturing Purchase Order Product Link @@ -6131,6 +6647,9 @@ END // DELIMITER ;; + +-- File: 3421_tri_Shop_Customer.sql + # Shop Customer @@ -6203,6 +6722,9 @@ END // DELIMITER ;; + +-- File: 3424_tri_Shop_Customer_Sales_Order.sql + # Shop Customer Sales Order @@ -6258,6 +6780,9 @@ BEGIN END // DELIMITER ;; + +-- File: 3427_tri_Shop_Customer_Sales_Order_Product_Link.sql + # Shop Customer Sales Order Product Link @@ -6336,6 +6861,9 @@ BEGIN ; END // DELIMITER ;; + + +-- File: 6000_p_debug_timing_reporting.sql -- USE partsltd_prod; -- Clear previous proc @@ -6380,6 +6908,9 @@ CALL partsltd_prod.p_debug_timing_reporting ( ); */ +-- File: 6000_p_split.sql + + DROP PROCEDURE IF EXISTS p_split; DELIMITER // @@ -6483,6 +7014,9 @@ WHERE GUID = 'nips'; CALL p_clear_split_temp( 'nips' ); */ + +-- File: 6001_p_clear_split_temp.sql + -- Clear previous proc DROP PROCEDURE IF EXISTS p_clear_split_temp; @@ -6513,6 +7047,9 @@ CALL p_clear_split_temp ( 'nips' ); */ +-- File: 6001_p_validate_guid.sql + + DROP PROCEDURE IF EXISTS p_validate_guid; DROP PROCEDURE IF EXISTS p_validate_guid_test; @@ -6571,6 +7108,9 @@ DELIMITER ;; CALL p_validate_guid_test(); +-- File: 6003_p_split_key_value_pair_csv.sql + + DROP PROCEDURE IF EXISTS p_split_key_value_pair_csv; DELIMITER // @@ -6678,6 +7218,9 @@ WHERE GUID = 'nipsnipsnipsnipsnipsnipsnipsnipsnips'; CALL p_clear_split_key_value_pair_csv_temp( 'nipsnipsnipsnipsnipsnipsnipsnipsnips' ); */ + +-- File: 6004_p_clear_split_key_value_pair_csv_temp.sql + -- Clear previous proc DROP PROCEDURE IF EXISTS p_clear_split_key_value_pair_csv_temp; @@ -6707,6 +7250,9 @@ CALL p_clear_split_key_value_pair_csv_temp ( 'nipsnipsnipsnipsnipsnipsnipsnipsni */ + +-- File: 6206_fn_shop_get_product_permutation_name.sql + DROP FUNCTION IF EXISTS fn_shop_get_product_permutation_name; DELIMITER // @@ -6750,6 +7296,9 @@ SELECT ) ; */ + +-- File: 6210_fn_shop_get_id_product_permutation_from_variation_csv_list.sql + DROP FUNCTION IF EXISTS fn_shop_get_id_product_permutation_from_variation_csv_list; DELIMITER // @@ -6971,6 +7520,165 @@ WHERE GUID = 'nipsnipsnipsnipsnipsnipsnipsnipsnips'; CALL p_clear_split_key_value_pair_csv_temp( 'nipsnipsnipsnipsnipsnipsnipsnipsnips' ); */ + +-- File: 6211_fn_shop_get_product_variations_from_id_csv_list.sql + +DROP FUNCTION IF EXISTS fn_shop_get_product_variations_from_id_csv_list; + +DELIMITER // + +CREATE FUNCTION fn_shop_get_product_variations_from_id_csv_list ( + a_id_permutation INT + , a_variation_csv TEXT + , a_guid BINARY(36) +) +RETURNS INT +DETERMINISTIC +READS SQL DATA +BEGIN + DECLARE v_csv_pairs VARCHAR(4000); + DECLARE v_current_pair VARCHAR(50); + DECLARE v_id_variation_type INT; + DECLARE v_id_variation INT; + DECLARE v_rank_counter INT; + + CALL p_validate_guid( a_guid ); + + SET v_csv_pairs := a_variation_csv; + SET v_rank_counter := 1; + + DROP TEMPORARY TABLE IF EXISTS tmp_Get_Variation_From_Csv_Variations; + CREATE TEMPORARY TABLE tmp_Get_Variation_From_Csv_Variations ( + id_variation_type INT NULL + , id_variation INT NOT NULL + ); + + WHILE LENGTH(v_csv_pairs) > 0 DO + IF LOCATE(',', v_csv_pairs) > 0 THEN + SET v_current_pair := SUBSTRING_INDEX(v_csv_pairs, ',', 1); + SET v_csv_pairs := SUBSTRING(v_csv_pairs, LOCATE(',', v_csv_pairs) + 1); + ELSE + SET v_current_pair := v_csv_pairs; + SET v_csv_pairs := ''; + END IF; + + SET v_id_variation_type := SUBSTRING_INDEX(v_current_pair, ':', 1); + SET v_id_variation := SUBSTRING_INDEX(v_current_pair, ':', -1); + + IF NOT ISNULL(v_id_variation) THEN + INSERT INTO tmp_Get_Variation_From_Csv_Variations ( + id_variation_type + , id_variation + ) + SELECT + v_id_variation_type AS id_variation_type + , v_id_variation AS id_variation + ; + + SET v_rank_counter := v_rank_counter + 1; + END IF; + END WHILE; + + INSERT INTO partsltd_prod.Shop_Product_Permutation_Variation_Link_Temp ( + id_link + , id_permutation + , id_variation + , display_order + , active + , GUID + ) + SELECT + IFNULL(PPVL.id_link, -v_rank_counter) AS id_link + , a_id_permutation + , t_V.id_variation + , v_rank_counter AS display_order + , 1 AS active + , a_guid + FROM tmp_Get_Variation_From_Csv_Variations t_V + LEFT JOIN partsltd_prod.Shop_Product_Permutation_Variation_Link PPVL ON t_V.id_variation = PPVL.id_variation + ; + + DROP TEMPORARY TABLE tmp_Get_Variation_From_Csv_Variations; + + RETURN v_rank_counter; +END // + +DELIMITER ; + + +/* + +SELECT + partsltd_prod.fn_shop_get_product_variations_from_id_csv_list( + 1 -- a_id_permutation + , '1:1' -- a_variation_csv + , 'NIPPLENIPPLENIPPLENIPPLENIPPLENIPPLE' -- a_guid + ) +; +SELECT * +FROM partsltd_prod.Shop_Product_Permutation_Variation_Link_Temp +WHERE GUID = 'NIPPLENIPPLENIPPLENIPPLENIPPLENIPPLE' +; +DELETE +FROM partsltd_prod.Shop_Product_Permutation_Variation_Link_Temp +WHERE GUID = 'NIPPLENIPPLENIPPLENIPPLENIPPLENIPPLE' +; +*/ + + +-- File: 6212_fn_shop_get_product_permutation_variations_csv.sql + +DROP FUNCTION IF EXISTS fn_shop_get_product_permutation_variations_csv; + +DELIMITER // + +CREATE FUNCTION fn_shop_get_product_permutation_variations_csv(id_product_permutation INT) +RETURNS VARCHAR(4000) +DETERMINISTIC +BEGIN + DECLARE csv VARCHAR(4000); + + SET csv := ( + SELECT + CASE WHEN P.has_variations = 0 THEN + '' + ELSE + GROUP_CONCAT( + CONCAT( + PV.id_type + , ':' + , PV.id_variation + ) + SEPARATOR ',' + ) + END + FROM partsltd_prod.Shop_Product_Permutation PP + LEFT JOIN partsltd_prod.Shop_Product P ON PP.id_product = P.id_product + LEFT JOIN partsltd_prod.Shop_Product_Permutation_Variation_Link PPVL ON PP.id_permutation = PPVL.id_permutation + LEFT JOIN partsltd_prod.Shop_Variation PV ON PPVL.id_variation = PV.id_variation + LEFT JOIN partsltd_prod.Shop_Variation_Type PVT ON PV.id_type = PVT.id_type + WHERE PP.id_permutation = id_product_permutation + GROUP BY P.id_product, P.has_variations, PVT.display_order, PVT.name, PV.display_order, PV.name + LIMIT 1 + ); + + RETURN csv; +END // + +DELIMITER ; +SELECT + fn_shop_get_product_permutation_variations_csv( + 3 -- id_product_permutation + ) + , fn_shop_get_product_permutation_variations_csv( + 1 -- id_product_permutation + ) +; +/* +*/ + +-- File: 6500_p_shop_calc_user.sql + -- Clear previous proc DROP PROCEDURE IF EXISTS p_shop_user_eval; DROP PROCEDURE IF EXISTS p_shop_calc_user; @@ -7527,6 +8235,9 @@ SELECT * FROM partsltd_prod.shop_user_role_link; SELECT * FROM partsltd_prod.shop_role_permission_link; */ + +-- File: 6501_p_shop_clear_calc_user.sql + -- Clear previous proc DROP PROCEDURE IF EXISTS p_shop_clear_Shop_Calc_User_Temp; DROP PROCEDURE IF EXISTS p_clear_Shop_Calc_User_Temp; @@ -7573,6 +8284,9 @@ WHERE GUID = 'noods, cheese ' */ +-- File: 7003_p_shop_get_many_access_level.sql + + /* @@ -7618,6 +8332,9 @@ CALL p_shop_get_many_access_level ( */ +-- File: 7101_p_shop_get_many_region.sql + + /* @@ -7663,6 +8380,9 @@ CALL p_shop_get_many_region ( */ +-- File: 7106_p_shop_get_many_plant.sql + + -- Clear previous proc DROP PROCEDURE IF EXISTS p_shop_get_many_plant; @@ -7699,6 +8419,9 @@ CALL p_shop_get_many_plant ( */ +-- File: 7109_p_shop_get_many_storage_location.sql + + -- Clear previous proc DROP PROCEDURE IF EXISTS p_shop_get_many_storage_location; @@ -7736,6 +8459,9 @@ CALL p_shop_get_many_storage_location ( */ +-- File: 7116_p_shop_get_many_currency.sql + + /* @@ -7782,6 +8508,9 @@ CALL p_shop_get_many_currency ( ); */ + +-- File: 7122_p_shop_get_many_unit_measurement.sql + -- Clear previous proc DROP PROCEDURE IF EXISTS p_shop_get_many_unit_measurement; @@ -7824,6 +8553,9 @@ from shop_unit_measurement */ +-- File: 7200_p_shop_save_product_category.sql + + -- Clear previous proc DROP PROCEDURE IF EXISTS p_save_category; DROP PROCEDURE IF EXISTS p_shop_save_category; @@ -8095,6 +8827,9 @@ END // DELIMITER ;; + +-- File: 7200_p_shop_save_product_category_test.sql + -- Clear previous proc DROP PROCEDURE IF EXISTS partsltd_prod.p_shop_save_product_category_test; @@ -8170,6 +8905,9 @@ DELETE FROM partsltd_prod.Shop_Product_Category_Temp; DROP TABLE IF EXISTS tmp_Msg_Error; */ + +-- File: 7202_p_shop_clear_calc_product_permutation.sql + -- Clear previous proc DROP PROCEDURE IF EXISTS p_shop_clear_calc_product_permutation; @@ -8223,6 +8961,9 @@ WHERE GUID = a_guid */ +-- File: 7203_p_shop_save_product.sql + + -- Clear previous proc @@ -8535,6 +9276,9 @@ DELIMITER ;; +-- File: 7203_p_shop_save_product_test.sql + + -- Clear previous proc DROP PROCEDURE IF EXISTS partsltd_prod.p_shop_save_product_test; @@ -8625,7 +9369,10 @@ CALL partsltd_prod.p_shop_save_product_test (); DELETE FROM partsltd_prod.Shop_Product_Temp; DROP TABLE IF EXISTS tmp_Msg_Error; -*/-- USE partsltd_prod; +*/ + +-- File: 7204_p_shop_calc_product_permutation.sql +-- USE partsltd_prod; -- Clear previous proc DROP PROCEDURE IF EXISTS p_shop_calc_product_permutation; @@ -9339,7 +10086,10 @@ CALL partsltd_prod.p_shop_calc_product_permutation ( WHERE GUID = 'NIPS ' ; -*/-- +*/ + +-- File: 7204_p_shop_get_many_product.sql +-- USE partsltd_prod; -- Clear previous proc @@ -9863,6 +10613,9 @@ FROM partsltd_prod.Shop_Calc_User_Temp; */ +-- File: 7205_p_shop_get_many_stripe_product_new.sql + + /* @@ -10170,6 +10923,9 @@ CALL p_shop_calc_user ( */ +-- File: 7206_p_shop_save_product_permutation.sql + + -- Clear previous proc DROP PROCEDURE IF EXISTS p_shop_save_permutation; DROP PROCEDURE IF EXISTS p_shop_save_product_permutation; @@ -10237,11 +10993,14 @@ BEGIN CALL p_validate_guid ( a_guid ); - DROP TABLE IF EXISTS tmp_Permutation; + DROP TEMPORARY TABLE IF EXISTS tmp_Permutation_Variation_Link; + DROP TEMPORARY TABLE IF EXISTS tmp_Permutation; CREATE TEMPORARY TABLE tmp_Permutation ( id_permutation INT NOT NULL + , id_permutation_temp INT NOT NULL , id_product INT NOT NULL + , csv_id_pairs_variation VARCHAR(4000) NULL , description VARCHAR(4000) NOT NULL , cost_local_VAT_excl FLOAT NULL , cost_local_VAT_incl FLOAT NULL @@ -10267,6 +11026,15 @@ BEGIN , name_error VARCHAR(255) NOT NULL , is_new BIT NOT NULL ); + + CREATE TEMPORARY TABLE tmp_Permutation_Variation_Link ( + id_link INT NOT NULL + , id_permutation INT NOT NULL + , id_variation INT NOT NULL + , active BIT NOT NULL + , display_order INT NOT NULL + , is_new BIT NOT NULL + ); CREATE TEMPORARY TABLE IF NOT EXISTS tmp_Msg_Error ( display_order INT NOT NULL PRIMARY KEY AUTO_INCREMENT @@ -10279,7 +11047,9 @@ BEGIN -- Get data from Temp table INSERT INTO tmp_Permutation ( id_permutation + , id_permutation_temp , id_product + , csv_id_pairs_variation , description , cost_local_VAT_excl , cost_local_VAT_incl @@ -10304,7 +11074,9 @@ BEGIN ) SELECT PP_T.id_permutation + , PP_T.id_permutation , IFNULL(PP_T.id_product, PP.id_product) AS id_product + , PP_T.csv_id_pairs_variation , IFNULL(PP_T.description, PP.description) AS description , IFNULL(PP_T.cost_local_VAT_excl, PP.cost_local_VAT_excl) AS cost_local_VAT_excl , IFNULL(PP_T.cost_local_VAT_incl, PP.cost_local_VAT_incl) AS cost_local_VAT_incl @@ -10331,6 +11103,42 @@ BEGIN WHERE PP_T.guid = a_guid ; + select 'nips'; + + SELECT + partsltd_prod.fn_shop_get_product_variations_from_id_csv_list( + t_PP.id_permutation -- a_id_permutation + , t_PP.csv_id_pairs_variation -- a_variation_csv + , a_guid -- a_guid + ) + FROM tmp_Permutation t_PP + WHERE NOT ISNULL(t_PP.csv_id_pairs_variation) + ; + + SELECT 'CHIPS'; + + INSERT INTO tmp_Permutation_Variation_Link ( + id_link + , id_permutation + , id_variation + , display_order + , active + , is_new + ) + SELECT + PPVL_T.id_link + , PPVL_T.id_permutation + , PPVL_T.id_variation + , PPVL_T.display_order + , ISNULL(PPVL_T.id_link) AS active + , IFNULL(PPVL_T.id_link, 0) < 1 AS is_new + FROM partsltd_prod.Shop_Product_Permutation_Variation_Link_Temp PPVL_T + RIGHT JOIN partsltd_prod.Shop_Product_Permutation_Variation_Link PPVL ON PPVL_T.id_link = PPVL.id_variation + INNER JOIN tmp_Permutation t_PP ON PPVL_T.id_permutation = t_PP.id_permutation + ; + + select 'lips'; + -- Validation -- Missing mandatory fields -- id_product @@ -10546,6 +11354,17 @@ BEGIN , t_P.can_admin = UE_T.can_admin ; + IF a_debug = 1 THEN + SELECT * + FROM partsltd_prod.Shop_Calc_User_Temp + WHERE GUID = a_guid + ; + SELECT * + FROM tmp_Permutation t_PP + LEFT JOIN Shop_Product P ON t_PP.id_product = P.id_product + ; + END IF; + CALL p_shop_clear_calc_user( a_guid , 0 -- a_debug @@ -10562,20 +11381,73 @@ BEGIN , v_code_type_error_bad_data , CONCAT('The following product permutation(s) do not have product edit permission: ', GROUP_CONCAT(t_P.name_error SEPARATOR ', ')) AS msg FROM tmp_Permutation t_P - WHERE ISNULL(t_P.can_edit) + WHERE + ISNULL(t_P.can_edit) ; END IF; IF NOT EXISTS (SELECT * FROM tmp_Msg_Error LIMIT 1) THEN START TRANSACTION; - IF NOT ISNULL(v_ids_product_permission) THEN INSERT INTO Shop_Product_Change_Set ( comment ) VALUES ( a_comment ) ; SET v_id_change_set := LAST_INSERT_ID(); + INSERT INTO Shop_Product_Permutation ( + id_product + , description + , cost_local_VAT_excl + , cost_local_VAT_incl + , id_currency_cost + , profit_local_min + , latency_manufacture + , id_unit_measurement_quantity + , count_unit_measurement_per_quantity_step + , quantity_min + , quantity_max + , quantity_stock + , is_subscription + , id_unit_measurement_interval_recurrence + , count_interval_recurrence + , id_stripe_product + , does_expire_faster_once_unsealed + , id_unit_measurement_interval_expiration_unsealed + , count_interval_expiration_unsealed + , active + , created_by + , created_on + ) + SELECT + t_P.id_product AS id_product + , t_P.description AS description + , t_P.cost_local_VAT_excl AS cost_local_VAT_excl + , t_P.cost_local_VAT_incl AS cost_local_VAT_incl + , t_P.id_currency_cost AS id_currency_cost + , t_P.profit_local_min AS profit_local_min + , t_P.latency_manufacture AS latency_manufacture + , t_P.id_unit_measurement_quantity AS id_unit_measurement_quantity + , t_P.count_unit_measurement_per_quantity_step AS count_unit_measurement_per_quantity_step + , t_P.quantity_min AS quantity_min + , t_P.quantity_max AS quantity_max + , t_P.quantity_stock AS quantity_stock + , t_P.is_subscription AS is_subscription + , t_P.id_unit_measurement_interval_recurrence AS id_unit_measurement_interval_recurrence + , t_P.count_interval_recurrence AS count_interval_recurrence + , t_P.id_stripe_product AS id_stripe_product + , t_P.does_expire_faster_once_unsealed AS does_expire_faster_once_unsealed + , t_P.id_unit_measurement_interval_expiration_unsealed AS id_unit_measurement_interval_expiration_unsealed + , t_P.count_interval_expiration_unsealed AS count_interval_expiration_unsealed + , t_P.active AS active + , a_id_user AS created_by + , v_time_start AS created_on + FROM tmp_Permutation t_P + WHERE + is_new = 1 + AND active = 1 + ; + UPDATE Shop_Product_Permutation PP INNER JOIN tmp_Permutation t_P ON PP.id_permutation = t_P.id_permutation SET @@ -10601,66 +11473,57 @@ BEGIN , PP.active = t_P.active , PP.id_change_set = v_id_change_set ; + + UPDATE tmp_Permutation t_PP + INNER JOIN partsltd_prod.Shop_Product_Permutation PP ON t_PP.id_permutation = PP.id_permutation_temp + SET + t_PP.id_permutation = PP.id_permutation + ; + UPDATE tmp_Permutation_Variation_Link t_PPVL + INNER JOIN tmp_Permutation t_PP ON t_PPVL.id_permutation = t_PP.id_permutation_temp + SET + t_PPVL.id_permutation = t_PP.id_permutation + ; + + INSERT INTO partsltd_prod.Shop_Product_Permutation_Variation_Link ( + id_permutation + , id_variation + , display_order + , active + ) + SELECT + t_PPVL.id_permutation + , t_PPVL.id_variation + , t_PPVL.display_order + , t_PPVL.active + FROM tmp_Permutation_Variation_Link t_PPVL + WHERE + t_PPVL.is_new = 1 + AND t_PPVL.active = 1 + ; + + UPDATE partsltd_prod.Shop_Product_Permutation_Variation_Link PPVL + INNER JOIN tmp_Permutation_Variation_Link t_PPVL + ON PPVL.id_link = t_PPVL.id_link + AND t_PPVL.is_new = 1 + SET + PPVL.id_permutation = t_PPVL.id_permutation + , PPVL.id_variation = t_PPVL.id_variation + , PPVL.display_order = t_PPVL.display_order + , PPVL.active = t_PPVL.active + , PPVL.id_change_set = v_id_change_set + ; END IF; - INSERT INTO Shop_Product_Permutation ( - id_product - , description - , cost_local_VAT_excl - , cost_local_VAT_incl - , id_currency_cost - , profit_local_min - , latency_manufacture - , id_unit_measurement_quantity - , count_unit_measurement_per_quantity_step - , quantity_min - , quantity_max - , quantity_stock - , is_subscription - , id_unit_measurement_interval_recurrence - , count_interval_recurrence - , id_stripe_product - , does_expire_faster_once_unsealed - , id_unit_measurement_interval_expiration_unsealed - , count_interval_expiration_unsealed - , active - , created_by - , created_on - ) - SELECT - t_P.id_product AS id_product - , t_P.description AS description - , t_P.cost_local_VAT_excl AS cost_local_VAT_excl - , t_P.cost_local_VAT_incl AS cost_local_VAT_incl - , t_P.id_currency_cost AS id_currency_cost - , t_P.profit_local_min AS profit_local_min - , t_P.latency_manufacture AS latency_manufacture - , t_P.id_unit_measurement_quantity AS id_unit_measurement_quantity - , t_P.count_unit_measurement_per_quantity_step AS count_unit_measurement_per_quantity_step - , t_P.quantity_min AS quantity_min - , t_P.quantity_max AS quantity_max - , t_P.quantity_stock AS quantity_stock - , t_P.is_subscription AS is_subscription - , t_P.id_unit_measurement_interval_recurrence AS id_unit_measurement_interval_recurrence - , t_P.count_interval_recurrence AS count_interval_recurrence - , t_P.id_stripe_product AS id_stripe_product - , t_P.does_expire_faster_once_unsealed AS does_expire_faster_once_unsealed - , t_P.id_unit_measurement_interval_expiration_unsealed AS id_unit_measurement_interval_expiration_unsealed - , t_P.count_interval_expiration_unsealed AS count_interval_expiration_unsealed - , t_P.active AS active - , a_id_user AS created_by - , v_time_start AS created_on - FROM tmp_Permutation t_P - WHERE - is_new = 1 - AND active = 1 - ; DELETE FROM Shop_Product_Permutation_Temp - WHERE GUID = a_guid; - - COMMIT; - END IF; + WHERE GUID = a_guid + ; + DELETE FROM Shop_Product_Permutation_Variation_Link_Temp + WHERE GUID = a_guid + ; + + COMMIT; # Errors SELECT * @@ -10669,9 +11532,11 @@ BEGIN ; IF a_debug = 1 THEN - SELECT * from tmp_Permutation; + SELECT * FROM tmp_Permutation; + SELECT * FROM tmp_Permutation_Variation_Link; END IF; + DROP TEMPORARY TABLE tmp_Permutation_Variation_Link; DROP TEMPORARY TABLE tmp_Permutation; DROP TEMPORARY TABLE tmp_Msg_Error; @@ -10764,6 +11629,9 @@ WHERE id_permutation = 1; +-- File: 7206_p_shop_save_product_permutation_test.sql + + -- Clear previous proc DROP PROCEDURE IF EXISTS partsltd_prod.p_shop_save_product_permutation_test; @@ -10790,6 +11658,7 @@ BEGIN INSERT INTO partsltd_prod.Shop_Product_Permutation_Temp ( id_permutation , id_product + , csv_id_pairs_variation , description , cost_local_VAT_excl , cost_local_VAT_incl @@ -10812,10 +11681,11 @@ BEGIN , guid ) VALUES - /* Test 1 - Insert */ + /* Test 1 - Insert ( -1 -- id_permutation , 5 -- id_product + , '' -- csv_id_pairs_variation , 'Hair clip' -- description , NULL -- cost_local_VAT_excl , NULL -- cost_local_VAT_incl @@ -10837,6 +11707,7 @@ BEGIN , 1 -- active , v_guid ) + */ /* Test 2 - Update ( 4 -- id_product @@ -10849,6 +11720,32 @@ BEGIN , v_guid ) */ + /* Test 3 - Insert with Variations */ + ( + -1 -- id_permutation + , 8 -- id_product + , '1:1' -- csv_id_pairs_variation + , 'Test with variations' -- description + , NULL -- cost_local_VAT_excl + , NULL -- cost_local_VAT_incl + , 1 -- id_currency_cost + , NULL -- profit_local_min + , 1 -- latency_manufacture + , 3 -- id_unit_measurement_quantity + , 1 -- count_unit_measurement_per_quantity_step + , 0 -- quantity_min + , 0 -- quantity_max + , 2 -- quantity_stock + , FALSE -- is_subscription + , NULL -- id_unit_measurement_interval_recurrence + , NULL -- count_interval_recurrence + , NULL -- id_stripe_product + , FALSE -- does_expire_faster_once_unsealed + , NULL -- id_unit_measurement_interval_expiration_unsealed + , NULL -- count_interval_expiration_unsealed + , 1 -- active + , v_guid + ) ; COMMIT; @@ -10876,6 +11773,7 @@ BEGIN END // DELIMITER ;; +/* CALL partsltd_prod.p_shop_save_product_permutation_test (); DELETE FROM partsltd_prod.Shop_Product_Permutation_Temp; @@ -10883,10 +11781,12 @@ DELETE FROM partsltd_prod.Shop_Product_Permutation_Temp; DROP TABLE IF EXISTS tmp_Msg_Error; -/* SELECT * FROM partsltd_prod.Shop_Product Cannot add or update a child row: a foreign key constraint fails (`partsltd_prod`.`shop_product_permutation`, CONSTRAINT `FK_Shop_Product_Permutation_id_product` FOREIGN KEY (`id_product`) REFERENCES `shop_product` (`id_product`) ON UPDATE RESTRICT) */ + +-- File: 7210_p_shop_get_many_product_variation.sql + DROP PROCEDURE IF EXISTS p_shop_get_many_product_variation; DELIMITER // @@ -11304,6 +12204,9 @@ insert into shop_product_change_set (comment) END IF; */ +-- File: 7212_p_shop_save_product_variation.sql + + -- Clear previous proc DROP PROCEDURE IF EXISTS p_shop_save_product_variation; @@ -11851,6 +12754,9 @@ DELIMITER ;; +-- File: 7212_p_shop_save_product_variation_test.sql + + -- Clear previous proc DROP PROCEDURE IF EXISTS partsltd_prod.p_shop_save_product_variation_test; @@ -12036,6 +12942,9 @@ Cannot add or update a child row: a foreign key constraint fails (`partsltd_prod */ +-- File: 7219_p_shop_get_many_stock_item.sql + + -- Clear previous proc DROP PROCEDURE IF EXISTS p_shop_get_many_stock_item; @@ -12811,6 +13720,9 @@ insert into shop_product_change_set (comment) */ +-- File: 7220_p_shop_save_stock_item.sql + + -- Clear previous proc DROP PROCEDURE IF EXISTS p_shop_save_stock_item; @@ -13509,6 +14421,9 @@ WHERE id_permutation = 1; +-- File: 7220_p_shop_save_stock_item_test.sql + + -- Clear previous proc DROP PROCEDURE IF EXISTS partsltd_prod.p_shop_save_stock_item_test; @@ -13607,7 +14522,10 @@ DELETE FROM partsltd_prod.Shop_Stock_Item_Temp; /* update shop_product p set p.has_variations = 0 where id_product = 4 DROP TABLE IF EXISTS tmp_Msg_Error; -*/-- USE partsltd_prod; +*/ + +-- File: 7221_p_get_many_shop_product_price_and_discount_and_delivery_option.sql +-- USE partsltd_prod; -- Clear previous proc DROP PROCEDURE IF EXISTS p_shop_get_many_product_price_and_discount_and_delivery_option; @@ -14615,6 +15533,9 @@ FROM Shop_Calc_User_Temp; */ +-- File: 7223_p_shop_get_many_stripe_price_new.sql + + /* @@ -14858,6 +15779,9 @@ CALL p_shop_get_many_stripe_price_new ( */ +-- File: 7312_p_shop_save_user.sql + + /* @@ -15038,6 +15962,9 @@ CALL p_shop_edit_user ( */ +-- File: 7313_p_get_many_user.sql + + -- Clear previous proc DROP PROCEDURE IF EXISTS p_get_many_user; @@ -15548,6 +16475,9 @@ CALL p_get_many_user( */ +-- File: 7321_p_shop_save_user_basket.sql + + /* @@ -16378,6 +17308,9 @@ CALL p_shop_edit_user_basket ( */ +-- File: 7400_p_shop_save_supplier.sql + + -- Clear previous proc @@ -16966,6 +17899,9 @@ delete from shop_supplier where id_supplier = 9; delete from shop_supplier_address_audit where id_address = -4; delete from shop_supplier_address where id_address = -4; +-- File: 7400_p_shop_save_supplier_temp.sql + + -- Clear previous proc DROP PROCEDURE IF EXISTS partsltd_prod.p_shop_save_supplier_test; @@ -17132,6 +18068,9 @@ Cannot add or update a child row: a foreign key constraint fails (`partsltd_prod */ +-- File: 7401_p_shop_get_many_supplier.sql + + DROP PROCEDURE IF EXISTS p_shop_get_many_supplier; DELIMITER // @@ -17394,6 +18333,9 @@ CALL p_shop_get_many_supplier ( */ +-- File: 7403_p_shop_save_supplier_purchase_order.sql + + -- Clear previous proc @@ -17797,8 +18739,8 @@ BEGIN id_type, code, msg ) SELECT - v_id_error_type_bad_data, - v_code_error_type_bad_data, + v_id_type_error_bad_data, + v_code_type_error_bad_data, CONCAT( 'A valid quantity ordered is required for the following Supplier Purchase Order Item(s): ' , GROUP_CONCAT(t_SPOPL.name_error SEPARATOR ', ') @@ -17819,8 +18761,8 @@ BEGIN id_type, code, msg ) SELECT - v_id_error_type_bad_data, - v_code_error_type_bad_data, + v_id_type_error_bad_data, + v_code_type_error_bad_data, CONCAT( 'A valid quantity received is required for the following Supplier Purchase Order Item(s): ' , GROUP_CONCAT(t_SPOPL.name_error, ' - ', t_SPOPL.quantity_received SEPARATOR ', ') @@ -17839,8 +18781,8 @@ BEGIN id_type, code, msg ) SELECT - v_id_error_type_bad_data, - v_code_error_type_bad_data, + v_id_type_error_bad_data, + v_code_type_error_bad_data, CONCAT( 'A valid delivery latency is required for the following Supplier Purchase Order Item(s): ' , GROUP_CONCAT(t_SPOPL.name_error, ' - ', t_SPOPL.latency_delivery_days SEPARATOR ', ') @@ -17864,8 +18806,8 @@ BEGIN id_type, code, msg ) SELECT - v_id_error_type_bad_data, - v_code_error_type_bad_data, + v_id_type_error_bad_data, + v_code_type_error_bad_data, CONCAT('Duplicate records: ', GROUP_CONCAT(t_SPOPLC.name_error SEPARATOR ', ')) FROM ( SELECT @@ -17884,8 +18826,8 @@ BEGIN id_type, code, msg ) SELECT - v_id_error_type_bad_data, - v_code_error_type_bad_data, + v_id_type_error_bad_data, + v_code_type_error_bad_data, CONCAT( 'There are no items in the following Supplier Purchase Order(s): ' , GROUP_CONCAT(t_SPO.name_error SEPARATOR ', ') @@ -17907,8 +18849,8 @@ BEGIN id_type, code, msg ) SELECT - v_id_error_type_bad_data, - v_code_error_type_bad_data, + v_id_type_error_bad_data, + v_code_type_error_bad_data, CONCAT( 'There is no order for the following Supplier Purchase Order Item(s): ' , GROUP_CONCAT(t_SPOPL.name_error SEPARATOR ', ') @@ -18244,6 +19186,9 @@ DELETE FROM Shop_Supplier_Purchase_Order; +-- File: 7403_p_shop_save_supplier_purchase_order_test.sql + + -- Clear previous proc DROP PROCEDURE IF EXISTS partsltd_prod.p_shop_save_supplier_purchase_order_test; @@ -18302,7 +19247,6 @@ BEGIN WHERE id_order = 6 */ ; - INSERT INTO partsltd_prod.Shop_Supplier_Purchase_Order_Product_Link_Temp ( id_link , id_order @@ -18395,11 +19339,13 @@ DELETE FROM partsltd_prod.Shop_Supplier_Purchase_Order_Product_Link_Temp; DROP TABLE IF EXISTS tmp_Msg_Error; -/* Cannot add or update a child row: a foreign key constraint fails (`partsltd_prod`.`shop_supplier_address`, CONSTRAINT `FK_Shop_Supplier_Address_id_supplier` FOREIGN KEY (`id_supplier`) REFERENCES `shop_supplier` (`id_supplier`) ON UPDATE RESTRICT) */ +-- File: 7404_p_shop_get_many_supplier_purchase_order.sql + + DROP PROCEDURE IF EXISTS p_shop_get_many_supplier_purchase_order; DELIMITER // @@ -18841,6 +19787,7 @@ BEGIN , P.id_product , SPOPL.id_permutation , fn_shop_get_product_permutation_name(SPOPL.id_permutation) AS name_permutation + , fn_shop_get_product_permutation_variations_csv(SPOPL.id_permutation) AS csv_id_pairs_variation -- , SPOPL.id_currency_cost , SPOPL.id_unit_quantity , SPOPL.quantity_ordered @@ -18903,6 +19850,9 @@ CALL p_shop_get_many_supplier_purchase_order ( */ +-- File: 7415_p_shop_save_manufacturing_purchase_order.sql + + -- Clear previous proc @@ -19000,7 +19950,6 @@ BEGIN , id_order INT NOT NULL , id_product INT NULL , id_permutation INT NULL - , id_currency INT NOT NULL , id_unit_quantity INT NOT NULL , quantity_used FLOAT NOT NULL , quantity_produced FLOAT NULL @@ -19018,7 +19967,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 ( @@ -19485,13 +20434,14 @@ BEGIN END IF; -- Duplicates + /* IF EXISTS ( SELECT - id_permutation - , name_error + t_MPOPL.id_permutation + , t_MPOPL.name_error , COUNT(*) FROM tmp_Manufacturing_Purchase_Order_Product_Link t_MPOPL - GROUP BY id_permutation + GROUP BY t_MPOPL.id_permutation, t_MPOPL.name_error HAVING COUNT(*) > 1 ) THEN INSERT INTO tmp_Msg_Error ( @@ -19503,15 +20453,16 @@ BEGIN CONCAT('Duplicate records: ', GROUP_CONCAT(t_MPOPLC.name_error SEPARATOR ', ')) FROM ( SELECT - id_permutation - , name_error - , COUNT(*) + t_MPOPL.id_permutation + , t_MPOPL.name_error + , COUNT(*) FROM tmp_Manufacturing_Purchase_Order_Product_Link t_MPOPL - GROUP BY id_permutation + GROUP BY t_MPOPL.id_permutation, t_MPOPL.name_error HAVING COUNT(*) > 1 ) t_MPOPLC ; END IF; + */ -- Empty Manufacturing Purchase Order IF EXISTS ( SELECT * FROM tmp_Manufacturing_Purchase_Order t_MPO LEFT JOIN tmp_Manufacturing_Purchase_Order_Product_Link t_MPOPL ON t_MPO.id_order = t_MPOPL.id_order WHERE ISNULL(t_MPOPL.id_order) ) THEN INSERT INTO tmp_Msg_Error ( @@ -19916,6 +20867,9 @@ DELETE FROM Shop_Manufacturing_Purchase_Order; +-- File: 7415_p_shop_save_Manufacturing_purchase_order_test.sql + + -- Clear previous proc DROP PROCEDURE IF EXISTS partsltd_prod.p_shop_save_Manufacturing_purchase_order_test; @@ -20062,8 +21016,12 @@ DELETE FROM partsltd_prod.Shop_Manufacturing_Purchase_Order_Product_Link_Temp; DROP TABLE IF EXISTS tmp_Msg_Error; select * from partsltd_prod.Shop_User; +Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'partsltd_prod.t_MPOPL.name_error' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by */ +-- File: 7416_p_shop_get_many_manufacturing_purchase_order.sql + + DROP PROCEDURE IF EXISTS p_shop_get_many_manufacturing_purchase_order; DELIMITER // @@ -20346,13 +21304,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 FIND_IN_SET(id_permission, v_ids_permission_manufacturing_purchase_order) > 0 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; @@ -20403,8 +21361,11 @@ 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 , MPOPL.id_unit_quantity , MPOPL.quantity_used , MPOPL.quantity_produced @@ -20417,7 +21378,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 @@ -20444,11 +21407,12 @@ END // 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 @@ -20456,10 +21420,19 @@ CALL p_shop_get_many_manufacturing_purchase_order ( , 0 # a_debug ); -/* + +select * +from partsltd_prod.shop_manufacturing_purchase_order +; +select * +from partsltd_prod.shop_manufacturing_purchase_order_product_link +; */ +-- File: 7421_p_shop_save_customer.sql + + -- Clear previous proc @@ -20760,6 +21733,9 @@ DELETE FROM Shop_Customer */ +-- File: 7422_p_shop_get_many_customer.sql + + /* @@ -21031,6 +22007,9 @@ FROM Shop_Customer; */ +-- File: 7424_p_shop_save_customer_sales_order.sql + + -- Clear previous proc @@ -21588,6 +22567,9 @@ DELETE FROM Shop_Customer_Sales_Order; +-- File: 7425_p_shop_get_many_customer_sales_order.sql + + -- Clear previous proc @@ -22364,6 +23346,9 @@ insert into shop_product_change_set (comment) */ +-- File: 9000_populate.sql + + /* @@ -22727,6 +23712,7 @@ VALUES # Product Permutations INSERT INTO Shop_Product_Permutation ( -- display_order, + id_permutation_temp, id_product, description, cost_local_VAT_excl, @@ -22751,7 +23737,8 @@ INSERT INTO Shop_Product_Permutation ( ) VALUES ( - -- 1, + -- 1, + -1, 1, 'Good Red', 5, @@ -22776,6 +23763,7 @@ VALUES ), ( -- 2, + -2, 1, 'Good Blue', 6, @@ -22800,6 +23788,7 @@ VALUES ), ( -- 3, + -3, 2, 'Test product describes good', 10, @@ -22824,6 +23813,7 @@ VALUES ), ( -- 4, + -4, 3, 'Phone describes good', 10, @@ -22848,6 +23838,7 @@ VALUES ), ( -- 5, + -5, 4, 'Laptop describes good', 10, @@ -22872,6 +23863,7 @@ VALUES ), ( -- 6, + -6, 5, 'Smart watch describes good', 10, @@ -22912,6 +23904,9 @@ INSERT INTO Shop_Variation ( VALUES (1, 1, 'RED', 'Red', NULL, NULL) , (2, 1, 'BLUE', 'Blue', NULL, NULL) + , (3, 1, 'GREEN', 'Green', NULL, NULL) + , (4, 1, 'White', 'White', NULL, NULL) + , (5, 1, 'BLACK', 'Black', NULL, NULL) , (1, 2, '400ml', '400 millilitres', 6, 400) , (2, 2, '400g', '400 grams', 4, 400) , (3, 2, '410g', '410 grams', 4, 410) @@ -23469,6 +24464,9 @@ CALL p_populate_database(); DROP PROCEDURE IF EXISTS p_populate_database; */ +-- File: 9001_view.sql + + # Product Change Sets SELECT * FROM Shop_Product_Change_Set; @@ -23674,3 +24672,38 @@ SELECT * FROM Shop_Customer_Sales_Order_Audit; SELECT * FROM Shop_Customer_Sales_Order_Product_Link; SELECT * FROM Shop_Customer_Sales_Order_Product_Link_Audit; + + +-- File: 9010_anal.sql + + +/* + +SELECT TABLE_NAME +FROM INFORMATION_SCHEMA.TABLES +WHERE TABLE_NAME LIKE '%SHOP%' + OR TABLE_NAME LIKE '%FILE_TYPE%'; + + +SELECT FOUND_ROWS(); + + + +SELECT + CONSTRAINT_NAME, + CONSTRAINT_TYPE, + TABLE_NAME, + COLUMN_NAME, + REFERENCED_TABLE_NAME, + REFERENCED_COLUMN_NAME +FROM + INFORMATION_SCHEMA.TABLES +WHERE + TABLE_SCHEMA = 'PARTS' + -- AND TABLE_NAME = 'your_table_name' +; + +*/ + + + diff --git a/static/MySQL/0001_destroy.sql b/static/MySQL/0001_destroy.sql index 6f137d65..b9a69b75 100644 --- a/static/MySQL/0001_destroy.sql +++ b/static/MySQL/0001_destroy.sql @@ -18,6 +18,7 @@ DROP TABLE IF EXISTS tmp_Shop_Order; DROP TABLE IF EXISTS tmp_Shop_Product; DROP TABLE IF EXISTS tmp_Product; DROP TABLE IF EXISTS tmp_Product_Permutation; +DROP TABLE IF EXISTS tmp_Permutation_Variation_Link; DROP TABLE IF EXISTS tmp_Permutation; DROP TABLE IF EXISTS tmp_Shop_Product_p_shop_calc_user; DROP TABLE IF EXISTS tmp_Shop_Product_p_Shop_Calc_User; @@ -51,6 +52,7 @@ DROP TABLE IF EXISTS tmp_Manufacturing_Purchase_Order; DROP TABLE IF EXISTS tmp_Shop_Customer; DROP TABLE IF EXISTS tmp_Shop_Customer_Sale_Order_Product_Link; DROP TABLE IF EXISTS tmp_Shop_Customer_Sale_Order; +DROP TABLE IF EXISTS tmp_Get_Variation_From_Csv_Variations; # Delete old tables @@ -165,6 +167,7 @@ DROP TABLE IF EXISTS Shop_Product_Currency_Link; DROP TABLE IF EXISTS Shop_Product_Variation_Link_Audit; DROP TABLE IF EXISTS Shop_Product_Variation_Link; +DROP TABLE IF EXISTS Shop_Product_Permutation_Variation_Link_Temp; DROP TABLE IF EXISTS Shop_Product_Permutation_Variation_Link_Audit; DROP TABLE IF EXISTS Shop_Product_Permutation_Variation_Link; @@ -304,6 +307,8 @@ DROP PROCEDURE IF EXISTS p_shop_save_product_variation; DROP PROCEDURE IF EXISTS p_shop_save_product_variation_test; DROP PROCEDURE IF EXISTS p_shop_get_many_product_variation; DROP FUNCTION IF EXISTS fn_shop_get_id_product_permutation_from_variation_csv_list; +DROP FUNCTION IF EXISTS fn_shop_get_product_variations_from_id_csv_list; +DROP FUNCTION IF EXISTS fn_shop_get_product_permutation_variations_csv; DROP PROCEDURE IF EXISTS p_shop_save_stock_item; DROP PROCEDURE IF EXISTS p_shop_save_stock_item_test; DROP PROCEDURE IF EXISTS p_shop_get_many_stock_item; diff --git a/static/MySQL/1202_tbl_Shop_Product_Category_Temp.sql b/static/MySQL/1202_tbl_Shop_Product_Category_Temp.sql index ff520588..70e104c2 100644 --- a/static/MySQL/1202_tbl_Shop_Product_Category_Temp.sql +++ b/static/MySQL/1202_tbl_Shop_Product_Category_Temp.sql @@ -6,7 +6,8 @@ SELECT CONCAT('WARNING: Table ', TABLE_NAME, ' already exists.') AS msg_warning FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'Shop_Product_Category_Temp'; CREATE TABLE IF NOT EXISTS Shop_Product_Category_Temp ( - id_category INT NOT NULL + id_temp INT NOT NULL PRIMARY KEY AUTO_INCREMENT + , id_category INT NOT NULL , code VARCHAR(50) NOT NULL , name VARCHAR(255) NOT NULL , description VARCHAR(4000) NULL diff --git a/static/MySQL/1205_tbl_Shop_Product_Temp.sql b/static/MySQL/1205_tbl_Shop_Product_Temp.sql index 4de8b151..d5f06994 100644 --- a/static/MySQL/1205_tbl_Shop_Product_Temp.sql +++ b/static/MySQL/1205_tbl_Shop_Product_Temp.sql @@ -6,7 +6,8 @@ SELECT CONCAT('WARNING: Table ', TABLE_NAME, ' already exists.') AS msg_warning FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'Shop_Product_Temp'; CREATE TABLE IF NOT EXISTS Shop_Product_Temp ( - id_product INT NOT NULL + id_temp INT NOT NULL PRIMARY KEY AUTO_INCREMENT + , id_product INT NOT NULL , name VARCHAR(255) NOT NULL , id_category INT NOT NULL , has_variations BIT NOT NULL diff --git a/static/MySQL/1206_tbl_Shop_Product_Permutation.sql b/static/MySQL/1206_tbl_Shop_Product_Permutation.sql index 3b0e2a9f..13dbcd4b 100644 --- a/static/MySQL/1206_tbl_Shop_Product_Permutation.sql +++ b/static/MySQL/1206_tbl_Shop_Product_Permutation.sql @@ -7,6 +7,7 @@ SELECT CONCAT('WARNING: Table ', TABLE_NAME, ' already exists.') AS msg_warning CREATE TABLE IF NOT EXISTS Shop_Product_Permutation ( id_permutation INT NOT NULL AUTO_INCREMENT PRIMARY KEY, + id_permutation_temp INT NOT NULL, id_product INT NOT NULL, CONSTRAINT FK_Shop_Product_Permutation_id_product FOREIGN KEY (id_product) diff --git a/static/MySQL/1208_tbl_Shop_Product_Permutation_Temp.sql b/static/MySQL/1208_tbl_Shop_Product_Permutation_Temp.sql index cc2df0eb..6ec4e35a 100644 --- a/static/MySQL/1208_tbl_Shop_Product_Permutation_Temp.sql +++ b/static/MySQL/1208_tbl_Shop_Product_Permutation_Temp.sql @@ -6,8 +6,10 @@ SELECT CONCAT('WARNING: Table ', TABLE_NAME, ' already exists.') AS msg_warning FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'Shop_Product_Permutation_Temp'; CREATE TABLE IF NOT EXISTS Shop_Product_Permutation_Temp ( - id_permutation INT NOT NULL + id_temp INT NOT NULL PRIMARY KEY AUTO_INCREMENT + , id_permutation INT NOT NULL , id_product INT NOT NULL + , csv_id_pairs_variation VARCHAR(4000) NULL , description VARCHAR(4000) NOT NULL , cost_local_VAT_excl FLOAT NULL , cost_local_VAT_incl FLOAT NULL diff --git a/static/MySQL/1217_tbl_Shop_Product_Permutation_Variation_Link_Temp.sql b/static/MySQL/1217_tbl_Shop_Product_Permutation_Variation_Link_Temp.sql new file mode 100644 index 00000000..c27883de --- /dev/null +++ b/static/MySQL/1217_tbl_Shop_Product_Permutation_Variation_Link_Temp.sql @@ -0,0 +1,16 @@ + +# Product Permutation Variation Link + +-- DROP TABLE IF EXISTS Shop_Product_Permutation_Variation_Link_Temp; + +SELECT CONCAT('WARNING: Table ', TABLE_NAME, ' already exists.') AS msg_warning FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'Shop_Product_Permutation_Variation_Link_Temp'; + +CREATE TABLE IF NOT EXISTS Shop_Product_Permutation_Variation_Link_Temp ( + id_temp INT NOT NULL AUTO_INCREMENT PRIMARY KEY + , id_link INT NOT NULL + , id_permutation INT NOT NULL + , id_variation INT NOT NULL + , active BIT NOT NULL + , display_order INT NOT NULL + , GUID BINARY(36) NOT NULL +); diff --git a/static/MySQL/3206_tri_Shop_Product_Permutation.sql b/static/MySQL/3206_tri_Shop_Product_Permutation.sql index 3964319f..9754d86b 100644 --- a/static/MySQL/3206_tri_Shop_Product_Permutation.sql +++ b/static/MySQL/3206_tri_Shop_Product_Permutation.sql @@ -23,6 +23,8 @@ CREATE TRIGGER before_update_Shop_Product_Permutation BEFORE UPDATE ON Shop_Product_Permutation FOR EACH ROW BEGIN + DECLARE v_msg VARCHAR(4000); + IF OLD.id_change_set <=> NEW.id_change_set THEN SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'New change Set ID must be provided.'; @@ -40,8 +42,10 @@ BEGIN NEW.id_unit_measurement_interval_expiration_unsealed IS NULL OR NEW.id_unit_measurement_interval_expiration_unsealed NOT IN (SELECT id_unit_measurement FROM Shop_Unit_Measurement WHERE is_unit_of_time = 1) )) THEN + SET v_msg := CONCAT('Unsealed expiration interval ID must be a unit of time. Invalid value: ', CAST(NEW.id_unit_measurement_interval_expiration_unsealed AS CHAR)); SIGNAL SQLSTATE '45000' - SET MESSAGE_TEXT = 'Unsealed expiration interval ID must be a unit of time.'; + SET MESSAGE_TEXT = v_msg + ; END IF; INSERT INTO Shop_Product_Permutation_Audit ( diff --git a/static/MySQL/6206_fn_shop_get_product_permutation_name.sql b/static/MySQL/6206_fn_shop_get_product_permutation_name.sql index d1d34f5b..f02187a2 100644 --- a/static/MySQL/6206_fn_shop_get_product_permutation_name.sql +++ b/static/MySQL/6206_fn_shop_get_product_permutation_name.sql @@ -1,49 +1,44 @@ -DROP FUNCTION IF EXISTS fn_shop_get_product_permutation_variations_csv; +DROP FUNCTION IF EXISTS fn_shop_get_product_permutation_name; DELIMITER // -CREATE FUNCTION fn_shop_get_product_permutation_variations_csv(id_product_permutation INT) +CREATE FUNCTION fn_shop_get_product_permutation_name(id_product_permutation INT) RETURNS VARCHAR(4000) DETERMINISTIC BEGIN - DECLARE csv VARCHAR(4000); + DECLARE name VARCHAR(4000); - SET csv := ( + SET name := ( SELECT - CASE WHEN P.has_variations = 0 THEN - '' - ELSE - GROUP_CONCAT( - CONCAT( - PV.id_type - , ':' - , PV.id_variation - ) - SEPARATOR ',' - ) - END - FROM partsltd_prod.Shop_Product_Permutation PP - LEFT JOIN partsltd_prod.Shop_Product P ON PP.id_product = P.id_product - LEFT JOIN partsltd_prod.Shop_Product_Permutation_Variation_Link PPVL ON PP.id_permutation = PPVL.id_permutation - LEFT JOIN partsltd_prod.Shop_Variation PV ON PPVL.id_variation = PV.id_variation - LEFT JOIN partsltd_prod.Shop_Variation_Type PVT ON PV.id_type = PVT.id_type + CONCAT( + IFNULL(PC.name, '(No Category)') + , ' - ' + , IFNULL(P.name, '(No Product)') + , CASE WHEN P.has_variations = 1 THEN + CONCAT(' - ', GROUP_CONCAT(CONCAT(VT.name, ': ', V.name) SEPARATOR ', ')) + ELSE '' END + ) + FROM Shop_Product_Permutation PP + LEFT JOIN Shop_Product P ON PP.id_product = P.id_product + LEFT JOIN Shop_Product_Category PC ON P.id_category = PC.id_category + LEFT JOIN Shop_Product_Permutation_Variation_Link PPVL ON PP.id_permutation = PPVL.id_permutation + LEFT JOIN Shop_Variation V ON PPVL.id_variation = V.id_variation + LEFT JOIN Shop_Variation_Type VT ON V.id_type = VT.id_type WHERE PP.id_permutation = id_product_permutation - GROUP BY P.id_product, P.has_variations, PVT.display_order, PVT.name, PV.display_order, PV.name + GROUP BY PC.id_category, PC.name, P.id_product, P.name, P.has_variations, VT.display_order, VT.name, V.display_order, V.name LIMIT 1 ); - RETURN csv; + RETURN name; END // DELIMITER ; + +/* SELECT - fn_shop_get_product_permutation_variations_csv( + fn_shop_get_product_permutation_name( 3 -- id_product_permutation ) - , fn_shop_get_product_permutation_variations_csv( - 1 -- id_product_permutation - ) ; -/* */ \ No newline at end of file diff --git a/static/MySQL/6211_fn_shop_get_product_variations_from_id_csv_list.sql b/static/MySQL/6211_fn_shop_get_product_variations_from_id_csv_list.sql new file mode 100644 index 00000000..b3c7e1d5 --- /dev/null +++ b/static/MySQL/6211_fn_shop_get_product_variations_from_id_csv_list.sql @@ -0,0 +1,102 @@ + +DROP FUNCTION IF EXISTS fn_shop_get_product_variations_from_id_csv_list; + +DELIMITER // + +CREATE FUNCTION fn_shop_get_product_variations_from_id_csv_list ( + a_id_permutation INT + , a_variation_csv TEXT + , a_guid BINARY(36) +) +RETURNS INT +DETERMINISTIC +READS SQL DATA +BEGIN + DECLARE v_csv_pairs VARCHAR(4000); + DECLARE v_current_pair VARCHAR(50); + DECLARE v_id_variation_type INT; + DECLARE v_id_variation INT; + DECLARE v_rank_counter INT; + + CALL p_validate_guid( a_guid ); + + SET v_csv_pairs := a_variation_csv; + SET v_rank_counter := 1; + + DROP TEMPORARY TABLE IF EXISTS tmp_Get_Variation_From_Csv_Variations; + CREATE TEMPORARY TABLE tmp_Get_Variation_From_Csv_Variations ( + id_variation_type INT NULL + , id_variation INT NOT NULL + ); + + WHILE LENGTH(v_csv_pairs) > 0 DO + IF LOCATE(',', v_csv_pairs) > 0 THEN + SET v_current_pair := SUBSTRING_INDEX(v_csv_pairs, ',', 1); + SET v_csv_pairs := SUBSTRING(v_csv_pairs, LOCATE(',', v_csv_pairs) + 1); + ELSE + SET v_current_pair := v_csv_pairs; + SET v_csv_pairs := ''; + END IF; + + SET v_id_variation_type := SUBSTRING_INDEX(v_current_pair, ':', 1); + SET v_id_variation := SUBSTRING_INDEX(v_current_pair, ':', -1); + + IF NOT ISNULL(v_id_variation) THEN + INSERT INTO tmp_Get_Variation_From_Csv_Variations ( + id_variation_type + , id_variation + ) + SELECT + v_id_variation_type AS id_variation_type + , v_id_variation AS id_variation + ; + + SET v_rank_counter := v_rank_counter + 1; + END IF; + END WHILE; + + INSERT INTO partsltd_prod.Shop_Product_Permutation_Variation_Link_Temp ( + id_link + , id_permutation + , id_variation + , display_order + , active + , GUID + ) + SELECT + IFNULL(PPVL.id_link, -v_rank_counter) AS id_link + , a_id_permutation + , t_V.id_variation + , v_rank_counter AS display_order + , 1 AS active + , a_guid + FROM tmp_Get_Variation_From_Csv_Variations t_V + LEFT JOIN partsltd_prod.Shop_Product_Permutation_Variation_Link PPVL ON t_V.id_variation = PPVL.id_variation + ; + + DROP TEMPORARY TABLE tmp_Get_Variation_From_Csv_Variations; + + RETURN v_rank_counter; +END // + +DELIMITER ; + + +/* + +SELECT + partsltd_prod.fn_shop_get_product_variations_from_id_csv_list( + 1 -- a_id_permutation + , '1:1' -- a_variation_csv + , 'NIPPLENIPPLENIPPLENIPPLENIPPLENIPPLE' -- a_guid + ) +; +SELECT * +FROM partsltd_prod.Shop_Product_Permutation_Variation_Link_Temp +WHERE GUID = 'NIPPLENIPPLENIPPLENIPPLENIPPLENIPPLE' +; +DELETE +FROM partsltd_prod.Shop_Product_Permutation_Variation_Link_Temp +WHERE GUID = 'NIPPLENIPPLENIPPLENIPPLENIPPLENIPPLE' +; +*/ diff --git a/static/MySQL/6212_fn_shop_get_product_permutation_variations_csv.sql b/static/MySQL/6212_fn_shop_get_product_permutation_variations_csv.sql new file mode 100644 index 00000000..d1d34f5b --- /dev/null +++ b/static/MySQL/6212_fn_shop_get_product_permutation_variations_csv.sql @@ -0,0 +1,49 @@ + +DROP FUNCTION IF EXISTS fn_shop_get_product_permutation_variations_csv; + +DELIMITER // + +CREATE FUNCTION fn_shop_get_product_permutation_variations_csv(id_product_permutation INT) +RETURNS VARCHAR(4000) +DETERMINISTIC +BEGIN + DECLARE csv VARCHAR(4000); + + SET csv := ( + SELECT + CASE WHEN P.has_variations = 0 THEN + '' + ELSE + GROUP_CONCAT( + CONCAT( + PV.id_type + , ':' + , PV.id_variation + ) + SEPARATOR ',' + ) + END + FROM partsltd_prod.Shop_Product_Permutation PP + LEFT JOIN partsltd_prod.Shop_Product P ON PP.id_product = P.id_product + LEFT JOIN partsltd_prod.Shop_Product_Permutation_Variation_Link PPVL ON PP.id_permutation = PPVL.id_permutation + LEFT JOIN partsltd_prod.Shop_Variation PV ON PPVL.id_variation = PV.id_variation + LEFT JOIN partsltd_prod.Shop_Variation_Type PVT ON PV.id_type = PVT.id_type + WHERE PP.id_permutation = id_product_permutation + GROUP BY P.id_product, P.has_variations, PVT.display_order, PVT.name, PV.display_order, PV.name + LIMIT 1 + ); + + RETURN csv; +END // + +DELIMITER ; +SELECT + fn_shop_get_product_permutation_variations_csv( + 3 -- id_product_permutation + ) + , fn_shop_get_product_permutation_variations_csv( + 1 -- id_product_permutation + ) +; +/* +*/ \ No newline at end of file diff --git a/static/MySQL/7206_p_shop_save_product_permutation.sql b/static/MySQL/7206_p_shop_save_product_permutation.sql index 7d0d1a2c..37c58cb2 100644 --- a/static/MySQL/7206_p_shop_save_product_permutation.sql +++ b/static/MySQL/7206_p_shop_save_product_permutation.sql @@ -67,11 +67,14 @@ BEGIN CALL p_validate_guid ( a_guid ); - DROP TABLE IF EXISTS tmp_Permutation; + DROP TEMPORARY TABLE IF EXISTS tmp_Permutation_Variation_Link; + DROP TEMPORARY TABLE IF EXISTS tmp_Permutation; CREATE TEMPORARY TABLE tmp_Permutation ( id_permutation INT NOT NULL + , id_permutation_temp INT NOT NULL , id_product INT NOT NULL + , csv_id_pairs_variation VARCHAR(4000) NULL , description VARCHAR(4000) NOT NULL , cost_local_VAT_excl FLOAT NULL , cost_local_VAT_incl FLOAT NULL @@ -97,6 +100,15 @@ BEGIN , name_error VARCHAR(255) NOT NULL , is_new BIT NOT NULL ); + + CREATE TEMPORARY TABLE tmp_Permutation_Variation_Link ( + id_link INT NOT NULL + , id_permutation INT NOT NULL + , id_variation INT NOT NULL + , active BIT NOT NULL + , display_order INT NOT NULL + , is_new BIT NOT NULL + ); CREATE TEMPORARY TABLE IF NOT EXISTS tmp_Msg_Error ( display_order INT NOT NULL PRIMARY KEY AUTO_INCREMENT @@ -109,7 +121,9 @@ BEGIN -- Get data from Temp table INSERT INTO tmp_Permutation ( id_permutation + , id_permutation_temp , id_product + , csv_id_pairs_variation , description , cost_local_VAT_excl , cost_local_VAT_incl @@ -134,7 +148,9 @@ BEGIN ) SELECT PP_T.id_permutation + , PP_T.id_permutation , IFNULL(PP_T.id_product, PP.id_product) AS id_product + , PP_T.csv_id_pairs_variation , IFNULL(PP_T.description, PP.description) AS description , IFNULL(PP_T.cost_local_VAT_excl, PP.cost_local_VAT_excl) AS cost_local_VAT_excl , IFNULL(PP_T.cost_local_VAT_incl, PP.cost_local_VAT_incl) AS cost_local_VAT_incl @@ -161,6 +177,46 @@ BEGIN WHERE PP_T.guid = a_guid ; + SELECT + partsltd_prod.fn_shop_get_product_variations_from_id_csv_list( + t_PP.id_permutation -- a_id_permutation + , t_PP.csv_id_pairs_variation -- a_variation_csv + , a_guid -- a_guid + ) + FROM tmp_Permutation t_PP + WHERE NOT ISNULL(t_PP.csv_id_pairs_variation) + ; + + INSERT INTO tmp_Permutation_Variation_Link ( + id_link + , id_permutation + , id_variation + , display_order + , active + , is_new + ) + SELECT + PPVL_T.id_link + , PPVL_T.id_permutation + , PPVL_T.id_variation + , PPVL_T.display_order + , NOT ISNULL(PPVL_T.id_link) AS active + , IFNULL(PPVL_T.id_link, 0) < 1 AS is_new + FROM partsltd_prod.Shop_Product_Permutation_Variation_Link_Temp PPVL_T + LEFT JOIN partsltd_prod.Shop_Product_Permutation_Variation_Link PPVL ON PPVL_T.id_link = PPVL.id_variation + LEFT JOIN tmp_Permutation t_PP ON PPVL_T.id_permutation = t_PP.id_permutation + WHERE PPVL_T.GUID = a_guid + ; + + IF a_debug = 1 THEN + SELECT * + FROM tmp_Permutation + ; + SELECT * + FROM tmp_Permutation_Variation_Link + ; + END IF; + -- Validation -- Missing mandatory fields -- id_product @@ -224,8 +280,6 @@ BEGIN ; END IF; - SELECT 'NIPS'; - -- latency_manufacture IF EXISTS (SELECT * FROM tmp_Permutation t_P WHERE ISNULL(t_P.latency_manufacture) LIMIT 1) THEN INSERT INTO tmp_Msg_Error ( @@ -376,6 +430,17 @@ BEGIN , t_P.can_admin = UE_T.can_admin ; + IF a_debug = 1 THEN + SELECT * + FROM partsltd_prod.Shop_Calc_User_Temp + WHERE GUID = a_guid + ; + SELECT * + FROM tmp_Permutation t_PP + LEFT JOIN Shop_Product P ON t_PP.id_product = P.id_product + ; + END IF; + CALL p_shop_clear_calc_user( a_guid , 0 -- a_debug @@ -392,20 +457,84 @@ BEGIN , v_code_type_error_bad_data , CONCAT('The following product permutation(s) do not have product edit permission: ', GROUP_CONCAT(t_P.name_error SEPARATOR ', ')) AS msg FROM tmp_Permutation t_P - WHERE ISNULL(t_P.can_edit) + WHERE + ISNULL(t_P.can_edit) ; END IF; + + IF a_debug = 1 THEN + SELECT * + FROM partsltd_prod.Shop_Product_Permutation_Variation_Link_Temp + WHERE GUID = a_guid + ; + END IF; IF NOT EXISTS (SELECT * FROM tmp_Msg_Error LIMIT 1) THEN START TRANSACTION; - IF NOT ISNULL(v_ids_product_permission) THEN INSERT INTO Shop_Product_Change_Set ( comment ) VALUES ( a_comment ) ; SET v_id_change_set := LAST_INSERT_ID(); + INSERT INTO Shop_Product_Permutation ( + id_permutation_temp + , id_product + , description + , cost_local_VAT_excl + , cost_local_VAT_incl + , id_currency_cost + , profit_local_min + , latency_manufacture + , id_unit_measurement_quantity + , count_unit_measurement_per_quantity_step + , quantity_min + , quantity_max + , quantity_stock + , is_subscription + , id_unit_measurement_interval_recurrence + , count_interval_recurrence + , id_stripe_product + , does_expire_faster_once_unsealed + , id_unit_measurement_interval_expiration_unsealed + , count_interval_expiration_unsealed + , active + , created_by + , created_on + , id_change_set + ) + SELECT + t_P.id_permutation + , t_P.id_product AS id_product + , t_P.description AS description + , t_P.cost_local_VAT_excl AS cost_local_VAT_excl + , t_P.cost_local_VAT_incl AS cost_local_VAT_incl + , t_P.id_currency_cost AS id_currency_cost + , t_P.profit_local_min AS profit_local_min + , t_P.latency_manufacture AS latency_manufacture + , t_P.id_unit_measurement_quantity AS id_unit_measurement_quantity + , t_P.count_unit_measurement_per_quantity_step AS count_unit_measurement_per_quantity_step + , t_P.quantity_min AS quantity_min + , t_P.quantity_max AS quantity_max + , t_P.quantity_stock AS quantity_stock + , t_P.is_subscription AS is_subscription + , t_P.id_unit_measurement_interval_recurrence AS id_unit_measurement_interval_recurrence + , t_P.count_interval_recurrence AS count_interval_recurrence + , t_P.id_stripe_product AS id_stripe_product + , t_P.does_expire_faster_once_unsealed AS does_expire_faster_once_unsealed + , t_P.id_unit_measurement_interval_expiration_unsealed AS id_unit_measurement_interval_expiration_unsealed + , t_P.count_interval_expiration_unsealed AS count_interval_expiration_unsealed + , t_P.active AS active + , a_id_user AS created_by + , v_time_start AS created_on + , v_id_change_set AS id_change_set + FROM tmp_Permutation t_P + WHERE + is_new = 1 + AND active = 1 + ; + UPDATE Shop_Product_Permutation PP INNER JOIN tmp_Permutation t_P ON PP.id_permutation = t_P.id_permutation SET @@ -431,66 +560,60 @@ BEGIN , PP.active = t_P.active , PP.id_change_set = v_id_change_set ; + + UPDATE tmp_Permutation t_PP + INNER JOIN partsltd_prod.Shop_Product_Permutation PP + ON t_PP.id_permutation_temp = PP.id_permutation_temp + AND PP.id_change_set = v_id_change_set + SET + t_PP.id_permutation = PP.id_permutation + ; + UPDATE tmp_Permutation_Variation_Link t_PPVL + INNER JOIN tmp_Permutation t_PP ON t_PPVL.id_permutation = t_PP.id_permutation_temp + SET + t_PPVL.id_permutation = t_PP.id_permutation + ; + + INSERT INTO partsltd_prod.Shop_Product_Permutation_Variation_Link ( + id_permutation + , id_variation + , display_order + , active + ) + SELECT + t_PPVL.id_permutation + , t_PPVL.id_variation + , t_PPVL.display_order + , t_PPVL.active + FROM tmp_Permutation_Variation_Link t_PPVL + WHERE + t_PPVL.is_new = 1 + AND t_PPVL.active = 1 + ; + + UPDATE partsltd_prod.Shop_Product_Permutation_Variation_Link PPVL + INNER JOIN tmp_Permutation_Variation_Link t_PPVL + ON PPVL.id_link = t_PPVL.id_link + AND t_PPVL.is_new = 1 + SET + PPVL.id_permutation = t_PPVL.id_permutation + , PPVL.id_variation = t_PPVL.id_variation + , PPVL.display_order = t_PPVL.display_order + , PPVL.active = t_PPVL.active + , PPVL.id_change_set = v_id_change_set + ; END IF; - INSERT INTO Shop_Product_Permutation ( - id_product - , description - , cost_local_VAT_excl - , cost_local_VAT_incl - , id_currency_cost - , profit_local_min - , latency_manufacture - , id_unit_measurement_quantity - , count_unit_measurement_per_quantity_step - , quantity_min - , quantity_max - , quantity_stock - , is_subscription - , id_unit_measurement_interval_recurrence - , count_interval_recurrence - , id_stripe_product - , does_expire_faster_once_unsealed - , id_unit_measurement_interval_expiration_unsealed - , count_interval_expiration_unsealed - , active - , created_by - , created_on - ) - SELECT - t_P.id_product AS id_product - , t_P.description AS description - , t_P.cost_local_VAT_excl AS cost_local_VAT_excl - , t_P.cost_local_VAT_incl AS cost_local_VAT_incl - , t_P.id_currency_cost AS id_currency_cost - , t_P.profit_local_min AS profit_local_min - , t_P.latency_manufacture AS latency_manufacture - , t_P.id_unit_measurement_quantity AS id_unit_measurement_quantity - , t_P.count_unit_measurement_per_quantity_step AS count_unit_measurement_per_quantity_step - , t_P.quantity_min AS quantity_min - , t_P.quantity_max AS quantity_max - , t_P.quantity_stock AS quantity_stock - , t_P.is_subscription AS is_subscription - , t_P.id_unit_measurement_interval_recurrence AS id_unit_measurement_interval_recurrence - , t_P.count_interval_recurrence AS count_interval_recurrence - , t_P.id_stripe_product AS id_stripe_product - , t_P.does_expire_faster_once_unsealed AS does_expire_faster_once_unsealed - , t_P.id_unit_measurement_interval_expiration_unsealed AS id_unit_measurement_interval_expiration_unsealed - , t_P.count_interval_expiration_unsealed AS count_interval_expiration_unsealed - , t_P.active AS active - , a_id_user AS created_by - , v_time_start AS created_on - FROM tmp_Permutation t_P - WHERE - is_new = 1 - AND active = 1 - ; DELETE FROM Shop_Product_Permutation_Temp - WHERE GUID = a_guid; - - COMMIT; - END IF; + WHERE GUID = a_guid + ; + + DELETE FROM partsltd_prod.Shop_Product_Permutation_Variation_Link_Temp + WHERE GUID = a_guid + ; + + COMMIT; # Errors SELECT * @@ -499,9 +622,11 @@ BEGIN ; IF a_debug = 1 THEN - SELECT * from tmp_Permutation; + SELECT * FROM tmp_Permutation; + SELECT * FROM tmp_Permutation_Variation_Link; END IF; + DROP TEMPORARY TABLE tmp_Permutation_Variation_Link; DROP TEMPORARY TABLE tmp_Permutation; DROP TEMPORARY TABLE tmp_Msg_Error; @@ -590,5 +715,7 @@ DELETE FROM Shop_Product_Permutation_Temp WHERE id_permutation = 1; +select * from shop_unit_measurement; + */ diff --git a/static/MySQL/7206_p_shop_save_product_permutation_test.sql b/static/MySQL/7206_p_shop_save_product_permutation_test.sql index b9468e10..3ce60a20 100644 --- a/static/MySQL/7206_p_shop_save_product_permutation_test.sql +++ b/static/MySQL/7206_p_shop_save_product_permutation_test.sql @@ -18,6 +18,9 @@ BEGIN FROM partsltd_prod.Shop_Product_Permutation ; SELECT * + FROM partsltd_prod.Shop_Product_Permutation_Variation_Link + ; + SELECT * FROM partsltd_prod.Shop_Product_Permutation_Temp ; @@ -26,6 +29,7 @@ BEGIN INSERT INTO partsltd_prod.Shop_Product_Permutation_Temp ( id_permutation , id_product + , csv_id_pairs_variation , description , cost_local_VAT_excl , cost_local_VAT_incl @@ -48,10 +52,11 @@ BEGIN , guid ) VALUES - /* Test 1 - Insert */ + /* Test 1 - Insert ( -1 -- id_permutation , 5 -- id_product + , '' -- csv_id_pairs_variation , 'Hair clip' -- description , NULL -- cost_local_VAT_excl , NULL -- cost_local_VAT_incl @@ -73,6 +78,7 @@ BEGIN , 1 -- active , v_guid ) + */ /* Test 2 - Update ( 4 -- id_product @@ -85,6 +91,32 @@ BEGIN , v_guid ) */ + /* Test 3 - Insert with Variations */ + ( + -1 -- id_permutation + , 1 -- id_product + , '1:3' -- csv_id_pairs_variation + , 'Test with variations' -- description + , NULL -- cost_local_VAT_excl + , NULL -- cost_local_VAT_incl + , 1 -- id_currency_cost + , NULL -- profit_local_min + , 1 -- latency_manufacture + , 3 -- id_unit_measurement_quantity + , 1 -- count_unit_measurement_per_quantity_step + , 0 -- quantity_min + , 0 -- quantity_max + , 2 -- quantity_stock + , FALSE -- is_subscription + , NULL -- id_unit_measurement_interval_recurrence + , NULL -- count_interval_recurrence + , NULL -- id_stripe_product + , TRUE -- does_expire_faster_once_unsealed + , 8 -- id_unit_measurement_interval_expiration_unsealed + , 2 -- count_interval_expiration_unsealed + , 1 -- active + , v_guid + ) ; COMMIT; @@ -105,6 +137,9 @@ BEGIN FROM partsltd_prod.Shop_Product_Permutation ; SELECT * + FROM partsltd_prod.Shop_Product_Permutation_Variation_Link + ; + SELECT * FROM partsltd_prod.Shop_Product_Permutation_Temp ; @@ -112,6 +147,7 @@ BEGIN END // DELIMITER ;; +/* CALL partsltd_prod.p_shop_save_product_permutation_test (); DELETE FROM partsltd_prod.Shop_Product_Permutation_Temp; @@ -119,7 +155,17 @@ DELETE FROM partsltd_prod.Shop_Product_Permutation_Temp; DROP TABLE IF EXISTS tmp_Msg_Error; -/* -SELECT * FROM partsltd_prod.Shop_Product -Cannot add or update a child row: a foreign key constraint fails (`partsltd_prod`.`shop_product_permutation`, CONSTRAINT `FK_Shop_Product_Permutation_id_product` FOREIGN KEY (`id_product`) REFERENCES `shop_product` (`id_product`) ON UPDATE RESTRICT) +DELETE FROM partsltd_prod.Shop_Product_Permutation_Variation_Link +WHERE id_link >= 3 +; +DELETE FROM partsltd_prod.Shop_Product_Permutation +WHERE id_permutation >= 7 +; + + SELECT * + FROM partsltd_prod.Shop_Product_Permutation_Variation_Link_Temp + ; + SELECT * + FROM partsltd_prod.Shop_Variation + ; */ \ No newline at end of file diff --git a/static/MySQL/7403_p_shop_save_supplier_purchase_order.sql b/static/MySQL/7403_p_shop_save_supplier_purchase_order.sql index 674de967..82f0d8b3 100644 --- a/static/MySQL/7403_p_shop_save_supplier_purchase_order.sql +++ b/static/MySQL/7403_p_shop_save_supplier_purchase_order.sql @@ -683,7 +683,9 @@ BEGIN UPDATE tmp_Supplier_Purchase_Order t_SPO - INNER JOIN partsltd_prod.Shop_Supplier_Purchase_Order SPO ON t_SPO.id_order_temp = SPO.id_order_temp + INNER JOIN partsltd_prod.Shop_Supplier_Purchase_Order SPO + ON t_SPO.id_order_temp = SPO.id_order_temp + AND SPO.id_change_set = v_id_change_set SET t_SPO.id_order = SPO.id_order WHERE t_SPO.is_new = 1 diff --git a/static/MySQL/7403_p_shop_save_supplier_purchase_order_test.sql b/static/MySQL/7403_p_shop_save_supplier_purchase_order_test.sql index 3902064f..2f49dec4 100644 --- a/static/MySQL/7403_p_shop_save_supplier_purchase_order_test.sql +++ b/static/MySQL/7403_p_shop_save_supplier_purchase_order_test.sql @@ -58,7 +58,6 @@ BEGIN WHERE id_order = 6 */ ; - /* INSERT INTO partsltd_prod.Shop_Supplier_Purchase_Order_Product_Link_Temp ( id_link , id_order @@ -73,8 +72,7 @@ BEGIN , cost_total_local_VAT_incl , GUID ) - ; - / Test 1 - Insert + /* Test 1 - Insert */ VALUES ( -1 , -1 @@ -89,7 +87,6 @@ BEGIN , 6 , v_guid ) - */ /* Test 2 - Update SELECT id_link @@ -107,7 +104,7 @@ BEGIN FROM partsltd_prod.Shop_Supplier_Purchase_Order_Product_Link WHERE id_order = 6 */ - + ; COMMIT; diff --git a/static/MySQL/7415_p_shop_save_Manufacturing_purchase_order_test.sql b/static/MySQL/7415_p_shop_save_Manufacturing_purchase_order_test.sql index fe5b3378..447ea810 100644 --- a/static/MySQL/7415_p_shop_save_Manufacturing_purchase_order_test.sql +++ b/static/MySQL/7415_p_shop_save_Manufacturing_purchase_order_test.sql @@ -146,4 +146,5 @@ DELETE FROM partsltd_prod.Shop_Manufacturing_Purchase_Order_Product_Link_Temp; DROP TABLE IF EXISTS tmp_Msg_Error; select * from partsltd_prod.Shop_User; +Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'partsltd_prod.t_MPOPL.name_error' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by */ \ No newline at end of file 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 b5f3d20c..dd50607c 100644 --- a/static/MySQL/7415_p_shop_save_manufacturing_purchase_order.sql +++ b/static/MySQL/7415_p_shop_save_manufacturing_purchase_order.sql @@ -581,13 +581,14 @@ BEGIN END IF; -- Duplicates + /* IF EXISTS ( SELECT - id_permutation - , name_error + t_MPOPL.id_permutation + , t_MPOPL.name_error , COUNT(*) FROM tmp_Manufacturing_Purchase_Order_Product_Link t_MPOPL - GROUP BY id_permutation + GROUP BY t_MPOPL.id_permutation, t_MPOPL.name_error HAVING COUNT(*) > 1 ) THEN INSERT INTO tmp_Msg_Error ( @@ -599,15 +600,16 @@ BEGIN CONCAT('Duplicate records: ', GROUP_CONCAT(t_MPOPLC.name_error SEPARATOR ', ')) FROM ( SELECT - id_permutation - , name_error - , COUNT(*) + t_MPOPL.id_permutation + , t_MPOPL.name_error + , COUNT(*) FROM tmp_Manufacturing_Purchase_Order_Product_Link t_MPOPL - GROUP BY id_permutation + GROUP BY t_MPOPL.id_permutation, t_MPOPL.name_error HAVING COUNT(*) > 1 ) t_MPOPLC ; END IF; + */ -- Empty Manufacturing Purchase Order IF EXISTS ( SELECT * FROM tmp_Manufacturing_Purchase_Order t_MPO LEFT JOIN tmp_Manufacturing_Purchase_Order_Product_Link t_MPOPL ON t_MPO.id_order = t_MPOPL.id_order WHERE ISNULL(t_MPOPL.id_order) ) THEN INSERT INTO tmp_Msg_Error ( @@ -829,7 +831,9 @@ BEGIN ; UPDATE tmp_Manufacturing_Purchase_Order t_MPO - INNER JOIN partsltd_prod.Shop_Manufacturing_Purchase_Order MPO ON t_MPO.id_order_temp = MPO.id_order_temp + INNER JOIN partsltd_prod.Shop_Manufacturing_Purchase_Order MPO + ON t_MPO.id_order_temp = MPO.id_order_temp + AND MPO.id_change_set = v_id_change_set SET t_MPO.id_order = MPO.id_order WHERE t_MPO.is_new = 1 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 dead2110..edee8283 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,7 +282,7 @@ BEGIN VALUES ( v_id_type_error_no_permission , v_code_type_error_no_permission - , 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)')) + , CONCAT('You do not have view permissions for ', IFNULL((SELECT IFNULL(name, '(No Permission Name)') FROM partsltd_prod.Shop_Permission WHERE FIND_IN_SET(id_permission, v_ids_permission_manufacturing_purchase_order) > 0 LIMIT 1), '(No Permissions Found)')) ) ; END IF; diff --git a/static/MySQL/9000_populate.sql b/static/MySQL/9000_populate.sql index dfa0f241..cbefd0d9 100644 --- a/static/MySQL/9000_populate.sql +++ b/static/MySQL/9000_populate.sql @@ -363,6 +363,7 @@ VALUES # Product Permutations INSERT INTO Shop_Product_Permutation ( -- display_order, + id_permutation_temp, id_product, description, cost_local_VAT_excl, @@ -387,7 +388,8 @@ INSERT INTO Shop_Product_Permutation ( ) VALUES ( - -- 1, + -- 1, + -1, 1, 'Good Red', 5, @@ -412,6 +414,7 @@ VALUES ), ( -- 2, + -2, 1, 'Good Blue', 6, @@ -436,6 +439,7 @@ VALUES ), ( -- 3, + -3, 2, 'Test product describes good', 10, @@ -460,6 +464,7 @@ VALUES ), ( -- 4, + -4, 3, 'Phone describes good', 10, @@ -484,6 +489,7 @@ VALUES ), ( -- 5, + -5, 4, 'Laptop describes good', 10, @@ -508,6 +514,7 @@ VALUES ), ( -- 6, + -6, 5, 'Smart watch describes good', 10, @@ -548,6 +555,9 @@ INSERT INTO Shop_Variation ( VALUES (1, 1, 'RED', 'Red', NULL, NULL) , (2, 1, 'BLUE', 'Blue', NULL, NULL) + , (3, 1, 'GREEN', 'Green', NULL, NULL) + , (4, 1, 'White', 'White', NULL, NULL) + , (5, 1, 'BLACK', 'Black', NULL, NULL) , (1, 2, '400ml', '400 millilitres', 6, 400) , (2, 2, '400g', '400 grams', 4, 400) , (3, 2, '410g', '410 grams', 4, 410) diff --git a/static/MySQL/temp.txt b/static/MySQL/file_list.txt similarity index 98% rename from static/MySQL/temp.txt rename to static/MySQL/file_list.txt index 76548723..c987460e 100644 --- a/static/MySQL/temp.txt +++ b/static/MySQL/file_list.txt @@ -57,6 +57,7 @@ 1214_tbl_Shop_Variation_Temp.sql 1215_tbl_Shop_Product_Permutation_Variation_Link.sql 1216_tbl_Shop_Product_Permutation_Variation_Link_Audit.sql +1217_tbl_Shop_Product_Permutation_Variation_Link_Temp.sql 1218_tbl_Shop_Stock_Item.sql 1219_tbl_Shop_Stock_Item_Audit.sql 1220_tbl_Shop_Stock_Item_Temp.sql @@ -172,6 +173,7 @@ 6004_p_clear_split_key_value_pair_csv_temp.sql 6206_fn_shop_get_product_permutation_name.sql 6210_fn_shop_get_id_product_permutation_from_variation_csv_list.sql +6211_fn_shop_get_product_variations_from_id_csv_list.sql 6500_p_shop_calc_user.sql 6501_p_shop_clear_calc_user.sql 7003_p_shop_get_many_access_level.sql diff --git a/static/batch/sql_combine.bat b/static/batch/sql_combine.bat index 54ad4175..997fadba 100644 --- a/static/batch/sql_combine.bat +++ b/static/batch/sql_combine.bat @@ -1,7 +1,6 @@ @echo off setlocal enabledelayedexpansion -:: set "test=C:\C:\ \" set dir_parent=C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\static\MySQL :: set dir_parent=C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\static\PostgreSQL set "f_list=file_list.txt" @@ -19,14 +18,12 @@ set "strs_delete_6=600_p_shop_save_product.sql" set "strs_delete_7=170_ish_tbl_ERP_Order.sql" set "strs_delete_7=dump.sql" set strs_n_max=8 -set strs_list =%strs_delete_0% %strs_delete_1% %strs_delete_2% %strs_delete_3% %strs_delete_4% -set "str_true=true" -set "str_replace=" set "str_list=" +set max_length=8191 +set threshold=1000 -:: report constants echo temp = %f_tmp% echo dir_parent = !%dir_parent%! echo dir_current = !%dir_current%! @@ -34,49 +31,43 @@ echo file_list = %f_list% echo file = %f_combine% echo n strings = !strs_n_max! -:: begin cd %dir_parent% -::echo current directory: %cd% del %f_tmp% del %f_list% del %f_combine% -:: colate dir files -dir /b > %f_list% +dir /b *.sql > %f_list% -::type %f_list% echo loopy -:: Remove blacklist files -:: grep -v '920_edit_permissions.sql' %f_list% > %f_list% -:: grep -v '910_anal.sql' %f_list% > %f_list% - (for /f "delims=" %%a in (%f_list%) do ( - ::if %verbose% gtr 0 ( echo new line ) set "line=%%a" - ::if %verbose% gtr 0 ( echo new line = !line! ) - ::if !line! neq %strs_delete_0% if !line! neq %strs_delete_1% if !line! neq %strs_delete_2% if !line! neq %strs_delete_3% if !line! neq %strs_delete_4% if !line! neq %strs_delete_5% if !line! neq %strs_delete_6% ( - :: echo !line! - :: set "str_list=!str_list! !line!" - ::) set include_line=1 for /L %%i in (0, 1, %strs_n_max%) do ( - ::set "str_delete=!strs_delete_%%i!" if !line! equ !strs_delete_%%i! ( set include_line=0 ) - ::set "include_line=!include_line!" set "line=!line!" ) if !include_line! gtr 0 ( echo !line! - set "str_list=!str_list! !line!" + ::set "str_list=!str_list! !line!" + ::set length=0 + ::for %%i in (!str_list!) do ( + :: set /a length+=1 + ::) + ::if !length! geq !threshold! ( + :: echo !str_list! + :: echo !str_list! > %f_combine% + :: set "str_list=" + ::) + type !line! >> %f_combine% ) set "line=!line!" )) > %f_tmp% -:: Combine files + echo output list: type %f_tmp% @@ -84,12 +75,15 @@ del %f_list% echo file_tmp: %f_tmp% echo file_list: %f_list% echo combining files -::type %f_tmp% | type > %f_list% -:: -::type %f_list% +echo !str_list! + echo cmd: -echo "type !str_list! > %f_combine%" -type !str_list! > %f_combine% +::echo "type !str_list! > %f_combine%" +::type !str_list! > %f_combine% +::(for %%f in (!str_list!) do ( +:: echo %%f +:: type "%%f" >> %f_combine% +::)) cd %dir_current% diff --git a/static/batch/sql_combine.ps1 b/static/batch/sql_combine.ps1 new file mode 100644 index 00000000..9918bf16 --- /dev/null +++ b/static/batch/sql_combine.ps1 @@ -0,0 +1,43 @@ + +# Combine-SqlFiles.ps1 +param( + [string]$sourceFolder = "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\static\MySQL\", + [string]$outputFileName = "0000_combined.sql", + [string]$filePattern = "*.sql", + [string[]]$excludeFiles = @("920_edit_permissions.sql", "910_anal.sql", "701_p_shop_get_many_role_permission.sql", "600_p_shop_save_product.sql", "dump.sql") # Array of filenames to exclude +) + +$outputFile = Join-Path $sourceFolder $outputFileName +$outputDir = Split-Path -Parent $outputFile + +# Remove output file if it exists +if (Test-Path $outputFile) { + Remove-Item $outputFile -Force +} + +# Create directory if needed +if (!(Test-Path -Path $outputDir)) { + New-Item -ItemType Directory -Force -Path $outputDir +} + +# Create a StringBuilder for efficiency +$output = New-Object System.Text.StringBuilder + +# Process each file +Get-ChildItem -Path $sourceFolder -Filter $filePattern -File | + Where-Object { $_.Name -notin $excludeFiles -and $_.Name -ne $outputFileName } | + ForEach-Object { + [void]$output.AppendLine("-- File: $($_.Name)") + # Read file content and remove BOM if present + $content = [System.IO.File]::ReadAllBytes($_.FullName) + if ($content[0] -eq 0xEF -and $content[1] -eq 0xBB -and $content[2] -eq 0xBF) { + $content = $content[3..($content.Length-1)] + } + [void]$output.AppendLine([System.Text.Encoding]::UTF8.GetString($content)) + [void]$output.AppendLine() + } + +# Write final output +[System.IO.File]::WriteAllText($outputFile, $output.ToString(), [System.Text.UTF8Encoding]::new($false)) + +Write-Host "Files combined successfully into $outputFile" \ No newline at end of file diff --git a/static/css/layouts/header.css b/static/css/layouts/header.css index 4918f844..eb486b3b 100644 --- a/static/css/layouts/header.css +++ b/static/css/layouts/header.css @@ -67,6 +67,28 @@ } /* Page Filters */ +#formFilters * { + font-size: 12px; +} + +#formFilters .container { + max-width: fit-content; +} +#formFilters .container-input { + padding: 0 0.5vh; +} + +#formFilters .container-input input { + max-width: 5vh; +} + +#formFilters .container-input.filter.active { + width: 8vh; +} +#formFilters .container-input.filter.is_not_empty { + width: 12vh; +} + button.collapsed { display: block; opacity: 0; @@ -79,11 +101,4 @@ form.filter button.save, form.filter button.button-cancel { form.filter button.save, form.filter button.button-cancel { margin-top: 0; margin-bottom: 0; -} - -#formFilters .container-input.filter.active { - width: 8vh; -} -#formFilters .container-input.filter.is_not_empty { - width: 12vh; } \ No newline at end of file diff --git a/static/css/pages/store/product_permutations.css b/static/css/pages/store/product_permutations.css index 2be740e6..bf8b4fa9 100644 --- a/static/css/pages/store/product_permutations.css +++ b/static/css/pages/store/product_permutations.css @@ -1,13 +1,8 @@ #formFilters { - width: 50vh; + width: 95vh; } -#formFilters .container { - max-width: fit-content; -} - - #tableMain { max-width: 90vw; } diff --git a/static/css/pages/store/products.css b/static/css/pages/store/products.css index 2a0c688e..9219df7c 100644 --- a/static/css/pages/store/products.css +++ b/static/css/pages/store/products.css @@ -15,11 +15,10 @@ width: 8vh; } -/* + #tableMain { - max-width: min(calc(1vh * 79), calc(1vw * 90)); + max-width: min(calc(1vh * 65), calc(1vw * 90)); } -*/ #tableMain tbody tr td.display_order, #tableMain thead tr th.display_order { width: 5vh; diff --git a/static/dist/css/main.bundle.css b/static/dist/css/main.bundle.css index 6f45fad5..5cfac856 100644 --- a/static/dist/css/main.bundle.css +++ b/static/dist/css/main.bundle.css @@ -563,6 +563,28 @@ table div { } /* Page Filters */ +#formFilters * { + font-size: 12px; +} + +#formFilters .container { + max-width: fit-content; +} +#formFilters .container-input { + padding: 0 0.5vh; +} + +#formFilters .container-input input { + max-width: 5vh; +} + +#formFilters .container-input.filter.active { + width: 8vh; +} +#formFilters .container-input.filter.is_not_empty { + width: 12vh; +} + button.collapsed { display: block; opacity: 0; @@ -577,13 +599,6 @@ form.filter button.save, form.filter button.button-cancel { margin-bottom: 0; } -#formFilters .container-input.filter.active { - width: 8vh; -} -#formFilters .container-input.filter.is_not_empty { - width: 12vh; -} - /* Footer */ .footer { padding: 1vh; diff --git a/static/dist/css/store_product_permutations.bundle.css b/static/dist/css/store_product_permutations.bundle.css index 3aa1b12e..c94b2239 100644 --- a/static/dist/css/store_product_permutations.bundle.css +++ b/static/dist/css/store_product_permutations.bundle.css @@ -57,14 +57,9 @@ #formFilters { - width: 50vh; + width: 95vh; } -#formFilters .container { - max-width: fit-content; -} - - #tableMain { max-width: 90vw; } diff --git a/static/dist/js/main.bundle.js b/static/dist/js/main.bundle.js index 2b8ea09c..51ba5f36 100644 --- a/static/dist/js/main.bundle.js +++ b/static/dist/js/main.bundle.js @@ -2792,7 +2792,7 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) { key: "handleChangeProductCategoryDdl", value: function handleChangeProductCategoryDdl(event, ddlCategory) { this.handleChangeNestedElementCellTable(event, ddlCategory); - var idProductCategorySelected = DOM.getElementValueCurrent(ddlCategory); + var idProductCategorySelected = DOM.getElementAttributeValueCurrent(ddlCategory); var row = DOM.getRowFromElement(ddlCategory); var tdProduct = row.querySelector('td.' + flagProduct); tdProduct.dispatchEvent(new Event('click')); @@ -4646,8 +4646,8 @@ var PageStoreProductPermutations = /*#__PURE__*/function (_TableBasePage) { var tdProduct = row.querySelector('td.' + flagProduct); var tdProductVariations = row.querySelector('td.' + flagProductVariations); var inputDescription = row.querySelector('td.' + flagDescription + ' textarea'); - var inputCostLocalVatExcl = row.querySelector('td.' + flagCostUnitLocalVatExcl + ' input'); - var inputCostLocalVatIncl = row.querySelector('td.' + flagCostUnitLocalVatIncl + ' input'); + // let inputCostLocalVatExcl = row.querySelector('td.' + flagCostUnitLocalVatExcl + ' input'); + // let inputCostLocalVatIncl = row.querySelector('td.' + flagCostUnitLocalVatIncl + ' input'); var tdCurrencyCost = row.querySelector('td.' + flagCurrencyCost); var inputProfitLocalMin = row.querySelector('td.' + flagProfitLocalMin + ' input'); var inputLatencyManufactureDays = row.querySelector('td.' + flagLatencyManufacture + ' input'); @@ -4671,8 +4671,8 @@ var PageStoreProductPermutations = /*#__PURE__*/function (_TableBasePage) { jsonRow[flagProductVariations] = tdProductVariations.getAttribute(attrValueCurrent); jsonRow[flagHasVariations] = jsonRow[flagProductVariations] != ''; jsonRow[flagDescription] = inputDescription.getAttribute(attrValueCurrent); - jsonRow[flagCostUnitLocalVatExcl] = inputCostLocalVatExcl.getAttribute(attrValueCurrent); - jsonRow[flagCostUnitLocalVatIncl] = inputCostLocalVatIncl.getAttribute(attrValueCurrent); + // jsonRow[flagCostUnitLocalVatExcl] = inputCostLocalVatExcl.getAttribute(attrValueCurrent); + // jsonRow[flagCostUnitLocalVatIncl] = inputCostLocalVatIncl.getAttribute(attrValueCurrent); jsonRow[flagCurrencyCost] = tdCurrencyCost.getAttribute(attrValueCurrent); jsonRow[flagProfitLocalMin] = inputProfitLocalMin.getAttribute(attrValueCurrent); jsonRow[flagLatencyManufacture] = inputLatencyManufactureDays.getAttribute(attrValueCurrent); @@ -4694,6 +4694,15 @@ var PageStoreProductPermutations = /*#__PURE__*/function (_TableBasePage) { }, { key: "initialiseRowNew", value: function initialiseRowNew(tbody, row) { + this.initialiseRowNewDdlsProductCategoryAndProduct(row); + var checkboxIsSubscription = row.querySelector('td.' + flagIsSubscription + ' input'); + var checkboxDoesExpireFasterOnceUnsealed = row.querySelector('td.' + flagDoesExpireFasterOnceUnsealed + ' input'); + this.handleChangeCheckboxDoesExpireFasterOnceUnsealed(null, checkboxDoesExpireFasterOnceUnsealed); + this.handleChangeCheckboxIsSubscription(null, checkboxIsSubscription); + } + }, { + key: "initialiseRowNewDdlsProductCategoryAndProduct", + value: function initialiseRowNewDdlsProductCategoryAndProduct(row) { var ddlCategoryFilter = document.querySelector(idFormFilters + ' #' + attrIdProductCategory); var idProductCategoryFilter = DOM.getElementValueCurrent(ddlCategoryFilter); var hasCategoryFilter = !(validation_Validation.isEmpty(idProductCategoryFilter) || idProductCategoryFilter == '0'); @@ -4842,22 +4851,27 @@ var PageStoreProductPermutations = /*#__PURE__*/function (_TableBasePage) { value: function hookupIsSubscriptionFields() { var _this3 = this; this.hookupChangeHandlerTableCells(idTableMain + ' td.' + flagIsSubscription + ' input', function (event, element) { - _this3.handleChangeNestedElementCellTable(event, element); - var isSubscription = DOM.getElementValueCurrent(element); - var row = DOM.getRowFromElement(element); - var inputCountIntervalRecurrence = row.querySelector('td.' + flagCountUnitMeasurementIntervalRecurrence + ' input'); - var divOrDdlIntervalRecurrence = row.querySelector('td.' + flagUnitMeasurementIntervalRecurrence + ' .' + flagUnitMeasurementIntervalRecurrence); - if (isSubscription) { - inputCountIntervalRecurrence.classList.remove(flagCollapsed); - divOrDdlIntervalRecurrence.classList.remove(flagCollapsed); - var tdUnitMeasurementIntervalRecurrence = divOrDdlIntervalRecurrence.closest('td'); - tdUnitMeasurementIntervalRecurrence.dispatchEvent(new Event('click')); - } else { - inputCountIntervalRecurrence.classList.add(flagCollapsed); - divOrDdlIntervalRecurrence.classList.add(flagCollapsed); - } + _this3.handleChangeCheckboxIsSubscription(event, element); }); } + }, { + key: "handleChangeCheckboxIsSubscription", + value: function handleChangeCheckboxIsSubscription(event, element) { + this.handleChangeNestedElementCellTable(event, element); + var isSubscription = DOM.getElementValueCurrent(element); + var row = DOM.getRowFromElement(element); + var inputCountIntervalRecurrence = row.querySelector('td.' + flagCountUnitMeasurementIntervalRecurrence + ' input'); + var divOrDdlIntervalRecurrence = row.querySelector('td.' + flagUnitMeasurementIntervalRecurrence + ' .' + flagUnitMeasurementIntervalRecurrence); + if (isSubscription) { + inputCountIntervalRecurrence.classList.remove(flagCollapsed); + divOrDdlIntervalRecurrence.classList.remove(flagCollapsed); + var tdUnitMeasurementIntervalRecurrence = divOrDdlIntervalRecurrence.closest('td'); + tdUnitMeasurementIntervalRecurrence.dispatchEvent(new Event('click')); + } else { + inputCountIntervalRecurrence.classList.add(flagCollapsed); + divOrDdlIntervalRecurrence.classList.add(flagCollapsed); + } + } }, { key: "hookupIntervalRecurrenceFields", value: function hookupIntervalRecurrenceFields() { @@ -4885,22 +4899,27 @@ var PageStoreProductPermutations = /*#__PURE__*/function (_TableBasePage) { value: function hookupDoesExpireFasterOnceUnsealedCheckboxes() { var _this4 = this; this.hookupChangeHandlerTableCells(idTableMain + ' td.' + flagDoesExpireFasterOnceUnsealed + ' input', function (event, element) { - _this4.handleChangeNestedElementCellTable(event, element); - var doesExpireFasterOnceUnsealed = DOM.getElementValueCurrent(element); - var row = DOM.getRowFromElement(element); - var inputCountIntervalExpirationUnsealed = row.querySelector('td.' + flagCountUnitMeasurementIntervalExpirationUnsealed + ' input'); - var divOrDdlIntervalExpirationUnsealed = row.querySelector('td.' + flagUnitMeasurementIntervalExpirationUnsealed + ' .' + flagUnitMeasurementIntervalExpirationUnsealed); - if (doesExpireFasterOnceUnsealed) { - inputCountIntervalExpirationUnsealed.classList.remove(flagCollapsed); - divOrDdlIntervalExpirationUnsealed.classList.remove(flagCollapsed); - var tdUnitMeasurementIntervalExpirationUnsealed = divOrDdlIntervalExpirationUnsealed.closest('td'); - tdUnitMeasurementIntervalExpirationUnsealed.dispatchEvent(new Event('click')); - } else { - inputCountIntervalExpirationUnsealed.classList.add(flagCollapsed); - divOrDdlIntervalExpirationUnsealed.classList.add(flagCollapsed); - } + _this4.handleChangeCheckboxDoesExpireFasterOnceUnsealed(event, element); }); } + }, { + key: "handleChangeCheckboxDoesExpireFasterOnceUnsealed", + value: function handleChangeCheckboxDoesExpireFasterOnceUnsealed(event, element) { + this.handleChangeNestedElementCellTable(event, element); + var doesExpireFasterOnceUnsealed = DOM.getElementValueCurrent(element); + var row = DOM.getRowFromElement(element); + var inputCountIntervalExpirationUnsealed = row.querySelector('td.' + flagCountUnitMeasurementIntervalExpirationUnsealed + ' input'); + var divOrDdlIntervalExpirationUnsealed = row.querySelector('td.' + flagUnitMeasurementIntervalExpirationUnsealed + ' .' + flagUnitMeasurementIntervalExpirationUnsealed); + if (doesExpireFasterOnceUnsealed) { + inputCountIntervalExpirationUnsealed.classList.remove(flagCollapsed); + divOrDdlIntervalExpirationUnsealed.classList.remove(flagCollapsed); + var tdUnitMeasurementIntervalExpirationUnsealed = divOrDdlIntervalExpirationUnsealed.closest('td'); + tdUnitMeasurementIntervalExpirationUnsealed.dispatchEvent(new Event('click')); + } else { + inputCountIntervalExpirationUnsealed.classList.add(flagCollapsed); + divOrDdlIntervalExpirationUnsealed.classList.add(flagCollapsed); + } + } }, { key: "hookupIntervalExpirationUnsealedFields", value: function hookupIntervalExpirationUnsealedFields() { diff --git a/static/js/pages/base_table.js b/static/js/pages/base_table.js index fcdd49cd..3c59b31b 100644 --- a/static/js/pages/base_table.js +++ b/static/js/pages/base_table.js @@ -615,7 +615,7 @@ export default class TableBasePage extends BasePage { } handleChangeProductCategoryDdl(event, ddlCategory) { this.handleChangeNestedElementCellTable(event, ddlCategory); - let idProductCategorySelected = DOM.getElementValueCurrent(ddlCategory); + let idProductCategorySelected = DOM.getElementAttributeValueCurrent(ddlCategory); let row = DOM.getRowFromElement(ddlCategory); let tdProduct = row.querySelector('td.' + flagProduct); tdProduct.dispatchEvent(new Event('click')); diff --git a/static/js/pages/store/product_permutations.js b/static/js/pages/store/product_permutations.js index 4a653990..351d5e98 100644 --- a/static/js/pages/store/product_permutations.js +++ b/static/js/pages/store/product_permutations.js @@ -129,8 +129,8 @@ export default class PageStoreProductPermutations extends TableBasePage { let tdProduct = row.querySelector('td.' + flagProduct); let tdProductVariations = row.querySelector('td.' + flagProductVariations); let inputDescription = row.querySelector('td.' + flagDescription + ' textarea'); - let inputCostLocalVatExcl = row.querySelector('td.' + flagCostUnitLocalVatExcl + ' input'); - let inputCostLocalVatIncl = row.querySelector('td.' + flagCostUnitLocalVatIncl + ' input'); + // let inputCostLocalVatExcl = row.querySelector('td.' + flagCostUnitLocalVatExcl + ' input'); + // let inputCostLocalVatIncl = row.querySelector('td.' + flagCostUnitLocalVatIncl + ' input'); let tdCurrencyCost = row.querySelector('td.' + flagCurrencyCost); let inputProfitLocalMin = row.querySelector('td.' + flagProfitLocalMin + ' input'); let inputLatencyManufactureDays = row.querySelector('td.' + flagLatencyManufacture + ' input'); @@ -155,8 +155,8 @@ export default class PageStoreProductPermutations extends TableBasePage { jsonRow[flagProductVariations] = tdProductVariations.getAttribute(attrValueCurrent); jsonRow[flagHasVariations] = jsonRow[flagProductVariations] != ''; jsonRow[flagDescription] = inputDescription.getAttribute(attrValueCurrent); - jsonRow[flagCostUnitLocalVatExcl] = inputCostLocalVatExcl.getAttribute(attrValueCurrent); - jsonRow[flagCostUnitLocalVatIncl] = inputCostLocalVatIncl.getAttribute(attrValueCurrent); + // jsonRow[flagCostUnitLocalVatExcl] = inputCostLocalVatExcl.getAttribute(attrValueCurrent); + // jsonRow[flagCostUnitLocalVatIncl] = inputCostLocalVatIncl.getAttribute(attrValueCurrent); jsonRow[flagCurrencyCost] = tdCurrencyCost.getAttribute(attrValueCurrent); jsonRow[flagProfitLocalMin] = inputProfitLocalMin.getAttribute(attrValueCurrent); jsonRow[flagLatencyManufacture] = inputLatencyManufactureDays.getAttribute(attrValueCurrent); @@ -176,6 +176,14 @@ export default class PageStoreProductPermutations extends TableBasePage { return jsonRow; } initialiseRowNew(tbody, row) { + this.initialiseRowNewDdlsProductCategoryAndProduct(row); + + let checkboxIsSubscription = row.querySelector('td.' + flagIsSubscription + ' input'); + let checkboxDoesExpireFasterOnceUnsealed = row.querySelector('td.' + flagDoesExpireFasterOnceUnsealed + ' input'); + this.handleChangeCheckboxDoesExpireFasterOnceUnsealed(null, checkboxDoesExpireFasterOnceUnsealed); + this.handleChangeCheckboxIsSubscription(null, checkboxIsSubscription); + } + initialiseRowNewDdlsProductCategoryAndProduct(row) { let ddlCategoryFilter = document.querySelector(idFormFilters + ' #' + attrIdProductCategory); let idProductCategoryFilter = DOM.getElementValueCurrent(ddlCategoryFilter); let hasCategoryFilter = !(Validation.isEmpty(idProductCategoryFilter) || idProductCategoryFilter == '0'); @@ -283,22 +291,25 @@ export default class PageStoreProductPermutations extends TableBasePage { } hookupIsSubscriptionFields(){ this.hookupChangeHandlerTableCells(idTableMain + ' td.' + flagIsSubscription + ' input', (event, element) => { - this.handleChangeNestedElementCellTable(event, element); - let isSubscription = DOM.getElementValueCurrent(element); - let row = DOM.getRowFromElement(element); - let inputCountIntervalRecurrence = row.querySelector('td.' + flagCountUnitMeasurementIntervalRecurrence + ' input'); - let divOrDdlIntervalRecurrence = row.querySelector('td.' + flagUnitMeasurementIntervalRecurrence + ' .' + flagUnitMeasurementIntervalRecurrence); - if (isSubscription) { - inputCountIntervalRecurrence.classList.remove(flagCollapsed); - divOrDdlIntervalRecurrence.classList.remove(flagCollapsed); - let tdUnitMeasurementIntervalRecurrence = divOrDdlIntervalRecurrence.closest('td'); - tdUnitMeasurementIntervalRecurrence.dispatchEvent(new Event('click')); - } else { - inputCountIntervalRecurrence.classList.add(flagCollapsed); - divOrDdlIntervalRecurrence.classList.add(flagCollapsed); - } + this.handleChangeCheckboxIsSubscription(event, element); }); } + handleChangeCheckboxIsSubscription(event, element) { + this.handleChangeNestedElementCellTable(event, element); + let isSubscription = DOM.getElementValueCurrent(element); + let row = DOM.getRowFromElement(element); + let inputCountIntervalRecurrence = row.querySelector('td.' + flagCountUnitMeasurementIntervalRecurrence + ' input'); + let divOrDdlIntervalRecurrence = row.querySelector('td.' + flagUnitMeasurementIntervalRecurrence + ' .' + flagUnitMeasurementIntervalRecurrence); + if (isSubscription) { + inputCountIntervalRecurrence.classList.remove(flagCollapsed); + divOrDdlIntervalRecurrence.classList.remove(flagCollapsed); + let tdUnitMeasurementIntervalRecurrence = divOrDdlIntervalRecurrence.closest('td'); + tdUnitMeasurementIntervalRecurrence.dispatchEvent(new Event('click')); + } else { + inputCountIntervalRecurrence.classList.add(flagCollapsed); + divOrDdlIntervalRecurrence.classList.add(flagCollapsed); + } + } hookupIntervalRecurrenceFields(){ this.hookupTableCellDDlPreviewsWhenNotCollapsed(idTableMain + ' td.' + flagUnitMeasurementIntervalRecurrence, Utils.getListFromDict(unitMeasurementsTime)); } @@ -314,23 +325,26 @@ export default class PageStoreProductPermutations extends TableBasePage { this.hookupCountIntervalExpirationUnsealedInputs(); } hookupDoesExpireFasterOnceUnsealedCheckboxes(){ - this.hookupChangeHandlerTableCells(idTableMain + ' td.' + flagDoesExpireFasterOnceUnsealed + ' input', (event, element) => { - this.handleChangeNestedElementCellTable(event, element); - let doesExpireFasterOnceUnsealed = DOM.getElementValueCurrent(element); - let row = DOM.getRowFromElement(element); - let inputCountIntervalExpirationUnsealed = row.querySelector('td.' + flagCountUnitMeasurementIntervalExpirationUnsealed + ' input'); - let divOrDdlIntervalExpirationUnsealed = row.querySelector('td.' + flagUnitMeasurementIntervalExpirationUnsealed + ' .' + flagUnitMeasurementIntervalExpirationUnsealed); - if (doesExpireFasterOnceUnsealed) { - inputCountIntervalExpirationUnsealed.classList.remove(flagCollapsed); - divOrDdlIntervalExpirationUnsealed.classList.remove(flagCollapsed); - let tdUnitMeasurementIntervalExpirationUnsealed = divOrDdlIntervalExpirationUnsealed.closest('td'); - tdUnitMeasurementIntervalExpirationUnsealed.dispatchEvent(new Event('click')); - } else { - inputCountIntervalExpirationUnsealed.classList.add(flagCollapsed); - divOrDdlIntervalExpirationUnsealed.classList.add(flagCollapsed); - } + this.hookupChangeHandlerTableCells(idTableMain + ' td.' + flagDoesExpireFasterOnceUnsealed + ' input', (event, element) => { + this.handleChangeCheckboxDoesExpireFasterOnceUnsealed(event, element); }); } + handleChangeCheckboxDoesExpireFasterOnceUnsealed(event, element) { + this.handleChangeNestedElementCellTable(event, element); + let doesExpireFasterOnceUnsealed = DOM.getElementValueCurrent(element); + let row = DOM.getRowFromElement(element); + let inputCountIntervalExpirationUnsealed = row.querySelector('td.' + flagCountUnitMeasurementIntervalExpirationUnsealed + ' input'); + let divOrDdlIntervalExpirationUnsealed = row.querySelector('td.' + flagUnitMeasurementIntervalExpirationUnsealed + ' .' + flagUnitMeasurementIntervalExpirationUnsealed); + if (doesExpireFasterOnceUnsealed) { + inputCountIntervalExpirationUnsealed.classList.remove(flagCollapsed); + divOrDdlIntervalExpirationUnsealed.classList.remove(flagCollapsed); + let tdUnitMeasurementIntervalExpirationUnsealed = divOrDdlIntervalExpirationUnsealed.closest('td'); + tdUnitMeasurementIntervalExpirationUnsealed.dispatchEvent(new Event('click')); + } else { + inputCountIntervalExpirationUnsealed.classList.add(flagCollapsed); + divOrDdlIntervalExpirationUnsealed.classList.add(flagCollapsed); + } + } hookupIntervalExpirationUnsealedFields(){ this.hookupTableCellDDlPreviewsWhenNotCollapsed(idTableMain + ' td.' + flagUnitMeasurementIntervalExpirationUnsealed, Utils.getListFromDict(unitMeasurementsTime)); } diff --git a/templates/components/store/_row_product_permutation.html b/templates/components/store/_row_product_permutation.html index a24619dd..e3b9eb13 100644 --- a/templates/components/store/_row_product_permutation.html +++ b/templates/components/store/_row_product_permutation.html @@ -56,12 +56,12 @@ -
+
0
-
+
0
@@ -111,7 +111,11 @@ {% include 'components/store/_preview_DDL_product_permutation_unit_measurement_quantity.html' %} - + {% set value = permutation.count_interval_recurrence if permutation.count_interval_recurrence is not none else 1 %} @@ -132,7 +136,11 @@ - + {% set value = permutation.count_interval_expiration_unsealed if permutation.count_interval_expiration_unsealed is not none else 1 %} @@ -149,10 +157,14 @@ {% include 'components/store/_preview_DDL_product_permutation_interval_expiration_unsealed.html' %} - +
+ {{ permutation.cost_local_VAT_excl }} +
- +
+ {{ permutation.cost_local_VAT_incl }} +
{% set currency = permutation.currency_cost %} diff --git a/templates/js/sections/store.js b/templates/js/sections/store.js index 1aed253a..1a24213e 100644 --- a/templates/js/sections/store.js +++ b/templates/js/sections/store.js @@ -103,15 +103,17 @@ var flagUnitMeasurementIntervalExpirationUnsealed = "{{ model.FLAG_UNIT_MEASUREM var flagUnitMeasurementIntervalRecurrence = "{{ model.FLAG_UNIT_MEASUREMENT_INTERVAL_RECURRENCE }}"; var flagUnitMeasurementLatencyManufacture = "{{ model.FLAG_UNIT_MEASUREMENT_LATENCY_MANUFACTURE }}"; var flagUnitMeasurementQuantity = "{{ model.FLAG_UNIT_MEASUREMENT_QUANTITY }}"; -var hashGetStoreCustomerSalesOrder = "{{ model.HASH_GET_STORE_CUSTOMER_SALES_ORDER }}"; -var hashGetStoreManufacturingPurchaseOrder = "{{ model.HASH_GET_STORE_MANUFACTURING_PURCHASE_ORDER }}"; -var hashGetStoreProduct = "{{ model.HASH_GET_STORE_PRODUCT }}"; -var hashGetStoreProductCategory = "{{ model.HASH_GET_STORE_PRODUCT_CATEGORY }}"; -var hashGetStoreProductPermutation = "{{ model.HASH_GET_STORE_PRODUCT_PERMUTATION }}"; -var hashGetStoreProductVariation = "{{ model.HASH_GET_STORE_PRODUCT_VARIATION }}"; -var hashGetStoreStockItem = "{{ model.HASH_GET_STORE_STOCK_ITEM }}"; -var hashGetStoreSupplier = "{{ model.HASH_GET_STORE_SUPPLIER }}"; -var hashGetStoreSupplierPurchaseOrder = "{{ model.HASH_GET_STORE_SUPPLIER_PURCHASE_ORDER }}"; +{# + var hashGetStoreCustomerSalesOrder = "{{ model.HASH_GET_STORE_CUSTOMER_SALES_ORDER }}"; + var hashGetStoreManufacturingPurchaseOrder = "{{ model.HASH_GET_STORE_MANUFACTURING_PURCHASE_ORDER }}"; + var hashGetStoreProduct = "{{ model.HASH_GET_STORE_PRODUCT }}"; + var hashGetStoreProductCategory = "{{ model.HASH_GET_STORE_PRODUCT_CATEGORY }}"; + var hashGetStoreProductPermutation = "{{ model.HASH_GET_STORE_PRODUCT_PERMUTATION }}"; + var hashGetStoreProductVariation = "{{ model.HASH_GET_STORE_PRODUCT_VARIATION }}"; + var hashGetStoreStockItem = "{{ model.HASH_GET_STORE_STOCK_ITEM }}"; + var hashGetStoreSupplier = "{{ model.HASH_GET_STORE_SUPPLIER }}"; + var hashGetStoreSupplierPurchaseOrder = "{{ model.HASH_GET_STORE_SUPPLIER_PURCHASE_ORDER }}"; +#} var hashSaveStoreCustomerSalesOrder = "{{ model.HASH_SAVE_STORE_CUSTOMER_SALES_ORDER }}"; var hashSaveStoreManufacturingPurchaseOrder = "{{ model.HASH_SAVE_STORE_MANUFACTURING_PURCHASE_ORDER }}"; var hashSaveStoreProduct = "{{ model.HASH_SAVE_STORE_PRODUCT }}"; diff --git a/templates/layouts/layout.html b/templates/layouts/layout.html index d728221c..93e500f3 100644 --- a/templates/layouts/layout.html +++ b/templates/layouts/layout.html @@ -273,64 +273,66 @@ Contact
- {% if model.is_page_store and model.user.can_admin_store %} -
- Product Permutations -
- {% if model.user.can_admin_store %} + {# + {% if model.is_page_store and model.user.can_admin_store %}
- Stock Items + Product Permutations
- {% endif %} - - {% else %} - {% if model.user.can_admin_store %} + {% endif %} + + {% else %} + {% if model.user.can_admin_store %} +
+ Shop +
+ {% endif %} {% endif %} - {% endif %} + #} {% if model.user.can_admin_store %}
Admin