fix: Public pages - Contact and Services - page load errors due to server errors and styling improvements
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -309,6 +309,7 @@ DROP PROCEDURE IF EXISTS p_shop_save_supplier;
|
||||
DROP PROCEDURE IF EXISTS p_shop_save_supplier_test;
|
||||
DROP PROCEDURE IF EXISTS p_shop_get_many_supplier;
|
||||
DROP PROCEDURE IF EXISTS p_shop_save_supplier_purchase_order;
|
||||
DROP PROCEDURE IF EXISTS p_shop_save_supplier_purchase_order_test;
|
||||
DROP PROCEDURE IF EXISTS p_shop_get_many_supplier_purchase_order;
|
||||
DROP PROCEDURE IF EXISTS p_shop_save_manufacturing_purchase_order;
|
||||
DROP PROCEDURE IF EXISTS p_shop_get_many_manufacturing_purchase_order;
|
||||
|
||||
@@ -35,9 +35,10 @@ END //
|
||||
|
||||
DELIMITER ;
|
||||
|
||||
|
||||
/*
|
||||
SELECT
|
||||
fn_shop_get_product_permutation_name(
|
||||
3 -- id_product_permutation
|
||||
)
|
||||
;
|
||||
;
|
||||
*/
|
||||
@@ -441,17 +441,17 @@ BEGIN
|
||||
WHERE ISNULL(t_P.can_view)
|
||||
);
|
||||
|
||||
DELETE
|
||||
DELETE t_C
|
||||
FROM tmp_Category_calc t_C
|
||||
WHERE FIND_IN_SET(t_C.id_category, v_ids_category_invalid) > 0
|
||||
;
|
||||
|
||||
DELETE
|
||||
DELETE t_P
|
||||
FROM tmp_Product_calc t_P
|
||||
WHERE FIND_IN_SET(t_P.id_product, v_ids_product_invalid) > 0
|
||||
;
|
||||
|
||||
DELETE
|
||||
DELETE t_PP
|
||||
FROM tmp_Permutation_calc t_PP
|
||||
WHERE FIND_IN_SET(t_PP.id_product, v_ids_product_invalid) > 0
|
||||
;
|
||||
|
||||
@@ -412,7 +412,7 @@ BEGIN
|
||||
SELECT *
|
||||
FROM tmp_Shop_Product t_P
|
||||
WHERE
|
||||
/*(
|
||||
*(
|
||||
a_get_all_category
|
||||
OR a_get_all_product
|
||||
OR a_get_all_product_permutation
|
||||
@@ -628,7 +628,7 @@ BEGIN
|
||||
-- select * from Shop_Calc_User_Temp;
|
||||
-- select * from tmp_Shop_Product;
|
||||
|
||||
DELETE -- t_P
|
||||
DELETE t_P
|
||||
FROM tmp_Shop_Product t_P
|
||||
WHERE
|
||||
FIND_IN_SET(t_P.id_product, (SELECT GROUP_CONCAT(UET.id_product SEPARATOR ',') FROM Shop_Calc_User_Temp UET)) = 0 # id_product NOT LIKE CONCAT('%', (SELECT GROUP_CONCAT(id_product SEPARATOR '|') FROM Shop_Calc_User_Temp), '%');
|
||||
|
||||
@@ -379,7 +379,7 @@ BEGIN
|
||||
-- String product id, permutation id, quantity list
|
||||
IF NOT EXISTS (SELECT * FROM tmp_Shop_Basket WHERE active LIMIT 1) AND NOT EXISTS (SELECT msg FROM tmp_Msg_Error WHERE guid = v_guid LIMIT 1) THEN -- NOT v_has_filter_user AND
|
||||
# Get product ids
|
||||
CALL p_split(a_guid, a_ids_permutation_basket, ',');
|
||||
CALL p_split(v_guid, a_ids_permutation_basket, ',');
|
||||
INSERT INTO tmp_Shop_Product (
|
||||
id_product, id_permutation, display_order
|
||||
)
|
||||
@@ -397,7 +397,7 @@ BEGIN
|
||||
DROP TABLE Split_Temp;
|
||||
|
||||
# Get product quantities
|
||||
CALL p_split(a_guid, a_quantities_permutation_basket, ',');
|
||||
CALL p_split(v_guid, a_quantities_permutation_basket, ',');
|
||||
INSERT INTO tmp_Shop_Quantity (
|
||||
quantity, display_order
|
||||
)
|
||||
|
||||
@@ -67,7 +67,7 @@ BEGIN
|
||||
|
||||
-- Suppliers
|
||||
IF v_has_filter_supplier = 1 THEN
|
||||
CALL partsltd_prod.p_split(a_guid, a_ids_supplier, ',', a_debug);
|
||||
CALL partsltd_prod.p_split(v_guid, a_ids_supplier, ',', a_debug);
|
||||
|
||||
INSERT INTO tmp_Split (
|
||||
substring
|
||||
@@ -78,12 +78,12 @@ BEGIN
|
||||
, CONVERT(substring, DECIMAL(10,0)) AS as_int
|
||||
FROM partsltd_prod.Split_Temp
|
||||
WHERE 1=1
|
||||
AND GUID = a_guid
|
||||
AND GUID = v_guid
|
||||
AND NOT ISNULL(substring)
|
||||
AND substring != ''
|
||||
;
|
||||
|
||||
CALL partsltd_prod.p_clear_split_temp( a_guid );
|
||||
CALL partsltd_prod.p_clear_split_temp( v_guid );
|
||||
END IF;
|
||||
|
||||
IF NOT EXISTS (SELECT * FROM tmp_Msg_Error LIMIT 1) THEN
|
||||
|
||||
@@ -1,740 +0,0 @@
|
||||
|
||||
|
||||
|
||||
|
||||
-- Clear previous proc
|
||||
DROP PROCEDURE IF EXISTS p_shop_save_supplier_purchase_order;
|
||||
|
||||
DROP TABLE IF EXISTS tmp_Supplier_Purchase_Order_Product_Link;
|
||||
DROP TABLE IF EXISTS tmp_Msg_Error;
|
||||
|
||||
DELIMITER //
|
||||
CREATE PROCEDURE p_shop_save_supplier_purchase_order (
|
||||
IN a_comment VARCHAR(500)
|
||||
, IN a_guid BINARY(36)
|
||||
, IN a_id_user INT
|
||||
, IN a_debug BIT
|
||||
)
|
||||
BEGIN
|
||||
DECLARE v_code_type_error_bad_data VARCHAR(50);
|
||||
DECLARE v_code_type_error_no_permission VARCHAR(50);
|
||||
DECLARE v_code_type_error_warning VARCHAR(50);
|
||||
DECLARE v_id_access_level_edit INT;
|
||||
DECLARE v_id_change_set INT;
|
||||
DECLARE v_id_permission_supplier_purchase_order VARCHAR(100);
|
||||
DECLARE v_id_type_error_bad_data INT;
|
||||
DECLARE v_id_type_error_no_permission INT;
|
||||
DECLARE v_id_type_error_warning INT;
|
||||
DECLARE v_ids_product_permission TEXT;
|
||||
DECLARE v_time_start TIMESTAMP(6);
|
||||
|
||||
DECLARE exit handler for SQLEXCEPTION
|
||||
BEGIN
|
||||
GET DIAGNOSTICS CONDITION 1
|
||||
@sqlstate = RETURNED_SQLSTATE
|
||||
, @errno = MYSQL_ERRNO
|
||||
, @text = MESSAGE_TEXT
|
||||
;
|
||||
|
||||
ROLLBACK;
|
||||
|
||||
CREATE TEMPORARY TABLE IF NOT EXISTS tmp_Msg_Error (
|
||||
display_order INT NOT NULL PRIMARY KEY AUTO_INCREMENT
|
||||
, id_type INT NULL
|
||||
, code VARCHAR(50) NOT NULL
|
||||
, msg VARCHAR(4000) NOT NULL
|
||||
);
|
||||
INSERT INTO tmp_Msg_Error (
|
||||
id_type
|
||||
, code
|
||||
, msg
|
||||
)
|
||||
SELECT
|
||||
NULL
|
||||
, @errno
|
||||
, @text
|
||||
;
|
||||
SELECT *
|
||||
FROM tmp_Msg_Error;
|
||||
DROP TABLE IF EXISTS tmp_Msg_Error;
|
||||
END;
|
||||
|
||||
SET v_time_start := CURRENT_TIMESTAMP(6);
|
||||
SET v_code_type_error_bad_data := (SELECT code FROM partsltd_prod.Shop_Msg_Error_Type WHERE code = 'BAD_DATA');
|
||||
SET v_id_type_error_bad_data := (SELECT id_type FROM partsltd_prod.Shop_Msg_Error_Type WHERE code = v_code_type_error_bad_data);
|
||||
SET v_code_type_error_no_permission := (SELECT code FROM partsltd_prod.Shop_Msg_Error_Type WHERE code = 'NO_PERMISSION');
|
||||
SET v_id_type_error_no_permission := (SELECT id_type FROM partsltd_prod.Shop_Msg_Error_Type WHERE code = v_code_type_error_no_permission);
|
||||
SET v_code_type_error_warning := (SELECT code FROM partsltd_prod.Shop_Msg_Error_Type WHERE code = 'WARNING');
|
||||
SET v_id_type_error_warning := (SELECT id_type FROM partsltd_prod.Shop_Msg_Error_Type WHERE code = v_code_type_error_warning);
|
||||
SET v_id_permission_supplier_purchase_order := (SELECT GROUP_CONCAT(id_permission SEPARATOR ',') FROM partsltd_prod.Shop_Permission WHERE code IN ('STORE_SUPPLIER', 'STORE_SUPPLIER_PURCHASE_ORDER', 'STORE_PRODUCT') LIMIT 1);
|
||||
SET v_id_access_level_edit := (SELECT id_access_level FROM partsltd_prod.Shop_Access_Level WHERE code = 'EDIT' LIMIT 1);
|
||||
|
||||
CALL p_validate_guid ( a_guid );
|
||||
SET a_comment := TRIM(IFNULL(a_comment, ''));
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp_Supplier;
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp_Msg_Error;
|
||||
|
||||
-- Temporary tables
|
||||
CREATE TEMPORARY TABLE tmp_Supplier_Purchase_Order (
|
||||
id_order INT NOT NULL PRIMARY KEY
|
||||
, id_supplier_ordered INT NOT NULL
|
||||
, id_currency_cost INT NOT NULL
|
||||
-- , cost_total_local FLOAT NOT NULL
|
||||
, active BIT NOT NULL
|
||||
);
|
||||
|
||||
CREATE TEMPORARY TABLE tmp_Supplier_Purchase_Order_Product_Link (
|
||||
id_link INT NOT NULL PRIMARY KEY
|
||||
, id_order INT NOT NULL
|
||||
, id_permutation INT NOT NULL
|
||||
-- , id_currency_cost INT NOT NULL
|
||||
, quantity_ordered FLOAT NOT NULL
|
||||
, id_unit_quantity INT NOT NULL
|
||||
, quantity_received FLOAT NULL
|
||||
, latency_delivery_days INT NOT NULL
|
||||
, display_order INT NOT NULL
|
||||
, active BIT NOT NULL
|
||||
, name_error VARCHAR(200) NOT NULL
|
||||
, cost_total_local_VAT_excl FLOAT NOT NULL
|
||||
, cost_total_local_VAT_incl FLOAT NOT NULL
|
||||
, cost_unit_local_VAT_excl FLOAT NOT NULL
|
||||
, cost_unit_local_VAT_incl FLOAT NOT NULL
|
||||
, has_order BIT NULL
|
||||
);
|
||||
|
||||
CREATE TEMPORARY TABLE IF NOT EXISTS tmp_Msg_Error (
|
||||
display_order INT NOT NULL PRIMARY KEY AUTO_INCREMENT
|
||||
, id_type INT NOT NULL
|
||||
, code VARCHAR(50) NOT NULL
|
||||
, msg VARCHAR(4000) NOT NULL
|
||||
);
|
||||
|
||||
INSERT INTO tmp_Supplier_Purchase_Order (
|
||||
id_order
|
||||
, id_supplier_ordered
|
||||
, id_currency_cost
|
||||
)
|
||||
SELECT
|
||||
SPO_T.id_order
|
||||
, IFNULL(IFNULL(SPO_T.id_supplier_ordered, SPO.id_supplier_ordered), 0) AS id_supplier_ordered
|
||||
, IFNULL(IFNULL(SPO_T.id_currency_cost, SPO.id_currency_cost), 0) AS id_currency_cost
|
||||
FROM partsltd_prod.Shop_Supplier_Purchase_Order_Temp SPO_T
|
||||
LEFT JOIN partsltd_prod.Shop_Supplier_Purchase_Order SPO ON SPO_T.id_order = SPO.id_order
|
||||
WHERE SPO_T.GUID = a_guid
|
||||
;
|
||||
|
||||
INSERT INTO tmp_Supplier_Purchase_Order_Product_Link (
|
||||
id_link
|
||||
, id_order
|
||||
, id_permutation
|
||||
-- , id_currency_cost
|
||||
, id_unit_quantity
|
||||
, quantity_ordered
|
||||
, quantity_received
|
||||
, latency_delivery_days
|
||||
, display_order
|
||||
, active
|
||||
, name_error
|
||||
, is_new
|
||||
, cost_total_local_VAT_excl
|
||||
, cost_total_local_VAT_incl
|
||||
, cost_unit_local_VAT_excl
|
||||
, cost_unit_local_VAT_incl
|
||||
, has_order
|
||||
)
|
||||
SELECT
|
||||
IFNULL(SPOPL_T.id_link, 0) AS id_link
|
||||
, IFNULL(IFNULL(SPOPL_T.id_order, SPOPL.id_order), 0) AS id_order
|
||||
, IFNULL(IFNULL(SPOPL_T.id_permutation, SPOPL.id_permutation), 0) AS id_permutation
|
||||
-- , IFNULL(IFNULL(SPOPL_T.id_currency_cost, SPOPL.id_currency_cost), 0) AS id_currency_cost
|
||||
, IFNULL(IFNULL(SPOPL_T.id_unit_quantity, SPOPL.id_unit_quantity), 0) AS id_unit_quantity
|
||||
, IFNULL(IFNULL(SPOPL_T.quantity_ordered, SPOPL.quantity_ordered), 0) AS quantity_ordered
|
||||
, IFNULL(SPOPL_T.quantity_received, SPOPL.quantity_received) AS quantity_received
|
||||
, IFNULL(SPOPL_T.latency_delivery_days, SPOPL.latency_delivery_days) AS latency_delivery_days
|
||||
, 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.active, SPOPL.active), 1) AS active
|
||||
, CONCAT(
|
||||
fn_shop_get_product_permutation_name(SPOPL_T.id_permutation)
|
||||
, ' - x'
|
||||
, IFNULL(SPOPL_T.quantity_ordered, '(No Quantity)')
|
||||
) AS name_error
|
||||
, IFNULL(SPOPL_T.id_link, 0) < 1 AS is_new
|
||||
, 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_incl / SPOPL_T.quantity_ordered, SPOPL.cost_unit_local_VAT_incl) AS cost_unit_local_VAT_incl
|
||||
, NOT ISNULL(t_SPO.id_order) AS has_order
|
||||
FROM partsltd_prod.Shop_Supplier_Purchase_Order_Product_Link_Temp SPOPL_T
|
||||
LEFT JOIN partsltd_prod.Shop_Supplier_Purchase_Order_Product_Link SPOPL ON SPOPL_T.id_link = SPOPL.id_link
|
||||
LEFT JOIN tmp_Supplier_Purchase_Order t_SPO ON SPOPL_T.id_order = t_SPO.id_order
|
||||
WHERE SPOPL_T.GUID = a_guid
|
||||
;
|
||||
|
||||
INSERT INTO tmp_Supplier_Purchase_Order (
|
||||
id_order
|
||||
, id_supplier_ordered
|
||||
, id_currency_cost
|
||||
)
|
||||
SELECT
|
||||
SPO_T.id_order
|
||||
, IFNULL(IFNULL(SPO_T.id_supplier_ordered, SPO.id_supplier_ordered), 0) AS id_supplier_ordered
|
||||
, IFNULL(IFNULL(SPO_T.id_currency_cost, SPO.id_currency_cost), 0) AS id_currency_cost
|
||||
FROM partsltd_prod.Shop_Supplier_Purchase_Order SPO
|
||||
INNER JOIN tmp_Supplier_Purchase_Order_Product_Link t_SPOPL
|
||||
ON SPO.id_order = t_SPOPL.id_order
|
||||
AND t_SPOPL.has_order = 0
|
||||
;
|
||||
|
||||
-- Validation
|
||||
-- Supplier Purchase Order
|
||||
# id_order
|
||||
IF EXISTS (
|
||||
SELECT *
|
||||
FROM tmp_Supplier_Purchase_Order t_SPO
|
||||
LEFT JOIN partsltd_prod.Shop_Supplier_Purchase_Order SPO ON t_SPO.id_order = SPO.id_order
|
||||
WHERE 1=1
|
||||
AND t_SPO.id_order > 0
|
||||
AND ISNULL(SPO.id_order)
|
||||
LIMIT 1
|
||||
) THEN
|
||||
INSERT INTO tmp_Msg_Error (
|
||||
id_type
|
||||
, code
|
||||
, msg
|
||||
)
|
||||
SELECT
|
||||
v_id_type_error_bad_data
|
||||
, v_code_type_error_bad_data
|
||||
, CONCAT(
|
||||
'A valid ID is required for the following Supplier Purchase Order(s): '
|
||||
, GROUP_CONCAT(CONCAT(IFNULL(t_SPO.id_stock, '(No Supplier Purchase Order)')) SEPARATOR ', ')
|
||||
) AS msg
|
||||
FROM tmp_Stock_Item t_SPO
|
||||
LEFT JOIN partsltd_prod.Shop_Supplier_Purchase_Order SPO ON t_SPO.id_order = SPO.id_order
|
||||
WHERE 1=1
|
||||
AND t_SPO.id_stock > 0
|
||||
AND ISNULL(SPO.id_stock)
|
||||
;
|
||||
END IF;
|
||||
# id_supplier_ordered
|
||||
IF EXISTS (
|
||||
SELECT *
|
||||
FROM tmp_Supplier_Purchase_Order t_SPO
|
||||
LEFT JOIN partsltd_prod.Shop_Supplier S ON t_SPO.id_supplier_ordered = S.id_supplier
|
||||
WHERE 1=1
|
||||
AND (
|
||||
ISNULL(S.id_supplier)
|
||||
OR S.active = 0
|
||||
)
|
||||
LIMIT 1
|
||||
) THEN
|
||||
INSERT INTO tmp_Msg_Error (
|
||||
id_type
|
||||
, code
|
||||
, msg
|
||||
)
|
||||
SELECT
|
||||
v_id_type_error_bad_data
|
||||
, v_code_type_error_bad_data
|
||||
, CONCAT(
|
||||
'A valid supplier is required for the following Supplier Purchase Order(s): '
|
||||
, GROUP_CONCAT(CONCAT(IFNULL(t_SPO.id_stock, '(No Supplier Purchase Order)'), ' - ', t_SPO.id_supplier_ordered) SEPARATOR ', ')
|
||||
) AS msg
|
||||
FROM tmp_Stock_Item t_SPO
|
||||
LEFT JOIN partsltd_prod.Shop_Supplier S ON t_SPO.id_supplier_ordered = S.id_supplier
|
||||
WHERE 1=1
|
||||
AND (
|
||||
ISNULL(S.id_supplier)
|
||||
OR S.active = 0
|
||||
)
|
||||
;
|
||||
END IF;
|
||||
# id_currency_cost
|
||||
IF EXISTS (
|
||||
SELECT *
|
||||
FROM tmp_Supplier_Purchase_Order t_SPO
|
||||
LEFT JOIN partsltd_prod.Shop_Currency C ON t_SPO.id_currency_cost = C.id_currency
|
||||
WHERE 1=1
|
||||
AND (
|
||||
ISNULL(C.id_currency)
|
||||
OR C.active = 0
|
||||
)
|
||||
LIMIT 1
|
||||
) THEN
|
||||
INSERT INTO tmp_Msg_Error (
|
||||
id_type
|
||||
, code
|
||||
, msg
|
||||
)
|
||||
SELECT
|
||||
v_id_type_error_bad_data
|
||||
, v_code_type_error_bad_data
|
||||
, CONCAT(
|
||||
'A valid currency is required for the following Supplier Purchase Order(s): '
|
||||
, GROUP_CONCAT(CONCAT(IFNULL(t_SPO.id_stock, '(No Supplier Purchase Order)'), ' - ', t_SPO.id_currency_cost) SEPARATOR ', ')
|
||||
) AS msg
|
||||
FROM tmp_Stock_Item t_SPO
|
||||
LEFT JOIN partsltd_prod.Shop_Currency C ON t_SPO.id_currency_cost = C.id_currency
|
||||
WHERE 1=1
|
||||
AND (
|
||||
ISNULL(C.id_currency)
|
||||
OR C.active = 0
|
||||
)
|
||||
;
|
||||
END IF;
|
||||
# id_unit_quantity
|
||||
IF EXISTS (
|
||||
SELECT *
|
||||
FROM tmp_Supplier_Purchase_Order_Product_Link t_SPOPL
|
||||
LEFT JOIN partsltd_prod.Shop_Unit_Measurement UM ON t_SPOPL.id_unit_quantity = UM.id_unit_measurement
|
||||
WHERE 1=1
|
||||
AND (
|
||||
ISNULL(UM.id_unit_measurement)
|
||||
OR UM.active = 0
|
||||
)
|
||||
LIMIT 1
|
||||
) THEN
|
||||
INSERT INTO tmp_Msg_Error (
|
||||
id_type
|
||||
, code
|
||||
, msg
|
||||
)
|
||||
SELECT
|
||||
v_id_type_error_bad_data
|
||||
, v_code_type_error_bad_data
|
||||
, CONCAT(
|
||||
'A valid unit measurement of quantity is required for the following Supplier Purchase Order(s): '
|
||||
, GROUP_CONCAT(CONCAT(IFNULL(t_SPO.id_stock, '(No Supplier Purchase Order)'), ' - ', t_SPO.id_currency_cost) SEPARATOR ', ')
|
||||
) AS msg
|
||||
FROM tmp_Supplier_Purchase_Order_Product_Link t_SPOPL
|
||||
LEFT JOIN partsltd_prod.Shop_Unit_Measurement UM ON t_SPOPL.id_unit_quantity = UM.id_unit_measurement
|
||||
WHERE 1=1
|
||||
AND (
|
||||
ISNULL(UM.id_unit_measurement)
|
||||
OR UM.active = 0
|
||||
)
|
||||
;
|
||||
END IF;
|
||||
# Invalid quantity ordered
|
||||
IF EXISTS (
|
||||
SELECT *
|
||||
FROM tmp_Supplier_Purchase_Order_Product_Link t_SPOPL
|
||||
WHERE
|
||||
ISNULL(t_SPOPL.quantity_ordered)
|
||||
OR t_SPOPL.quantity_ordered <= 0
|
||||
) THEN
|
||||
INSERT INTO tmp_Msg_Error (
|
||||
id_type, code, msg
|
||||
)
|
||||
SELECT
|
||||
v_id_error_type_bad_data,
|
||||
v_code_error_type_bad_data,
|
||||
CONCAT(
|
||||
'A valid quantity ordered is required for the following Supplier Purchase Order Item(s): '
|
||||
, GROUP_CONCAT(t_SPOPL.name_error SEPARATOR ', ')
|
||||
)
|
||||
FROM tmp_Supplier_Purchase_Order_Product_Link t_SPOPL
|
||||
WHERE
|
||||
ISNULL(t_SPOPL.quantity_ordered)
|
||||
OR t_SPOPL.quantity_ordered <= 0
|
||||
;
|
||||
END IF;
|
||||
# Invalid quantity received
|
||||
IF EXISTS (
|
||||
SELECT *
|
||||
FROM tmp_Supplier_Purchase_Order_Product_Link t_SPOPL
|
||||
WHERE t_SPOPL.quantity_received < 0
|
||||
) THEN
|
||||
INSERT INTO tmp_Msg_Error (
|
||||
id_type, code, msg
|
||||
)
|
||||
SELECT
|
||||
v_id_error_type_bad_data,
|
||||
v_code_error_type_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 ', ')
|
||||
)
|
||||
FROM tmp_Supplier_Purchase_Order_Product_Link t_SPOPL
|
||||
WHERE t_SPOPL.quantity_received < 0
|
||||
;
|
||||
END IF;
|
||||
# Invalid delivery latency
|
||||
IF EXISTS (
|
||||
SELECT *
|
||||
FROM tmp_Supplier_Purchase_Order_Product_Link t_SPOPL
|
||||
WHERE t_SPOPL.latency_delivery_days < 0
|
||||
) THEN
|
||||
INSERT INTO tmp_Msg_Error (
|
||||
id_type, code, msg
|
||||
)
|
||||
SELECT
|
||||
v_id_error_type_bad_data,
|
||||
v_code_error_type_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 ', ')
|
||||
)
|
||||
FROM tmp_Supplier_Purchase_Order_Product_Link t_SPOPL
|
||||
WHERE t_SPOPL.latency_delivery_days < 0
|
||||
;
|
||||
END IF;
|
||||
|
||||
-- Duplicates
|
||||
IF EXISTS (
|
||||
SELECT
|
||||
id_permutation
|
||||
, name_error
|
||||
, COUNT(*)
|
||||
FROM tmp_Supplier_Purchase_Order_Product_Link t_SPOPL
|
||||
GROUP BY id_permutation
|
||||
HAVING COUNT(*) > 1
|
||||
) THEN
|
||||
INSERT INTO tmp_Msg_Error (
|
||||
id_type, code, msg
|
||||
)
|
||||
SELECT
|
||||
v_id_error_type_bad_data,
|
||||
v_code_error_type_bad_data,
|
||||
CONCAT('Duplicate records: ', GROUP_CONCAT(t_SPOPLC.name_error SEPARATOR ', '))
|
||||
FROM (
|
||||
SELECT
|
||||
id_permutation
|
||||
, name_error
|
||||
, COUNT(*)
|
||||
FROM tmp_Supplier_Purchase_Order_Product_Link t_SPOPL
|
||||
GROUP BY id_permutation
|
||||
HAVING COUNT(*) > 1
|
||||
) t_SPOPLC
|
||||
;
|
||||
END IF;
|
||||
-- Empty Supplier Purchase Order
|
||||
IF EXISTS ( SELECT * FROM tmp_Supplier_Purchase_Order t_SPO LEFT JOIN tmp_Supplier_Purchase_Order_Product_Link t_SPOPL ON t_SPO.id_order = t_SPOPL.id_order WHERE ISNULL(t_SPOPL.id_order) ) THEN
|
||||
INSERT INTO tmp_Msg_Error (
|
||||
id_type, code, msg
|
||||
)
|
||||
SELECT
|
||||
v_id_error_type_bad_data,
|
||||
v_code_error_type_bad_data,
|
||||
CONCAT(
|
||||
'There are no items in the following Supplier Purchase Order(s): '
|
||||
, GROUP_CONCAT(t_SPO.name_error SEPARATOR ', ')
|
||||
) AS msg
|
||||
FROM tmp_Supplier_Purchase_Order t_SPO
|
||||
LEFT JOIN tmp_Supplier_Purchase_Order_Product_Link t_SPOPL ON t_SPO.id_order = t_SPOPL.id_order
|
||||
WHERE ISNULL(t_SPOPL.id_order)
|
||||
;
|
||||
END IF;
|
||||
|
||||
-- Supplier Purchase Order Items without Order
|
||||
IF EXISTS (
|
||||
SELECT *
|
||||
FROM tmp_Supplier_Purchase_Order_Product_Link t_SPOPL
|
||||
LEFT JOIN tmp_Supplier_Purchase_Order t_SPO ON t_SPOPL.id_order = t_SPO.id_order
|
||||
WHERE ISNULL(t_SPO.id_order)
|
||||
) THEN
|
||||
INSERT INTO tmp_Msg_Error (
|
||||
id_type, code, msg
|
||||
)
|
||||
SELECT
|
||||
v_id_error_type_bad_data,
|
||||
v_code_error_type_bad_data,
|
||||
CONCAT(
|
||||
'There is no order for the following Supplier Purchase Order Item(s): '
|
||||
, GROUP_CONCAT(t_SPOPL.name_error SEPARATOR ', ')
|
||||
) AS msg
|
||||
FROM tmp_Supplier_Purchase_Order_Product_Link t_SPOPL
|
||||
LEFT JOIN tmp_Supplier_Purchase_Order t_SPO ON t_SPOPL.id_order = t_SPO.id_order
|
||||
WHERE ISNULL(t_SPO.id_order)
|
||||
;
|
||||
END IF;
|
||||
|
||||
-- Permissions
|
||||
SET v_ids_product_permission := (
|
||||
SELECT
|
||||
GROUP_CONCAT(DISTINCT PP.id_product SEPARATOR ',')
|
||||
FROM tmp_Supplier_Purchase_Order_Product_Link t_SPOPL
|
||||
INNER JOIN partsltd_prod.Shop_Product_Permutation PP ON t_SPOPL.id_permutation = PP.id_permutation
|
||||
);
|
||||
IF a_debug = 1 THEN
|
||||
SELECT
|
||||
v_guid
|
||||
, a_id_user
|
||||
, FALSE -- get inactive users
|
||||
, v_id_permission_supplier_purchase_order
|
||||
, v_id_access_level_edit
|
||||
, v_ids_product_permission -- ids_product
|
||||
, 0 -- a_debug
|
||||
;
|
||||
SELECT * from partsltd_prod.Shop_Calc_User_Temp;
|
||||
END IF;
|
||||
|
||||
CALL p_shop_calc_user(
|
||||
v_guid
|
||||
, a_id_user
|
||||
, FALSE -- get inactive users
|
||||
, v_id_permission_supplier_purchase_order
|
||||
, v_id_access_level_edit
|
||||
, v_ids_product_permission -- ids_product
|
||||
, 0 -- a_debug
|
||||
);
|
||||
|
||||
IF a_debug = 1 THEN
|
||||
SELECT * from partsltd_prod.Shop_Calc_User_Temp WHERE GUID = a_guid;
|
||||
END IF;
|
||||
|
||||
IF NOT EXISTS (SELECT can_view FROM partsltd_prod.Shop_Calc_User_Temp UE_T WHERE UE_T.GUID = v_guid) THEN
|
||||
DELETE FROM tmp_Msg_Error;
|
||||
|
||||
INSERT INTO tmp_Msg_Error (
|
||||
id_type
|
||||
, code
|
||||
, msg
|
||||
)
|
||||
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_supplier LIMIT 1))
|
||||
)
|
||||
;
|
||||
END IF;
|
||||
|
||||
CALL partsltd_prod.p_shop_clear_calc_user( a_guid );
|
||||
|
||||
IF EXISTS ( SELECT * FROM tmp_Msg_Error LIMIT 1 ) THEN
|
||||
DELETE FROM tmp_Supplier_Purchase_Order;
|
||||
DELETE FROM tmp_Supplier_Purchase_Order_Product_Link;
|
||||
END IF;
|
||||
|
||||
IF EXISTS (
|
||||
SELECT *
|
||||
FROM tmp_Supplier_Purchase_Order_Product_Link t_SPOPL
|
||||
INNER JOIN partsltd_prod.Shop_Supplier_Purchase_Order_Product_Link SPOPL ON t_SPOPL.id_link = SPOPL.id_link
|
||||
INNER JOIN partsltd_prod.Shop_Stock_Item SI ON SPOPL.id_permutation = SI.id_permutation
|
||||
WHERE
|
||||
t_SPOPL.is_new = 0
|
||||
AND t_SPOPL.quantity_received <> SPOPL.quantity_received
|
||||
) THEN
|
||||
INSERT INTO tmp_Msg_Error (
|
||||
id_type
|
||||
, code
|
||||
, msg
|
||||
)
|
||||
SELECT
|
||||
v_id_type_error_warning
|
||||
, v_code_type_error_warning
|
||||
, CONCAT(
|
||||
'The quantity received has changed on the following orders. Please update the stock items appropriately.'
|
||||
, GROUP_CONCAT(
|
||||
CONCAT(
|
||||
t_SPOPL.name_error
|
||||
, ' - from '
|
||||
, SPOPL.quantity_received
|
||||
, ' to '
|
||||
, t_SPOPL.quantity_received
|
||||
) SEPARATOR ', '
|
||||
)
|
||||
) AS msg
|
||||
;
|
||||
END IF;
|
||||
|
||||
-- Transaction
|
||||
IF NOT EXISTS (SELECT * FROM tmp_Msg_Error) THEN
|
||||
START TRANSACTION;
|
||||
INSERT INTO Shop_Sales_And_Purchasing_Change_Set (
|
||||
comment
|
||||
, updated_last_by
|
||||
, updated_last_on
|
||||
)
|
||||
VALUES (
|
||||
a_comment
|
||||
, a_id_user
|
||||
, v_time_start
|
||||
);
|
||||
|
||||
SET v_id_change_set := LAST_INSERT_ID();
|
||||
|
||||
INSERT INTO partsltd_prod.Shop_Supplier_Purchase_Order (
|
||||
id_supplier_ordered
|
||||
, id_currency_cost
|
||||
, cost_total_local_VAT_excl
|
||||
, cost_total_local_VAT_incl
|
||||
, created_by
|
||||
, created_on
|
||||
, id_change_set
|
||||
, active
|
||||
)
|
||||
SELECT
|
||||
t_SPO.id_supplier_ordered
|
||||
, t_SPO.id_currency_cost
|
||||
, SUM(t_SPOPL.cost_total_local_VAT_excl)
|
||||
, SUM(t_SPOPL.cost_total_local_VAT_incl)
|
||||
, t_SPO.active
|
||||
, a_id_user
|
||||
, v_time_start
|
||||
, v_id_change_set
|
||||
FROM tmp_Supplier_Purchase_Order t_SPO
|
||||
INNER JOIN tmp_Supplier_Purchase_Order_Product_Link t_SPOPL ON t_SPO.id_order = t_SPOPL.id_order
|
||||
WHERE t_SPOPL.is_new = 1
|
||||
;
|
||||
|
||||
INSERT INTO Shop_Supplier_Purchase_Order_Product_Link (
|
||||
id_order
|
||||
, id_permutation
|
||||
-- , id_currency_cost
|
||||
, id_unit_quantity
|
||||
, quantity_ordered
|
||||
, quantity_received
|
||||
, latency_delivery_days
|
||||
, display_order
|
||||
, active
|
||||
, cost_total_local_VAT_excl
|
||||
, cost_total_local_VAT_incl
|
||||
, created_by
|
||||
, id_change_set
|
||||
)
|
||||
SELECT
|
||||
t_SPOPL.id_order
|
||||
, t_SPOPL.id_permutation
|
||||
-- , t_SPOPL.id_currency_cost
|
||||
, t_SPOPL.id_unit_quantity
|
||||
, t_SPOPL.quantity_ordered
|
||||
, t_SPOPL.quantity_received
|
||||
, t_SPOPL.latency_delivery_days
|
||||
, t_SPOPL.display_order
|
||||
, t_SPOPL.active
|
||||
, t_SPOPL.cost_total_local_VAT_excl
|
||||
, t_SPOPL.cost_total_local_VAT_incl
|
||||
, a_id_user
|
||||
, v_id_change_set
|
||||
FROM tmp_Supplier_Purchase_Order_Product_Link t_SPOPL
|
||||
WHERE t_SPOPL.is_new = 1
|
||||
;
|
||||
|
||||
UPDATE partsltd_prod.Shop_Supplier_Purchase_Order SPO
|
||||
INNER JOIN tmp_Supplier_Purchase_Order t_SPO
|
||||
ON SPO.id_order = t_SPO.id_order
|
||||
AND t_SPO.is_new = 0
|
||||
INNER JOIN tmp_Supplier_Purchase_Order_Product_Link t_SPOPL ON t_SPO.id_order = t_SPOPL.id_order
|
||||
SET
|
||||
SPO.id_supplier_ordered = t_SPO.id_supplier_ordered
|
||||
, SPO.id_currency_cost = id_currency_cost
|
||||
, SPO.cost_total_local_VAT_excl = SUM(t_SPOPL.cost_total_local_VAT_excl)
|
||||
, SPO.cost_total_local_VAT_incl = SUM(t_SPOPL.cost_total_local_VAT_incl)
|
||||
, SPO.active = a_active
|
||||
, SPO.id_change_set = v_id_change_set
|
||||
;
|
||||
|
||||
UPDATE partsltd_prod.Shop_Supplier_Purchase_Order_Product_Link SPOPL
|
||||
INNER JOIN tmp_Supplier_Purchase_Order_Product_Link t_SPOPL
|
||||
ON SPOPL.id_link = t_SPOPL.id_link
|
||||
AND t_SPOPL.is_new = 0
|
||||
SET
|
||||
SPOPL.id_order = t_SPOPL.id_order,
|
||||
SPOPL.id_permutation = t_SPOPL.id_permutation,
|
||||
-- SPOPL.id_currency_cost = t_SPOPL.id_currency_cost,
|
||||
SPOPL.id_unit_quantity = t_SPOPL.id_unit_quantity,
|
||||
SPOPL.quantity_ordered = t_SPOPL.quantity_ordered,
|
||||
SPOPL.quantity_received = t_SPOPL.quantity_received,
|
||||
SPOPL.latency_delivery_days = t_SPOPL.latency_delivery_days,
|
||||
SPOPL.display_order = t_SPOPL.display_order,
|
||||
SPOPL.active = t_SPOPL.active,
|
||||
SPOPL.cost_total_local_VAT_excl = t_SPOPL.cost_total_local_VAT_excl,
|
||||
SPOPL.cost_total_local_VAT_incl = t_SPOPL.cost_total_local_VAT_incl,
|
||||
SPOPL.id_change_set = v_id_change_set
|
||||
;
|
||||
|
||||
DELETE SPO_T
|
||||
FROM Shop_Supplier_Purchase_Order_Temp SPO_T
|
||||
WHERE SPO_T.GUID = a_guid
|
||||
;
|
||||
DELETE SPOPL_T
|
||||
FROM Shop_Supplier_Purchase_Order_Product_Link_Temp SPOPL_T
|
||||
WHERE SPOPL_T.GUID = a_guid
|
||||
;
|
||||
|
||||
COMMIT;
|
||||
END IF;
|
||||
|
||||
# Errors
|
||||
SELECT *
|
||||
FROM tmp_Msg_Error t_ME
|
||||
INNER JOIN partsltd_prod.Shop_Msg_Error_Type MET ON t_ME.id_type = MET.id_type
|
||||
;
|
||||
|
||||
IF a_debug = 1 THEN
|
||||
SELECT * from tmp_Supplier;
|
||||
END IF;
|
||||
|
||||
DROP TEMPORARY TABLE tmp_Supplier_Purchase_Order;
|
||||
DROP TEMPORARY TABLE tmp_Supplier_Purchase_Order_Product_Link;
|
||||
DROP TEMPORARY TABLE tmp_Msg_Error;
|
||||
|
||||
IF a_debug = 1 THEN
|
||||
CALL partsltd_prod.p_debug_timing_reporting ( v_time_start );
|
||||
END IF;
|
||||
END //
|
||||
DELIMITER ;;
|
||||
|
||||
|
||||
/*
|
||||
|
||||
DELETE FROM Shop_Supplier_Purchase_Order_Product_Link_Audit;
|
||||
DELETE FROM Shop_Supplier_Purchase_Order_Product_Link;
|
||||
DELETE FROM Shop_Supplier_Purchase_Order_Product_Link_Temp;
|
||||
DELETE FROM Shop_Supplier_Purchase_Order_Audit;
|
||||
DELETE FROM Shop_Supplier_Purchase_Order;
|
||||
|
||||
INSERT INTO Shop_Supplier_Purchase_Order_Product_Link_Temp (
|
||||
guid,
|
||||
id_link,
|
||||
id_order,
|
||||
id_permutation,
|
||||
cost_total_local,
|
||||
id_currency_cost,
|
||||
quantity_ordered,
|
||||
id_unit_quantity,
|
||||
quantity_received,
|
||||
latency_delivery_days,
|
||||
display_order,
|
||||
active
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
'NIPS', # guid
|
||||
-1, # id_link,
|
||||
-1, # id_order,
|
||||
1, # id_permutation,
|
||||
100, # cost_total_local,
|
||||
1, # id_currency_cost,
|
||||
1, # quantity_ordered,
|
||||
1, # id_unit_quantity,
|
||||
1, # quantity_received,
|
||||
14, # latency_delivery_days ,
|
||||
1, # display_order
|
||||
1 # active
|
||||
)
|
||||
;
|
||||
|
||||
SELECT * FROM Shop_Supplier_Purchase_Order_Product_Link_Temp;
|
||||
|
||||
CALL p_shop_save_supplier_purchase_order (
|
||||
'NIPS', # a_guid
|
||||
'auth0|6582b95c895d09a70ba10fef', # a_id_user
|
||||
-1, # a_id_order
|
||||
1, # a_id_supplier_ordered
|
||||
1 # a_id_currency_cost
|
||||
);
|
||||
|
||||
SELECT * FROM Shop_Supplier_Purchase_Order_Product_Link_Temp;
|
||||
|
||||
DELETE FROM Shop_Supplier_Purchase_Order_Product_Link_Audit;
|
||||
DELETE FROM Shop_Supplier_Purchase_Order_Product_Link;
|
||||
DELETE FROM Shop_Supplier_Purchase_Order_Product_Link_Temp;
|
||||
DELETE FROM Shop_Supplier_Purchase_Order_Audit;
|
||||
DELETE FROM Shop_Supplier_Purchase_Order;
|
||||
|
||||
|
||||
*/
|
||||
|
||||
@@ -26,7 +26,7 @@ BEGIN
|
||||
SELECT *
|
||||
FROM partsltd_prod.Shop_Supplier_Purchase_Order_Product_Link_Temp
|
||||
;
|
||||
|
||||
|
||||
START TRANSACTION;
|
||||
|
||||
DELETE FROM partsltd_prod.Shop_Supplier_Purchase_Order_Temp;
|
||||
@@ -39,6 +39,7 @@ BEGIN
|
||||
, active
|
||||
, GUID
|
||||
)
|
||||
/* Test 1 - Insert
|
||||
VALUES (
|
||||
-1
|
||||
, 1
|
||||
@@ -46,6 +47,15 @@ BEGIN
|
||||
, 1
|
||||
, v_guid
|
||||
)
|
||||
*/
|
||||
SELECT
|
||||
id_order
|
||||
, id_supplier_ordered
|
||||
, id_currency_cost
|
||||
, active
|
||||
, v_guid
|
||||
FROM partsltd_prod.Shop_Supplier_Purchase_Order
|
||||
WHERE id_order = 6
|
||||
;
|
||||
|
||||
INSERT INTO partsltd_prod.Shop_Supplier_Purchase_Order_Product_Link_Temp (
|
||||
@@ -62,6 +72,7 @@ BEGIN
|
||||
, cost_total_local_VAT_incl
|
||||
, GUID
|
||||
)
|
||||
/* Test 1 - Insert
|
||||
VALUES (
|
||||
-1
|
||||
, -1
|
||||
@@ -76,6 +87,22 @@ BEGIN
|
||||
, 6
|
||||
, v_guid
|
||||
)
|
||||
*/
|
||||
SELECT
|
||||
id_link
|
||||
, id_order
|
||||
, id_permutation
|
||||
, id_unit_quantity
|
||||
, 5 AS quantity_ordered
|
||||
, quantity_received
|
||||
, latency_delivery_days
|
||||
, display_order
|
||||
, active
|
||||
, cost_total_local_VAT_excl
|
||||
, cost_total_local_VAT_incl
|
||||
, v_guid
|
||||
FROM partsltd_prod.Shop_Supplier_Purchase_Order_Product_Link
|
||||
WHERE id_order = 6
|
||||
;
|
||||
|
||||
COMMIT;
|
||||
@@ -114,13 +141,13 @@ BEGIN
|
||||
END //
|
||||
DELIMITER ;;
|
||||
|
||||
/*
|
||||
CALL partsltd_prod.p_shop_save_supplier_purchase_order_test ();
|
||||
|
||||
DELETE FROM partsltd_prod.Shop_Supplier_Purchase_Order_Temp;
|
||||
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)
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ BEGIN
|
||||
|
||||
-- Permutations
|
||||
IF v_has_filter_permutation = 1 THEN
|
||||
CALL partsltd_prod.p_split(a_guid, a_ids_permutation, ',', a_debug);
|
||||
CALL partsltd_prod.p_split(v_guid, a_ids_permutation, ',', a_debug);
|
||||
|
||||
INSERT INTO tmp_Split (
|
||||
substring
|
||||
@@ -112,12 +112,12 @@ BEGIN
|
||||
, CONVERT(substring, DECIMAL(10,0)) AS as_int
|
||||
FROM partsltd_prod.Split_Temp
|
||||
WHERE 1=1
|
||||
AND GUID = a_guid
|
||||
AND GUID = v_guid
|
||||
AND NOT ISNULL(substring)
|
||||
AND substring != ''
|
||||
;
|
||||
|
||||
CALL partsltd_prod.p_clear_split_temp( a_guid );
|
||||
CALL partsltd_prod.p_clear_split_temp( v_guid );
|
||||
END IF;
|
||||
|
||||
IF NOT EXISTS (SELECT * FROM tmp_Msg_Error LIMIT 1) THEN
|
||||
@@ -166,7 +166,7 @@ BEGIN
|
||||
|
||||
-- Suppliers
|
||||
IF v_has_filter_supplier = 1 THEN
|
||||
CALL partsltd_prod.p_split(a_guid, a_ids_supplier, ',', a_debug);
|
||||
CALL partsltd_prod.p_split(v_guid, a_ids_supplier, ',', a_debug);
|
||||
|
||||
INSERT INTO tmp_Split (
|
||||
substring
|
||||
@@ -177,12 +177,12 @@ BEGIN
|
||||
, CONVERT(substring, DECIMAL(10,0)) AS as_int
|
||||
FROM partsltd_prod.Split_Temp
|
||||
WHERE 1=1
|
||||
AND GUID = a_guid
|
||||
AND GUID = v_guid
|
||||
AND NOT ISNULL(substring)
|
||||
AND substring != ''
|
||||
;
|
||||
|
||||
CALL partsltd_prod.p_clear_split_temp( a_guid );
|
||||
CALL partsltd_prod.p_clear_split_temp( v_guid );
|
||||
END IF;
|
||||
|
||||
IF NOT EXISTS (SELECT * FROM tmp_Msg_Error LIMIT 1) THEN
|
||||
@@ -244,7 +244,7 @@ BEGIN
|
||||
|
||||
-- Supplier Purchase Orders
|
||||
IF v_has_filter_order = 1 THEN
|
||||
CALL partsltd_prod.p_split(a_guid, a_ids_order, ',', a_debug);
|
||||
CALL partsltd_prod.p_split(v_guid, a_ids_order, ',', a_debug);
|
||||
|
||||
INSERT INTO tmp_Split (
|
||||
substring
|
||||
@@ -255,12 +255,12 @@ BEGIN
|
||||
, CONVERT(substring, DECIMAL(10,0)) AS as_int
|
||||
FROM partsltd_prod.Split_Temp
|
||||
WHERE 1=1
|
||||
AND GUID = a_guid
|
||||
AND GUID = v_guid
|
||||
AND NOT ISNULL(substring)
|
||||
AND substring != ''
|
||||
;
|
||||
|
||||
CALL partsltd_prod.p_clear_split_temp( a_guid );
|
||||
CALL partsltd_prod.p_clear_split_temp( v_guid );
|
||||
END IF;
|
||||
|
||||
IF NOT EXISTS (SELECT * FROM tmp_Msg_Error LIMIT 1) THEN
|
||||
@@ -484,6 +484,7 @@ END //
|
||||
DELIMITER ;;
|
||||
|
||||
|
||||
/*
|
||||
|
||||
CALL p_shop_get_many_supplier_purchase_order (
|
||||
1, # a_id_user
|
||||
@@ -499,5 +500,4 @@ CALL p_shop_get_many_supplier_purchase_order (
|
||||
, 0 # a_debug
|
||||
);
|
||||
|
||||
/*
|
||||
*/
|
||||
|
||||
@@ -87,7 +87,7 @@ BEGIN
|
||||
|
||||
-- Permutations
|
||||
IF v_has_filter_permutation = 1 THEN
|
||||
CALL partsltd_prod.p_split(a_guid, a_ids_permutation, ',', a_debug);
|
||||
CALL partsltd_prod.p_split(v_guid, a_ids_permutation, ',', a_debug);
|
||||
|
||||
INSERT INTO tmp_Split (
|
||||
substring
|
||||
@@ -98,12 +98,12 @@ BEGIN
|
||||
, CONVERT(substring, DECIMAL(10,0)) AS as_int
|
||||
FROM partsltd_prod.Split_Temp
|
||||
WHERE 1=1
|
||||
AND GUID = a_guid
|
||||
AND GUID = v_guid
|
||||
AND NOT ISNULL(substring)
|
||||
AND substring != ''
|
||||
;
|
||||
|
||||
CALL partsltd_prod.p_clear_split_temp( a_guid );
|
||||
CALL partsltd_prod.p_clear_split_temp( v_guid );
|
||||
END IF;
|
||||
|
||||
IF NOT EXISTS (SELECT * FROM tmp_Msg_Error LIMIT 1) THEN
|
||||
@@ -152,7 +152,7 @@ BEGIN
|
||||
|
||||
-- Manufacturing Purchase Orders
|
||||
IF v_has_filter_order = 1 THEN
|
||||
CALL partsltd_prod.p_split(a_guid, a_ids_order, ',', a_debug);
|
||||
CALL partsltd_prod.p_split(v_guid, a_ids_order, ',', a_debug);
|
||||
|
||||
INSERT INTO tmp_Split (
|
||||
substring
|
||||
@@ -163,12 +163,12 @@ BEGIN
|
||||
, CONVERT(substring, DECIMAL(10,0)) AS as_int
|
||||
FROM partsltd_prod.Split_Temp
|
||||
WHERE 1=1
|
||||
AND GUID = a_guid
|
||||
AND GUID = v_guid
|
||||
AND NOT ISNULL(substring)
|
||||
AND substring != ''
|
||||
;
|
||||
|
||||
CALL partsltd_prod.p_clear_split_temp( a_guid );
|
||||
CALL partsltd_prod.p_clear_split_temp( v_guid );
|
||||
END IF;
|
||||
|
||||
IF NOT EXISTS (SELECT * FROM tmp_Msg_Error LIMIT 1) THEN
|
||||
@@ -380,6 +380,7 @@ END //
|
||||
DELIMITER ;;
|
||||
|
||||
|
||||
/*
|
||||
|
||||
CALL p_shop_get_many_manufacturing_purchase_order (
|
||||
1 # a_id_user
|
||||
@@ -392,5 +393,4 @@ CALL p_shop_get_many_manufacturing_purchase_order (
|
||||
, 0 # a_debug
|
||||
);
|
||||
|
||||
/*
|
||||
*/
|
||||
|
||||
@@ -106,7 +106,7 @@ BEGIN
|
||||
-- select v_has_filter_product, v_has_filter_permutation;
|
||||
|
||||
IF v_has_filter_customer = 1 OR a_get_all_customer = 1 THEN
|
||||
CALL p_split(a_guid, a_ids_customer, ',');
|
||||
CALL p_split(v_guid, a_ids_customer, ',');
|
||||
|
||||
IF EXISTS (SELECT * FROM Split_Temp S_T LEFT JOIN Shop_Customer C ON S_T.substring = C.id_customer WHERE ISNULL(C.id_customer)) THEN
|
||||
INSERT INTO tmp_Msg_Error (
|
||||
|
||||
@@ -244,7 +244,7 @@ BEGIN
|
||||
-- select v_has_filter_product, v_has_filter_permutation;
|
||||
|
||||
IF v_has_filter_customer = 1 OR a_get_all_customer = 1 THEN
|
||||
CALL p_split(a_guid, a_ids_customer, ',');
|
||||
CALL p_split(v_guid, a_ids_customer, ',');
|
||||
|
||||
IF EXISTS (SELECT * FROM Split_Temp TS LEFT JOIN Shop_Customer S ON TS.substring = S.id_customer WHERE ISNULL(S.id_customer)) THEN
|
||||
INSERT INTO tmp_Msg_Error (
|
||||
@@ -301,7 +301,7 @@ BEGIN
|
||||
|
||||
IF v_has_filter_category = 1 THEN
|
||||
IF NOT EXISTS (SELECT * FROM tmp_Msg_Error WHERE guid = v_guid LIMIT 1) THEN
|
||||
CALL p_split(a_guid, a_ids_category, ',');
|
||||
CALL p_split(v_guid, a_ids_category, ',');
|
||||
|
||||
IF EXISTS (SELECT * FROM Split_Temp TS LEFT JOIN Shop_Product_Category C ON TS.substring = C.id_category WHERE ISNULL(C.id_category)) THEN
|
||||
INSERT INTO tmp_Msg_Error (
|
||||
@@ -327,7 +327,7 @@ BEGIN
|
||||
|
||||
IF v_has_filter_product = 1 THEN
|
||||
IF NOT EXISTS (SELECT * FROM tmp_Msg_Error WHERE guid = v_guid LIMIT 1) THEN
|
||||
CALL p_split(a_guid, a_ids_product, ',');
|
||||
CALL p_split(v_guid, a_ids_product, ',');
|
||||
|
||||
IF EXISTS (SELECT * FROM Split_Temp TS LEFT JOIN Shop_Product ON TS.substring = P.id_product WHERE ISNULL(P.id_product)) THEN
|
||||
INSERT INTO tmp_Msg_Error (
|
||||
@@ -353,7 +353,7 @@ BEGIN
|
||||
|
||||
IF v_has_filter_permutation = 1 THEN
|
||||
IF NOT EXISTS (SELECT * FROM tmp_Msg_Error WHERE guid = v_guid LIMIT 1) THEN
|
||||
CALL p_split(a_guid, a_ids_permutation, ',');
|
||||
CALL p_split(v_guid, a_ids_permutation, ',');
|
||||
|
||||
IF EXISTS (SELECT * FROM Split_Temp TS LEFT JOIN Shop_Product_Permutation PP ON TS.substring = PP.id_permutation WHERE ISNULL(PP.id_permutation)) THEN
|
||||
INSERT INTO tmp_Msg_Error (
|
||||
@@ -486,7 +486,7 @@ BEGIN
|
||||
|
||||
-- Get orders
|
||||
IF NOT EXISTS (SELECT * FROM tmp_Msg_Error WHERE guid = v_guid LIMIT 1) THEN
|
||||
CALL p_split(a_guid, a_ids_order, ',');
|
||||
CALL p_split(v_guid, a_ids_order, ',');
|
||||
|
||||
IF v_has_filter_order AND EXISTS (SELECT * FROM Split_Temp TS LEFT JOIN Shop_Customer_Sales_Order CSO ON TS.substring = CSO.id_order WHERE ISNULL(CSO.id_order)) THEN
|
||||
INSERT INTO tmp_Msg_Error (
|
||||
|
||||
@@ -200,6 +200,7 @@
|
||||
7400_p_shop_save_supplier_temp.sql
|
||||
7401_p_shop_get_many_supplier.sql
|
||||
7403_p_shop_save_supplier_purchase_order.sql
|
||||
7403_p_shop_save_supplier_purchase_order_test.sql
|
||||
7404_p_shop_get_many_supplier_purchase_order.sql
|
||||
7415_p_shop_save_manufacturing_purchase_order.sql
|
||||
7416_p_shop_get_many_manufacturing_purchase_order.sql
|
||||
|
||||
@@ -99,15 +99,15 @@ h1, h2, h3, h4, h5, p, a, label {
|
||||
*/
|
||||
|
||||
h1 {
|
||||
font-size: 24px;
|
||||
font-size: min(24px, calc(1vh * 6));
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 22px;
|
||||
font-size: min(20px, calc(1vh * 5));
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 18px;
|
||||
font-size: min(16px, calc(1vh * 4));
|
||||
margin-top: 1vh;
|
||||
}
|
||||
|
||||
@@ -239,8 +239,8 @@ h5 {
|
||||
}
|
||||
#pageBody > * > * {
|
||||
align-self: center;
|
||||
padding-top: 1vh;
|
||||
padding-bottom: 1vh;
|
||||
padding-top: 0.5vh;
|
||||
padding-bottom: 0.5vh;
|
||||
color: var(--c_purple_dark);
|
||||
}
|
||||
#pageBody > .card {
|
||||
@@ -572,6 +572,7 @@ button:hover, input[type="submit"]:hover, #overlayHamburger .row *:hover {
|
||||
|
||||
ul {
|
||||
max-width: 90%;
|
||||
padding: 5px 0 10px 0;
|
||||
}
|
||||
li {
|
||||
text-align: left;
|
||||
|
||||
@@ -6,6 +6,11 @@
|
||||
}
|
||||
#pageBody > .card:not(:first-of-type) {
|
||||
}
|
||||
|
||||
#pageBody label {
|
||||
font-size: min(16px, calc(1vh * 4));
|
||||
}
|
||||
|
||||
#email {
|
||||
min-width: 40vw;
|
||||
width: 40vw;
|
||||
|
||||
@@ -3,13 +3,14 @@
|
||||
padding-right: 5vw;
|
||||
max-width: 80vw;
|
||||
}
|
||||
#pageBody > .card:first-of-type{
|
||||
|
||||
#pageBody .card h1,
|
||||
#pageBody .card h2 {
|
||||
width: 100%;
|
||||
}
|
||||
#pageBody > .card:last-of-type {
|
||||
padding-left: 5vw;
|
||||
padding-right: 5vw;
|
||||
}
|
||||
#pageBody > .card:not(:first-of-type) {
|
||||
|
||||
#pageBody .card p {
|
||||
font-size: min(16px, calc(1vh * 4));
|
||||
}
|
||||
|
||||
table {
|
||||
@@ -18,6 +19,14 @@ table {
|
||||
width: fit-content !important;
|
||||
}
|
||||
|
||||
table td {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
table th {
|
||||
font-size: min(16px, calc(1vh * 4));
|
||||
}
|
||||
|
||||
/*
|
||||
tr th::after {
|
||||
content: "";
|
||||
|
||||
5
static/dist/css/core_contact.bundle.css
vendored
5
static/dist/css/core_contact.bundle.css
vendored
@@ -6,6 +6,11 @@
|
||||
}
|
||||
#pageBody > .card:not(:first-of-type) {
|
||||
}
|
||||
|
||||
#pageBody label {
|
||||
font-size: min(16px, calc(1vh * 4));
|
||||
}
|
||||
|
||||
#email {
|
||||
min-width: 40vw;
|
||||
width: 40vw;
|
||||
|
||||
21
static/dist/css/core_services.bundle.css
vendored
21
static/dist/css/core_services.bundle.css
vendored
@@ -3,13 +3,14 @@
|
||||
padding-right: 5vw;
|
||||
max-width: 80vw;
|
||||
}
|
||||
#pageBody > .card:first-of-type{
|
||||
|
||||
#pageBody .card h1,
|
||||
#pageBody .card h2 {
|
||||
width: 100%;
|
||||
}
|
||||
#pageBody > .card:last-of-type {
|
||||
padding-left: 5vw;
|
||||
padding-right: 5vw;
|
||||
}
|
||||
#pageBody > .card:not(:first-of-type) {
|
||||
|
||||
#pageBody .card p {
|
||||
font-size: min(16px, calc(1vh * 4));
|
||||
}
|
||||
|
||||
table {
|
||||
@@ -18,6 +19,14 @@ table {
|
||||
width: fit-content !important;
|
||||
}
|
||||
|
||||
table td {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
table th {
|
||||
font-size: min(16px, calc(1vh * 4));
|
||||
}
|
||||
|
||||
/*
|
||||
tr th::after {
|
||||
content: "";
|
||||
|
||||
11
static/dist/css/main.bundle.css
vendored
11
static/dist/css/main.bundle.css
vendored
@@ -99,15 +99,15 @@ h1, h2, h3, h4, h5, p, a, label {
|
||||
*/
|
||||
|
||||
h1 {
|
||||
font-size: 24px;
|
||||
font-size: min(24px, calc(1vh * 6));
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 22px;
|
||||
font-size: min(20px, calc(1vh * 5));
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 18px;
|
||||
font-size: min(16px, calc(1vh * 4));
|
||||
margin-top: 1vh;
|
||||
}
|
||||
|
||||
@@ -239,8 +239,8 @@ h5 {
|
||||
}
|
||||
#pageBody > * > * {
|
||||
align-self: center;
|
||||
padding-top: 1vh;
|
||||
padding-bottom: 1vh;
|
||||
padding-top: 0.5vh;
|
||||
padding-bottom: 0.5vh;
|
||||
color: var(--c_purple_dark);
|
||||
}
|
||||
#pageBody > .card {
|
||||
@@ -572,6 +572,7 @@ button:hover, input[type="submit"]:hover, #overlayHamburger .row *:hover {
|
||||
|
||||
ul {
|
||||
max-width: 90%;
|
||||
padding: 5px 0 10px 0;
|
||||
}
|
||||
li {
|
||||
text-align: left;
|
||||
|
||||
Reference in New Issue
Block a user