Fix: Manufacturing Purchase Order page view, filter, and save.

This commit is contained in:
2024-11-14 12:23:02 +00:00
parent 19f74d2e91
commit 70de7026d3
18 changed files with 213 additions and 244 deletions

View File

@@ -114,7 +114,7 @@ BEGIN
, price_total_local_VAT_incl FLOAT NULL
, has_order BIT NULL
, is_new BIT NOT NULL
, name_error VARCHAR(1000) NOT NULL
, name_error VARCHAR(1000) NULL
);
CREATE TEMPORARY TABLE IF NOT EXISTS tmp_Msg_Error (
@@ -170,7 +170,6 @@ BEGIN
, price_unit_local_VAT_incl
, has_order
, is_new
, name_error
)
SELECT
IFNULL(MPOPL_T.id_link, 0) AS id_link

View File

@@ -282,13 +282,13 @@ BEGIN
VALUES (
v_id_type_error_no_permission
, v_code_type_error_no_permission
, CONCAT('You do not have view permissions for ', (SELECT name FROM partsltd_prod.Shop_Permission WHERE id_permission = v_id_permission_manufacturing LIMIT 1))
, CONCAT('You do not have view permissions for ', IFNULL((SELECT IFNULL(name, '(No Permission Name)') FROM partsltd_prod.Shop_Permission WHERE id_permission LIKE CONCAT('%', v_ids_permission_manufacturing_purchase_order, '%') LIMIT 1), '(No Permissions Found)'))
)
;
END IF;
IF EXISTS ( SELECT * FROM tmp_Msg_Error LIMIT 1 ) THEN
DELETE FROM tmp_Manufacturing_Purchase_Order_Product_Link;
-- DELETE FROM tmp_Manufacturing_Purchase_Order_Product_Link;
DELETE FROM tmp_Manufacturing_Purchase_Order;
END IF;
@@ -339,6 +339,8 @@ BEGIN
SELECT
MPOPL.id_link
, MPOPL.id_order
, P.id_category
, P.id_product
, MPOPL.id_permutation
, fn_shop_get_product_permutation_name(MPOPL.id_permutation) AS name_permutation
, fn_shop_get_product_permutation_variations_csv(MPOPL.id_permutation) AS csv_id_pairs_variation
@@ -354,7 +356,9 @@ BEGIN
, MPOPL.price_unit_local_VAT_incl
, MPOPL.active
FROM tmp_Manufacturing_Purchase_Order t_MPO
INNER JOIN partsltd_prod.Shop_Manufacturing_Purchase_Order_Product_Link MPOPL ON t_MPO.id_order = MPOPL.id_order
INNER JOIN partsltd_prod.Shop_Manufacturing_Purchase_Order_Product_Link MPOPL ON t_MPO.id_order = MPOPL.id_order
LEFT JOIN partsltd_prod.Shop_Product_Permutation PP ON MPOPL.id_permutation = PP.id_permutation
LEFT JOIN partsltd_prod.Shop_Product P ON PP.id_product = P.id_product
;
# Errors
@@ -384,9 +388,9 @@ DELIMITER ;;
/*
CALL p_shop_get_many_manufacturing_purchase_order (
1 # a_id_user
0 # a_id_user
, 1 # a_get_all_order
, 0 # a_get_inactive_order
, 1 # a_get_inactive_order
, '' # a_ids_order
, '' # a_ids_permutation
, NULL # a_date_from