Initial commit

This commit is contained in:
user
2026-07-12 13:56:05 +04:00
commit 04bf3a4b58
850 changed files with 9057 additions and 0 deletions
@@ -0,0 +1,13 @@
USE [Database]
IF OBJECT_ID('[Procedures].[update_attribute]', 'P') IS NOT NULL
DROP PROCEDURE [Procedures].[update_attribute];
GO
CREATE PROCEDURE [Procedures].[update_attribute]
@attribute_id AS INT,
@name AS NVARCHAR(128)
AS
UPDATE [Tables].[attributes]
SET [name] = @name
WHERE [id] = @attribute_id;
GO
@@ -0,0 +1,18 @@
USE [Database]
IF OBJECT_ID('[Procedures].[update_price_history_record]', 'P') IS NOT NULL
DROP PROCEDURE [Procedures].[update_price_history_record];
GO
CREATE PROCEDURE [Procedures].[update_price_history_record]
@price_history_record_id AS INT,
@product_id AS INT,
@datetime AS DATETIME,
@price AS MONEY
AS
UPDATE [Tables].[price_history_records]
SET
[product_id] = @product_id,
[datetime] = @datetime,
[price] = @price
WHERE [id] = @price_history_record_id;
GO
@@ -0,0 +1,17 @@
USE [Database]
IF OBJECT_ID('[Procedures].[update_product]', 'P') IS NOT NULL
DROP PROCEDURE [Procedures].[update_product];
GO
CREATE PROCEDURE [Procedures].[update_product]
@product_id AS INT,
@name AS NVARCHAR(128),
@product_type_id AS INT,
@barcode_attribute_id AS INT
AS
UPDATE [Tables].[products]
SET
[name] = @name,
[product_type_id] = @product_type_id
WHERE [id] = @product_id;
GO
@@ -0,0 +1,22 @@
USE [Database]
IF OBJECT_ID('[Procedures].[update_product_inflow_record]', 'P') IS NOT NULL
DROP PROCEDURE [Procedures].[update_product_inflow_record];
GO
CREATE PROCEDURE [Procedures].[update_product_inflow_record]
@product_inflow_record_id AS INT,
@barcode_product_value_id AS INT,
@supplier_id AS INT,
@count AS INT,
@full_price AS INT,
@datetime AS DATETIME
AS
UPDATE [Tables].[product_inflow_records]
SET
[barcode_product_value_id] = @barcode_product_value_id,
[supplier_id] = @supplier_id,
[count] = @count,
[full_price] = @full_price,
[datetime] = @datetime
WHERE [id] = @product_inflow_record_id;
GO
@@ -0,0 +1,19 @@
USE [Database]
IF OBJECT_ID('[Procedures].[update_product_outflow_record]', 'P') IS NOT NULL
DROP PROCEDURE [Procedures].[update_product_outflow_record];
GO
CREATE PROCEDURE [Procedures].[update_product_outflow_record]
@product_outflow_record_id AS INT,
@barcode_product_value_record_id AS INT,
@count AS INT,
@datetime AS INT,
@inserted_product_outflow_records AS INT = NULL OUTPUT
AS
UPDATE [Tables].[product_outflow_records]
SET
[barcode_product_value_id] = @barcode_product_value_record_id,
[count] = @count,
[datetime] = @datetime
WHERE [id] = @product_outflow_record_id;
GO
@@ -0,0 +1,17 @@
USE [Database]
IF OBJECT_ID('[Procedures].[update_product_type]', 'P') IS NOT NULL
DROP PROCEDURE [Procedures].[update_product_type];
GO
CREATE PROCEDURE [Procedures].[update_product_type]
@product_type_id AS INT,
@parent_id AS INT = NULL,
@name AS NVARCHAR(128)
AS
UPDATE [Tables].[product_types]
SET
[parent_id] = @parent_id,
[name] = @name
WHERE [id] = @product_type_id;
GO
@@ -0,0 +1,18 @@
USE [Database]
IF OBJECT_ID('[Procedures].[update_product_value]', 'P') IS NOT NULL
DROP PROCEDURE [Procedures].[update_product_value];
GO
CREATE PROCEDURE [Procedures].[update_product_value]
@product_value_id AS INT,
@product_id AS INT,
@attribute_id AS INT,
@value AS NVARCHAR(128)
AS
UPDATE [Tables].[product_values]
SET
[product_id] = @product_id,
[attribute_id] = @attribute_id,
[value] = @value
WHERE [id] = @product_value_id;
GO
@@ -0,0 +1,20 @@
USE [Database]
IF OBJECT_ID('[Procedures].[update_product_write_off_record]', 'P') IS NOT NULL
DROP PROCEDURE [Procedures].[update_product_write_off_record];
GO
CREATE PROCEDURE [Procedures].[update_product_write_off_record]
@product_write_off_record_id AS INT,
@barcode_product_value_id AS INT,
@reason_id AS INT,
@count AS INT,
@datetime AS DATETIME
AS
UPDATE [Tables].[product_write_off_records]
SET
[barcode_product_value_id] = @barcode_product_value_id,
[reason_id] = @reason_id,
[count] = @count,
[datetime] = @datetime
WHERE [id] = @product_write_off_record_id;
GO
@@ -0,0 +1,18 @@
USE [Database]
IF OBJECT_ID('[Procedures].[update_supplier]', 'P') IS NOT NULL
DROP PROCEDURE [Procedures].[update_supplier];
GO
CREATE PROCEDURE [Procedures].[update_supplier]
@supplier_id AS INT,
@name AS NVARCHAR(128),
@address AS NVARCHAR(128),
@telephone_number AS NVARCHAR(128)
AS
UPDATE [Tables].[suppliers]
SET
[name] = @name,
[address] = @address,
[telephone_number] = @telephone_number
WHERE [id] = @supplier_id;
GO
@@ -0,0 +1,13 @@
USE [Database]
IF OBJECT_ID('[Procedures].[update_write_off_reason]', 'P') IS NOT NULL
DROP PROCEDURE [Procedures].[update_write_off_reason];
GO
CREATE PROCEDURE [Procedures].[update_write_off_reason]
@write_off_reason_id AS INT,
@name AS NVARCHAR(128)
AS
UPDATE [Tables].[write_off_reasons]
SET [name] = @name
WHERE [id] = @write_off_reason_id;
GO