From 64d0e2b95fa2156f608727f8d3ea191f606751de Mon Sep 17 00:00:00 2001 From: teddy Date: Thu, 21 Nov 2024 08:21:51 +0000 Subject: [PATCH] Fix: User login on production. --- app.log.1 | 143 +++--- app.log.2 | 157 ++---- app.log.3 | 454 ++---------------- static/MySQL/1218_tbl_Shop_Stock_Item.sql | 62 ++- ...03_p_shop_save_supplier_purchase_order.sql | 70 ++- static/dist/js/main.bundle.js | 23 +- static/js/pages/base.js | 12 +- 7 files changed, 254 insertions(+), 667 deletions(-) diff --git a/app.log.1 b/app.log.1 index ae7ececa..d4ae3e91 100644 --- a/app.log.1 +++ b/app.log.1 @@ -1,71 +1,76 @@ -result: -index_variation_type: {1: 0, 2: 1} +session: +DataStore_Base.get_user_session +User.from_json +json: {'can_admin_store': True, 'can_admin_user': True, 'email': 'edward.middletonsmith@gmail.com', 'firstname': 'Teddy', 'id_currency_default': None, 'id_region_default': None, 'id_user': 1, 'id_user_auth0': 'auth0|6582b95c895d09a70ba10fef', 'is_email_verified': False, 'is_included_VAT_default': True, 'is_super_user': True, 'surname': 'Middleton-Smith'} +user: + id_user: 1 + id_user_auth0: auth0|6582b95c895d09a70ba10fef + firstname: Teddy + surname: Middleton-Smith + email: edward.middletonsmith@gmail.com + is_email_verified: False + is_super_user: True + id_currency_default: None + id_region_default: None + is_included_VAT_default: True + can_admin_store: True + can_admin_user: True + +User.from_json +json: {'can_admin_store': True, 'can_admin_user': True, 'email': 'edward.middletonsmith@gmail.com', 'firstname': 'Teddy', 'id_currency_default': None, 'id_region_default': None, 'id_user': 1, 'id_user_auth0': 'auth0|6582b95c895d09a70ba10fef', 'is_email_verified': False, 'is_included_VAT_default': True, 'is_super_user': True, 'surname': 'Middleton-Smith'} +user: + id_user: 1 + id_user_auth0: auth0|6582b95c895d09a70ba10fef + firstname: Teddy + surname: Middleton-Smith + email: edward.middletonsmith@gmail.com + is_email_verified: False + is_super_user: True + id_currency_default: None + id_region_default: None + is_included_VAT_default: True + can_admin_store: True + can_admin_user: True + +argument_dict: {'a_id_user': 1, 'a_id_user_auth0': 'auth0|6582b95c895d09a70ba10fef', 'get_all_user': False, 'get_inactive_user': False, 'ids_user': 1, 'ids_user_auth0': '', 'a_debug': 0} +executing p_get_many_user +DataStore_Base.db_procedure_execute +proc_string: CALL p_get_many_user(:a_id_user, :a_id_user_auth0, :get_all_user, :get_inactive_user, :ids_user, :ids_user_auth0, :a_debug) +args: {'a_id_user': 1, 'a_id_user_auth0': 'auth0|6582b95c895d09a70ba10fef', 'get_all_user': False, 'get_inactive_user': False, 'ids_user': 1, 'ids_user_auth0': '', 'a_debug': 0} +result: +data received +raw users: ((1, 'auth0|6582b95c895d09a70ba10fef', 'Teddy', 'Middleton-Smith', 'edward.middletonsmith@gmail.com', b'\x00', None, None, b'\x01', b'\x01', b'\x01', b'\x01', b'\x00'),) raw errors: () new result set: () -argument_dict: {'active': True} -executing p_shop_get_many_unit_measurement -DataStore_Base.db_procedure_execute -proc_string: CALL p_shop_get_many_unit_measurement(:active) -args: {'active': True} -result: -data received -raw units of measurement: ((1, 'metre', 'metres', 'm', b'\x01', b'\x01', b'\x01', b'\x00', b'\x00', b'\x00', b'\x01'), (2, 'millimetre', 'millimetres', 'mm', b'\x01', b'\x00', b'\x01', b'\x00', b'\x00', b'\x00', b'\x01'), (3, 'kilogram', 'kilograms', 'kg', b'\x01', b'\x01', b'\x00', b'\x01', b'\x00', b'\x00', b'\x01'), (4, 'gram', 'grams', 'g', b'\x01', b'\x00', b'\x00', b'\x01', b'\x00', b'\x00', b'\x01'), (5, 'litre', 'litres', 'L', b'\x01', b'\x00', b'\x00', b'\x00', b'\x00', b'\x01', b'\x01'), (6, 'millilitre', 'millilitres', 'mL', b'\x01', b'\x00', b'\x00', b'\x00', b'\x00', b'\x01', b'\x01'), (7, 'item', 'items', 'x', b'\x01', b'\x00', b'\x00', b'\x00', b'\x00', b'\x00', b'\x01'), (8, 'hour', 'hours', 'h', b'\x01', b'\x01', b'\x00', b'\x00', b'\x01', b'\x00', b'\x01'), (9, 'day', 'days', 'd', b'\x01', b'\x00', b'\x00', b'\x00', b'\x01', b'\x00', b'\x01')) -raw errors: () -executing p_shop_get_many_currency -DataStore_Base.db_procedure_execute -proc_string: CALL p_shop_get_many_currency(:a_get_inactive_currency) -args: {'a_get_inactive_currency': 0} -result: -data received -currencies: [ - id: 1 - name: Great British Pound - code: GBP - symbol: £ - factor from GBP: 1.0 - display_order: 1 - active: True - , - id: 2 - name: Euro - code: EUR - symbol: € - factor from GBP: 1.17 - display_order: 2 - active: True - ] -new result set: () -{1: {'NAME_ATTR_OPTION_TEXT': 'name_singular', 'NAME_ATTR_OPTION_VALUE': 'id_unit_measurement', 'id_unit_measurement': 1, 'name_singular': 'metre', 'name_plural': 'metres', 'symbol': 'm', 'symbol_is_suffix_not_prefix': True, 'is_base_unit': True, 'is_unit_of_distance': True, 'is_unit_of_mass': False, 'is_unit_of_time': False, 'is_unit_of_volume': False, 'active': True}, 2: {'NAME_ATTR_OPTION_TEXT': 'name_singular', 'NAME_ATTR_OPTION_VALUE': 'id_unit_measurement', 'id_unit_measurement': 2, 'name_singular': 'millimetre', 'name_plural': 'millimetres', 'symbol': 'mm', 'symbol_is_suffix_not_prefix': True, 'is_base_unit': False, 'is_unit_of_distance': True, 'is_unit_of_mass': False, 'is_unit_of_time': False, 'is_unit_of_volume': False, 'active': True}, 3: {'NAME_ATTR_OPTION_TEXT': 'name_singular', 'NAME_ATTR_OPTION_VALUE': 'id_unit_measurement', 'id_unit_measurement': 3, 'name_singular': 'kilogram', 'name_plural': 'kilograms', 'symbol': 'kg', 'symbol_is_suffix_not_prefix': True, 'is_base_unit': True, 'is_unit_of_distance': False, 'is_unit_of_mass': True, 'is_unit_of_time': False, 'is_unit_of_volume': False, 'active': True}, 4: {'NAME_ATTR_OPTION_TEXT': 'name_singular', 'NAME_ATTR_OPTION_VALUE': 'id_unit_measurement', 'id_unit_measurement': 4, 'name_singular': 'gram', 'name_plural': 'grams', 'symbol': 'g', 'symbol_is_suffix_not_prefix': True, 'is_base_unit': False, 'is_unit_of_distance': False, 'is_unit_of_mass': True, 'is_unit_of_time': False, 'is_unit_of_volume': False, 'active': True}, 5: {'NAME_ATTR_OPTION_TEXT': 'name_singular', 'NAME_ATTR_OPTION_VALUE': 'id_unit_measurement', 'id_unit_measurement': 5, 'name_singular': 'litre', 'name_plural': 'litres', 'symbol': 'L', 'symbol_is_suffix_not_prefix': True, 'is_base_unit': False, 'is_unit_of_distance': False, 'is_unit_of_mass': False, 'is_unit_of_time': False, 'is_unit_of_volume': True, 'active': True}, 6: {'NAME_ATTR_OPTION_TEXT': 'name_singular', 'NAME_ATTR_OPTION_VALUE': 'id_unit_measurement', 'id_unit_measurement': 6, 'name_singular': 'millilitre', 'name_plural': 'millilitres', 'symbol': 'mL', 'symbol_is_suffix_not_prefix': True, 'is_base_unit': False, 'is_unit_of_distance': False, 'is_unit_of_mass': False, 'is_unit_of_time': False, 'is_unit_of_volume': True, 'active': True}, 7: {'NAME_ATTR_OPTION_TEXT': 'name_singular', 'NAME_ATTR_OPTION_VALUE': 'id_unit_measurement', 'id_unit_measurement': 7, 'name_singular': 'item', 'name_plural': 'items', 'symbol': 'x', 'symbol_is_suffix_not_prefix': True, 'is_base_unit': False, 'is_unit_of_distance': False, 'is_unit_of_mass': False, 'is_unit_of_time': False, 'is_unit_of_volume': False, 'active': True}, 8: {'NAME_ATTR_OPTION_TEXT': 'name_singular', 'NAME_ATTR_OPTION_VALUE': 'id_unit_measurement', 'id_unit_measurement': 8, 'name_singular': 'hour', 'name_plural': 'hours', 'symbol': 'h', 'symbol_is_suffix_not_prefix': True, 'is_base_unit': True, 'is_unit_of_distance': False, 'is_unit_of_mass': False, 'is_unit_of_time': True, 'is_unit_of_volume': False, 'active': True}, 9: {'NAME_ATTR_OPTION_TEXT': 'name_singular', 'NAME_ATTR_OPTION_VALUE': 'id_unit_measurement', 'id_unit_measurement': 9, 'name_singular': 'day', 'name_plural': 'days', 'symbol': 'd', 'symbol_is_suffix_not_prefix': True, 'is_base_unit': False, 'is_unit_of_distance': False, 'is_unit_of_mass': False, 'is_unit_of_time': True, 'is_unit_of_volume': False, 'active': True}} -{8: {'NAME_ATTR_OPTION_TEXT': 'name_singular', 'NAME_ATTR_OPTION_VALUE': 'id_unit_measurement', 'id_unit_measurement': 8, 'name_singular': 'hour', 'name_plural': 'hours', 'symbol': 'h', 'symbol_is_suffix_not_prefix': True, 'is_base_unit': True, 'is_unit_of_distance': False, 'is_unit_of_mass': False, 'is_unit_of_time': True, 'is_unit_of_volume': False, 'active': True}, 9: {'NAME_ATTR_OPTION_TEXT': 'name_singular', 'NAME_ATTR_OPTION_VALUE': 'id_unit_measurement', 'id_unit_measurement': 9, 'name_singular': 'day', 'name_plural': 'days', 'symbol': 'd', 'symbol_is_suffix_not_prefix': True, 'is_base_unit': False, 'is_unit_of_distance': False, 'is_unit_of_mass': False, 'is_unit_of_time': True, 'is_unit_of_volume': False, 'active': True}} -Product_Variation_Tree.to_preview_str -variation_types: [ - Product_Variation_Type - id_type: 1 - code: COLOUR - name_singular: Colour - name_plural: Colours - display_order: 1 - active: True - ] -preview_str: Colour: Red - -{'NAME_ATTR_OPTION_TEXT': 'name_singular', 'NAME_ATTR_OPTION_VALUE': 'id_unit_measurement', 'id_unit_measurement': 1, 'name_singular': 'metre', 'name_plural': 'metres', 'symbol': 'm', 'symbol_is_suffix_not_prefix': True, 'is_base_unit': True, 'is_unit_of_distance': True, 'is_unit_of_mass': False, 'is_unit_of_time': False, 'is_unit_of_volume': False, 'active': True} -Product_Variation_Tree.to_preview_str -variation_types: [ - Product_Variation_Type - id_type: 1 - code: COLOUR - name_singular: Colour - name_plural: Colours - display_order: 1 - active: True - ] -preview_str: Colour: Blue - -{'NAME_ATTR_OPTION_TEXT': 'name_singular', 'NAME_ATTR_OPTION_VALUE': 'id_unit_measurement', 'id_unit_measurement': 1, 'name_singular': 'metre', 'name_plural': 'metres', 'symbol': 'm', 'symbol_is_suffix_not_prefix': True, 'is_base_unit': True, 'is_unit_of_distance': True, 'is_unit_of_mass': False, 'is_unit_of_time': False, 'is_unit_of_volume': False, 'active': True} -{'NAME_ATTR_OPTION_TEXT': 'name_singular', 'NAME_ATTR_OPTION_VALUE': 'id_unit_measurement', 'id_unit_measurement': 1, 'name_singular': 'metre', 'name_plural': 'metres', 'symbol': 'm', 'symbol_is_suffix_not_prefix': True, 'is_base_unit': True, 'is_unit_of_distance': True, 'is_unit_of_mass': False, 'is_unit_of_time': False, 'is_unit_of_volume': False, 'active': True} -{'NAME_ATTR_OPTION_TEXT': 'name_singular', 'NAME_ATTR_OPTION_VALUE': 'id_unit_measurement', 'id_unit_measurement': 1, 'name_singular': 'metre', 'name_plural': 'metres', 'symbol': 'm', 'symbol_is_suffix_not_prefix': True, 'is_base_unit': True, 'is_unit_of_distance': True, 'is_unit_of_mass': False, 'is_unit_of_time': False, 'is_unit_of_volume': False, 'active': True} -{'NAME_ATTR_OPTION_TEXT': 'name_singular', 'NAME_ATTR_OPTION_VALUE': 'id_unit_measurement', 'id_unit_measurement': 1, 'name_singular': 'metre', 'name_plural': 'metres', 'symbol': 'm', 'symbol_is_suffix_not_prefix': True, 'is_base_unit': True, 'is_unit_of_distance': True, 'is_unit_of_mass': False, 'is_unit_of_time': False, 'is_unit_of_volume': False, 'active': True} -{'NAME_ATTR_OPTION_TEXT': 'name_singular', 'NAME_ATTR_OPTION_VALUE': 'id_unit_measurement', 'id_unit_measurement': 1, 'name_singular': 'metre', 'name_plural': 'metres', 'symbol': 'm', 'symbol_is_suffix_not_prefix': True, 'is_base_unit': True, 'is_unit_of_distance': True, 'is_unit_of_mass': False, 'is_unit_of_time': False, 'is_unit_of_volume': False, 'active': True} -Model_View_Store.__init__ -starting +model_view_base init end - model.user: + id_user: 1 + id_user_auth0: auth0|6582b95c895d09a70ba10fef + firstname: Teddy + surname: Middleton-Smith + email: edward.middletonsmith@gmail.com + is_email_verified: False + is_super_user: True + id_currency_default: None + id_region_default: None + is_included_VAT_default: True + can_admin_store: True + can_admin_user: True + +session: +DataStore_Base.get_user_session +User.from_json +json: {'can_admin_store': True, 'can_admin_user': True, 'email': 'edward.middletonsmith@gmail.com', 'firstname': 'Teddy', 'id_currency_default': None, 'id_region_default': None, 'id_user': 1, 'id_user_auth0': 'auth0|6582b95c895d09a70ba10fef', 'is_email_verified': False, 'is_included_VAT_default': True, 'is_super_user': True, 'surname': 'Middleton-Smith'} +user: + id_user: 1 + id_user_auth0: auth0|6582b95c895d09a70ba10fef + firstname: Teddy + surname: Middleton-Smith + email: edward.middletonsmith@gmail.com + is_email_verified: False + is_super_user: True + id_currency_default: None + id_region_default: None + is_included_VAT_default: True + can_admin_store: True + can_admin_user: True + diff --git a/app.log.2 b/app.log.2 index 1ba9ed32..9781375e 100644 --- a/app.log.2 +++ b/app.log.2 @@ -1,3 +1,28 @@ +DataStore_Base.db_procedure_execute +proc_string: CALL p_get_many_user(:a_id_user, :a_id_user_auth0, :get_all_user, :get_inactive_user, :ids_user, :ids_user_auth0, :a_debug) +args: {'a_id_user': 1, 'a_id_user_auth0': 'auth0|6582b95c895d09a70ba10fef', 'get_all_user': False, 'get_inactive_user': False, 'ids_user': 1, 'ids_user_auth0': '', 'a_debug': 0} +result: +data received +raw users: ((1, 'auth0|6582b95c895d09a70ba10fef', 'Teddy', 'Middleton-Smith', 'edward.middletonsmith@gmail.com', b'\x00', None, None, b'\x01', b'\x01', b'\x01', b'\x01', b'\x00'),) +raw errors: () +new result set: () +model_view_base init end - model.user: + id_user: 1 + id_user_auth0: auth0|6582b95c895d09a70ba10fef + firstname: Teddy + surname: Middleton-Smith + email: edward.middletonsmith@gmail.com + is_email_verified: False + is_super_user: True + id_currency_default: None + id_region_default: None + is_included_VAT_default: True + can_admin_store: True + can_admin_user: True + +Model_View_Admin.__init__ +starting +session: DataStore_Base.get_user_session User.from_json json: {'can_admin_store': True, 'can_admin_user': True, 'email': 'edward.middletonsmith@gmail.com', 'firstname': 'Teddy', 'id_currency_default': None, 'id_region_default': None, 'id_user': 1, 'id_user_auth0': 'auth0|6582b95c895d09a70ba10fef', 'is_email_verified': False, 'is_included_VAT_default': True, 'is_super_user': True, 'surname': 'Middleton-Smith'} @@ -36,109 +61,12 @@ executing p_get_many_user DataStore_Base.db_procedure_execute proc_string: CALL p_get_many_user(:a_id_user, :a_id_user_auth0, :get_all_user, :get_inactive_user, :ids_user, :ids_user_auth0, :a_debug) args: {'a_id_user': 1, 'a_id_user_auth0': 'auth0|6582b95c895d09a70ba10fef', 'get_all_user': False, 'get_inactive_user': False, 'ids_user': 1, 'ids_user_auth0': '', 'a_debug': 0} -result: +result: data received raw users: ((1, 'auth0|6582b95c895d09a70ba10fef', 'Teddy', 'Middleton-Smith', 'edward.middletonsmith@gmail.com', b'\x00', None, None, b'\x01', b'\x01', b'\x01', b'\x01', b'\x00'),) raw errors: () new result set: () -argument_dict: {'a_id_user': 1, 'a_get_all_product_category': True, 'a_get_inactive_product_category': False, 'a_ids_product_category': '', 'a_get_all_product': True, 'a_get_inactive_product': False, 'a_ids_product': '', 'a_get_all_permutation': True, 'a_get_inactive_permutation': False, 'a_ids_permutation': '', 'a_get_all_image': False, 'a_get_inactive_image': False, 'a_ids_image': '', 'a_get_products_quantity_stock_below_min': False, 'a_debug': 0} -executing p_shop_get_many_product -DataStore_Base.db_procedure_execute -proc_string: CALL p_shop_get_many_product(:a_id_user, :a_get_all_product_category, :a_get_inactive_product_category, :a_ids_product_category, :a_get_all_product, :a_get_inactive_product, :a_ids_product, :a_get_all_permutation, :a_get_inactive_permutation, :a_ids_permutation, :a_get_all_image, :a_get_inactive_image, :a_ids_image, :a_get_products_quantity_stock_below_min, :a_debug) -args: {'a_id_user': 1, 'a_get_all_product_category': True, 'a_get_inactive_product_category': False, 'a_ids_product_category': '', 'a_get_all_product': True, 'a_get_inactive_product': False, 'a_ids_product': '', 'a_get_all_permutation': True, 'a_get_inactive_permutation': False, 'a_ids_permutation': '', 'a_get_all_image': False, 'a_get_inactive_image': False, 'a_ids_image': '', 'a_get_products_quantity_stock_below_min': False, 'a_debug': 0} -result: -data received -initial category_list: categories: [] -raw categories: ((4, 'CHOCOLATE', 'Chocolates and sweets', 'Confectionery', 1, 'View', 1, b'\x01', None, None, None),) -new_category: - id: 4 - code: CHOCOLATE - name: Chocolates and sweets - description: Confectionery - access_level: View - display_order: 1 - active: True - products: [] - -category-loaded category_list: categories: [ - id: 4 - code: CHOCOLATE - name: Chocolates and sweets - description: Confectionery - access_level: View - display_order: 1 - active: True - products: [] - ] -raw products: ((6, 4, 'Digestives', b'\x01', 1, 'View', b'\x01', 1, None, None, None),) -row: (6, 4, 'Digestives', b'\x01', 1, 'View', b'\x01', 1, None, None, None) -new_product: Product - id_product: 6 - id_category: 4 - name: Digestives - display_order: 1 - can_view: False - can_edit: False - can_admin: False - has_variations: True - permutations: [] - variation trees: [] - active: True - -raw errors: () -product with id:6 has variations -new result set: () -get many category_list: categories: [ - id: 4 - code: CHOCOLATE - name: Chocolates and sweets - description: Confectionery - access_level: View - display_order: 1 - active: True - products: [Product - id_product: 6 - id_category: 4 - name: Digestives - display_order: 1 - can_view: False - can_edit: False - can_admin: False - has_variations: True - permutations: [] - variation trees: [] - active: True - ] - ] -category filters: [ - id: 4 - code: CHOCOLATE - name: Chocolates and sweets - description: Confectionery - access_level: View - display_order: 1 - active: True - products: [Product - id_product: 6 - id_category: 4 - name: Digestives - display_order: 1 - can_view: False - can_edit: False - can_admin: False - has_variations: True - permutations: [] - variation trees: [] - active: True - ] - ] -category options: [('', ''), ('4', 'Chocolates and sweets')] -product options: [{'value': 6, 'text': 'Digestives', 'id_category': 4}] -DataStore_Store_Base.get_many_product_variation -DataStore_Base.get_user_session -User.from_json -json: {'can_admin_store': True, 'can_admin_user': True, 'email': 'edward.middletonsmith@gmail.com', 'firstname': 'Teddy', 'id_currency_default': None, 'id_region_default': None, 'id_user': 1, 'id_user_auth0': 'auth0|6582b95c895d09a70ba10fef', 'is_email_verified': False, 'is_included_VAT_default': True, 'is_super_user': True, 'surname': 'Middleton-Smith'} -user: +model_view_base init end - model.user: id_user: 1 id_user_auth0: auth0|6582b95c895d09a70ba10fef firstname: Teddy @@ -152,32 +80,5 @@ user: can_admin_store: True can_admin_user: True -User.from_json -json: {'can_admin_store': True, 'can_admin_user': True, 'email': 'edward.middletonsmith@gmail.com', 'firstname': 'Teddy', 'id_currency_default': None, 'id_region_default': None, 'id_user': 1, 'id_user_auth0': 'auth0|6582b95c895d09a70ba10fef', 'is_email_verified': False, 'is_included_VAT_default': True, 'is_super_user': True, 'surname': 'Middleton-Smith'} -user: - id_user: 1 - id_user_auth0: auth0|6582b95c895d09a70ba10fef - firstname: Teddy - surname: Middleton-Smith - email: edward.middletonsmith@gmail.com - is_email_verified: False - is_super_user: True - id_currency_default: None - id_region_default: None - is_included_VAT_default: True - can_admin_store: True - can_admin_user: True - -argument_dict: {'a_id_user': 1, 'a_id_user_auth0': 'auth0|6582b95c895d09a70ba10fef', 'get_all_user': False, 'get_inactive_user': False, 'ids_user': 1, 'ids_user_auth0': '', 'a_debug': 0} -executing p_get_many_user -DataStore_Base.db_procedure_execute -proc_string: CALL p_get_many_user(:a_id_user, :a_id_user_auth0, :get_all_user, :get_inactive_user, :ids_user, :ids_user_auth0, :a_debug) -args: {'a_id_user': 1, 'a_id_user_auth0': 'auth0|6582b95c895d09a70ba10fef', 'get_all_user': False, 'get_inactive_user': False, 'ids_user': 1, 'ids_user_auth0': '', 'a_debug': 0} -result: -data received -raw users: ((1, 'auth0|6582b95c895d09a70ba10fef', 'Teddy', 'Middleton-Smith', 'edward.middletonsmith@gmail.com', b'\x00', None, None, b'\x01', b'\x01', b'\x01', b'\x01', b'\x00'),) -raw errors: () -new result set: () -DataStore_Base.db_procedure_execute -proc_string: CALL p_shop_get_many_product_variation(:a_id_user, :a_get_all_variation_type, :a_get_inactive_variation_type, :a_ids_variation_type, :a_get_all_variation, :a_get_inactive_variation, :a_ids_variation, :a_debug) -args: {'a_id_user': 1, 'a_get_all_variation_type': True, 'a_get_inactive_variation_type': False, 'a_ids_variation_type': '', 'a_get_all_variation': True, 'a_get_inactive_variation': False, 'a_ids_variation': '', 'a_debug': 0} +Model_View_Admin.__init__ +starting diff --git a/app.log.3 b/app.log.3 index 4f015eaa..051a31ff 100644 --- a/app.log.3 +++ b/app.log.3 @@ -1,409 +1,53 @@ -get many category_list: categories: [ - id: 1 - code: ASS - name: Assistive Devices - description: Braille product line and other assistive devices - access_level: View - display_order: 1 - active: False - products: [Product - id_product: 1 - id_category: 1 - name: Braille Keyboard Translator - display_order: 1 - can_view: False - can_edit: False - can_admin: False - has_variations: True - permutations: [Product_Permutation - id_permutation: 1 - id_product: 1 - id_category: 1 - description: Good Red - cost_local_VAT_excl: 5.0 - cost_local_VAT_incl: 6.0 - currency_cost: - id: 1 - name: None - code: GBP - symbol: £ - factor from GBP: None - display_order: None - active: None - - latency_manufacture: 14 - id_unit_measurement_quantity: 1 - symbol_unit_measurement_quantity: m - symbol_is_suffix_not_prefix_unit_measurement_quantity: True - name_singular_unit_measurement_quantity: metre - name_plural_unit_measurement_quantity: metres - count_unit_measurement_per_quantity_step: 1.0 - quantity_min: 3.0 - quantity_max: 99.0 - quantity_stock: 1.0 - is_subscription: False - id_unit_measurement_interval_recurrence: None - symbol_unit_measurement_interval_recurrence: None - symbol_is_suffix_not_prefix_unit_measurement_interval_recurrence: False - name_singular_unit_measurement_interval_recurrence: None - name_plural_unit_measurement_interval_recurrence: None - count_interval_recurrence: None - id_stripe_product: None - does_expire_faster_once_unsealed: False - id_unit_measurement_interval_expiration_unsealed: None - symbol_unit_measurement_interval_expiration_unsealed: None - symbol_is_suffix_not_prefix_unit_measurement_interval_expiration_unsealed: False - name_singular_unit_measurement_interval_expiration_unsealed: None - name_plural_unit_measurement_interval_expiration_unsealed: None - count_interval_expiration_unsealed: None - has_variations: True - csv_id_pairs_variation: None - can_view: False - can_edit: False - can_admin: False - variation tree: - images: [] - delivery_options: [] - prices: [] - , Product_Permutation - id_permutation: 2 - id_product: 1 - id_category: 1 - description: Good Blue - cost_local_VAT_excl: 6.0 - cost_local_VAT_incl: 7.2 - currency_cost: - id: 1 - name: None - code: GBP - symbol: £ - factor from GBP: None - display_order: None - active: None - - latency_manufacture: 14 - id_unit_measurement_quantity: 1 - symbol_unit_measurement_quantity: m - symbol_is_suffix_not_prefix_unit_measurement_quantity: True - name_singular_unit_measurement_quantity: metre - name_plural_unit_measurement_quantity: metres - count_unit_measurement_per_quantity_step: 1.0 - quantity_min: 3.0 - quantity_max: 99.0 - quantity_stock: 1.0 - is_subscription: False - id_unit_measurement_interval_recurrence: None - symbol_unit_measurement_interval_recurrence: None - symbol_is_suffix_not_prefix_unit_measurement_interval_recurrence: False - name_singular_unit_measurement_interval_recurrence: None - name_plural_unit_measurement_interval_recurrence: None - count_interval_recurrence: None - id_stripe_product: None - does_expire_faster_once_unsealed: False - id_unit_measurement_interval_expiration_unsealed: None - symbol_unit_measurement_interval_expiration_unsealed: None - symbol_is_suffix_not_prefix_unit_measurement_interval_expiration_unsealed: False - name_singular_unit_measurement_interval_expiration_unsealed: None - name_plural_unit_measurement_interval_expiration_unsealed: None - count_interval_expiration_unsealed: None - has_variations: True - csv_id_pairs_variation: None - can_view: False - can_edit: False - can_admin: False - variation tree: - images: [] - delivery_options: [] - prices: [] - ] - variation trees: [, ] - active: False - ] - , - id: 4 - code: CHOCOLATE - name: Chocolates and sweets - description: Confectionery - access_level: View - display_order: 1 - active: True - products: [Product - id_product: 6 - id_category: 4 - name: Digestives - display_order: 1 - can_view: False - can_edit: False - can_admin: False - has_variations: True - permutations: [] - variation trees: [] +{1: {'NAME_ATTR_OPTION_TEXT': 'name_singular', 'NAME_ATTR_OPTION_VALUE': 'id_unit_measurement', 'id_unit_measurement': 1, 'name_singular': 'metre', 'name_plural': 'metres', 'symbol': 'm', 'symbol_is_suffix_not_prefix': True, 'is_base_unit': True, 'is_unit_of_distance': True, 'is_unit_of_mass': False, 'is_unit_of_time': False, 'is_unit_of_volume': False, 'active': True}, 2: {'NAME_ATTR_OPTION_TEXT': 'name_singular', 'NAME_ATTR_OPTION_VALUE': 'id_unit_measurement', 'id_unit_measurement': 2, 'name_singular': 'millimetre', 'name_plural': 'millimetres', 'symbol': 'mm', 'symbol_is_suffix_not_prefix': True, 'is_base_unit': False, 'is_unit_of_distance': True, 'is_unit_of_mass': False, 'is_unit_of_time': False, 'is_unit_of_volume': False, 'active': True}, 3: {'NAME_ATTR_OPTION_TEXT': 'name_singular', 'NAME_ATTR_OPTION_VALUE': 'id_unit_measurement', 'id_unit_measurement': 3, 'name_singular': 'kilogram', 'name_plural': 'kilograms', 'symbol': 'kg', 'symbol_is_suffix_not_prefix': True, 'is_base_unit': True, 'is_unit_of_distance': False, 'is_unit_of_mass': True, 'is_unit_of_time': False, 'is_unit_of_volume': False, 'active': True}, 4: {'NAME_ATTR_OPTION_TEXT': 'name_singular', 'NAME_ATTR_OPTION_VALUE': 'id_unit_measurement', 'id_unit_measurement': 4, 'name_singular': 'gram', 'name_plural': 'grams', 'symbol': 'g', 'symbol_is_suffix_not_prefix': True, 'is_base_unit': False, 'is_unit_of_distance': False, 'is_unit_of_mass': True, 'is_unit_of_time': False, 'is_unit_of_volume': False, 'active': True}, 5: {'NAME_ATTR_OPTION_TEXT': 'name_singular', 'NAME_ATTR_OPTION_VALUE': 'id_unit_measurement', 'id_unit_measurement': 5, 'name_singular': 'litre', 'name_plural': 'litres', 'symbol': 'L', 'symbol_is_suffix_not_prefix': True, 'is_base_unit': False, 'is_unit_of_distance': False, 'is_unit_of_mass': False, 'is_unit_of_time': False, 'is_unit_of_volume': True, 'active': True}, 6: {'NAME_ATTR_OPTION_TEXT': 'name_singular', 'NAME_ATTR_OPTION_VALUE': 'id_unit_measurement', 'id_unit_measurement': 6, 'name_singular': 'millilitre', 'name_plural': 'millilitres', 'symbol': 'mL', 'symbol_is_suffix_not_prefix': True, 'is_base_unit': False, 'is_unit_of_distance': False, 'is_unit_of_mass': False, 'is_unit_of_time': False, 'is_unit_of_volume': True, 'active': True}, 7: {'NAME_ATTR_OPTION_TEXT': 'name_singular', 'NAME_ATTR_OPTION_VALUE': 'id_unit_measurement', 'id_unit_measurement': 7, 'name_singular': 'item', 'name_plural': 'items', 'symbol': 'x', 'symbol_is_suffix_not_prefix': True, 'is_base_unit': False, 'is_unit_of_distance': False, 'is_unit_of_mass': False, 'is_unit_of_time': False, 'is_unit_of_volume': False, 'active': True}, 8: {'NAME_ATTR_OPTION_TEXT': 'name_singular', 'NAME_ATTR_OPTION_VALUE': 'id_unit_measurement', 'id_unit_measurement': 8, 'name_singular': 'hour', 'name_plural': 'hours', 'symbol': 'h', 'symbol_is_suffix_not_prefix': True, 'is_base_unit': True, 'is_unit_of_distance': False, 'is_unit_of_mass': False, 'is_unit_of_time': True, 'is_unit_of_volume': False, 'active': True}, 9: {'NAME_ATTR_OPTION_TEXT': 'name_singular', 'NAME_ATTR_OPTION_VALUE': 'id_unit_measurement', 'id_unit_measurement': 9, 'name_singular': 'day', 'name_plural': 'days', 'symbol': 'd', 'symbol_is_suffix_not_prefix': True, 'is_base_unit': False, 'is_unit_of_distance': False, 'is_unit_of_mass': False, 'is_unit_of_time': True, 'is_unit_of_volume': False, 'active': True}} +{8: {'NAME_ATTR_OPTION_TEXT': 'name_singular', 'NAME_ATTR_OPTION_VALUE': 'id_unit_measurement', 'id_unit_measurement': 8, 'name_singular': 'hour', 'name_plural': 'hours', 'symbol': 'h', 'symbol_is_suffix_not_prefix': True, 'is_base_unit': True, 'is_unit_of_distance': False, 'is_unit_of_mass': False, 'is_unit_of_time': True, 'is_unit_of_volume': False, 'active': True}, 9: {'NAME_ATTR_OPTION_TEXT': 'name_singular', 'NAME_ATTR_OPTION_VALUE': 'id_unit_measurement', 'id_unit_measurement': 9, 'name_singular': 'day', 'name_plural': 'days', 'symbol': 'd', 'symbol_is_suffix_not_prefix': True, 'is_base_unit': False, 'is_unit_of_distance': False, 'is_unit_of_mass': False, 'is_unit_of_time': True, 'is_unit_of_volume': False, 'active': True}} +Product_Variation_Tree.to_preview_str +variation_types: [ + Product_Variation_Type + id_type: 2 + code: SIZE + name_singular: Size + name_plural: Sizes + display_order: 2 active: True ] - , - id: 3 - code: TECH - name: Technology - description: Technological devices - access_level: View - display_order: 2 - active: False - products: [Product - id_product: 3 - id_category: 3 - name: Phone - display_order: 2 - can_view: False - can_edit: False - can_admin: False - has_variations: False - permutations: [Product_Permutation - id_permutation: 4 - id_product: 3 - id_category: 3 - description: Phone describes good - cost_local_VAT_excl: 10.0 - cost_local_VAT_incl: 12.0 - currency_cost: - id: 1 - name: None - code: GBP - symbol: £ - factor from GBP: None - display_order: None - active: None +preview_str: Size: 400 grams + +{'NAME_ATTR_OPTION_TEXT': 'name_singular', 'NAME_ATTR_OPTION_VALUE': 'id_unit_measurement', 'id_unit_measurement': 7, 'name_singular': 'item', 'name_plural': 'items', 'symbol': 'x', 'symbol_is_suffix_not_prefix': True, 'is_base_unit': False, 'is_unit_of_distance': False, 'is_unit_of_mass': False, 'is_unit_of_time': False, 'is_unit_of_volume': False, 'active': True} +Model_View_Store.__init__ +starting +session: +DataStore_Base.get_user_session +User.from_json +json: {'can_admin_store': True, 'can_admin_user': True, 'email': 'edward.middletonsmith@gmail.com', 'firstname': 'Teddy', 'id_currency_default': None, 'id_region_default': None, 'id_user': 1, 'id_user_auth0': 'auth0|6582b95c895d09a70ba10fef', 'is_email_verified': False, 'is_included_VAT_default': True, 'is_super_user': True, 'surname': 'Middleton-Smith'} +user: + id_user: 1 + id_user_auth0: auth0|6582b95c895d09a70ba10fef + firstname: Teddy + surname: Middleton-Smith + email: edward.middletonsmith@gmail.com + is_email_verified: False + is_super_user: True + id_currency_default: None + id_region_default: None + is_included_VAT_default: True + can_admin_store: True + can_admin_user: True - latency_manufacture: 14 - id_unit_measurement_quantity: 1 - symbol_unit_measurement_quantity: m - symbol_is_suffix_not_prefix_unit_measurement_quantity: True - name_singular_unit_measurement_quantity: metre - name_plural_unit_measurement_quantity: metres - count_unit_measurement_per_quantity_step: 1.0 - quantity_min: 2.0 - quantity_max: 99.0 - quantity_stock: 1.0 - is_subscription: False - id_unit_measurement_interval_recurrence: None - symbol_unit_measurement_interval_recurrence: None - symbol_is_suffix_not_prefix_unit_measurement_interval_recurrence: False - name_singular_unit_measurement_interval_recurrence: None - name_plural_unit_measurement_interval_recurrence: None - count_interval_recurrence: None - id_stripe_product: None - does_expire_faster_once_unsealed: False - id_unit_measurement_interval_expiration_unsealed: None - symbol_unit_measurement_interval_expiration_unsealed: None - symbol_is_suffix_not_prefix_unit_measurement_interval_expiration_unsealed: False - name_singular_unit_measurement_interval_expiration_unsealed: None - name_plural_unit_measurement_interval_expiration_unsealed: None - count_interval_expiration_unsealed: None - has_variations: False - csv_id_pairs_variation: None - can_view: False - can_edit: False - can_admin: False - variation tree: None - images: [] - delivery_options: [] - prices: [] - ] - variation trees: [] - active: False - , Product - id_product: 4 - id_category: 3 - name: Laptop - display_order: 2 - can_view: False - can_edit: False - can_admin: False - has_variations: False - permutations: [Product_Permutation - id_permutation: 5 - id_product: 4 - id_category: 3 - description: Laptop describes good - cost_local_VAT_excl: 10.0 - cost_local_VAT_incl: 12.0 - currency_cost: - id: 1 - name: None - code: GBP - symbol: £ - factor from GBP: None - display_order: None - active: None +User.from_json +json: {'can_admin_store': True, 'can_admin_user': True, 'email': 'edward.middletonsmith@gmail.com', 'firstname': 'Teddy', 'id_currency_default': None, 'id_region_default': None, 'id_user': 1, 'id_user_auth0': 'auth0|6582b95c895d09a70ba10fef', 'is_email_verified': False, 'is_included_VAT_default': True, 'is_super_user': True, 'surname': 'Middleton-Smith'} +user: + id_user: 1 + id_user_auth0: auth0|6582b95c895d09a70ba10fef + firstname: Teddy + surname: Middleton-Smith + email: edward.middletonsmith@gmail.com + is_email_verified: False + is_super_user: True + id_currency_default: None + id_region_default: None + is_included_VAT_default: True + can_admin_store: True + can_admin_user: True - latency_manufacture: 14 - id_unit_measurement_quantity: 1 - symbol_unit_measurement_quantity: m - symbol_is_suffix_not_prefix_unit_measurement_quantity: True - name_singular_unit_measurement_quantity: metre - name_plural_unit_measurement_quantity: metres - count_unit_measurement_per_quantity_step: 1.0 - quantity_min: 2.0 - quantity_max: 99.0 - quantity_stock: 1.0 - is_subscription: False - id_unit_measurement_interval_recurrence: None - symbol_unit_measurement_interval_recurrence: None - symbol_is_suffix_not_prefix_unit_measurement_interval_recurrence: False - name_singular_unit_measurement_interval_recurrence: None - name_plural_unit_measurement_interval_recurrence: None - count_interval_recurrence: None - id_stripe_product: None - does_expire_faster_once_unsealed: False - id_unit_measurement_interval_expiration_unsealed: None - symbol_unit_measurement_interval_expiration_unsealed: None - symbol_is_suffix_not_prefix_unit_measurement_interval_expiration_unsealed: False - name_singular_unit_measurement_interval_expiration_unsealed: None - name_plural_unit_measurement_interval_expiration_unsealed: None - count_interval_expiration_unsealed: None - has_variations: False - csv_id_pairs_variation: None - can_view: False - can_edit: False - can_admin: False - variation tree: None - images: [] - delivery_options: [] - prices: [] - ] - variation trees: [] - active: False - , Product - id_product: 5 - id_category: 3 - name: Smart Watch - display_order: 2 - can_view: False - can_edit: False - can_admin: False - has_variations: False - permutations: [Product_Permutation - id_permutation: 6 - id_product: 5 - id_category: 3 - description: Smart watch describes good - cost_local_VAT_excl: 10.0 - cost_local_VAT_incl: 12.0 - currency_cost: - id: 1 - name: None - code: GBP - symbol: £ - factor from GBP: None - display_order: None - active: None - - latency_manufacture: 14 - id_unit_measurement_quantity: 1 - symbol_unit_measurement_quantity: m - symbol_is_suffix_not_prefix_unit_measurement_quantity: True - name_singular_unit_measurement_quantity: metre - name_plural_unit_measurement_quantity: metres - count_unit_measurement_per_quantity_step: 1.0 - quantity_min: 2.0 - quantity_max: 99.0 - quantity_stock: 1.0 - is_subscription: False - id_unit_measurement_interval_recurrence: None - symbol_unit_measurement_interval_recurrence: None - symbol_is_suffix_not_prefix_unit_measurement_interval_recurrence: False - name_singular_unit_measurement_interval_recurrence: None - name_plural_unit_measurement_interval_recurrence: None - count_interval_recurrence: None - id_stripe_product: None - does_expire_faster_once_unsealed: False - id_unit_measurement_interval_expiration_unsealed: None - symbol_unit_measurement_interval_expiration_unsealed: None - symbol_is_suffix_not_prefix_unit_measurement_interval_expiration_unsealed: False - name_singular_unit_measurement_interval_expiration_unsealed: None - name_plural_unit_measurement_interval_expiration_unsealed: None - count_interval_expiration_unsealed: None - has_variations: False - csv_id_pairs_variation: None - can_view: False - can_edit: False - can_admin: False - variation tree: None - images: [] - delivery_options: [] - prices: [] - ] - variation trees: [] - active: False - ] - , - id: 2 - code: MISC - name: Miscellaneous - description: Not category allocated products - access_level: View - display_order: 99 - active: False - products: [Product - id_product: 2 - id_category: 2 - name: Test product 1 - display_order: 99 - can_view: False - can_edit: False - can_admin: False - has_variations: False - permutations: [Product_Permutation - id_permutation: 3 - id_product: 2 - id_category: 2 - description: Test product describes good - cost_local_VAT_excl: 10.0 - cost_local_VAT_incl: 12.0 - currency_cost: - id: 1 - name: None - code: GBP - symbol: £ - factor from GBP: None - display_order: None - active: None - - latency_manufacture: 14 - id_unit_measurement_quantity: 1 - symbol_unit_measurement_quantity: m - symbol_is_suffix_not_prefix_unit_measurement_quantity: True - name_singular_unit_measurement_quantity: metre - name_plural_unit_measurement_quantity: metres - count_unit_measurement_per_quantity_step: 1.0 - quantity_min: 2.0 - quantity_max: 99.0 - quantity_stock: 1.0 - is_subscription: False - id_unit_measurement_interval_recurrence: None - symbol_unit_measurement_interval_recurrence: None - symbol_is_suffix_not_prefix_unit_measurement_interval_recurrence: False - name_singular_unit_measurement_interval_recurrence: None - name_plural_unit_measurement_interval_recurrence: None - count_interval_recurrence: None - id_stripe_product: None - does_expire_faster_once_unsealed: False - id_unit_measurement_interval_expiration_unsealed: None - symbol_unit_measurement_interval_expiration_unsealed: None - symbol_is_suffix_not_prefix_unit_measurement_interval_expiration_unsealed: False - name_singular_unit_measurement_interval_expiration_unsealed: None - name_plural_unit_measurement_interval_expiration_unsealed: None - count_interval_expiration_unsealed: None - has_variations: False - csv_id_pairs_variation: None - can_view: False - can_edit: False - can_admin: False - variation tree: None - images: [] - delivery_options: [] - prices: [] - ] - variation trees: [] - active: False - ] - ] +argument_dict: {'a_id_user': 1, 'a_id_user_auth0': 'auth0|6582b95c895d09a70ba10fef', 'get_all_user': False, 'get_inactive_user': False, 'ids_user': 1, 'ids_user_auth0': '', 'a_debug': 0} +executing p_get_many_user diff --git a/static/MySQL/1218_tbl_Shop_Stock_Item.sql b/static/MySQL/1218_tbl_Shop_Stock_Item.sql index 810c8b0f..3751715a 100644 --- a/static/MySQL/1218_tbl_Shop_Stock_Item.sql +++ b/static/MySQL/1218_tbl_Shop_Stock_Item.sql @@ -6,33 +6,45 @@ SELECT CONCAT('WARNING: Table ', TABLE_NAME, ' already exists.') AS msg_warning FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'Shop_Stock_Item'; CREATE TABLE IF NOT EXISTS Shop_Stock_Item ( - id_stock INT NOT NULL AUTO_INCREMENT PRIMARY KEY, - id_permutation INT NOT NULL, - CONSTRAINT FK_Shop_Stock_Item_id_permutation + id_stock INT NOT NULL AUTO_INCREMENT PRIMARY KEY + , id_permutation INT NOT NULL + , CONSTRAINT FK_Shop_Stock_Item_id_permutation FOREIGN KEY (id_permutation) - REFERENCES Shop_Product_Permutation(id_permutation), - date_purchased DATETIME NOT NULL, - date_received DATETIME NULL, - id_location_storage INT NOT NULL, - CONSTRAINT FK_Shop_Stock_Item_id_location_storage + REFERENCES partsltd_prod.Shop_Product_Permutation(id_permutation) + , id_supplier_purchase_order INT + , CONSTRAINT FK_Shop_Stock_Item_id_supplier_purchase_order + FOREIGN KEY (id_supplier_purchase_order) + REFERENCES partsltd_prod.Shop_Supplier_Purchase_Order(id_order) + , id_manufacturing_purchase_order INT + , CONSTRAINT FK_Shop_Stock_Item_id_manufacturing_purchase_order + FOREIGN KEY (id_manufacturing_purchase_order) + REFERENCES partsltd_prod.Shop_Manufacturing_Purchase_Order(id_order) + , id_customer_sales_order INT + , CONSTRAINT FK_Shop_Stock_Item_id_customer_sales_order + FOREIGN KEY (id_customer_sales_order) + REFERENCES partsltd_prod.Shop_Customer_Sales_Order(id_order) + , date_purchased DATETIME NOT NULL + , date_received DATETIME + , id_location_storage INT NOT NULL + , CONSTRAINT FK_Shop_Stock_Item_id_location_storage FOREIGN KEY (id_location_storage) - REFERENCES Shop_Storage_Location(id_location), - id_currency_cost INT NOT NULL, - CONSTRAINT FK_Shop_Stock_Item_id_currency + REFERENCES partsltd_prod.Shop_Storage_Location(id_location) + , id_currency_cost INT NOT NULL + , CONSTRAINT FK_Shop_Stock_Item_id_currency FOREIGN KEY (id_currency_cost) - REFERENCES Shop_Currency(id_currency), - cost_local_VAT_incl FLOAT NULL, - cost_local_VAT_excl FLOAT NULL, - is_sealed BIT NOT NULL DEFAULT 1, - date_unsealed DATETIME NULL, - date_expiration DATETIME NOT NULL, - is_consumed BIT NOT NULL DEFAULT 0, - date_consumed DATETIME NULL, - active BIT NOT NULL DEFAULT 1, - created_on DATETIME, - created_by INT, - id_change_set INT, - CONSTRAINT FK_Shop_Stock_Item_id_change_set + REFERENCES partsltd_prod.Shop_Currency(id_currency) + , cost_local_VAT_incl FLOAT + , cost_local_VAT_excl FLOAT + , is_sealed BIT NOT NULL DEFAULT 1 + , date_unsealed DATETIME + , date_expiration DATETIME NOT NULL + , is_consumed BIT NOT NULL DEFAULT 0 + , date_consumed DATETIME + , active BIT NOT NULL DEFAULT 1 + , created_on DATETIME + , created_by INT + , id_change_set INT + , CONSTRAINT FK_Shop_Stock_Item_id_change_set FOREIGN KEY (id_change_set) - REFERENCES Shop_Product_Change_Set(id_change_set) + REFERENCES partsltd_prod.Shop_Product_Change_Set(id_change_set) ); 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 bd3850f9..70626d08 100644 --- a/static/MySQL/7403_p_shop_save_supplier_purchase_order.sql +++ b/static/MySQL/7403_p_shop_save_supplier_purchase_order.sql @@ -95,6 +95,7 @@ BEGIN id_link INT NOT NULL PRIMARY KEY , id_order INT NOT NULL , id_permutation INT NOT NULL + , id_product INT -- , id_currency_cost INT NOT NULL , quantity_ordered FLOAT NOT NULL , id_unit_quantity INT NOT NULL @@ -109,6 +110,7 @@ BEGIN , has_order BIT NULL , is_new BIT NOT NULL , name_error VARCHAR(1000) NULL + , can_edit BIT ); CREATE TEMPORARY TABLE IF NOT EXISTS tmp_Msg_Error ( @@ -191,9 +193,11 @@ BEGIN , RANK() OVER (PARTITION BY IFNULL(IFNULL(SPOPL_T.id_order, SPOPL.id_order), 0) ORDER BY IFNULL(IFNULL(SPOPL_T.display_order, SPOPL.display_order), 0)) AS display_order , IFNULL(IFNULL(SPOPL_T.cost_total_local_VAT_excl, SPOPL.cost_total_local_VAT_excl), 0) AS cost_total_local_VAT_excl , IFNULL(IFNULL(SPOPL_T.cost_total_local_VAT_incl, SPOPL.cost_total_local_VAT_incl), 0) AS cost_total_local_VAT_incl - , IFNULL(SPOPL_T.cost_total_local_VAT_excl / SPOPL_T.quantity_ordered, SPOPL.cost_unit_local_VAT_excl) AS cost_unit_local_VAT_excl + /* + , IFNULL(SPOPL_T.cost_total_local_VAT_excl / SPOPL_T.quantity_ordered, SPOPL.cost_unit_local_VAT_excl) AS cost_unit_local_VAT_excl , IFNULL(SPOPL_T.cost_total_local_VAT_incl / SPOPL_T.quantity_ordered, SPOPL.cost_unit_local_VAT_incl) AS cost_unit_local_VAT_incl - , IFNULL(IFNULL(SPOPL_T.active, SPOPL.active), 1) AS active + */ + , IFNULL(IFNULL(SPOPL_T.active, SPOPL.active), 1) AS active , NOT ISNULL(t_SPO.id_order) AS has_order , IFNULL(SPOPL_T.id_link, 0) < 1 AS is_new FROM partsltd_prod.Shop_Supplier_Purchase_Order_Product_Link_Temp SPOPL_T @@ -203,13 +207,18 @@ BEGIN ; UPDATE tmp_Supplier_Purchase_Order_Product_Link t_SPOPL - INNER JOIN partsltd_prod.Shop_Supplier_Purchase_Order_Product_Link_Temp SPOPL_T ON t_SPOPL.id_order = SPOPL_T.id_order + LEFT JOIN partsltd_prod.Shop_Supplier_Purchase_Order_Product_Link_Temp SPOPL_T + ON t_SPOPL.id_link = SPOPL_T.id_link + AND t_SPOPL.GUID = a_guid + LEFT JOIN partsltd_prod.Shop_Supplier_Purchase_Order_Product_Link SPOPL ON t_SPOPL.id_link = SPOPL.id_link + LEFT JOIN partsltd_prod.Shop_Product_Permutation PP ON t_SPOPL.id_permutation = PP.id_permutation LEFT JOIN partsltd_prod.Shop_Product P ON SPOPL_T.id_product = P.id_product LEFT JOIN partsltd_prod.Shop_Product_Category PC ON P.id_category = PC.id_category SET - name_error = CONCAT( + t_SPOPL.id_product = IFNULL(P.id_product, SPOPL_T.id_product) + , t_SPOPL.name_error = CONCAT( CASE WHEN ISNULL(t_SPOPL.id_permutation) THEN - CASE WHEN ISNULL(SPOPL_T.id_product) THEN + CASE WHEN ISNULL(P.id_product) THEN '(No Product Permutation)' ELSE CONCAT( @@ -224,6 +233,10 @@ BEGIN , ' - x' , IFNULL(t_SPOPL.quantity_ordered, '(No Quantity)') ) + , t_SPOPL.cost_unit_local_VAT_excl = t_SPOPL.cost_total_local_VAT_excl / t_SPOPL.quantity_ordered + , t_SPOPL.cost_unit_local_VAT_incl = t_SPOPL.cost_total_local_VAT_incl / t_SPOPL.quantity_ordered + , t_SPOPL.delta_quantity_ordered = t_SPOPL.quantity_ordered - IFNULL(SPOPL.quantity_ordered, 0) + , t_SPOPL.delta_quantity_received = t_SPOPL.quantity_received - IFNULL(SPOPL.quantity_received, 0) ; INSERT INTO tmp_Supplier_Purchase_Order ( @@ -558,8 +571,37 @@ BEGIN IF a_debug = 1 THEN SELECT * from partsltd_prod.Shop_Calc_User_Temp WHERE GUID = a_guid; END IF; + + UPDATE tmp_Supplier_Purchase_Order_Product_Link t_SPOPL + INNER JOIN partsltd_prod.Shop_Calc_User_Temp CUT + ON t_SPOPL.id_product = t_SPOPL.id_product + AND CUT.GUID = a_guid + SET + t_SPOPL.can_edit = CUT.can_edit + ; - IF EXISTS (SELECT * FROM partsltd_prod.Shop_Calc_User_Temp UE_T WHERE UE_T.GUID = a_guid AND IFNULL(UE_T.can_view, 0) = 0) THEN + IF EXISTS (SELECT * FROM tmp_Supplier_Purchase_Order_Product_Link WHERE can_edit = 0) THEN + INSERT INTO tmp_Msg_Error ( + id_type + , code + , msg + ) + SELECT + v_id_type_error_no_permission + , v_code_type_error_no_permission + , CONCAT( + 'You do not permissions to edit the following Product(s): ' + , GROUP_CONCAT(P.name SEPARATOR ', ') + ) AS msg + FROM tmp_Supplier_Purchase_Order_Product_Link t_SPOPL + INNER JOIN partsltd_prod.Shop_Product P ON t_SPOPL.id_product = P.id_product + WHERE + t_SPOPL.is_new = 0 + AND t_SPOPL.can_view = 0 + ; + END IF; + + IF EXISTS (SELECT * FROM tmp_Supplier_Purchase_Order_Product_Link WHERE is_new = 0 AND can_edit = 0 LIMIT 1) THEN DELETE FROM tmp_Msg_Error; INSERT INTO tmp_Msg_Error ( @@ -571,14 +613,16 @@ BEGIN v_id_type_error_no_permission , v_code_type_error_no_permission , CONCAT( - 'You do not have view permissions for ' - , GROUP_CONCAT(name SEPARATOR ', ') + 'You are missing the following permissions with access level ' + , AL.name + , ': ' + , GROUP_CONCAT(PERM.name SEPARATOR ', ') ) AS msg - FROM partsltd_prod.Shop_Permission PERM - INNER JOIN partsltd_prod.Shop_Calc_User_Temp UE_T - ON PERM.id_permission = UE_T.id_permission - AND UE_T.GUID = a_guid - AND IFNULL(UE_T.can_view, 0) = 0 + FROM partsltd_prod.Shop_Access_Level AL + CROSS JOIN partsltd_prod.Shop_Calc_User_Temp CU_T + ON CU_T.GUID = a_guid + AND ISNULL(CU_T.id_product) + AND IFNULL(CU_T.can_edit, 0) = 0 ; END IF; diff --git a/static/dist/js/main.bundle.js b/static/dist/js/main.bundle.js index e265ee31..b403cae4 100644 --- a/static/dist/js/main.bundle.js +++ b/static/dist/js/main.bundle.js @@ -1094,17 +1094,11 @@ var BasePage = /*#__PURE__*/function () { var _this2 = this; this.hookupEventHandler("click", '.' + flagNavUserLogin, function (event, navigator) { event.stopPropagation(); - // this.router.navigateToHash(hashPageUserLogin); - /* - let dataRequest = {}; - dataRequest[flagCallback] = hashPageCurrent; - console.log('sending data to user login controller: '); - console.log(dataRequest); - */ - // let page = this; + _this2.leave(); api_API.loginUser().then(function (response) { if (response.Success) { - _this2.router.navigateToUrl(response[flagCallback], null, false); // window.app. + // this.router.navigateToUrl(response[flagCallback], null, false); // window.app. + window.location.href = response[flagCallback]; } else { DOM.alertError("Error", response.Message); } @@ -2642,18 +2636,15 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) { var changeHandler = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : function (event, element) { _this14.handleChangeNestedElementCellTable(event, element); }; - debugger; var row = DOM.getRowFromElement(element); - // row.classList.add(flagDelete); if (row.classList.contains(flagRowNew) && !DOM.hasDirtyChildrenContainer(row)) { row.parentNode.removeChild(row); } - var buttonAdd = element.cloneNode(false); // document.createElement("button"); + var buttonAdd = element.cloneNode(false); buttonAdd.classList.remove(flagInitialised); buttonAdd.classList.remove(flagDelete); buttonAdd.classList.add(flagAdd); buttonAdd.textContent = '+'; - // DOM.setElementAttributeValueCurrent(buttonAdd, false); element.replaceWith(buttonAdd); changeHandler(null, buttonAdd); this.hookupButtonsRowUndelete(selectorButtonDelete, selectorButtonUndelete, function (changeEvent, changeElement) { @@ -2681,15 +2672,11 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) { var changeHandler = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : function (event, element) { _this16.handleChangeNestedElementCellTable(event, element); }; - debugger; - // let row = DOM.getRowFromElement(element); - // row.classList.remove(flagDelete); - var buttonDelete = element.cloneNode(false); // document.createElement("button"); + var buttonDelete = element.cloneNode(false); buttonDelete.classList.remove(flagInitialised); buttonDelete.classList.remove(flagAdd); buttonDelete.classList.add(flagDelete); buttonDelete.textContent = 'x'; - // DOM.setElementAttributeValueCurrent(buttonDelete, true); element.replaceWith(buttonDelete); changeHandler(null, buttonDelete); this.hookupButtonsRowDelete(selectorButtonDelete, selectorButtonUndelete, function (changeEvent, changeElement) { diff --git a/static/js/pages/base.js b/static/js/pages/base.js index a77377c9..c8b6097f 100644 --- a/static/js/pages/base.js +++ b/static/js/pages/base.js @@ -114,18 +114,12 @@ export default class BasePage { hookupButtonsNavUserLogin() { this.hookupEventHandler("click", '.' + flagNavUserLogin, (event, navigator) => { event.stopPropagation(); - // this.router.navigateToHash(hashPageUserLogin); - /* - let dataRequest = {}; - dataRequest[flagCallback] = hashPageCurrent; - console.log('sending data to user login controller: '); - console.log(dataRequest); - */ - // let page = this; + this.leave(); API.loginUser() .then((response) => { if (response.Success) { - this.router.navigateToUrl(response[flagCallback], null, false); // window.app. + // this.router.navigateToUrl(response[flagCallback], null, false); // window.app. + window.location.href = response[flagCallback]; } else { DOM.alertError("Error", response.Message); }