ALTER DATABASE CHARACTER SET utf8mb4;


CREATE TABLE `Job_CheckJob` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `DeliverNoteNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `UpStreamJobNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `JobDescription` varchar(1024) CHARACTER SET utf8mb4 NULL,
    `JobType` int NOT NULL,
    `JobStatus` int NOT NULL,
    `Priority` int NOT NULL DEFAULT 0,
    `PriorityIncrement` int NOT NULL DEFAULT 0,
    `WorkGroupCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `IsAutoComplete` tinyint(1) NOT NULL DEFAULT FALSE,
    `AcceptUserId` char(36) COLLATE ascii_general_ci NULL,
    `AcceptUserName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `AcceptTime` datetime(6) NULL,
    `CompleteUserId` char(36) COLLATE ascii_general_ci NULL,
    `CompleteUserName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CompleteTime` datetime(6) NULL,
    `WarehouseCode` longtext CHARACTER SET utf8mb4 NULL,
    CONSTRAINT `PK_Job_CheckJob` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Job_CountJob` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `CountPlanNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CountStage` int NOT NULL,
    `CountMethod` int NOT NULL,
    `Type` int NOT NULL,
    `Description` longtext CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `UpStreamJobNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `JobDescription` varchar(1024) CHARACTER SET utf8mb4 NULL,
    `JobType` int NOT NULL,
    `JobStatus` int NOT NULL,
    `Priority` int NOT NULL DEFAULT 0,
    `PriorityIncrement` int NOT NULL DEFAULT 0,
    `WorkGroupCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `IsAutoComplete` tinyint(1) NOT NULL DEFAULT FALSE,
    `AcceptUserId` char(36) COLLATE ascii_general_ci NULL,
    `AcceptUserName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `AcceptTime` datetime(6) NULL,
    `CompleteUserId` char(36) COLLATE ascii_general_ci NULL,
    `CompleteUserName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CompleteTime` datetime(6) NULL,
    `WarehouseCode` longtext CHARACTER SET utf8mb4 NULL,
    CONSTRAINT `PK_Job_CountJob` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Job_DeliverJob` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `DeliverRequestNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CustomerCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `CustomerAddressCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `DeliverTime` datetime(6) NOT NULL,
    `DeliverPlanNumber` longtext CHARACTER SET utf8mb4 NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `UpStreamJobNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `JobDescription` varchar(1024) CHARACTER SET utf8mb4 NULL,
    `JobType` int NOT NULL,
    `JobStatus` int NOT NULL,
    `Priority` int NOT NULL DEFAULT 0,
    `PriorityIncrement` int NOT NULL DEFAULT 0,
    `WorkGroupCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `IsAutoComplete` tinyint(1) NOT NULL DEFAULT FALSE,
    `AcceptUserId` char(36) COLLATE ascii_general_ci NULL,
    `AcceptUserName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `AcceptTime` datetime(6) NULL,
    `CompleteUserId` char(36) COLLATE ascii_general_ci NULL,
    `CompleteUserName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CompleteTime` datetime(6) NULL,
    `WarehouseCode` longtext CHARACTER SET utf8mb4 NULL,
    CONSTRAINT `PK_Job_DeliverJob` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Job_InspectJob` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `InspectNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ReceiptNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `PurchaseReceiptRequestNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `AsnNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RpNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `PoNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierCode` longtext CHARACTER SET utf8mb4 NULL,
    `NextAction` int NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `UpStreamJobNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `JobDescription` varchar(1024) CHARACTER SET utf8mb4 NULL,
    `JobType` int NOT NULL,
    `JobStatus` int NOT NULL,
    `Priority` int NOT NULL DEFAULT 0,
    `PriorityIncrement` int NOT NULL DEFAULT 0,
    `WorkGroupCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `IsAutoComplete` tinyint(1) NOT NULL DEFAULT FALSE,
    `AcceptUserId` char(36) COLLATE ascii_general_ci NULL,
    `AcceptUserName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `AcceptTime` datetime(6) NULL,
    `CompleteUserId` char(36) COLLATE ascii_general_ci NULL,
    `CompleteUserName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CompleteTime` datetime(6) NULL,
    `WarehouseCode` longtext CHARACTER SET utf8mb4 NULL,
    CONSTRAINT `PK_Job_InspectJob` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Job_IssueJob` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `RequestType` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ProdLine` varchar(64) CHARACTER SET utf8mb4 NULL,
    `MaterialRequestNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `Workshop` varchar(64) CHARACTER SET utf8mb4 NULL,
    `UseOnTheWayLocation` tinyint(1) NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `UpStreamJobNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `JobDescription` varchar(1024) CHARACTER SET utf8mb4 NULL,
    `JobType` int NOT NULL,
    `JobStatus` int NOT NULL,
    `Priority` int NOT NULL DEFAULT 0,
    `PriorityIncrement` int NOT NULL DEFAULT 0,
    `WorkGroupCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `IsAutoComplete` tinyint(1) NOT NULL DEFAULT FALSE,
    `AcceptUserId` char(36) COLLATE ascii_general_ci NULL,
    `AcceptUserName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `AcceptTime` datetime(6) NULL,
    `CompleteUserId` char(36) COLLATE ascii_general_ci NULL,
    `CompleteUserName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CompleteTime` datetime(6) NULL,
    `WarehouseCode` longtext CHARACTER SET utf8mb4 NULL,
    CONSTRAINT `PK_Job_IssueJob` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Job_JisDeliverJob` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `Customer` longtext CHARACTER SET utf8mb4 NULL,
    `CustomerAddressCode` longtext CHARACTER SET utf8mb4 NULL,
    `CustomerLocationCode` longtext CHARACTER SET utf8mb4 NULL,
    `CustomerWarehouseCode` longtext CHARACTER SET utf8mb4 NULL,
    `ProjectCode` longtext CHARACTER SET utf8mb4 NULL,
    `Position` longtext CHARACTER SET utf8mb4 NULL,
    `PlanTime` datetime(6) NOT NULL,
    `ContainerQty` decimal(18,6) NOT NULL,
    `ItemQty` decimal(18,6) NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `UpStreamJobNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `JobDescription` varchar(1024) CHARACTER SET utf8mb4 NULL,
    `JobType` int NOT NULL,
    `JobStatus` int NOT NULL,
    `Priority` int NOT NULL DEFAULT 0,
    `PriorityIncrement` int NOT NULL DEFAULT 0,
    `WorkGroupCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `IsAutoComplete` tinyint(1) NOT NULL DEFAULT FALSE,
    `AcceptUserId` char(36) COLLATE ascii_general_ci NULL,
    `AcceptUserName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `AcceptTime` datetime(6) NULL,
    `CompleteUserId` char(36) COLLATE ascii_general_ci NULL,
    `CompleteUserName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CompleteTime` datetime(6) NULL,
    `WarehouseCode` longtext CHARACTER SET utf8mb4 NULL,
    CONSTRAINT `PK_Job_JisDeliverJob` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Job_ProductionReturnJob` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `ProductionReturnRequestNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `UpStreamJobNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `JobDescription` varchar(1024) CHARACTER SET utf8mb4 NULL,
    `JobType` int NOT NULL,
    `JobStatus` int NOT NULL,
    `Priority` int NOT NULL DEFAULT 0,
    `PriorityIncrement` int NOT NULL DEFAULT 0,
    `WorkGroupCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `IsAutoComplete` tinyint(1) NOT NULL DEFAULT FALSE,
    `AcceptUserId` char(36) COLLATE ascii_general_ci NULL,
    `AcceptUserName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `AcceptTime` datetime(6) NULL,
    `CompleteUserId` char(36) COLLATE ascii_general_ci NULL,
    `CompleteUserName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CompleteTime` datetime(6) NULL,
    `WarehouseCode` longtext CHARACTER SET utf8mb4 NULL,
    CONSTRAINT `PK_Job_ProductionReturnJob` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Job_ProductReceiveJob` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `ProductionPlanNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `Workshop` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Shift` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `UpStreamJobNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `JobDescription` varchar(1024) CHARACTER SET utf8mb4 NULL,
    `JobType` int NOT NULL,
    `JobStatus` int NOT NULL,
    `Priority` int NOT NULL DEFAULT 0,
    `PriorityIncrement` int NOT NULL DEFAULT 0,
    `WorkGroupCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `IsAutoComplete` tinyint(1) NOT NULL DEFAULT FALSE,
    `AcceptUserId` char(36) COLLATE ascii_general_ci NULL,
    `AcceptUserName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `AcceptTime` datetime(6) NULL,
    `CompleteUserId` char(36) COLLATE ascii_general_ci NULL,
    `CompleteUserName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CompleteTime` datetime(6) NULL,
    `WarehouseCode` longtext CHARACTER SET utf8mb4 NULL,
    CONSTRAINT `PK_Job_ProductReceiveJob` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Job_PurchaseReceiptJob` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `PurchaseReceiptRequestNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `AsnNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RpNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `PoNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `SupplierName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `Type` int NOT NULL,
    `TimeWindow` varchar(64) CHARACTER SET utf8mb4 NULL,
    `PlanArriveDate` datetime(6) NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `UpStreamJobNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `JobDescription` varchar(1024) CHARACTER SET utf8mb4 NULL,
    `JobType` int NOT NULL,
    `JobStatus` int NOT NULL,
    `Priority` int NOT NULL DEFAULT 0,
    `PriorityIncrement` int NOT NULL DEFAULT 0,
    `WorkGroupCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `IsAutoComplete` tinyint(1) NOT NULL DEFAULT FALSE,
    `AcceptUserId` char(36) COLLATE ascii_general_ci NULL,
    `AcceptUserName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `AcceptTime` datetime(6) NULL,
    `CompleteUserId` char(36) COLLATE ascii_general_ci NULL,
    `CompleteUserName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CompleteTime` datetime(6) NULL,
    `WarehouseCode` longtext CHARACTER SET utf8mb4 NULL,
    CONSTRAINT `PK_Job_PurchaseReceiptJob` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Job_PurchaseReturnJob` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `RpNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `AsnNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `PoNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `PurchaseReturnRequestNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ReturnReason` longtext CHARACTER SET utf8mb4 NULL,
    `ReturnTime` datetime(6) NOT NULL,
    `ReturnType` int NOT NULL DEFAULT 2,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `UpStreamJobNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `JobDescription` varchar(1024) CHARACTER SET utf8mb4 NULL,
    `JobType` int NOT NULL,
    `JobStatus` int NOT NULL,
    `Priority` int NOT NULL DEFAULT 0,
    `PriorityIncrement` int NOT NULL DEFAULT 0,
    `WorkGroupCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `IsAutoComplete` tinyint(1) NOT NULL DEFAULT FALSE,
    `AcceptUserId` char(36) COLLATE ascii_general_ci NULL,
    `AcceptUserName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `AcceptTime` datetime(6) NULL,
    `CompleteUserId` char(36) COLLATE ascii_general_ci NULL,
    `CompleteUserName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CompleteTime` datetime(6) NULL,
    `WarehouseCode` longtext CHARACTER SET utf8mb4 NULL,
    CONSTRAINT `PK_Job_PurchaseReturnJob` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Job_PutawayJob` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `PutawayMode` int NOT NULL,
    `SupplierCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `InspectNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ReceiptNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `PurchaseReceiptRequestNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `AsnNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RpNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `PoNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ProductReceiptNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `Type` int NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `UpStreamJobNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `JobDescription` varchar(1024) CHARACTER SET utf8mb4 NULL,
    `JobType` int NOT NULL,
    `JobStatus` int NOT NULL,
    `Priority` int NOT NULL DEFAULT 0,
    `PriorityIncrement` int NOT NULL DEFAULT 0,
    `WorkGroupCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `IsAutoComplete` tinyint(1) NOT NULL DEFAULT FALSE,
    `AcceptUserId` char(36) COLLATE ascii_general_ci NULL,
    `AcceptUserName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `AcceptTime` datetime(6) NULL,
    `CompleteUserId` char(36) COLLATE ascii_general_ci NULL,
    `CompleteUserName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CompleteTime` datetime(6) NULL,
    `WarehouseCode` longtext CHARACTER SET utf8mb4 NULL,
    CONSTRAINT `PK_Job_PutawayJob` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Job_UnplannedIssueJob` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `UnplannedIssueRequestNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `DeptCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `DeptName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `BuildDate` datetime(6) NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `UpStreamJobNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `JobDescription` varchar(1024) CHARACTER SET utf8mb4 NULL,
    `JobType` int NOT NULL,
    `JobStatus` int NOT NULL,
    `Priority` int NOT NULL DEFAULT 0,
    `PriorityIncrement` int NOT NULL DEFAULT 0,
    `WorkGroupCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `IsAutoComplete` tinyint(1) NOT NULL DEFAULT FALSE,
    `AcceptUserId` char(36) COLLATE ascii_general_ci NULL,
    `AcceptUserName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `AcceptTime` datetime(6) NULL,
    `CompleteUserId` char(36) COLLATE ascii_general_ci NULL,
    `CompleteUserName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CompleteTime` datetime(6) NULL,
    `WarehouseCode` longtext CHARACTER SET utf8mb4 NULL,
    CONSTRAINT `PK_Job_UnplannedIssueJob` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Job_UnplannedReceiptJob` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `UnplannedReceiptRequestNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `DeptCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `DeptName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `BuildDate` datetime(6) NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `UpStreamJobNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `JobDescription` varchar(1024) CHARACTER SET utf8mb4 NULL,
    `JobType` int NOT NULL,
    `JobStatus` int NOT NULL,
    `Priority` int NOT NULL DEFAULT 0,
    `PriorityIncrement` int NOT NULL DEFAULT 0,
    `WorkGroupCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `IsAutoComplete` tinyint(1) NOT NULL DEFAULT FALSE,
    `AcceptUserId` char(36) COLLATE ascii_general_ci NULL,
    `AcceptUserName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `AcceptTime` datetime(6) NULL,
    `CompleteUserId` char(36) COLLATE ascii_general_ci NULL,
    `CompleteUserName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CompleteTime` datetime(6) NULL,
    `WarehouseCode` longtext CHARACTER SET utf8mb4 NULL,
    CONSTRAINT `PK_Job_UnplannedReceiptJob` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_BackFlushNote` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `PackingCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `Lot` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `LocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `LocationArea` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `LocationGroup` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `LocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `WarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `CompleteTime` datetime(6) NOT NULL,
    `Workshop` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ProdLine` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Shift` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ProductionPlanNumber` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ProductReceiptNumber` longtext CHARACTER SET utf8mb4 NULL,
    `ProductRecycleNumber` longtext CHARACTER SET utf8mb4 NULL,
    `JobNumber` longtext CHARACTER SET utf8mb4 NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    CONSTRAINT `PK_Store_BackFlushNote` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_ContainerBindNote` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `ContainerCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `LocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `BindType` int NOT NULL,
    `BindTime` datetime(6) NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    CONSTRAINT `PK_Store_ContainerBindNote` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_CountAdjustNote` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `CountNoteNumber` longtext CHARACTER SET utf8mb4 NULL,
    `CountPlanNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `Type` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CountAdjustRequestNumber` longtext CHARACTER SET utf8mb4 NULL,
    `JobNumber` longtext CHARACTER SET utf8mb4 NULL,
    `IsAdjusted` tinyint(1) NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    CONSTRAINT `PK_Store_CountAdjustNote` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_CountAdjustRequest` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `CountNoteNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CountPlanNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    `AutoSubmit` tinyint(1) NOT NULL,
    `AutoAgree` tinyint(1) NOT NULL,
    `AutoHandle` tinyint(1) NOT NULL,
    `AutoCompleteJob` tinyint(1) NOT NULL,
    `DirectCreateNote` tinyint(1) NOT NULL,
    `RequestStatus` int NOT NULL,
    CONSTRAINT `PK_Store_CountAdjustRequest` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_CountNote` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `CountPlanNumber` longtext CHARACTER SET utf8mb4 NULL,
    `Type` int NOT NULL,
    `Stage` int NOT NULL,
    `Description` varchar(64) CHARACTER SET utf8mb4 NULL,
    `BeginTime` datetime(6) NOT NULL,
    `EndTime` datetime(6) NOT NULL,
    `Adjusted` tinyint(1) NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    CONSTRAINT `PK_Store_CountNote` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_CountPlan` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `Type` int NOT NULL,
    `Stage` int NOT NULL DEFAULT 1,
    `RequestType` int NOT NULL,
    `CountMethod` int NOT NULL,
    `Description` varchar(64) CHARACTER SET utf8mb4 NULL,
    `BeginTime` datetime(6) NULL,
    `EndTime` datetime(6) NULL,
    `PlanTime` datetime(6) NOT NULL,
    `JsonItemCodes` longtext CHARACTER SET utf8mb4 NULL,
    `JsonLocationCodes` longtext CHARACTER SET utf8mb4 NULL,
    `JsonInventoryStatus` longtext CHARACTER SET utf8mb4 NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    `AutoSubmit` tinyint(1) NOT NULL,
    `AutoAgree` tinyint(1) NOT NULL,
    `AutoHandle` tinyint(1) NOT NULL,
    `AutoCompleteJob` tinyint(1) NOT NULL,
    `DirectCreateNote` tinyint(1) NOT NULL,
    `RequestStatus` int NOT NULL,
    CONSTRAINT `PK_Store_CountPlan` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_CustomerAsn` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `SoNumber` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `CustomerCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Status` int NOT NULL,
    `ContactName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ContactPhone` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ContactEmail` varchar(64) CHARACTER SET utf8mb4 NULL,
    `DockCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `BeginTime` datetime(6) NULL,
    `EndTime` datetime(6) NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    CONSTRAINT `PK_Store_CustomerAsn` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_CustomerReturnNote` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `JobNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ReturnTime` datetime(6) NOT NULL,
    `Customer` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    CONSTRAINT `PK_Store_CustomerReturnNote` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_DeliverNote` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `JobNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CustomerCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `CustomerAddressCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `DeliverPlanNumber` longtext CHARACTER SET utf8mb4 NULL,
    `DeliverTime` datetime(6) NOT NULL,
    `DeliverRequestNumber` longtext CHARACTER SET utf8mb4 NULL,
    `DeliverRequestType` int NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    CONSTRAINT `PK_Store_DeliverNote` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_DeliverPlan` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `PlanDate` datetime(6) NOT NULL,
    `PlanTime` datetime(6) NOT NULL,
    `CustomerCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `CustomerAddressCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Project` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `SoNumber` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    `AutoSubmit` tinyint(1) NOT NULL,
    `AutoAgree` tinyint(1) NOT NULL,
    `AutoHandle` tinyint(1) NOT NULL,
    `AutoCompleteJob` tinyint(1) NOT NULL,
    `DirectCreateNote` tinyint(1) NOT NULL,
    `RequestStatus` int NOT NULL,
    CONSTRAINT `PK_Store_DeliverPlan` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_DeliverRequest` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `DeliverTime` datetime(6) NOT NULL,
    `DeliverPlanNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CustomerCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `CustomerAddressCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `DeliverRequestType` int NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    `AutoSubmit` tinyint(1) NOT NULL,
    `AutoAgree` tinyint(1) NOT NULL,
    `AutoHandle` tinyint(1) NOT NULL,
    `AutoCompleteJob` tinyint(1) NOT NULL,
    `DirectCreateNote` tinyint(1) NOT NULL,
    `RequestStatus` int NOT NULL,
    CONSTRAINT `PK_Store_DeliverRequest` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_ExchangeData` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `Number` bigint NOT NULL,
    `DataType` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `DataAction` int NOT NULL,
    `EffectiveDate` datetime(6) NOT NULL,
    `Status` int NOT NULL,
    `DataIdentityCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `DataContent` longtext CHARACTER SET utf8mb4 NULL,
    `DestinationSystem` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ReadTime` datetime(6) NULL,
    `Reader` longtext CHARACTER SET utf8mb4 NULL,
    `SourceSystem` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `WriteTime` datetime(6) NOT NULL,
    `Writer` longtext CHARACTER SET utf8mb4 NULL,
    `ErrorCode` int NOT NULL,
    `ErrorMessage` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `RetryTimes` int NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    CONSTRAINT `PK_Store_ExchangeData` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_InspectAbnormalNote` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `InspectNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ReceiptNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    CONSTRAINT `PK_Store_InspectAbnormalNote` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_InspectNote` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `InspectNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ReceiptNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `PurchaseReceiptRequestNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `AsnNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RpNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `PoNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `NextAction` int NOT NULL,
    `JobNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    CONSTRAINT `PK_Store_InspectNote` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_InspectRequest` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `ReceiptNumber` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `PurchaseReceiptRequestNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `AsnNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RpNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `PoNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    `AutoSubmit` tinyint(1) NOT NULL,
    `AutoAgree` tinyint(1) NOT NULL,
    `AutoHandle` tinyint(1) NOT NULL,
    `AutoCompleteJob` tinyint(1) NOT NULL,
    `DirectCreateNote` tinyint(1) NOT NULL,
    `RequestStatus` int NOT NULL,
    CONSTRAINT `PK_Store_InspectRequest` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_InventoryInitialNote` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `RequestNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    CONSTRAINT `PK_Store_InventoryInitialNote` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_InventoryTransferNote` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `TransferType` int NOT NULL,
    `JobNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    CONSTRAINT `PK_Store_InventoryTransferNote` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_IsolationNote` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `JobNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    CONSTRAINT `PK_Store_IsolationNote` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_IssueNote` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `JobNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `Workshop` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RequestNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RequestType` varchar(64) CHARACTER SET utf8mb4 NULL,
    `UseOnTheWayLocation` tinyint(1) NOT NULL,
    `ConfirmTime` datetime(6) NULL,
    `Confirmed` tinyint(1) NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    CONSTRAINT `PK_Store_IssueNote` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_ItemTransformNote` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `RequestNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `JobNumber` longtext CHARACTER SET utf8mb4 NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    CONSTRAINT `PK_Store_ItemTransformNote` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_ItemTransformRequest` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    `AutoSubmit` tinyint(1) NOT NULL,
    `AutoAgree` tinyint(1) NOT NULL,
    `AutoHandle` tinyint(1) NOT NULL,
    `AutoCompleteJob` tinyint(1) NOT NULL,
    `DirectCreateNote` tinyint(1) NOT NULL,
    `RequestStatus` int NOT NULL,
    CONSTRAINT `PK_Store_ItemTransformRequest` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_JisDeliverNote` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `JobNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `Customer` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `CustomerAddressCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ProjectCode` longtext CHARACTER SET utf8mb4 NULL,
    `DeliverTime` datetime(6) NOT NULL,
    `ContainerQty` decimal(18,6) NOT NULL,
    `ItemQty` decimal(18,6) NOT NULL,
    `TotalPackCapacity` longtext CHARACTER SET utf8mb4 NULL,
    `ArrivalTime` datetime(6) NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    CONSTRAINT `PK_Store_JisDeliverNote` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_JisProductReceiptNote` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `ReceiptType` int NOT NULL,
    `SourceNumber` longtext CHARACTER SET utf8mb4 NULL,
    `JobNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ProductionPlanNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationCode` longtext CHARACTER SET utf8mb4 NULL,
    `RawLocationCode` longtext CHARACTER SET utf8mb4 NULL,
    `ProdLine` longtext CHARACTER SET utf8mb4 NULL,
    `WorkShop` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Shift` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CompleteTime` datetime(6) NOT NULL,
    `ContainerQty` decimal(18,6) NOT NULL,
    `ItemQty` decimal(18,6) NOT NULL,
    `WarehouseCode` longtext CHARACTER SET utf8mb4 NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    CONSTRAINT `PK_Store_JisProductReceiptNote` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_MaterialRequest` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `Type` varchar(64) CHARACTER SET utf8mb4 NULL,
    `PreparationPlanNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ProdLine` varchar(64) CHARACTER SET utf8mb4 NULL,
    `Workshop` varchar(64) CHARACTER SET utf8mb4 NULL,
    `UseOnTheWayLocation` tinyint(1) NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    `AutoSubmit` tinyint(1) NOT NULL,
    `AutoAgree` tinyint(1) NOT NULL,
    `AutoHandle` tinyint(1) NOT NULL,
    `AutoCompleteJob` tinyint(1) NOT NULL,
    `DirectCreateNote` tinyint(1) NOT NULL,
    `RequestStatus` int NOT NULL DEFAULT 1,
    CONSTRAINT `PK_Store_MaterialRequest` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_NoOkConvertOkNote` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    CONSTRAINT `PK_Store_NoOkConvertOkNote` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_OfflineSettlementNote` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `JobNumber` longtext CHARACTER SET utf8mb4 NULL,
    `ProductReceiptNumber` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    CONSTRAINT `PK_Store_OfflineSettlementNote` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_PreparationPlan` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `ProductionPlanNumber` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Workshop` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ProdLine` varchar(64) CHARACTER SET utf8mb4 NULL,
    `Shift` varchar(64) CHARACTER SET utf8mb4 NULL,
    `Team` varchar(64) CHARACTER SET utf8mb4 NULL,
    `PlanDate` datetime(6) NOT NULL,
    `PlanTime` datetime(6) NOT NULL,
    `Status` int NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    CONSTRAINT `PK_Store_PreparationPlan` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_ProductionPlan` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `Workshop` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ProdLine` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Shift` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Team` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `PlanDate` datetime(6) NOT NULL,
    `PlanTime` datetime(6) NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    `AutoSubmit` tinyint(1) NOT NULL,
    `AutoAgree` tinyint(1) NOT NULL,
    `AutoHandle` tinyint(1) NOT NULL,
    `AutoCompleteJob` tinyint(1) NOT NULL,
    `DirectCreateNote` tinyint(1) NOT NULL,
    `RequestStatus` int NOT NULL,
    CONSTRAINT `PK_Store_ProductionPlan` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_ProductionReturnNote` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `JobNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ProductionReturnRequestNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ReturnTime` datetime(6) NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    CONSTRAINT `PK_Store_ProductionReturnNote` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_ProductionReturnRequest` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    `AutoSubmit` tinyint(1) NOT NULL,
    `AutoAgree` tinyint(1) NOT NULL,
    `AutoHandle` tinyint(1) NOT NULL,
    `AutoCompleteJob` tinyint(1) NOT NULL,
    `DirectCreateNote` tinyint(1) NOT NULL,
    `RequestStatus` int NOT NULL DEFAULT 1,
    CONSTRAINT `PK_Store_ProductionReturnRequest` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_ProductL7PartsNote` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `Year` longtext CHARACTER SET utf8mb4 NULL,
    `ProductNo` longtext CHARACTER SET utf8mb4 NULL,
    `Program` longtext CHARACTER SET utf8mb4 NULL,
    `Position` longtext CHARACTER SET utf8mb4 NULL,
    `FATA` longtext CHARACTER SET utf8mb4 NULL,
    `Configuration` longtext CHARACTER SET utf8mb4 NULL,
    `ContainerCode` longtext CHARACTER SET utf8mb4 NULL,
    `State` int NOT NULL,
    `CreateDate` datetime(6) NOT NULL,
    `Status` int NOT NULL,
    `ReceiptNumber` longtext CHARACTER SET utf8mb4 NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    CONSTRAINT `PK_Store_ProductL7PartsNote` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_ProductReceiptNote` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `ReceiptType` int NOT NULL,
    `SourceNumber` longtext CHARACTER SET utf8mb4 NULL,
    `JobNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ProductionPlanNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ProductReceiptRequestNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `WorkShop` varchar(64) CHARACTER SET utf8mb4 NULL,
    `Shift` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CompleteTime` datetime(6) NOT NULL,
    `Type` varchar(64) CHARACTER SET utf8mb4 NULL,
    `WarehouseCode` longtext CHARACTER SET utf8mb4 NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    CONSTRAINT `PK_Store_ProductReceiptNote` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_ProductReceiptRequest` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `ProductionPlanNumber` longtext CHARACTER SET utf8mb4 NULL,
    `Workshop` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ProdLine` varchar(64) CHARACTER SET utf8mb4 NULL,
    `Shift` varchar(64) CHARACTER SET utf8mb4 NULL,
    `Team` varchar(64) CHARACTER SET utf8mb4 NULL,
    `PlanDate` datetime(6) NOT NULL,
    `Type` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    `AutoSubmit` tinyint(1) NOT NULL,
    `AutoAgree` tinyint(1) NOT NULL,
    `AutoHandle` tinyint(1) NOT NULL,
    `AutoCompleteJob` tinyint(1) NOT NULL,
    `DirectCreateNote` tinyint(1) NOT NULL,
    `RequestStatus` int NOT NULL,
    CONSTRAINT `PK_Store_ProductReceiptRequest` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_ProductRecycleNote` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `RequestNumber` longtext CHARACTER SET utf8mb4 NULL,
    `RecycleTime` datetime(6) NOT NULL,
    `Workshop` varchar(64) CHARACTER SET utf8mb4 NULL,
    `Shift` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    CONSTRAINT `PK_Store_ProductRecycleNote` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_ProductRecycleRequest` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `Workshop` varchar(64) CHARACTER SET utf8mb4 NULL,
    `Shift` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    `AutoSubmit` tinyint(1) NOT NULL,
    `AutoAgree` tinyint(1) NOT NULL,
    `AutoHandle` tinyint(1) NOT NULL,
    `AutoCompleteJob` tinyint(1) NOT NULL,
    `DirectCreateNote` tinyint(1) NOT NULL,
    `RequestStatus` int NOT NULL,
    CONSTRAINT `PK_Store_ProductRecycleRequest` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_PurchaseOrder` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `SupplierCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `PoType` varchar(64) CHARACTER SET utf8mb4 NULL,
    `OrderStatus` int NOT NULL,
    `IsConsignment` tinyint(1) NOT NULL DEFAULT FALSE,
    `OrderDate` datetime(6) NOT NULL,
    `DueDate` datetime(6) NOT NULL,
    `Version` varchar(64) CHARACTER SET utf8mb4 NULL,
    `TaxRate` decimal(18,6) NOT NULL DEFAULT 0.0,
    `ContactName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ContactPhone` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ContactEmail` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    CONSTRAINT `PK_Store_PurchaseOrder` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_PurchaseReceiptNote` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `PurchaseReceiptRequestNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `AsnNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RpNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `PoNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ReceiveTime` datetime(6) NOT NULL,
    `JobNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `Type` int NOT NULL,
    `Status` int NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    CONSTRAINT `PK_Store_PurchaseReceiptNote` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_PurchaseReceiptRequest` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `AsnNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RpNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `PoNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `SupplierName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `TruckNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `DockCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `TimeWindow` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `PlanArriveDate` datetime(6) NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    `AutoSubmit` tinyint(1) NOT NULL,
    `AutoAgree` tinyint(1) NOT NULL,
    `AutoHandle` tinyint(1) NOT NULL,
    `AutoCompleteJob` tinyint(1) NOT NULL,
    `DirectCreateNote` tinyint(1) NOT NULL,
    `RequestStatus` int NOT NULL,
    CONSTRAINT `PK_Store_PurchaseReceiptRequest` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_PurchaseReturnNote` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `JobNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RpNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `AsnNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `PoNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `PurchaseReturnRequestNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ReturnReason` longtext CHARACTER SET utf8mb4 NULL,
    `ReturnTime` datetime(6) NOT NULL,
    `ReturnType` int NOT NULL DEFAULT 2,
    `Status` int NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    CONSTRAINT `PK_Store_PurchaseReturnNote` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_PurchaseReturnRequest` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `RpNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `AsnNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `PoNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ReturnTime` datetime(6) NOT NULL,
    `ReturnType` int NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    `AutoSubmit` tinyint(1) NOT NULL,
    `AutoAgree` tinyint(1) NOT NULL,
    `AutoHandle` tinyint(1) NOT NULL,
    `AutoCompleteJob` tinyint(1) NOT NULL,
    `DirectCreateNote` tinyint(1) NOT NULL,
    `RequestStatus` int NOT NULL,
    CONSTRAINT `PK_Store_PurchaseReturnRequest` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_PutawayNote` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `JobNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `InspectNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ReceiptNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `PurchaseReceiptRequestNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `AsnNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RpNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ProductReceiptNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `Type` int NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    CONSTRAINT `PK_Store_PutawayNote` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_PutawayRequest` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `PutawayMode` int NOT NULL,
    `SupplierCode` longtext CHARACTER SET utf8mb4 NULL,
    `InspectNumber` longtext CHARACTER SET utf8mb4 NULL,
    `ReceiptNumber` longtext CHARACTER SET utf8mb4 NULL,
    `PurchaseReceiptRequestNumber` longtext CHARACTER SET utf8mb4 NULL,
    `AsnNumber` longtext CHARACTER SET utf8mb4 NULL,
    `RpNumber` longtext CHARACTER SET utf8mb4 NULL,
    `PoNumber` longtext CHARACTER SET utf8mb4 NULL,
    `ProductReceiptNumber` longtext CHARACTER SET utf8mb4 NULL,
    `Type` int NOT NULL,
    `RequestNumber` longtext CHARACTER SET utf8mb4 NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    `AutoSubmit` tinyint(1) NOT NULL,
    `AutoAgree` tinyint(1) NOT NULL,
    `AutoHandle` tinyint(1) NOT NULL,
    `AutoCompleteJob` tinyint(1) NOT NULL,
    `DirectCreateNote` tinyint(1) NOT NULL,
    `RequestStatus` int NOT NULL,
    CONSTRAINT `PK_Store_PutawayRequest` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_ReceiptAbnormalNote` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `ReceiptNumber` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `AsnNumber` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `SupplierCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    CONSTRAINT `PK_Store_ReceiptAbnormalNote` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_RecycledMaterialReceiptNote` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    CONSTRAINT `PK_Store_RecycledMaterialReceiptNote` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_SaleOrder` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `CustomerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SoType` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SoStatus` int NOT NULL,
    `OrderDate` datetime(6) NOT NULL,
    `DueDate` datetime(6) NOT NULL,
    `Version` varchar(64) CHARACTER SET utf8mb4 NULL,
    `TaxRate` decimal(18,6) NOT NULL DEFAULT 0.0,
    `ContactName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ContactPhone` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ContactEmail` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    CONSTRAINT `PK_Store_SaleOrder` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_ScrapNote` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `JobNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ScrapRequestNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `Type` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    CONSTRAINT `PK_Store_ScrapNote` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_ScrapRequest` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `Type` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    `AutoSubmit` tinyint(1) NOT NULL,
    `AutoAgree` tinyint(1) NOT NULL,
    `AutoHandle` tinyint(1) NOT NULL,
    `AutoCompleteJob` tinyint(1) NOT NULL,
    `DirectCreateNote` tinyint(1) NOT NULL,
    `RequestStatus` int NOT NULL,
    CONSTRAINT `PK_Store_ScrapRequest` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_SupplierAsn` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `RpNumber` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `PoNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Status` int NOT NULL,
    `ContactName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ContactPhone` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ContactEmail` varchar(64) CHARACTER SET utf8mb4 NULL,
    `TruckNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `DockCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ShipDate` datetime(6) NOT NULL,
    `DueDate` datetime(6) NOT NULL,
    `TimeWindow` varchar(64) CHARACTER SET utf8mb4 NULL,
    `PlanArriveDate` datetime(6) NOT NULL,
    `Ctype` longtext CHARACTER SET utf8mb4 NULL,
    `PlanUserCode` longtext CHARACTER SET utf8mb4 NULL,
    `CreateType` int NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    CONSTRAINT `PK_Store_SupplierAsn` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_TransferNote` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `RequestNumber` longtext CHARACTER SET utf8mb4 NULL,
    `JobNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `Type` varchar(64) CHARACTER SET utf8mb4 NULL,
    `UseOnTheWayLocation` tinyint(1) NOT NULL,
    `ConfirmTime` datetime(6) NULL,
    `Confirmed` tinyint(1) NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    CONSTRAINT `PK_Store_TransferNote` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_TransferRequest` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `Type` varchar(64) CHARACTER SET utf8mb4 NULL,
    `UseOnTheWayLocation` tinyint(1) NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    `AutoSubmit` tinyint(1) NOT NULL,
    `AutoAgree` tinyint(1) NOT NULL,
    `AutoHandle` tinyint(1) NOT NULL,
    `AutoCompleteJob` tinyint(1) NOT NULL,
    `DirectCreateNote` tinyint(1) NOT NULL,
    `RequestStatus` int NOT NULL,
    CONSTRAINT `PK_Store_TransferRequest` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_UnplannedIssueNote` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `DeptCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `DeptName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `BuildDate` datetime(6) NOT NULL,
    `UnplannedIssueRequestNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `JobNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    CONSTRAINT `PK_Store_UnplannedIssueNote` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_UnplannedIssueRequest` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `DeptCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `DeptName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `BuildDate` datetime(6) NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    `AutoSubmit` tinyint(1) NOT NULL,
    `AutoAgree` tinyint(1) NOT NULL,
    `AutoHandle` tinyint(1) NOT NULL,
    `AutoCompleteJob` tinyint(1) NOT NULL,
    `DirectCreateNote` tinyint(1) NOT NULL,
    `RequestStatus` int NOT NULL,
    CONSTRAINT `PK_Store_UnplannedIssueRequest` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_UnplannedReceiptNote` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `DeptCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `DeptName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `BuildDate` datetime(6) NOT NULL,
    `UnplannedReceiptRequestNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `JobNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    CONSTRAINT `PK_Store_UnplannedReceiptNote` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_UnplannedReceiptRequest` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `DeptCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `DeptName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `BuildDate` datetime(6) NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    `AutoSubmit` tinyint(1) NOT NULL,
    `AutoAgree` tinyint(1) NOT NULL,
    `AutoHandle` tinyint(1) NOT NULL,
    `AutoCompleteJob` tinyint(1) NOT NULL,
    `DirectCreateNote` tinyint(1) NOT NULL,
    `RequestStatus` int NOT NULL,
    CONSTRAINT `PK_Store_UnplannedReceiptRequest` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_WarehouseTransferNote` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `JobNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    CONSTRAINT `PK_Store_WarehouseTransferNote` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_WorkOrder` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `WorkOrderId` varchar(64) CHARACTER SET utf8mb4 NULL,
    `EffectiveDate` datetime(6) NOT NULL,
    `WorkStation` varchar(64) CHARACTER SET utf8mb4 NULL,
    `WoStatus` int NOT NULL,
    `Op` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Type` int NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `Worker` longtext CHARACTER SET utf8mb4 NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ActiveDate` datetime(6) NOT NULL,
    CONSTRAINT `PK_Store_WorkOrder` PRIMARY KEY (`Id`)
) CHARACTER SET=utf8mb4;


CREATE TABLE `Job_CheckJobDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `Order` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CustomerItemCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    `Status` int NOT NULL,
    `ContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `PackingCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Lot` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `LocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `LocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `WarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    CONSTRAINT `PK_Job_CheckJobDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Job_CheckJobDetail_Job_CheckJob_MasterID` FOREIGN KEY (`MasterID`) REFERENCES `Job_CheckJob` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Job_CountJobDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `CountLabel` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `InventoryQty` decimal(18,6) NOT NULL,
    `Uom` longtext CHARACTER SET utf8mb4 NULL,
    `InventoryLocationCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CountQty` decimal(18,6) NOT NULL,
    `CountTime` datetime(6) NULL,
    `CountOperator` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CountDescription` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    `Status` int NOT NULL,
    `ContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `PackingCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Lot` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `LocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `LocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `WarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    CONSTRAINT `PK_Job_CountJobDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Job_CountJobDetail_Job_CountJob_MasterID` FOREIGN KEY (`MasterID`) REFERENCES `Job_CountJob` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Job_DeliverJobDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `ToLocationCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationArea` longtext CHARACTER SET utf8mb4 NULL,
    `ToLocationGroup` longtext CHARACTER SET utf8mb4 NULL,
    `ToLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `OnTheWayLocationCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    `Status` int NOT NULL,
    `RecommendContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendPackingCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendSupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendArriveDate` datetime(6) NOT NULL,
    `RecommendProduceDate` datetime(6) NOT NULL,
    `RecommendExpireDate` datetime(6) NOT NULL,
    `RecommendLot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendLocationCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `Uom` longtext CHARACTER SET utf8mb4 NULL,
    `RecommendQty` decimal(18,6) NOT NULL,
    `HandledContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledPackingCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledSupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledArriveDate` datetime(6) NOT NULL,
    `HandledProduceDate` datetime(6) NOT NULL,
    `HandledExpireDate` datetime(6) NOT NULL,
    `HandledLot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledLocationCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledQty` decimal(18,6) NOT NULL,
    CONSTRAINT `PK_Job_DeliverJobDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Job_DeliverJobDetail_Job_DeliverJob_MasterID` FOREIGN KEY (`MasterID`) REFERENCES `Job_DeliverJob` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Job_InspectJobDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `PoNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `PoLine` varchar(64) CHARACTER SET utf8mb4 NULL,
    `InspectType` int NOT NULL,
    `SamplePercent` decimal(18,6) NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ReceiveQty` decimal(18,6) NOT NULL,
    `InspectQty` decimal(18,6) NOT NULL,
    `GoodQty` decimal(18,6) NOT NULL DEFAULT 0.0,
    `FailedReason` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FailedQty` decimal(18,6) NOT NULL DEFAULT 0.0,
    `CrackQty` decimal(18,6) NOT NULL DEFAULT 0.0,
    `InspectUser` varchar(64) CHARACTER SET utf8mb4 NULL,
    `NotPassedQty` decimal(18,6) NOT NULL DEFAULT 0.0,
    `AbcClass` longtext CHARACTER SET utf8mb4 NULL,
    `DetailInspectStatus` int NOT NULL,
    `Appearance` longtext CHARACTER SET utf8mb4 NULL,
    `Volume` longtext CHARACTER SET utf8mb4 NULL,
    `Weight` longtext CHARACTER SET utf8mb4 NULL,
    `OtherPropertyJson` longtext CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    `Status` int NOT NULL,
    `ContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `PackingCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Lot` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `LocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `LocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `WarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    CONSTRAINT `PK_Job_InspectJobDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Job_InspectJobDetail_Job_InspectJob_MasterID` FOREIGN KEY (`MasterID`) REFERENCES `Job_InspectJob` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Job_InspectJobSummaryDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `PoNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `PoLine` varchar(64) CHARACTER SET utf8mb4 NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    `InspectType` int NOT NULL,
    `SamplePercent` decimal(18,6) NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ReceiveQty` decimal(18,6) NOT NULL,
    `InspectQty` decimal(18,6) NOT NULL,
    `GoodQty` decimal(18,6) NOT NULL DEFAULT 0.0,
    `FailedReason` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FailedQty` decimal(18,6) NOT NULL DEFAULT 0.0,
    `CrackQty` decimal(18,6) NOT NULL DEFAULT 0.0,
    `InspectUser` varchar(64) CHARACTER SET utf8mb4 NULL,
    `NotPassedQty` decimal(18,6) NOT NULL DEFAULT 0.0,
    `SummaryInspectStatus` int NOT NULL,
    `AbcClass` longtext CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Lot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `InspectReport` longtext CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    CONSTRAINT `PK_Job_InspectJobSummaryDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Job_InspectJobSummaryDetail_Job_InspectJob_MasterID` FOREIGN KEY (`MasterID`) REFERENCES `Job_InspectJob` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Job_IssueJobDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `RequestLocationCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `OnTheWayLocationCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ProdLine` varchar(64) CHARACTER SET utf8mb4 NULL,
    `WorkStation` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ExpiredTime` datetime(6) NOT NULL,
    `Operation` varchar(64) CHARACTER SET utf8mb4 NULL,
    `DistributionType` int NOT NULL,
    `TruncType` int NOT NULL,
    `RoundedQty` decimal(18,6) NOT NULL,
    `PlannedSplitRule` int NOT NULL,
    `PlanBeginTime` datetime(6) NOT NULL,
    `DeliveryQty` decimal(18,6) NOT NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    `Status` int NOT NULL,
    `RecommendContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendPackingCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendSupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendArriveDate` datetime(6) NOT NULL,
    `RecommendProduceDate` datetime(6) NOT NULL,
    `RecommendExpireDate` datetime(6) NOT NULL,
    `RecommendLot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendLocationCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `Uom` longtext CHARACTER SET utf8mb4 NULL,
    `RecommendQty` decimal(18,6) NOT NULL,
    `HandledContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledPackingCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledSupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledArriveDate` datetime(6) NOT NULL,
    `HandledProduceDate` datetime(6) NOT NULL,
    `HandledExpireDate` datetime(6) NOT NULL,
    `HandledLot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledLocationCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledQty` decimal(18,6) NOT NULL,
    CONSTRAINT `PK_Job_IssueJobDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Job_IssueJobDetail_Job_IssueJob_MasterID` FOREIGN KEY (`MasterID`) REFERENCES `Job_IssueJob` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Job_JisDeliverJobDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `ContainerCode` longtext CHARACTER SET utf8mb4 NULL,
    `ContainerName` longtext CHARACTER SET utf8mb4 NULL,
    `ContainerDesc` longtext CHARACTER SET utf8mb4 NULL,
    `ItemQty` decimal(18,6) NOT NULL,
    `FromLocationCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `Status` int NOT NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` longtext CHARACTER SET utf8mb4 NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    CONSTRAINT `PK_Job_JisDeliverJobDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Job_JisDeliverJobDetail_Job_JisDeliverJob_MasterID` FOREIGN KEY (`MasterID`) REFERENCES `Job_JisDeliverJob` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Job_ProductionReturnJobDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `ToLocationCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    `Status` int NOT NULL,
    `RecommendContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendPackingCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendSupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendArriveDate` datetime(6) NOT NULL,
    `RecommendProduceDate` datetime(6) NOT NULL,
    `RecommendExpireDate` datetime(6) NOT NULL,
    `RecommendLot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendLocationCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `Uom` longtext CHARACTER SET utf8mb4 NULL,
    `RecommendQty` decimal(18,6) NOT NULL,
    `HandledContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledPackingCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledSupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledArriveDate` datetime(6) NOT NULL,
    `HandledProduceDate` datetime(6) NOT NULL,
    `HandledExpireDate` datetime(6) NOT NULL,
    `HandledLot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledLocationCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledQty` decimal(18,6) NOT NULL,
    CONSTRAINT `PK_Job_ProductionReturnJobDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Job_ProductionReturnJobDetail_Job_ProductionReturnJob_Master~` FOREIGN KEY (`MasterID`) REFERENCES `Job_ProductionReturnJob` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Job_ProductReceiveJobDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `ProdLine` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `RawLocationCode` longtext CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    `Status` int NOT NULL,
    `RecommendContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendPackingCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendSupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendArriveDate` datetime(6) NOT NULL,
    `RecommendProduceDate` datetime(6) NOT NULL,
    `RecommendExpireDate` datetime(6) NOT NULL,
    `RecommendLot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendLocationCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `Uom` longtext CHARACTER SET utf8mb4 NULL,
    `RecommendQty` decimal(18,6) NOT NULL,
    `HandledContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledPackingCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledSupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledArriveDate` datetime(6) NOT NULL,
    `HandledProduceDate` datetime(6) NOT NULL,
    `HandledExpireDate` datetime(6) NOT NULL,
    `HandledLot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledLocationCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledQty` decimal(18,6) NOT NULL,
    CONSTRAINT `PK_Job_ProductReceiveJobDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Job_ProductReceiveJobDetail_Job_ProductReceiveJob_MasterID` FOREIGN KEY (`MasterID`) REFERENCES `Job_ProductReceiveJob` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Job_PurchaseReceiptJobDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `PoNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `PoLine` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `PurchaseReceiptInspectStatus` int NOT NULL,
    `InspectPhotoJson` longtext CHARACTER SET utf8mb4 NULL,
    `FailedReason` longtext CHARACTER SET utf8mb4 NULL,
    `MassDefect` longtext CHARACTER SET utf8mb4 NULL,
    `SupplierPackUom` longtext CHARACTER SET utf8mb4 NULL,
    `SupplierPackQty` decimal(18,6) NOT NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    `Status` int NOT NULL,
    `RecommendContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendPackingCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendSupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendArriveDate` datetime(6) NOT NULL,
    `RecommendProduceDate` datetime(6) NOT NULL,
    `RecommendExpireDate` datetime(6) NOT NULL,
    `RecommendLot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendLocationCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `Uom` longtext CHARACTER SET utf8mb4 NULL,
    `RecommendQty` decimal(18,6) NOT NULL,
    `HandledContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledPackingCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledSupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledArriveDate` datetime(6) NOT NULL,
    `HandledProduceDate` datetime(6) NOT NULL,
    `HandledExpireDate` datetime(6) NOT NULL,
    `HandledLot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledLocationCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledQty` decimal(18,6) NOT NULL,
    CONSTRAINT `PK_Job_PurchaseReceiptJobDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Job_PurchaseReceiptJobDetail_Job_PurchaseReceiptJob_MasterID` FOREIGN KEY (`MasterID`) REFERENCES `Job_PurchaseReceiptJob` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Job_PurchaseReturnJobDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `PoNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `PoLine` varchar(64) CHARACTER SET utf8mb4 NULL,
    `Reason` longtext CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    `Status` int NOT NULL,
    `RecommendContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendPackingCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendSupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendArriveDate` datetime(6) NOT NULL,
    `RecommendProduceDate` datetime(6) NOT NULL,
    `RecommendExpireDate` datetime(6) NOT NULL,
    `RecommendLot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendLocationCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `Uom` longtext CHARACTER SET utf8mb4 NULL,
    `RecommendQty` decimal(18,6) NOT NULL,
    `HandledContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledPackingCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledSupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledArriveDate` datetime(6) NOT NULL,
    `HandledProduceDate` datetime(6) NOT NULL,
    `HandledExpireDate` datetime(6) NOT NULL,
    `HandledLot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledLocationCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledQty` decimal(18,6) NOT NULL,
    CONSTRAINT `PK_Job_PurchaseReturnJobDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Job_PurchaseReturnJobDetail_Job_PurchaseReturnJob_MasterID` FOREIGN KEY (`MasterID`) REFERENCES `Job_PurchaseReturnJob` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Job_PutawayJobDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `PoNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `PoLine` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `Qty` decimal(18,6) NOT NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    `Status` int NOT NULL,
    `RecommendContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendPackingCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendSupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendArriveDate` datetime(6) NOT NULL,
    `RecommendProduceDate` datetime(6) NOT NULL,
    `RecommendExpireDate` datetime(6) NOT NULL,
    `RecommendLot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendLocationCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `RecommendQty` decimal(18,6) NOT NULL,
    `HandledContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledPackingCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledSupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledArriveDate` datetime(6) NOT NULL,
    `HandledProduceDate` datetime(6) NOT NULL,
    `HandledExpireDate` datetime(6) NOT NULL,
    `HandledLot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledLocationCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledQty` decimal(18,6) NOT NULL,
    CONSTRAINT `PK_Job_PutawayJobDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Job_PutawayJobDetail_Job_PutawayJob_MasterID` FOREIGN KEY (`MasterID`) REFERENCES `Job_PutawayJob` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Job_UnplannedIssueJobDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `ReasonCode` longtext CHARACTER SET utf8mb4 NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    `Status` int NOT NULL,
    `RecommendContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendPackingCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendSupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendArriveDate` datetime(6) NOT NULL,
    `RecommendProduceDate` datetime(6) NOT NULL,
    `RecommendExpireDate` datetime(6) NOT NULL,
    `RecommendLot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendLocationCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `Uom` longtext CHARACTER SET utf8mb4 NULL,
    `RecommendQty` decimal(18,6) NOT NULL,
    `HandledContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledPackingCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledSupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledArriveDate` datetime(6) NOT NULL,
    `HandledProduceDate` datetime(6) NOT NULL,
    `HandledExpireDate` datetime(6) NOT NULL,
    `HandledLot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledLocationCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledQty` decimal(18,6) NOT NULL,
    CONSTRAINT `PK_Job_UnplannedIssueJobDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Job_UnplannedIssueJobDetail_Job_UnplannedIssueJob_MasterID` FOREIGN KEY (`MasterID`) REFERENCES `Job_UnplannedIssueJob` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Job_UnplannedReceiptJobDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `ReasonCode` longtext CHARACTER SET utf8mb4 NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    `Status` int NOT NULL,
    `RecommendContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendPackingCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendSupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendArriveDate` datetime(6) NOT NULL,
    `RecommendProduceDate` datetime(6) NOT NULL,
    `RecommendExpireDate` datetime(6) NOT NULL,
    `RecommendLot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendLocationCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RecommendWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `Uom` longtext CHARACTER SET utf8mb4 NULL,
    `RecommendQty` decimal(18,6) NOT NULL,
    `HandledContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledPackingCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledSupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledArriveDate` datetime(6) NOT NULL,
    `HandledProduceDate` datetime(6) NOT NULL,
    `HandledExpireDate` datetime(6) NOT NULL,
    `HandledLot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledLocationCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `HandledQty` decimal(18,6) NOT NULL,
    CONSTRAINT `PK_Job_UnplannedReceiptJobDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Job_UnplannedReceiptJobDetail_Job_UnplannedReceiptJob_Master~` FOREIGN KEY (`MasterID`) REFERENCES `Job_UnplannedReceiptJob` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_BackFlushNoteDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `BomVersion` varchar(64) CHARACTER SET utf8mb4 NULL,
    `IsOffLine` tinyint(1) NOT NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Lot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `PackingCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `LocationArea` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `LocationGroup` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `LocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `WarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Status` int NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    CONSTRAINT `PK_Store_BackFlushNoteDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_BackFlushNoteDetail_Store_BackFlushNote_MasterID` FOREIGN KEY (`MasterID`) REFERENCES `Store_BackFlushNote` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_ContainerBindNoteDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Lot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `PackingCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    CONSTRAINT `PK_Store_ContainerBindNoteDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_ContainerBindNoteDetail_Store_ContainerBindNote_Master~` FOREIGN KEY (`MasterID`) REFERENCES `Store_ContainerBindNote` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_CountAdjustNoteDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `CountLabel` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `InventoryQty` decimal(18,6) NOT NULL,
    `TransInOut` int NOT NULL,
    `ReasonCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CountQty` decimal(18,6) NOT NULL,
    `AdjustQty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Lot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `PackingCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `LocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `WarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Status` int NOT NULL,
    CONSTRAINT `PK_Store_CountAdjustNoteDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_CountAdjustNoteDetail_Store_CountAdjustNote_MasterID` FOREIGN KEY (`MasterID`) REFERENCES `Store_CountAdjustNote` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_CountAdjustRequestDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `ReasonCode` longtext CHARACTER SET utf8mb4 NULL,
    `InventoryQty` decimal(18,6) NOT NULL,
    `CountQty` decimal(18,6) NOT NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Lot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `PackingCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `LocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `WarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Status` int NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    CONSTRAINT `PK_Store_CountAdjustRequestDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_CountAdjustRequestDetail_Store_CountAdjustRequest_Mast~` FOREIGN KEY (`MasterID`) REFERENCES `Store_CountAdjustRequest` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_CountNoteDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `CountPlanNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CountLabel` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Uom` longtext CHARACTER SET utf8mb4 NULL,
    `InventoryQty` decimal(18,6) NOT NULL,
    `FirstCountQty` decimal(18,6) NOT NULL,
    `FirstCountTime` datetime(6) NULL,
    `FirstCountOperator` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FirstCountDescription` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RepeatCountQty` decimal(18,6) NOT NULL,
    `RepeatCountTime` datetime(6) NULL,
    `RepeatCountOperator` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RepeatCountDescription` varchar(64) CHARACTER SET utf8mb4 NULL,
    `AuditCountQty` decimal(18,6) NOT NULL,
    `AuditCountTime` datetime(6) NULL,
    `AuditCountOperator` varchar(64) CHARACTER SET utf8mb4 NULL,
    `AuditCountDescription` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FinalCountQty` decimal(18,6) NOT NULL,
    `DetailStatus` int NOT NULL,
    `Stage` int NOT NULL,
    `Adjusted` tinyint(1) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Lot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `PackingCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `LocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `WarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Status` int NOT NULL,
    CONSTRAINT `PK_Store_CountNoteDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_CountNoteDetail_Store_CountNote_MasterID` FOREIGN KEY (`MasterID`) REFERENCES `Store_CountNote` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_CountPlanDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `CountLabel` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NULL,
    `InventoryQty` decimal(18,6) NOT NULL,
    `FirstCountQty` decimal(18,6) NOT NULL,
    `FirstCountTime` datetime(6) NULL,
    `FirstCountOperator` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FirstCountDescription` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RepeatCountQty` decimal(18,6) NOT NULL,
    `RepeatCountTime` datetime(6) NULL,
    `RepeatCountOperator` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RepeatCountDescription` varchar(64) CHARACTER SET utf8mb4 NULL,
    `AuditCountQty` decimal(18,6) NOT NULL,
    `AuditCountTime` datetime(6) NULL,
    `AuditCountOperator` varchar(64) CHARACTER SET utf8mb4 NULL,
    `AuditCountDescription` varchar(64) CHARACTER SET utf8mb4 NULL,
    `DetailStatus` int NOT NULL,
    `Stage` int NOT NULL,
    `FinalCountQty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Lot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `PackingCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `LocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `WarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Status` int NOT NULL,
    CONSTRAINT `PK_Store_CountPlanDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_CountPlanDetail_Store_CountPlan_MasterID` FOREIGN KEY (`MasterID`) REFERENCES `Store_CountPlan` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_CustomerAsnDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `SoNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SoLine` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    CONSTRAINT `PK_Store_CustomerAsnDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_CustomerAsnDetail_Store_CustomerAsn_MasterID` FOREIGN KEY (`MasterID`) REFERENCES `Store_CustomerAsn` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_CustomerReturnNoteDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    `FromPackingCode` varchar(255) CHARACTER SET utf8mb4 NULL,
    `ToPackingCode` longtext CHARACTER SET utf8mb4 NULL,
    `FromContainerCode` longtext CHARACTER SET utf8mb4 NULL,
    `ToContainerCode` longtext CHARACTER SET utf8mb4 NULL,
    `FromLot` longtext CHARACTER SET utf8mb4 NULL,
    `ToLot` longtext CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `FromLocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromStatus` int NOT NULL,
    `ToLocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToStatus` int NOT NULL,
    CONSTRAINT `PK_Store_CustomerReturnNoteDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_CustomerReturnNoteDetail_Store_CustomerReturnNote_Mast~` FOREIGN KEY (`MasterID`) REFERENCES `Store_CustomerReturnNote` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_DeliverNoteDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    `FromPackingCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToPackingCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromContainerCode` longtext CHARACTER SET utf8mb4 NULL,
    `ToContainerCode` longtext CHARACTER SET utf8mb4 NULL,
    `FromLot` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToLot` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `FromLocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromStatus` int NOT NULL,
    `ToLocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToStatus` int NOT NULL,
    CONSTRAINT `PK_Store_DeliverNoteDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_DeliverNoteDetail_Store_DeliverNote_MasterID` FOREIGN KEY (`MasterID`) REFERENCES `Store_DeliverNote` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_DeliverPlanDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `SoNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SoLine` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    CONSTRAINT `PK_Store_DeliverPlanDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_DeliverPlanDetail_Store_DeliverPlan_MasterID` FOREIGN KEY (`MasterID`) REFERENCES `Store_DeliverPlan` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_DeliverRequestDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `AreaCode` longtext CHARACTER SET utf8mb4 NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    CONSTRAINT `PK_Store_DeliverRequestDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_DeliverRequestDetail_Store_DeliverRequest_MasterID` FOREIGN KEY (`MasterID`) REFERENCES `Store_DeliverRequest` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_InspectAbnormalNoteDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `AbnormalType` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Photos` longtext CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Lot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `PackingCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    CONSTRAINT `PK_Store_InspectAbnormalNoteDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_InspectAbnormalNoteDetail_Store_InspectAbnormalNote_Ma~` FOREIGN KEY (`MasterID`) REFERENCES `Store_InspectAbnormalNote` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_InspectNoteDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `PoNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `PoLine` varchar(64) CHARACTER SET utf8mb4 NULL,
    `InspectType` int NOT NULL,
    `SamplePercent` decimal(18,6) NOT NULL DEFAULT 0.0,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ReceiveQty` decimal(18,6) NOT NULL,
    `InspectQty` decimal(18,6) NOT NULL DEFAULT 0.0,
    `GoodQty` decimal(18,6) NOT NULL DEFAULT 0.0,
    `FailedReason` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FailedQty` decimal(18,6) NOT NULL DEFAULT 0.0,
    `CrackQty` decimal(18,6) NOT NULL DEFAULT 0.0,
    `Photos` longtext CHARACTER SET utf8mb4 NULL,
    `InspectUser` varchar(64) CHARACTER SET utf8mb4 NULL,
    `NotPassedQty` decimal(18,6) NOT NULL,
    `DetailInspectStatus` int NOT NULL,
    `AbcClass` longtext CHARACTER SET utf8mb4 NULL,
    `Appearance` longtext CHARACTER SET utf8mb4 NULL,
    `Volume` longtext CHARACTER SET utf8mb4 NULL,
    `Weight` longtext CHARACTER SET utf8mb4 NULL,
    `OtherPropertyJson` longtext CHARACTER SET utf8mb4 NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Lot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `PackingCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `LocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `WarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Status` int NOT NULL,
    CONSTRAINT `PK_Store_InspectNoteDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_InspectNoteDetail_Store_InspectNote_MasterID` FOREIGN KEY (`MasterID`) REFERENCES `Store_InspectNote` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_InspectNoteSummaryDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `PoNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `PoLine` varchar(64) CHARACTER SET utf8mb4 NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    `InspectType` int NOT NULL,
    `SamplePercent` decimal(18,6) NOT NULL DEFAULT 0.0,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ReceiveQty` decimal(18,6) NOT NULL,
    `InspectQty` decimal(18,6) NOT NULL DEFAULT 0.0,
    `GoodQty` decimal(18,6) NOT NULL DEFAULT 0.0,
    `FailedReason` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FailedQty` decimal(18,6) NOT NULL DEFAULT 0.0,
    `CrackQty` decimal(18,6) NOT NULL DEFAULT 0.0,
    `InspectUser` varchar(64) CHARACTER SET utf8mb4 NULL,
    `NotPassedQty` decimal(18,6) NOT NULL,
    `SummaryInspectStatus` int NOT NULL,
    `AbcClass` longtext CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Lot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    CONSTRAINT `PK_Store_InspectNoteSummaryDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_InspectNoteSummaryDetail_Store_InspectNote_MasterID` FOREIGN KEY (`MasterID`) REFERENCES `Store_InspectNote` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_InspectRequestDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `PoNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `PoLine` varchar(64) CHARACTER SET utf8mb4 NULL,
    `InspectType` int NOT NULL,
    `SamplePercent` decimal(18,6) NOT NULL DEFAULT 0.0,
    `StdPackQty` decimal(18,6) NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ReceiveQty` decimal(18,6) NOT NULL,
    `InspectQty` decimal(18,6) NOT NULL DEFAULT 0.0,
    `Attributes` longtext CHARACTER SET utf8mb4 NULL,
    `DetailInspectStatus` int NOT NULL,
    `AbcClass` longtext CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Lot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `PackingCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `LocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `WarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Status` int NOT NULL,
    CONSTRAINT `PK_Store_InspectRequestDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_InspectRequestDetail_Store_InspectRequest_MasterID` FOREIGN KEY (`MasterID`) REFERENCES `Store_InspectRequest` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_InspectRequestSummaryDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `PoNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `PoLine` varchar(64) CHARACTER SET utf8mb4 NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    `InspectType` int NOT NULL,
    `SamplePercent` decimal(18,6) NOT NULL DEFAULT 0.0,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ReceiveQty` decimal(18,6) NOT NULL,
    `InspectQty` decimal(18,6) NOT NULL DEFAULT 0.0,
    `InspectReport` longtext CHARACTER SET utf8mb4 NULL,
    `SummaryInspectStatus` int NOT NULL,
    `GoodQty` decimal(18,6) NOT NULL,
    `FailedQty` decimal(18,6) NOT NULL,
    `CrackQty` decimal(18,6) NOT NULL,
    `NotPassedQty` decimal(18,6) NOT NULL,
    `AbcClass` longtext CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Lot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    CONSTRAINT `PK_Store_InspectRequestSummaryDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_InspectRequestSummaryDetail_Store_InspectRequest_Maste~` FOREIGN KEY (`MasterID`) REFERENCES `Store_InspectRequest` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_InventoryInitialNoteDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Lot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `PackingCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `LocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `WarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Status` int NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    CONSTRAINT `PK_Store_InventoryInitialNoteDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_InventoryInitialNoteDetail_Store_InventoryInitialNote_~` FOREIGN KEY (`MasterID`) REFERENCES `Store_InventoryInitialNote` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_InventoryTransferNoteDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `Reason` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    `FromPackingCode` varchar(255) CHARACTER SET utf8mb4 NULL,
    `ToPackingCode` longtext CHARACTER SET utf8mb4 NULL,
    `FromContainerCode` longtext CHARACTER SET utf8mb4 NULL,
    `ToContainerCode` longtext CHARACTER SET utf8mb4 NULL,
    `FromLot` longtext CHARACTER SET utf8mb4 NULL,
    `ToLot` longtext CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `FromLocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromStatus` int NOT NULL,
    `ToLocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToStatus` int NOT NULL,
    CONSTRAINT `PK_Store_InventoryTransferNoteDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_InventoryTransferNoteDetail_Store_InventoryTransferNot~` FOREIGN KEY (`MasterID`) REFERENCES `Store_InventoryTransferNote` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_IsolationNoteDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    `FromPackingCode` varchar(255) CHARACTER SET utf8mb4 NULL,
    `ToPackingCode` longtext CHARACTER SET utf8mb4 NULL,
    `FromContainerCode` longtext CHARACTER SET utf8mb4 NULL,
    `ToContainerCode` longtext CHARACTER SET utf8mb4 NULL,
    `FromLot` longtext CHARACTER SET utf8mb4 NULL,
    `ToLot` longtext CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `FromLocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromStatus` int NOT NULL,
    `ToLocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToStatus` int NOT NULL,
    CONSTRAINT `PK_Store_IsolationNoteDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_IsolationNoteDetail_Store_IsolationNote_MasterID` FOREIGN KEY (`MasterID`) REFERENCES `Store_IsolationNote` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_IssueNoteDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `IssueTime` datetime(6) NOT NULL,
    `ExpiredTime` datetime(6) NOT NULL,
    `ProdLine` varchar(64) CHARACTER SET utf8mb4 NULL,
    `WorkStation` varchar(64) CHARACTER SET utf8mb4 NULL,
    `OnTheWayLocationCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    `FromPackingCode` varchar(255) CHARACTER SET utf8mb4 NULL,
    `ToPackingCode` longtext CHARACTER SET utf8mb4 NULL,
    `FromContainerCode` longtext CHARACTER SET utf8mb4 NULL,
    `ToContainerCode` longtext CHARACTER SET utf8mb4 NULL,
    `FromLot` longtext CHARACTER SET utf8mb4 NULL,
    `ToLot` longtext CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `FromLocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromStatus` int NOT NULL,
    `ToLocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToStatus` int NOT NULL,
    CONSTRAINT `PK_Store_IssueNoteDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_IssueNoteDetail_Store_IssueNote_MasterID` FOREIGN KEY (`MasterID`) REFERENCES `Store_IssueNote` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_ItemTransformNoteDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `FromPackingCode` varchar(255) CHARACTER SET utf8mb4 NULL,
    `FromQty` decimal(18,6) NOT NULL,
    `FromSupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromArriveDate` datetime(6) NOT NULL,
    `FromProduceDate` datetime(6) NOT NULL,
    `FromExpireDate` datetime(6) NOT NULL,
    `FromLot` longtext CHARACTER SET utf8mb4 NULL,
    `FromStatus` int NOT NULL,
    `FromContainerCode` longtext CHARACTER SET utf8mb4 NULL,
    `ToItemCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToPackingCode` varchar(255) CHARACTER SET utf8mb4 NULL,
    `ToQty` decimal(18,6) NOT NULL,
    `ToSupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToArriveDate` datetime(6) NOT NULL,
    `ToProduceDate` datetime(6) NOT NULL,
    `ToExpireDate` datetime(6) NOT NULL,
    `ToLot` longtext CHARACTER SET utf8mb4 NULL,
    `ToStatus` int NOT NULL,
    `ToLocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToContainerCode` longtext CHARACTER SET utf8mb4 NULL,
    `ReasonCode` longtext CHARACTER SET utf8mb4 NULL,
    `ConcurrencyStamp` longtext CHARACTER SET utf8mb4 NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    CONSTRAINT `PK_Store_ItemTransformNoteDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_ItemTransformNoteDetail_Store_ItemTransformNote_Master~` FOREIGN KEY (`MasterID`) REFERENCES `Store_ItemTransformNote` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_ItemTransformRequestDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `FromPackingCode` varchar(255) CHARACTER SET utf8mb4 NULL,
    `FromQty` decimal(18,6) NOT NULL,
    `FromSupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromArriveDate` datetime(6) NOT NULL,
    `FromProduceDate` datetime(6) NOT NULL,
    `FromExpireDate` datetime(6) NOT NULL,
    `FromLot` longtext CHARACTER SET utf8mb4 NULL,
    `FromStatus` int NOT NULL,
    `FromContainerCode` longtext CHARACTER SET utf8mb4 NULL,
    `ToPackingCode` varchar(255) CHARACTER SET utf8mb4 NULL,
    `ToItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToItemCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToSupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToArriveDate` datetime(6) NOT NULL,
    `ToProduceDate` datetime(6) NOT NULL,
    `ToExpireDate` datetime(6) NOT NULL,
    `ToQty` decimal(18,6) NOT NULL,
    `ToLot` longtext CHARACTER SET utf8mb4 NULL,
    `ToStatus` int NOT NULL,
    `ToLocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToContainerCode` longtext CHARACTER SET utf8mb4 NULL,
    `ReasonCode` longtext CHARACTER SET utf8mb4 NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    CONSTRAINT `PK_Store_ItemTransformRequestDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_ItemTransformRequestDetail_Store_ItemTransformRequest_~` FOREIGN KEY (`MasterID`) REFERENCES `Store_ItemTransformRequest` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_JisDeliverNoteDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `DeliverTime` datetime(6) NOT NULL,
    `ExpiredTime` datetime(6) NOT NULL,
    `Year` longtext CHARACTER SET utf8mb4 NULL,
    `ProductNo` longtext CHARACTER SET utf8mb4 NULL,
    `ProjectCode` longtext CHARACTER SET utf8mb4 NULL,
    `Position` longtext CHARACTER SET utf8mb4 NULL,
    `SeqNo` longtext CHARACTER SET utf8mb4 NULL,
    `PackCapacity` longtext CHARACTER SET utf8mb4 NULL,
    `OnlineType` longtext CHARACTER SET utf8mb4 NULL,
    `Stage` longtext CHARACTER SET utf8mb4 NULL,
    `UsedFor` longtext CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    `FromPackingCode` varchar(255) CHARACTER SET utf8mb4 NULL,
    `ToPackingCode` longtext CHARACTER SET utf8mb4 NULL,
    `FromContainerCode` longtext CHARACTER SET utf8mb4 NULL,
    `ToContainerCode` longtext CHARACTER SET utf8mb4 NULL,
    `FromLot` longtext CHARACTER SET utf8mb4 NULL,
    `ToLot` longtext CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `FromLocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromStatus` int NOT NULL,
    `ToLocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToStatus` int NOT NULL,
    CONSTRAINT `PK_Store_JisDeliverNoteDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_JisDeliverNoteDetail_Store_JisDeliverNote_MasterID` FOREIGN KEY (`MasterID`) REFERENCES `Store_JisDeliverNote` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_JisProductReceiptNoteDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `RawLocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ProdLine` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `BomVersion` varchar(64) CHARACTER SET utf8mb4 NULL,
    `Year` longtext CHARACTER SET utf8mb4 NULL,
    `ProductNo` longtext CHARACTER SET utf8mb4 NULL,
    `ProjectCode` longtext CHARACTER SET utf8mb4 NULL,
    `Position` longtext CHARACTER SET utf8mb4 NULL,
    `SeqNo` longtext CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Lot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `PackingCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `LocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `WarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Status` int NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    CONSTRAINT `PK_Store_JisProductReceiptNoteDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_JisProductReceiptNoteDetail_Store_JisProductReceiptNot~` FOREIGN KEY (`MasterID`) REFERENCES `Store_JisProductReceiptNote` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_MaterialRequestDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `ToLocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToLocationArea` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToLocationGroup` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromLocationArea` longtext CHARACTER SET utf8mb4 NULL,
    `ProdLine` varchar(64) CHARACTER SET utf8mb4 NULL,
    `WorkStation` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ExpiredTime` datetime(6) NOT NULL,
    `IssuedQty` decimal(18,6) NOT NULL,
    `ReceivedQty` decimal(18,6) NOT NULL,
    `Status` int NOT NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    CONSTRAINT `PK_Store_MaterialRequestDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_MaterialRequestDetail_Store_MaterialRequest_MasterID` FOREIGN KEY (`MasterID`) REFERENCES `Store_MaterialRequest` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_NoOkConvertOkNoteDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    `FromPackingCode` varchar(255) CHARACTER SET utf8mb4 NULL,
    `ToPackingCode` longtext CHARACTER SET utf8mb4 NULL,
    `FromContainerCode` longtext CHARACTER SET utf8mb4 NULL,
    `ToContainerCode` longtext CHARACTER SET utf8mb4 NULL,
    `FromLot` longtext CHARACTER SET utf8mb4 NULL,
    `ToLot` longtext CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `FromLocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromStatus` int NOT NULL,
    `ToLocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToStatus` int NOT NULL,
    CONSTRAINT `PK_Store_NoOkConvertOkNoteDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_NoOkConvertOkNoteDetail_Store_NoOkConvertOkNote_Master~` FOREIGN KEY (`MasterID`) REFERENCES `Store_NoOkConvertOkNote` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_OfflineSettlementNoteDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Lot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `PackingCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `LocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `WarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Status` int NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    CONSTRAINT `PK_Store_OfflineSettlementNoteDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_OfflineSettlementNoteDetail_Store_OfflineSettlementNot~` FOREIGN KEY (`MasterID`) REFERENCES `Store_OfflineSettlementNote` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_PreparationPlanDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `ToLocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `WorkStation` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `LineStatus` int NOT NULL,
    `LatestTime` datetime(6) NOT NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    CONSTRAINT `PK_Store_PreparationPlanDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_PreparationPlanDetail_Store_PreparationPlan_MasterID` FOREIGN KEY (`MasterID`) REFERENCES `Store_PreparationPlan` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_ProductionPlanDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `PlanQty` decimal(18,6) NOT NULL,
    `GoodQty` decimal(18,6) NOT NULL DEFAULT 1.0,
    `NoGoodQty` decimal(18,6) NOT NULL DEFAULT 1.0,
    `BomVersion` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LineStatus` int NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Lot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    CONSTRAINT `PK_Store_ProductionPlanDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_ProductionPlanDetail_Store_ProductionPlan_MasterID` FOREIGN KEY (`MasterID`) REFERENCES `Store_ProductionPlan` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_ProductionReturnNoteDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    `FromPackingCode` varchar(255) CHARACTER SET utf8mb4 NULL,
    `ToPackingCode` varchar(255) CHARACTER SET utf8mb4 NULL,
    `FromContainerCode` longtext CHARACTER SET utf8mb4 NULL,
    `ToContainerCode` longtext CHARACTER SET utf8mb4 NULL,
    `FromLot` longtext CHARACTER SET utf8mb4 NULL,
    `ToLot` longtext CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `FromLocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromStatus` int NOT NULL,
    `ToLocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToStatus` int NOT NULL,
    CONSTRAINT `PK_Store_ProductionReturnNoteDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_ProductionReturnNoteDetail_Store_ProductionReturnNote_~` FOREIGN KEY (`MasterID`) REFERENCES `Store_ProductionReturnNote` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_ProductionReturnRequestDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    `FromPackingCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToPackingCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `FromLocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromStatus` int NOT NULL,
    `ToLocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToStatus` int NOT NULL,
    CONSTRAINT `PK_Store_ProductionReturnRequestDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_ProductionReturnRequestDetail_Store_ProductionReturnRe~` FOREIGN KEY (`MasterID`) REFERENCES `Store_ProductionReturnRequest` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_ProductL7PartsNoteDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `RowID` int NOT NULL,
    `ProductNo` varchar(255) CHARACTER SET utf8mb4 NULL,
    `Program` longtext CHARACTER SET utf8mb4 NULL,
    `Position` varchar(255) CHARACTER SET utf8mb4 NULL,
    `FATA` longtext CHARACTER SET utf8mb4 NULL,
    `Configuration` varchar(255) CHARACTER SET utf8mb4 NULL,
    `L7Part` varchar(255) CHARACTER SET utf8mb4 NULL,
    `CanMake` tinyint(1) NOT NULL,
    `CanBuy` tinyint(1) NOT NULL,
    `RawLocationCode` longtext CHARACTER SET utf8mb4 NULL,
    `LocationCode` longtext CHARACTER SET utf8mb4 NULL,
    `ProdLine` longtext CHARACTER SET utf8mb4 NULL,
    `Qty` int NOT NULL,
    `State` int NOT NULL,
    `CreateDate` datetime(6) NOT NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    CONSTRAINT `PK_Store_ProductL7PartsNoteDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_ProductL7PartsNoteDetail_Store_ProductL7PartsNote_Mast~` FOREIGN KEY (`MasterID`) REFERENCES `Store_ProductL7PartsNote` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_ProductReceiptNoteDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `RawLocationCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RawArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ProdLine` varchar(64) CHARACTER SET utf8mb4 NULL,
    `BomVersion` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ReturnQty` decimal(18,6) NOT NULL DEFAULT 0.0,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Lot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `PackingCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `LocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `WarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Status` int NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    CONSTRAINT `PK_Store_ProductReceiptNoteDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_ProductReceiptNoteDetail_Store_ProductReceiptNote_Mast~` FOREIGN KEY (`MasterID`) REFERENCES `Store_ProductReceiptNote` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_ProductReceiptRequestDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `RawArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    `BomVersion` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `LocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `WarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ReturnQty` decimal(18,6) NOT NULL DEFAULT 0.0,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Lot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    CONSTRAINT `PK_Store_ProductReceiptRequestDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_ProductReceiptRequestDetail_Store_ProductReceiptReques~` FOREIGN KEY (`MasterID`) REFERENCES `Store_ProductReceiptRequest` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_ProductRecycleMaterialDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `BomVersion` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ProductPackingCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ProductItemCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ProductItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ProductItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ProductItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ProductLot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Lot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `PackingCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `LocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `WarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Status` int NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    CONSTRAINT `PK_Store_ProductRecycleMaterialDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_ProductRecycleMaterialDetail_Store_ProductRecycleNote_~` FOREIGN KEY (`MasterID`) REFERENCES `Store_ProductRecycleNote` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_ProductRecycleNoteDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `ReasonCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Lot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `PackingCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `LocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `WarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Status` int NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    CONSTRAINT `PK_Store_ProductRecycleNoteDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_ProductRecycleNoteDetail_Store_ProductRecycleNote_Mast~` FOREIGN KEY (`MasterID`) REFERENCES `Store_ProductRecycleNote` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_ProductRecycleRequestDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `BomVersion` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `LocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `RawLocationCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RawLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RawLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RawLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RawWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `Status` int NOT NULL,
    `WarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    CONSTRAINT `PK_Store_ProductRecycleRequestDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_ProductRecycleRequestDetail_Store_ProductRecycleReques~` FOREIGN KEY (`MasterID`) REFERENCES `Store_ProductRecycleRequest` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_PurchaseOrderDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `PoLine` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierPackUom` longtext CHARACTER SET utf8mb4 NULL,
    `SupplierPackQty` decimal(18,6) NOT NULL,
    `ConvertRate` decimal(18,6) NOT NULL DEFAULT 1.0,
    `IsConsignment` tinyint(1) NOT NULL DEFAULT FALSE,
    `LineStatus` int NOT NULL,
    `LocationErpCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ProjectCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ShippedQty` decimal(18,6) NOT NULL,
    `ReceivedQty` decimal(18,6) NOT NULL,
    `ReturnedQty` decimal(18,6) NOT NULL,
    `PutAwayQty` decimal(18,6) NOT NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    CONSTRAINT `PK_Store_PurchaseOrderDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_PurchaseOrderDetail_Store_PurchaseOrder_MasterID` FOREIGN KEY (`MasterID`) REFERENCES `Store_PurchaseOrder` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_PurchaseReceiptNoteDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `PoNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `PoLine` varchar(64) CHARACTER SET utf8mb4 NULL,
    `PurchaseReceiptInspectStatus` int NOT NULL,
    `InspectPhotoJson` longtext CHARACTER SET utf8mb4 NULL,
    `FailedReason` longtext CHARACTER SET utf8mb4 NULL,
    `MassDefect` longtext CHARACTER SET utf8mb4 NULL,
    `SupplierPackUom` longtext CHARACTER SET utf8mb4 NULL,
    `SupplierPackQty` decimal(18,6) NOT NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Lot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `PackingCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `LocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `WarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Status` int NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    CONSTRAINT `PK_Store_PurchaseReceiptNoteDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_PurchaseReceiptNoteDetail_Store_PurchaseReceiptNote_Ma~` FOREIGN KEY (`MasterID`) REFERENCES `Store_PurchaseReceiptNote` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_PurchaseReceiptRequestDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `PoNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `PoLine` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierPackUom` longtext CHARACTER SET utf8mb4 NULL,
    `SupplierPackQty` decimal(18,6) NOT NULL,
    `ConvertRate` decimal(18,6) NOT NULL,
    `RecommendErpCode` longtext CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Lot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `PackingCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    CONSTRAINT `PK_Store_PurchaseReceiptRequestDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_PurchaseReceiptRequestDetail_Store_PurchaseReceiptRequ~` FOREIGN KEY (`MasterID`) REFERENCES `Store_PurchaseReceiptRequest` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_PurchaseReturnNoteDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `PoNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `PoLine` varchar(64) CHARACTER SET utf8mb4 NULL,
    `Reason` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Lot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `PackingCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `LocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `WarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Status` int NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    CONSTRAINT `PK_Store_PurchaseReturnNoteDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_PurchaseReturnNoteDetail_Store_PurchaseReturnNote_Mast~` FOREIGN KEY (`MasterID`) REFERENCES `Store_PurchaseReturnNote` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_PurchaseReturnRequestDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `PoNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `PoLine` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Lot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `PackingCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `LocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `WarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Status` int NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    CONSTRAINT `PK_Store_PurchaseReturnRequestDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_PurchaseReturnRequestDetail_Store_PurchaseReturnReques~` FOREIGN KEY (`MasterID`) REFERENCES `Store_PurchaseReturnRequest` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_PutawayNoteDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `PoNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `PoLine` varchar(64) CHARACTER SET utf8mb4 NULL,
    `JobNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    `FromPackingCode` varchar(255) CHARACTER SET utf8mb4 NULL,
    `ToPackingCode` varchar(255) CHARACTER SET utf8mb4 NULL,
    `FromContainerCode` longtext CHARACTER SET utf8mb4 NULL,
    `ToContainerCode` longtext CHARACTER SET utf8mb4 NULL,
    `FromLot` longtext CHARACTER SET utf8mb4 NULL,
    `ToLot` longtext CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `FromLocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromStatus` int NOT NULL,
    `ToLocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToStatus` int NOT NULL,
    CONSTRAINT `PK_Store_PutawayNoteDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_PutawayNoteDetail_Store_PutawayNote_MasterID` FOREIGN KEY (`MasterID`) REFERENCES `Store_PutawayNote` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_PutawayRequestDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `InventoryQty` decimal(18,6) NOT NULL,
    `PoNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `PoLine` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    `FromPackingCode` longtext CHARACTER SET utf8mb4 NULL,
    `ToPackingCode` longtext CHARACTER SET utf8mb4 NULL,
    `FromContainerCode` longtext CHARACTER SET utf8mb4 NULL,
    `ToContainerCode` longtext CHARACTER SET utf8mb4 NULL,
    `FromLot` longtext CHARACTER SET utf8mb4 NULL,
    `ToLot` longtext CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `FromLocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromStatus` int NOT NULL,
    `ToLocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToStatus` int NOT NULL,
    CONSTRAINT `PK_Store_PutawayRequestDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_PutawayRequestDetail_Store_PutawayRequest_MasterID` FOREIGN KEY (`MasterID`) REFERENCES `Store_PutawayRequest` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_ReceiptAbnormalNoteDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `ReceiptNumber` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `AbnormalType` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Photos` longtext CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Lot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `PackingCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `LocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `WarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Status` int NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    CONSTRAINT `PK_Store_ReceiptAbnormalNoteDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_ReceiptAbnormalNoteDetail_Store_ReceiptAbnormalNote_Ma~` FOREIGN KEY (`MasterID`) REFERENCES `Store_ReceiptAbnormalNote` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_RecycledMaterialReceiptNoteDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `ReasonCode` longtext CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Lot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `PackingCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `LocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `WarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Status` int NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    CONSTRAINT `PK_Store_RecycledMaterialReceiptNoteDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_RecycledMaterialReceiptNoteDetail_Store_RecycledMateri~` FOREIGN KEY (`MasterID`) REFERENCES `Store_RecycledMaterialReceiptNote` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_SaleOrderDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `SoLine` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `CustomerPackUom` longtext CHARACTER SET utf8mb4 NULL,
    `CustomerPackQty` decimal(18,6) NOT NULL,
    `ConvertRate` decimal(18,6) NOT NULL DEFAULT 1.0,
    `LineStatus` int NOT NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    CONSTRAINT `PK_Store_SaleOrderDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_SaleOrderDetail_Store_SaleOrder_MasterID` FOREIGN KEY (`MasterID`) REFERENCES `Store_SaleOrder` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_ScrapNoteDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `ReasonCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    `FromPackingCode` varchar(255) CHARACTER SET utf8mb4 NULL,
    `ToPackingCode` longtext CHARACTER SET utf8mb4 NULL,
    `FromContainerCode` longtext CHARACTER SET utf8mb4 NULL,
    `ToContainerCode` longtext CHARACTER SET utf8mb4 NULL,
    `FromLot` varchar(255) CHARACTER SET utf8mb4 NULL,
    `ToLot` longtext CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `FromLocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromStatus` int NOT NULL,
    `ToLocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToStatus` int NOT NULL,
    CONSTRAINT `PK_Store_ScrapNoteDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_ScrapNoteDetail_Store_ScrapNote_MasterID` FOREIGN KEY (`MasterID`) REFERENCES `Store_ScrapNote` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_ScrapRequestDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `ReasonCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `LocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `WarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    CONSTRAINT `PK_Store_ScrapRequestDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_ScrapRequestDetail_Store_ScrapRequest_MasterID` FOREIGN KEY (`MasterID`) REFERENCES `Store_ScrapRequest` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_SupplierAsnDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `PoNumber` varchar(64) CHARACTER SET utf8mb4 NULL,
    `PoLine` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierPackUom` longtext CHARACTER SET utf8mb4 NULL,
    `SupplierPackQty` decimal(18,6) NOT NULL,
    `ConvertRate` decimal(18,6) NOT NULL,
    `ProjectCode` longtext CHARACTER SET utf8mb4 NULL,
    `Ctype` longtext CHARACTER SET utf8mb4 NULL,
    `RecommendErpCode` longtext CHARACTER SET utf8mb4 NULL,
    `PlanUserCode` longtext CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Lot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `PackingCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    CONSTRAINT `PK_Store_SupplierAsnDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_SupplierAsnDetail_Store_SupplierAsn_MasterID` FOREIGN KEY (`MasterID`) REFERENCES `Store_SupplierAsn` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_TransferNoteDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `OnTheWayLocationCode` longtext CHARACTER SET utf8mb4 NULL,
    `Reason` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    `FromPackingCode` varchar(255) CHARACTER SET utf8mb4 NULL,
    `ToPackingCode` longtext CHARACTER SET utf8mb4 NULL,
    `FromContainerCode` longtext CHARACTER SET utf8mb4 NULL,
    `ToContainerCode` longtext CHARACTER SET utf8mb4 NULL,
    `FromLot` longtext CHARACTER SET utf8mb4 NULL,
    `ToLot` longtext CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `FromLocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromStatus` int NOT NULL,
    `ToLocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToStatus` int NOT NULL,
    CONSTRAINT `PK_Store_TransferNoteDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_TransferNoteDetail_Store_TransferNote_MasterID` FOREIGN KEY (`MasterID`) REFERENCES `Store_TransferNote` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_TransferRequestDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `Reason` longtext CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    `FromPackingCode` longtext CHARACTER SET utf8mb4 NULL,
    `ToPackingCode` longtext CHARACTER SET utf8mb4 NULL,
    `FromContainerCode` longtext CHARACTER SET utf8mb4 NULL,
    `ToContainerCode` longtext CHARACTER SET utf8mb4 NULL,
    `FromLot` longtext CHARACTER SET utf8mb4 NULL,
    `ToLot` longtext CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `FromLocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromStatus` int NOT NULL,
    `ToLocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToStatus` int NOT NULL,
    CONSTRAINT `PK_Store_TransferRequestDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_TransferRequestDetail_Store_TransferRequest_MasterID` FOREIGN KEY (`MasterID`) REFERENCES `Store_TransferRequest` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_UnplannedIssueNoteDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `ReasonCode` longtext CHARACTER SET utf8mb4 NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Lot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `PackingCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `LocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `WarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Status` int NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    CONSTRAINT `PK_Store_UnplannedIssueNoteDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_UnplannedIssueNoteDetail_Store_UnplannedIssueNote_Mast~` FOREIGN KEY (`MasterID`) REFERENCES `Store_UnplannedIssueNote` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_UnplannedIssueRequestDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Lot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `PackingCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `LocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `WarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Status` int NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    CONSTRAINT `PK_Store_UnplannedIssueRequestDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_UnplannedIssueRequestDetail_Store_UnplannedIssueReques~` FOREIGN KEY (`MasterID`) REFERENCES `Store_UnplannedIssueRequest` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_UnplannedReceiptNoteDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `ReasonCode` longtext CHARACTER SET utf8mb4 NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Lot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `PackingCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `LocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `WarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Status` int NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    CONSTRAINT `PK_Store_UnplannedReceiptNoteDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_UnplannedReceiptNoteDetail_Store_UnplannedReceiptNote_~` FOREIGN KEY (`MasterID`) REFERENCES `Store_UnplannedReceiptNote` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_UnplannedReceiptRequestDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Lot` varchar(64) CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `PackingCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ContainerCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `LocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `LocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `WarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Status` int NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    CONSTRAINT `PK_Store_UnplannedReceiptRequestDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_UnplannedReceiptRequestDetail_Store_UnplannedReceiptRe~` FOREIGN KEY (`MasterID`) REFERENCES `Store_UnplannedReceiptRequest` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_WarehouseTransferNoteDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `Reason` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Uom` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Qty` decimal(18,6) NOT NULL,
    `StdPackQty` decimal(18,6) NOT NULL,
    `FromPackingCode` varchar(255) CHARACTER SET utf8mb4 NULL,
    `ToPackingCode` longtext CHARACTER SET utf8mb4 NULL,
    `FromContainerCode` longtext CHARACTER SET utf8mb4 NULL,
    `ToContainerCode` longtext CHARACTER SET utf8mb4 NULL,
    `FromLot` longtext CHARACTER SET utf8mb4 NULL,
    `ToLot` longtext CHARACTER SET utf8mb4 NULL,
    `SupplierBatch` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ArriveDate` datetime(6) NOT NULL,
    `ProduceDate` datetime(6) NOT NULL,
    `ExpireDate` datetime(6) NOT NULL,
    `FromLocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `FromLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `FromStatus` int NOT NULL,
    `ToLocationCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToLocationArea` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationGroup` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ToLocationErpCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToWarehouseCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `ToStatus` int NOT NULL,
    CONSTRAINT `PK_Store_WarehouseTransferNoteDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_WarehouseTransferNoteDetail_Store_WarehouseTransferNot~` FOREIGN KEY (`MasterID`) REFERENCES `Store_WarehouseTransferNote` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE TABLE `Store_WorkOrderDetail` (
    `Id` char(36) COLLATE ascii_general_ci NOT NULL,
    `EffectiveDate` datetime(6) NOT NULL,
    `Op` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RawUom` varchar(64) CHARACTER SET utf8mb4 NULL,
    `RawQty` decimal(18,6) NOT NULL,
    `RawLocationCode` varchar(64) CHARACTER SET utf8mb4 NULL,
    `CreationTime` datetime(6) NOT NULL,
    `CreatorId` char(36) COLLATE ascii_general_ci NULL,
    `LastModificationTime` datetime(6) NULL,
    `LastModifierId` char(36) COLLATE ascii_general_ci NULL,
    `MasterID` char(36) COLLATE ascii_general_ci NOT NULL,
    `TenantId` char(36) COLLATE ascii_general_ci NULL,
    `Number` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    `Remark` varchar(4096) CHARACTER SET utf8mb4 NULL,
    `ItemName` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc1` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemDesc2` varchar(64) CHARACTER SET utf8mb4 NULL,
    `ItemCode` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
    CONSTRAINT `PK_Store_WorkOrderDetail` PRIMARY KEY (`Id`),
    CONSTRAINT `FK_Store_WorkOrderDetail_Store_WorkOrder_MasterID` FOREIGN KEY (`MasterID`) REFERENCES `Store_WorkOrder` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;


CREATE UNIQUE INDEX `IX_Job_CheckJob_Number` ON `Job_CheckJob` (`Number`);


CREATE INDEX `IX_Job_CheckJobDetail_MasterID` ON `Job_CheckJobDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Job_CountJob_Number` ON `Job_CountJob` (`Number`);


CREATE INDEX `IX_Job_CountJobDetail_MasterID` ON `Job_CountJobDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Job_DeliverJob_Number` ON `Job_DeliverJob` (`Number`);


CREATE INDEX `IX_Job_DeliverJobDetail_MasterID` ON `Job_DeliverJobDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Job_InspectJob_Number` ON `Job_InspectJob` (`Number`);


CREATE INDEX `IX_Job_InspectJobDetail_MasterID` ON `Job_InspectJobDetail` (`MasterID`);


CREATE INDEX `IX_Job_InspectJobSummaryDetail_MasterID` ON `Job_InspectJobSummaryDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Job_IssueJob_Number` ON `Job_IssueJob` (`Number`);


CREATE INDEX `IX_Job_IssueJobDetail_MasterID` ON `Job_IssueJobDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Job_JisDeliverJob_Number` ON `Job_JisDeliverJob` (`Number`);


CREATE INDEX `IX_Job_JisDeliverJobDetail_MasterID` ON `Job_JisDeliverJobDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Job_ProductionReturnJob_Number` ON `Job_ProductionReturnJob` (`Number`);


CREATE INDEX `IX_Job_ProductionReturnJobDetail_MasterID` ON `Job_ProductionReturnJobDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Job_ProductReceiveJob_Number` ON `Job_ProductReceiveJob` (`Number`);


CREATE INDEX `IX_Job_ProductReceiveJobDetail_MasterID` ON `Job_ProductReceiveJobDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Job_PurchaseReceiptJob_Number` ON `Job_PurchaseReceiptJob` (`Number`);


CREATE INDEX `IX_Job_PurchaseReceiptJobDetail_MasterID` ON `Job_PurchaseReceiptJobDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Job_PurchaseReturnJob_Number` ON `Job_PurchaseReturnJob` (`Number`);


CREATE INDEX `IX_Job_PurchaseReturnJobDetail_MasterID` ON `Job_PurchaseReturnJobDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Job_PutawayJob_Number` ON `Job_PutawayJob` (`Number`);


CREATE INDEX `IX_Job_PutawayJobDetail_MasterID` ON `Job_PutawayJobDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Job_UnplannedIssueJob_Number` ON `Job_UnplannedIssueJob` (`Number`);


CREATE INDEX `IX_Job_UnplannedIssueJobDetail_MasterID` ON `Job_UnplannedIssueJobDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Job_UnplannedReceiptJob_Number` ON `Job_UnplannedReceiptJob` (`Number`);


CREATE INDEX `IX_Job_UnplannedReceiptJobDetail_MasterID` ON `Job_UnplannedReceiptJobDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_BackFlushNote_Number` ON `Store_BackFlushNote` (`Number`);


CREATE INDEX `IX_Store_BackFlushNoteDetail_MasterID` ON `Store_BackFlushNoteDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_BackFlushNoteDetail_Number_ItemCode_Lot` ON `Store_BackFlushNoteDetail` (`Number`, `ItemCode`, `Lot`);


CREATE UNIQUE INDEX `IX_Store_ContainerBindNote_Number` ON `Store_ContainerBindNote` (`Number`);


CREATE INDEX `IX_Store_ContainerBindNoteDetail_MasterID` ON `Store_ContainerBindNoteDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_ContainerBindNoteDetail_Number_PackingCode` ON `Store_ContainerBindNoteDetail` (`Number`, `PackingCode`);


CREATE UNIQUE INDEX `IX_Store_CountAdjustNote_Number` ON `Store_CountAdjustNote` (`Number`);


CREATE INDEX `IX_Store_CountAdjustNoteDetail_MasterID` ON `Store_CountAdjustNoteDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_CountAdjustNoteDetail_Number_CountLabel_ItemCode_Locat~` ON `Store_CountAdjustNoteDetail` (`Number`, `CountLabel`, `ItemCode`, `LocationCode`, `Lot`, `Status`, `PackingCode`);


CREATE UNIQUE INDEX `IX_Store_CountAdjustRequest_Number` ON `Store_CountAdjustRequest` (`Number`);


CREATE INDEX `IX_Store_CountAdjustRequestDetail_MasterID` ON `Store_CountAdjustRequestDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_CountAdjustRequestDetail_Number_ItemCode_LocationCode_~` ON `Store_CountAdjustRequestDetail` (`Number`, `ItemCode`, `LocationCode`, `Lot`, `Status`, `PackingCode`);


CREATE UNIQUE INDEX `IX_Store_CountNote_Number` ON `Store_CountNote` (`Number`);


CREATE INDEX `IX_Store_CountNoteDetail_MasterID` ON `Store_CountNoteDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_CountNoteDetail_Number_CountLabel` ON `Store_CountNoteDetail` (`Number`, `CountLabel`);


CREATE UNIQUE INDEX `IX_Store_CountPlan_Number` ON `Store_CountPlan` (`Number`);


CREATE INDEX `IX_Store_CountPlanDetail_MasterID` ON `Store_CountPlanDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_CountPlanDetail_Number_CountLabel` ON `Store_CountPlanDetail` (`Number`, `CountLabel`);


CREATE INDEX `IX_Store_CustomerAsn_CustomerCode` ON `Store_CustomerAsn` (`CustomerCode`);


CREATE UNIQUE INDEX `IX_Store_CustomerAsn_Number` ON `Store_CustomerAsn` (`Number`);


CREATE INDEX `IX_Store_CustomerAsnDetail_MasterID` ON `Store_CustomerAsnDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_CustomerAsnDetail_Number_ItemCode` ON `Store_CustomerAsnDetail` (`Number`, `ItemCode`);


CREATE UNIQUE INDEX `IX_Store_CustomerReturnNote_Number` ON `Store_CustomerReturnNote` (`Number`);


CREATE INDEX `IX_Store_CustomerReturnNoteDetail_MasterID` ON `Store_CustomerReturnNoteDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_CustomerReturnNoteDetail_Number_FromPackingCode_FromLo~` ON `Store_CustomerReturnNoteDetail` (`Number`, `FromPackingCode`, `FromLocationCode`, `ToLocationCode`);


CREATE UNIQUE INDEX `IX_Store_DeliverNote_Number` ON `Store_DeliverNote` (`Number`);


CREATE INDEX `IX_Store_DeliverNoteDetail_MasterID` ON `Store_DeliverNoteDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_DeliverNoteDetail_Number_ItemCode_FromPackingCode_From~` ON `Store_DeliverNoteDetail` (`Number`, `ItemCode`, `FromPackingCode`, `FromLot`, `FromLocationCode`, `ToLocationCode`);


CREATE UNIQUE INDEX `IX_Store_DeliverPlan_Number` ON `Store_DeliverPlan` (`Number`);


CREATE INDEX `IX_Store_DeliverPlanDetail_MasterID` ON `Store_DeliverPlanDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_DeliverPlanDetail_Number_SoNumber_SoLine` ON `Store_DeliverPlanDetail` (`Number`, `SoNumber`, `SoLine`);


CREATE UNIQUE INDEX `IX_Store_DeliverRequest_Number` ON `Store_DeliverRequest` (`Number`);


CREATE INDEX `IX_Store_DeliverRequestDetail_MasterID` ON `Store_DeliverRequestDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_DeliverRequestDetail_Number_ItemCode` ON `Store_DeliverRequestDetail` (`Number`, `ItemCode`);


CREATE UNIQUE INDEX `IX_Store_InspectAbnormalNote_Number` ON `Store_InspectAbnormalNote` (`Number`);


CREATE INDEX `IX_Store_InspectAbnormalNoteDetail_MasterID` ON `Store_InspectAbnormalNoteDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_InspectAbnormalNoteDetail_Number_PackingCode` ON `Store_InspectAbnormalNoteDetail` (`Number`, `PackingCode`);


CREATE UNIQUE INDEX `IX_Store_InspectNote_Number` ON `Store_InspectNote` (`Number`);


CREATE INDEX `IX_Store_InspectNoteDetail_MasterID` ON `Store_InspectNoteDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_InspectNoteDetail_Number_PackingCode` ON `Store_InspectNoteDetail` (`Number`, `PackingCode`);


CREATE INDEX `IX_Store_InspectNoteSummaryDetail_MasterID` ON `Store_InspectNoteSummaryDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_InspectNoteSummaryDetail_Number_ItemCode` ON `Store_InspectNoteSummaryDetail` (`Number`, `ItemCode`);


CREATE UNIQUE INDEX `IX_Store_InspectRequest_Number` ON `Store_InspectRequest` (`Number`);


CREATE INDEX `IX_Store_InspectRequestDetail_MasterID` ON `Store_InspectRequestDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_InspectRequestDetail_Number_PackingCode` ON `Store_InspectRequestDetail` (`Number`, `PackingCode`);


CREATE INDEX `IX_Store_InspectRequestSummaryDetail_MasterID` ON `Store_InspectRequestSummaryDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_InspectRequestSummaryDetail_Number_ItemCode_Lot` ON `Store_InspectRequestSummaryDetail` (`Number`, `ItemCode`, `Lot`);


CREATE UNIQUE INDEX `IX_Store_InventoryInitialNote_Number` ON `Store_InventoryInitialNote` (`Number`);


CREATE INDEX `IX_Store_InventoryInitialNoteDetail_MasterID` ON `Store_InventoryInitialNoteDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_InventoryInitialNoteDetail_Number_PackingCode_ItemCode~` ON `Store_InventoryInitialNoteDetail` (`Number`, `PackingCode`, `ItemCode`, `Lot`, `Status`);


CREATE UNIQUE INDEX `IX_Store_InventoryTransferNote_Number` ON `Store_InventoryTransferNote` (`Number`);


CREATE INDEX `IX_Store_InventoryTransferNoteDetail_MasterID` ON `Store_InventoryTransferNoteDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_InventoryTransferNoteDetail_Number_FromPackingCode_Fro~` ON `Store_InventoryTransferNoteDetail` (`Number`, `FromPackingCode`, `FromLocationCode`, `ToLocationCode`);


CREATE UNIQUE INDEX `IX_Store_IsolationNote_Number` ON `Store_IsolationNote` (`Number`);


CREATE INDEX `IX_Store_IsolationNoteDetail_FromPackingCode` ON `Store_IsolationNoteDetail` (`FromPackingCode`);


CREATE INDEX `IX_Store_IsolationNoteDetail_MasterID` ON `Store_IsolationNoteDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_IsolationNoteDetail_Number_FromPackingCode_FromLocatio~` ON `Store_IsolationNoteDetail` (`Number`, `FromPackingCode`, `FromLocationCode`, `ToLocationCode`);


CREATE UNIQUE INDEX `IX_Store_IssueNote_Number` ON `Store_IssueNote` (`Number`);


CREATE INDEX `IX_Store_IssueNoteDetail_FromPackingCode` ON `Store_IssueNoteDetail` (`FromPackingCode`);


CREATE INDEX `IX_Store_IssueNoteDetail_MasterID` ON `Store_IssueNoteDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_IssueNoteDetail_Number_FromPackingCode_FromLocationCod~` ON `Store_IssueNoteDetail` (`Number`, `FromPackingCode`, `FromLocationCode`, `ToLocationCode`);


CREATE UNIQUE INDEX `IX_Store_ItemTransformNote_Number` ON `Store_ItemTransformNote` (`Number`);


CREATE INDEX `IX_Store_ItemTransformNoteDetail_MasterID` ON `Store_ItemTransformNoteDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_ItemTransformNoteDetail_Number_FromPackingCode_FromSta~` ON `Store_ItemTransformNoteDetail` (`Number`, `FromPackingCode`, `FromStatus`, `ToPackingCode`, `ToStatus`);


CREATE UNIQUE INDEX `IX_Store_ItemTransformRequest_Number` ON `Store_ItemTransformRequest` (`Number`);


CREATE INDEX `IX_Store_ItemTransformRequestDetail_MasterID` ON `Store_ItemTransformRequestDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_ItemTransformRequestDetail_Number_FromPackingCode_From~` ON `Store_ItemTransformRequestDetail` (`Number`, `FromPackingCode`, `FromStatus`, `ToPackingCode`, `ToStatus`);


CREATE UNIQUE INDEX `IX_Store_JisDeliverNote_Number` ON `Store_JisDeliverNote` (`Number`);


CREATE INDEX `IX_Store_JisDeliverNoteDetail_MasterID` ON `Store_JisDeliverNoteDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_JisDeliverNoteDetail_Number_FromPackingCode_FromLocati~` ON `Store_JisDeliverNoteDetail` (`Number`, `FromPackingCode`, `FromLocationCode`, `ToLocationCode`);


CREATE UNIQUE INDEX `IX_Store_JisProductReceiptNote_Number` ON `Store_JisProductReceiptNote` (`Number`);


CREATE INDEX `IX_Store_JisProductReceiptNoteDetail_MasterID` ON `Store_JisProductReceiptNoteDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_JisProductReceiptNoteDetail_Number_PackingCode` ON `Store_JisProductReceiptNoteDetail` (`Number`, `PackingCode`);


CREATE UNIQUE INDEX `IX_Store_MaterialRequest_Number` ON `Store_MaterialRequest` (`Number`);


CREATE INDEX `IX_Store_MaterialRequestDetail_ItemCode` ON `Store_MaterialRequestDetail` (`ItemCode`);


CREATE INDEX `IX_Store_MaterialRequestDetail_MasterID` ON `Store_MaterialRequestDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_MaterialRequestDetail_Number_ItemCode_ToLocationCode` ON `Store_MaterialRequestDetail` (`Number`, `ItemCode`, `ToLocationCode`);


CREATE UNIQUE INDEX `IX_Store_NoOkConvertOkNote_Number` ON `Store_NoOkConvertOkNote` (`Number`);


CREATE INDEX `IX_Store_NoOkConvertOkNoteDetail_MasterID` ON `Store_NoOkConvertOkNoteDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_NoOkConvertOkNoteDetail_Number_FromPackingCode_FromLoc~` ON `Store_NoOkConvertOkNoteDetail` (`Number`, `FromPackingCode`, `FromLocationCode`, `ToLocationCode`);


CREATE UNIQUE INDEX `IX_Store_OfflineSettlementNote_Number` ON `Store_OfflineSettlementNote` (`Number`);


CREATE INDEX `IX_Store_OfflineSettlementNoteDetail_MasterID` ON `Store_OfflineSettlementNoteDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_OfflineSettlementNoteDetail_Number` ON `Store_OfflineSettlementNoteDetail` (`Number`);


CREATE UNIQUE INDEX `IX_Store_PreparationPlan_Number` ON `Store_PreparationPlan` (`Number`);


CREATE INDEX `IX_Store_PreparationPlanDetail_MasterID` ON `Store_PreparationPlanDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_PreparationPlanDetail_Number_ItemCode` ON `Store_PreparationPlanDetail` (`Number`, `ItemCode`);


CREATE UNIQUE INDEX `IX_Store_ProductionPlan_Number` ON `Store_ProductionPlan` (`Number`);


CREATE INDEX `IX_Store_ProductionPlanDetail_MasterID` ON `Store_ProductionPlanDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_ProductionPlanDetail_Number_ItemCode` ON `Store_ProductionPlanDetail` (`Number`, `ItemCode`);


CREATE UNIQUE INDEX `IX_Store_ProductionReturnNote_Number` ON `Store_ProductionReturnNote` (`Number`);


CREATE INDEX `IX_Store_ProductionReturnNoteDetail_MasterID` ON `Store_ProductionReturnNoteDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_ProductionReturnNoteDetail_Number_ItemCode_FromPacking~` ON `Store_ProductionReturnNoteDetail` (`Number`, `ItemCode`, `FromPackingCode`, `ToPackingCode`, `FromLocationCode`, `ToLocationCode`);


CREATE UNIQUE INDEX `IX_Store_ProductionReturnRequest_Number` ON `Store_ProductionReturnRequest` (`Number`);


CREATE INDEX `IX_Store_ProductionReturnRequestDetail_ItemCode` ON `Store_ProductionReturnRequestDetail` (`ItemCode`);


CREATE INDEX `IX_Store_ProductionReturnRequestDetail_MasterID` ON `Store_ProductionReturnRequestDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_ProductionReturnRequestDetail_Number_ItemCode_FromLoca~` ON `Store_ProductionReturnRequestDetail` (`Number`, `ItemCode`, `FromLocationCode`);


CREATE UNIQUE INDEX `IX_Store_ProductL7PartsNote_Number` ON `Store_ProductL7PartsNote` (`Number`);


CREATE INDEX `IX_Store_ProductL7PartsNoteDetail_MasterID` ON `Store_ProductL7PartsNoteDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_ProductL7PartsNoteDetail_Number_ProductNo_Position_Con~` ON `Store_ProductL7PartsNoteDetail` (`Number`, `ProductNo`, `Position`, `Configuration`, `L7Part`);


CREATE UNIQUE INDEX `IX_Store_ProductReceiptNote_Number` ON `Store_ProductReceiptNote` (`Number`);


CREATE INDEX `IX_Store_ProductReceiptNoteDetail_MasterID` ON `Store_ProductReceiptNoteDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_ProductReceiptNoteDetail_Number_ItemCode_PackingCode_L~` ON `Store_ProductReceiptNoteDetail` (`Number`, `ItemCode`, `PackingCode`, `Lot`, `Status`);


CREATE UNIQUE INDEX `IX_Store_ProductReceiptRequest_Number` ON `Store_ProductReceiptRequest` (`Number`);


CREATE INDEX `IX_Store_ProductReceiptRequestDetail_MasterID` ON `Store_ProductReceiptRequestDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_ProductReceiptRequestDetail_Number_ItemCode_LocationCo~` ON `Store_ProductReceiptRequestDetail` (`Number`, `ItemCode`, `LocationCode`);


CREATE INDEX `IX_Store_ProductRecycleMaterialDetail_MasterID` ON `Store_ProductRecycleMaterialDetail` (`MasterID`);


CREATE INDEX `IX_Store_ProductRecycleMaterialDetail_Number_ProductItemCode_It~` ON `Store_ProductRecycleMaterialDetail` (`Number`, `ProductItemCode`, `ItemCode`);


CREATE UNIQUE INDEX `IX_Store_ProductRecycleNote_Number` ON `Store_ProductRecycleNote` (`Number`);


CREATE INDEX `IX_Store_ProductRecycleNoteDetail_MasterID` ON `Store_ProductRecycleNoteDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_ProductRecycleNoteDetail_Number_ItemCode` ON `Store_ProductRecycleNoteDetail` (`Number`, `ItemCode`);


CREATE UNIQUE INDEX `IX_Store_ProductRecycleRequest_Number` ON `Store_ProductRecycleRequest` (`Number`);


CREATE INDEX `IX_Store_ProductRecycleRequestDetail_MasterID` ON `Store_ProductRecycleRequestDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_ProductRecycleRequestDetail_Number_ItemCode` ON `Store_ProductRecycleRequestDetail` (`Number`, `ItemCode`);


CREATE UNIQUE INDEX `IX_Store_PurchaseOrder_Number` ON `Store_PurchaseOrder` (`Number`);


CREATE UNIQUE INDEX `IX_Store_PurchaseOrderDetail_ItemCode_Number_PoLine` ON `Store_PurchaseOrderDetail` (`ItemCode`, `Number`, `PoLine`);


CREATE INDEX `IX_Store_PurchaseOrderDetail_MasterID` ON `Store_PurchaseOrderDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_PurchaseReceiptNote_Number` ON `Store_PurchaseReceiptNote` (`Number`);


CREATE INDEX `IX_Store_PurchaseReceiptNote_SupplierCode` ON `Store_PurchaseReceiptNote` (`SupplierCode`);


CREATE INDEX `IX_Store_PurchaseReceiptNoteDetail_MasterID` ON `Store_PurchaseReceiptNoteDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_PurchaseReceiptRequest_Number` ON `Store_PurchaseReceiptRequest` (`Number`);


CREATE INDEX `IX_Store_PurchaseReceiptRequest_SupplierCode` ON `Store_PurchaseReceiptRequest` (`SupplierCode`);


CREATE INDEX `IX_Store_PurchaseReceiptRequestDetail_MasterID` ON `Store_PurchaseReceiptRequestDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_PurchaseReceiptRequestDetail_Number_PackingCode` ON `Store_PurchaseReceiptRequestDetail` (`Number`, `PackingCode`);


CREATE UNIQUE INDEX `IX_Store_PurchaseReturnNote_Number` ON `Store_PurchaseReturnNote` (`Number`);


CREATE INDEX `IX_Store_PurchaseReturnNoteDetail_MasterID` ON `Store_PurchaseReturnNoteDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_PurchaseReturnNoteDetail_Number_PackingCode` ON `Store_PurchaseReturnNoteDetail` (`Number`, `PackingCode`);


CREATE UNIQUE INDEX `IX_Store_PurchaseReturnRequest_Number` ON `Store_PurchaseReturnRequest` (`Number`);


CREATE INDEX `IX_Store_PurchaseReturnRequestDetail_MasterID` ON `Store_PurchaseReturnRequestDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_PurchaseReturnRequestDetail_Number_PackingCode` ON `Store_PurchaseReturnRequestDetail` (`Number`, `PackingCode`);


CREATE UNIQUE INDEX `IX_Store_PutawayNote_Number` ON `Store_PutawayNote` (`Number`);


CREATE INDEX `IX_Store_PutawayNoteDetail_MasterID` ON `Store_PutawayNoteDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_PutawayNoteDetail_Number_FromPackingCode_FromLocationC~` ON `Store_PutawayNoteDetail` (`Number`, `FromPackingCode`, `FromLocationCode`, `ToLocationCode`, `ToPackingCode`);


CREATE UNIQUE INDEX `IX_Store_PutawayRequest_Number` ON `Store_PutawayRequest` (`Number`);


CREATE INDEX `IX_Store_PutawayRequestDetail_MasterID` ON `Store_PutawayRequestDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_ReceiptAbnormalNote_AsnNumber_Number_SupplierCode_Rece~` ON `Store_ReceiptAbnormalNote` (`AsnNumber`, `Number`, `SupplierCode`, `ReceiptNumber`);


CREATE INDEX `IX_Store_ReceiptAbnormalNote_SupplierCode` ON `Store_ReceiptAbnormalNote` (`SupplierCode`);


CREATE INDEX `IX_Store_ReceiptAbnormalNoteDetail_MasterID` ON `Store_ReceiptAbnormalNoteDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_ReceiptAbnormalNoteDetail_Number_PackingCode_ReceiptNu~` ON `Store_ReceiptAbnormalNoteDetail` (`Number`, `PackingCode`, `ReceiptNumber`);


CREATE UNIQUE INDEX `IX_Store_RecycledMaterialReceiptNote_Number` ON `Store_RecycledMaterialReceiptNote` (`Number`);


CREATE INDEX `IX_Store_RecycledMaterialReceiptNoteDetail_MasterID` ON `Store_RecycledMaterialReceiptNoteDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_RecycledMaterialReceiptNoteDetail_Number_PackingCode` ON `Store_RecycledMaterialReceiptNoteDetail` (`Number`, `PackingCode`);


CREATE INDEX `IX_Store_SaleOrder_CustomerCode` ON `Store_SaleOrder` (`CustomerCode`);


CREATE UNIQUE INDEX `IX_Store_SaleOrder_Number` ON `Store_SaleOrder` (`Number`);


CREATE INDEX `IX_Store_SaleOrderDetail_MasterID` ON `Store_SaleOrderDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_SaleOrderDetail_Number_SoLine_ItemCode` ON `Store_SaleOrderDetail` (`Number`, `SoLine`, `ItemCode`);


CREATE UNIQUE INDEX `IX_Store_ScrapNote_Number` ON `Store_ScrapNote` (`Number`);


CREATE INDEX `IX_Store_ScrapNoteDetail_MasterID` ON `Store_ScrapNoteDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_ScrapNoteDetail_Number_ItemCode_FromPackingCode_FromLo~` ON `Store_ScrapNoteDetail` (`Number`, `ItemCode`, `FromPackingCode`, `FromLocationCode`, `ToLocationCode`, `FromLot`, `FromStatus`);


CREATE UNIQUE INDEX `IX_Store_ScrapRequest_Number` ON `Store_ScrapRequest` (`Number`);


CREATE INDEX `IX_Store_ScrapRequestDetail_MasterID` ON `Store_ScrapRequestDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_ScrapRequestDetail_Number_ItemCode_LocationCode` ON `Store_ScrapRequestDetail` (`Number`, `ItemCode`, `LocationCode`);


CREATE UNIQUE INDEX `IX_Store_SupplierAsn_Number` ON `Store_SupplierAsn` (`Number`);


CREATE INDEX `IX_Store_SupplierAsn_SupplierCode` ON `Store_SupplierAsn` (`SupplierCode`);


CREATE INDEX `IX_Store_SupplierAsnDetail_MasterID` ON `Store_SupplierAsnDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_SupplierAsnDetail_Number_ItemCode_PackingCode` ON `Store_SupplierAsnDetail` (`Number`, `ItemCode`, `PackingCode`);


CREATE UNIQUE INDEX `IX_Store_TransferNote_Number` ON `Store_TransferNote` (`Number`);


CREATE INDEX `IX_Store_TransferNoteDetail_MasterID` ON `Store_TransferNoteDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_TransferNoteDetail_Number_FromPackingCode_FromLocation~` ON `Store_TransferNoteDetail` (`Number`, `FromPackingCode`, `FromLocationCode`, `ToLocationCode`, `FromStatus`, `ToStatus`);


CREATE UNIQUE INDEX `IX_Store_TransferRequest_Number` ON `Store_TransferRequest` (`Number`);


CREATE INDEX `IX_Store_TransferRequestDetail_MasterID` ON `Store_TransferRequestDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_UnplannedIssueNote_Number` ON `Store_UnplannedIssueNote` (`Number`);


CREATE INDEX `IX_Store_UnplannedIssueNoteDetail_MasterID` ON `Store_UnplannedIssueNoteDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_UnplannedIssueNoteDetail_Number_PackingCode_ItemCode_L~` ON `Store_UnplannedIssueNoteDetail` (`Number`, `PackingCode`, `ItemCode`, `Lot`, `Status`);


CREATE UNIQUE INDEX `IX_Store_UnplannedIssueRequest_Number` ON `Store_UnplannedIssueRequest` (`Number`);


CREATE INDEX `IX_Store_UnplannedIssueRequestDetail_MasterID` ON `Store_UnplannedIssueRequestDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_UnplannedIssueRequestDetail_Number_PackingCode_ItemCod~` ON `Store_UnplannedIssueRequestDetail` (`Number`, `PackingCode`, `ItemCode`, `Lot`, `Status`);


CREATE UNIQUE INDEX `IX_Store_UnplannedReceiptNote_Number` ON `Store_UnplannedReceiptNote` (`Number`);


CREATE INDEX `IX_Store_UnplannedReceiptNoteDetail_MasterID` ON `Store_UnplannedReceiptNoteDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_UnplannedReceiptNoteDetail_Number_PackingCode_ItemCode~` ON `Store_UnplannedReceiptNoteDetail` (`Number`, `PackingCode`, `ItemCode`, `Lot`, `Status`);


CREATE UNIQUE INDEX `IX_Store_UnplannedReceiptRequest_Number` ON `Store_UnplannedReceiptRequest` (`Number`);


CREATE INDEX `IX_Store_UnplannedReceiptRequestDetail_MasterID` ON `Store_UnplannedReceiptRequestDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_UnplannedReceiptRequestDetail_Number_PackingCode_ItemC~` ON `Store_UnplannedReceiptRequestDetail` (`Number`, `PackingCode`, `ItemCode`, `Lot`, `Status`);


CREATE UNIQUE INDEX `IX_Store_WarehouseTransferNote_Number` ON `Store_WarehouseTransferNote` (`Number`);


CREATE INDEX `IX_Store_WarehouseTransferNoteDetail_MasterID` ON `Store_WarehouseTransferNoteDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_WarehouseTransferNoteDetail_Number_FromPackingCode_Fro~` ON `Store_WarehouseTransferNoteDetail` (`Number`, `FromPackingCode`, `FromLocationCode`, `ToLocationCode`);


CREATE UNIQUE INDEX `IX_Store_WorkOrder_Number` ON `Store_WorkOrder` (`Number`);


CREATE INDEX `IX_Store_WorkOrderDetail_MasterID` ON `Store_WorkOrderDetail` (`MasterID`);


CREATE UNIQUE INDEX `IX_Store_WorkOrderDetail_Number_ItemCode` ON `Store_WorkOrderDetail` (`Number`, `ItemCode`);


