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

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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