diff --git a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211129095823_init.Designer.cs b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211129095823_init.Designer.cs new file mode 100644 index 00000000..6c46c9d8 --- /dev/null +++ b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211129095823_init.Designer.cs @@ -0,0 +1,10345 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; +using Win.Sfs.SettleAccount; + +namespace Win.Sfs.SettleAccount.Migrations +{ + [DbContext(typeof(SettleAccountHttpApiHostMigrationsDbContext))] + [Migration("20211129095823_init")] + partial class init + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("ProductVersion", "5.0.8") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("Win.Sfs.SettleAccount.BTCarConsigns.BTCarConsign", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("KBCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Qty") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasMaxLength(36) + .HasColumnType("int"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("CustomerCode", "MaterialCode", "KBCode", "Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_btcarconsign"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.BTCarKBs.BTCarKB", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsignQty") + .HasColumnType("decimal(18,2)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DateTime") + .HasColumnType("datetime2"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DeliveryDateTime") + .HasColumnType("datetime2"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("MaterialDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("NeedQty") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("OrderKBCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ReceiveAreaCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ReceiveAreaName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasMaxLength(36) + .HasColumnType("int"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("CustomerCode", "MaterialCode", "OrderKBCode", "Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_btcarkb"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.BTCarSeqFirsts.BTCarSeqFirst", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BarCode") + .HasColumnType("nvarchar(450)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("DT") + .HasColumnType("datetime2"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("OnLineDateTime") + .HasColumnType("datetime2"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("VIN") + .HasColumnType("nvarchar(450)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("CustomerCode", "BarCode", "VIN", "Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_btcarseqfirst"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.BTCarSeqSeconds.BTCarSeqSecond", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BarCode") + .HasColumnType("nvarchar(450)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("CMSerie") + .HasColumnType("nvarchar(max)"); + + b.Property("CMSerieRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("CarModelShort") + .HasColumnType("nvarchar(max)"); + + b.Property("CarName") + .HasColumnType("nvarchar(max)"); + + b.Property("CarType") + .HasColumnType("nvarchar(max)"); + + b.Property("Code") + .HasColumnType("nvarchar(max)"); + + b.Property("Color") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("DateTime") + .HasColumnType("datetime2"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("EngineCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InColor") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("OnLineDateTime") + .HasColumnType("datetime2"); + + b.Property("OrderStateNum") + .HasColumnType("nvarchar(max)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("PlanDate") + .HasColumnType("datetime2"); + + b.Property("PlanSeq") + .HasColumnType("int"); + + b.Property("PlanTypeRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SpecialCarTypeRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("StateName") + .HasColumnType("nvarchar(max)"); + + b.Property("TopSeq") + .HasColumnType("nvarchar(max)"); + + b.Property("VIN") + .HasColumnType("nvarchar(450)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("CustomerCode", "BarCode", "VIN", "Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_btcarseqsecond"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.BTCarSeqs.BTCarSeq", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BarCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DT") + .HasColumnType("datetime2"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("OnLineDateTime") + .HasColumnType("datetime2"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Period") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("VIN") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("CustomerCode", "BarCode", "VIN", "Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_btcarseq"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.BTNotConsignReports.BTNotConsignReport", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BeginTime") + .HasColumnType("datetime2"); + + b.Property("BranchId") + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CreatorName") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomCode") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomName") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DocumentNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DocumentStatus") + .HasColumnType("int"); + + b.Property("DocumentType") + .HasColumnType("int"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("EndTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("BranchId", "DocumentNumber") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_bt_not_kb_consign_report"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.BTNotConsignReports.BTNotConsignReportDetail", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("ConsignQty") + .HasColumnType("decimal(18,2)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomCode") + .HasColumnType("nvarchar(450)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DeliveryDateTime") + .HasColumnType("datetime2"); + + b.Property("DocumentId") + .HasColumnType("uniqueidentifier"); + + b.Property("DocumentNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .HasColumnType("nvarchar(450)"); + + b.Property("MaterialDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("NeedQty") + .HasColumnType("decimal(18,2)"); + + b.Property("OrderKBCode") + .HasColumnType("nvarchar(450)"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("Version") + .HasColumnType("nvarchar(450)"); + + b.Property("Year") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("BranchId", "DocumentId", "Version", "CustomCode", "MaterialCode", "OrderKBCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_bt_not_kb_consign_report_detail"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.BTSeqKBDiffReports.BTSeqKBDiffReport", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CreatorName") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomCode") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomName") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DocumentNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DocumentStatus") + .HasColumnType("int"); + + b.Property("DocumentType") + .HasColumnType("int"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasColumnType("nvarchar(max)"); + + b.Property("Year") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("BranchId", "DocumentNumber") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_bt_seq_kb_diff_report"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.BTSeqKBDiffReports.BTSeqKBDiffReportDetail", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomCode") + .HasColumnType("nvarchar(450)"); + + b.Property("DT") + .HasColumnType("datetime2"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DiffQty") + .HasColumnType("decimal(18,2)"); + + b.Property("DocumentId") + .HasColumnType("uniqueidentifier"); + + b.Property("DocumentNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("KBQty") + .HasColumnType("decimal(18,2)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SeqQty") + .HasColumnType("decimal(18,2)"); + + b.Property("Version") + .HasColumnType("nvarchar(450)"); + + b.Property("Year") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("BranchId", "DocumentId", "Version", "DT", "CustomCode", "MaterialCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_bt_seq_kb_diff_report_detail"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Boms.Bom", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BomLevel") + .HasColumnType("int"); + + b.Property("BomType") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ChildItemCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ChildItemDesc") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.Property("ChildItemUom") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("EffectiveTime") + .HasColumnType("datetime2"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExpireTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IssuePosition") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("OperateProcess") + .HasColumnType("int"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("ParentItemCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ParentItemDesc") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("ScrapPercent") + .HasColumnType("decimal(18,2)"); + + b.Property("Version") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("ParentItemCode", "ChildItemCode", "Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_bom"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Customers.Customer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.Property("BranchId") + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Contact") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ContactEmail") + .HasColumnType("nvarchar(max)"); + + b.Property("ContactFax") + .HasColumnType("nvarchar(max)"); + + b.Property("ContactPhone") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CurrencyId") + .HasColumnType("uniqueidentifier"); + + b.Property("CustomerType") + .HasColumnType("int"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("TaxRate") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.HasIndex("BranchId", "Code") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_customer"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Customers.CustomerBom", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ChildItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("EffectiveTime") + .HasColumnType("datetime2"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FailureTime") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ParentItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("BranchId", "CustomerCode", "ParentItemCode", "ChildItemCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_customer_bom"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BTCarConsigns.BTCarConsignVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.ToTable("Set_btcarconsign_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BTCarKBs.BTCarKBVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DateTime") + .HasColumnType("datetime2"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.ToTable("Set_btcarkb_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BTCarSeqFirsts.BTCarSeqFirstVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DT") + .HasColumnType("datetime2"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.ToTable("Set_btcarseqfirst_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BTCarSeqSeconds.BTCarSeqSecondVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DateTime") + .HasColumnType("datetime2"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.ToTable("Set_btcarseqsecond_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BTCarSeqs.BTCarSeqVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DT") + .HasColumnType("datetime2"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.ToTable("Set_btcarseq_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Boms.BomVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.ToTable("Set_bom_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.CarMaterialConfigs.CarMaterialConfig", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("CarCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("CarCode", "MaterialCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_carmaterialconfig"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.CodeSettings.CodeSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Project") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Project", "Value") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_code"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Controls.CentralizedControl", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("Version") + .HasColumnType("nvarchar(max)"); + + b.Property("Year") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Year", "Period") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_control"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.EstimatedInventories.EstimatedInventoryVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.ToTable("Set_estinventory_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.EstimatedSums.EstimatedSum", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("MaterialDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Postingperiod") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("PurchaseDocument") + .HasColumnType("nvarchar(max)"); + + b.Property("PurchaseLine") + .HasColumnType("nvarchar(max)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SupplierCode") + .HasColumnType("nvarchar(max)"); + + b.Property("SupplierDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.ToTable("Set_estsum"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.EstimatedSums.EstimatedSumVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.ToTable("Set_estsum_verion"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.FISes.FIS_TH", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BeginTime") + .HasColumnType("datetime2"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("CP5Time") + .HasColumnType("datetime2"); + + b.Property("CP7Time") + .HasColumnType("datetime2"); + + b.Property("ChassisNumber") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ChassisNumber2") + .HasColumnType("nvarchar(450)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("EndTime") + .HasColumnType("datetime2"); + + b.Property("ErpMaterialCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Extend1") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("KENNCode") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Model") + .HasColumnType("nvarchar(450)"); + + b.Property("OrderBillNum") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Period") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SequenceNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("SettledQty") + .HasColumnType("decimal(18,2)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("ChassisNumber2", "Version", "Model", "MaterialCode") + .IsUnique() + .HasFilter("[ChassisNumber2] IS NOT NULL AND [Model] IS NOT NULL"); + + b.ToTable("Set_fis_th"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Factories.Factory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Desc") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Code") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_factory"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.HQCarConsigns.HQConsign", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("MaterialDesc") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("VIN") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("CustomerCode", "MaterialCode", "VIN", "Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_hqcon"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.HQCarConsigns.HQConsignVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.ToTable("Set_hqcon_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.HQCarConsigns.HQSpecConsign", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("KBCode") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("KBCodeExtend") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("MaterialDesc") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("CustomerCode", "MaterialCode", "KBCode", "KBCodeExtend", "Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_hqspcon"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.HQCarConsigns.HQSpecConsignVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.ToTable("Set_hqspcon_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.HQCarKBs.HQKB", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsignQty") + .HasColumnType("decimal(18,2)"); + + b.Property("CreateTime") + .HasColumnType("datetime2"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("KBCode") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("MaterialDesc") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("NeedQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("VIN") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("CustomerCode", "MaterialCode", "VIN", "Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_hqkb"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.HQCarKBs.HQKBVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.ToTable("Set_hqkb_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.HQCarKBs.HQSpecKB", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsignQty") + .HasColumnType("decimal(18,2)"); + + b.Property("CreateTime") + .HasColumnType("datetime2"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("KBCode") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("MaterialDesc") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("NeedQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("CustomerCode", "MaterialCode", "KBCode", "Version") + .IsUnique() + .HasFilter("[MaterialCode] IS NOT NULL"); + + b.ToTable("Set_hqspkb"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.HQCarKBs.HQSpecKBVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.ToTable("Set_hqspkb_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.ImportMap.ImportColumnMap", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsCheck") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("NewColumnName") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("OldColumnName") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ProjectName") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Set_importmap"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Inventories.InventoryDetailVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasColumnType("nvarchar(450)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Version", "Factory") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_inventory_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Invoices.Invoice", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Amt") + .HasColumnType("decimal(18,2)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("Extend") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialDesc") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Period") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("Version") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Year") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_Invoice"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Invoices.InvoiceVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Year") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_InvoiceVersion"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.ItemInvoicePrices.ItemInvoicePrice", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Backorder") + .HasColumnType("nvarchar(max)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("CC") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtendedMargin") + .HasColumnType("decimal(18,2)"); + + b.Property("ExtendedPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("MaterialDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Sales") + .HasColumnType("nvarchar(max)"); + + b.Property("SubAcct") + .HasColumnType("nvarchar(max)"); + + b.Property("UM") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Period", "Version", "MaterialCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_item_invoice_price"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.ItemInvoicePrices.ItemInvoicePriceVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Year") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_item_invoice_price_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.JFCarConsigns.JFCarConsignVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.ToTable("Set_jfcarconsign_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.JFCarKBs.JFCarKBVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.ToTable("Set_jfcarkb_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.MaterialRelationships.MaterialRelationshipDetail", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AppraisalCategory") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ErpMaterialCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialDesc") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialProperty") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SettleMaterialCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ShipMaterailCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_MaterialRelationshipDetail"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.MaterialRelationships.MaterialRelationshipVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Remark") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Year") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_MaterialRelationshipVersion"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Materials.Material", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("EstimateType") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("EstimateTypeDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("MaterialDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Unit") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("MaterialCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_material"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Prices.PriceList", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BeginDate") + .HasColumnType("datetime2"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("EndDate") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Type") + .HasColumnType("int"); + + b.Property("Version") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Set_PriceList"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Prices.PriceListVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Year") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_PriceListVersion"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.SecMatch.SecMatchBase", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("Buyer") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DiffAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("DiffPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Index") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsDiffNumber") + .HasColumnType("bit"); + + b.Property("IsSettle") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialDesc") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialPartCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Model") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PartType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("RealSettlementNumber") + .HasColumnType("decimal(18,2)"); + + b.Property("RealSettlementPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SettleMentPartCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SettlementNumber") + .HasColumnType("decimal(18,2)"); + + b.Property("SettlementPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("SupplierCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SupplierName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SupplyProportion") + .HasMaxLength(50) + .HasColumnType("decimal(18,2)"); + + b.Property("TheoreticalSettlementNumber") + .HasColumnType("decimal(18,2)"); + + b.Property("UsedNumber") + .HasMaxLength(50) + .HasColumnType("decimal(18,2)"); + + b.Property("Version") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_SecMatchBase"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.SecondaryMatching.SecondaryAdjustment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Amt") + .HasColumnType("decimal(18,2)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("Buyer") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerComponentCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("CustomerMaterialCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("HasChanged") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SupplierCode") + .HasColumnType("nvarchar(450)"); + + b.Property("Total") + .HasColumnType("decimal(18,2)"); + + b.Property("Version") + .HasColumnType("nvarchar(450)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Version", "CustomerComponentCode", "CustomerMaterialCode", "SupplierCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_sec_adj"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.SecondaryMatching.SecondaryAdjustmentVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasColumnType("nvarchar(450)"); + + b.Property("Year") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_sec_adj_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.SecondaryMatching.SecondaryDiscount", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Amt") + .HasColumnType("decimal(18,2)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("Buyer") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("HasChanged") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SupplierCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Total") + .HasColumnType("decimal(18,2)"); + + b.Property("Version") + .HasColumnType("nvarchar(max)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("SupplierCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_sec_dis"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.SecondaryMatching.SecondaryDiscountVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_sec_dis_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.SecondaryMatching.SecondaryPriceRatio", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomItemCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("CustomItemPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("CustomSubItemCode") + .HasColumnType("nvarchar(450)"); + + b.Property("CustomSubItemPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("CustomerCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Period") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SupplierCode") + .HasColumnType("nvarchar(450)"); + + b.Property("SupplierDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("SupplyProportion") + .HasColumnType("nvarchar(max)"); + + b.Property("SupplyProportionPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("Version") + .HasColumnType("nvarchar(450)"); + + b.Property("Year") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Version", "CustomItemCode", "CustomSubItemCode", "SupplierCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_sec_ratio"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.SecondaryMatching.SecondaryPriceRatioVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasColumnType("nvarchar(450)"); + + b.Property("Year") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_sec_ratio_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("CP5A") + .HasColumnType("datetime2"); + + b.Property("CP7") + .HasColumnType("datetime2"); + + b.Property("ChassisNumber") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("KENNCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Model") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SettleYear") + .HasColumnType("nvarchar(max)"); + + b.Property("SettlementID") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("SettlementSupplier") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("state") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("state"); + + b.HasIndex("Version", "ChassisNumber", "MaterialCode", "KENNCode"); + + b.ToTable("Set_Settle"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccountVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_Settle_Version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.SettleAccounts.UnSettleAccount", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("CP5A") + .HasColumnType("datetime2"); + + b.Property("CP7") + .HasColumnType("datetime2"); + + b.Property("ChassisNumber") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("KENNCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Model") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SettleYear") + .HasColumnType("nvarchar(max)"); + + b.Property("SettlementID") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("SettlementSupplier") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("UnsettledReason") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("state") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("state"); + + b.HasIndex("Version", "ChassisNumber", "MaterialCode") + .IsUnique(); + + b.ToTable("Set_Unsettle"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.SettleAccounts.UnSettleAccountVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_Unsettle_Version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.SettlementCrossReference.SettlementCrossReferenceVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Year") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_SettlementCrossReference_Version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.SettlementCrossReferences.SettlementCrossReference", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BomMaterialCode") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("Buyer") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialDesc") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Model") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PartType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Period") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SettlementMaterialCode") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SupplierCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SupplierDesc") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Year") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("Version", "SettlementMaterialCode", "BomMaterialCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_SettlementCrossReference"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.SettlementPakAndSparePartsRef.SettlementPakAndSpareParts", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ApplicableFunction") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ErpSparePartCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ErpSparePartName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Model") + .HasColumnType("nvarchar(max)"); + + b.Property("PartType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PerCarNum") + .HasMaxLength(50) + .HasColumnType("decimal(18,2)"); + + b.Property("Period") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Price") + .HasMaxLength(50) + .HasColumnType("decimal(18,2)"); + + b.Property("ProductLine") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("QADCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("QuantityPrice") + .HasMaxLength(50) + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SettlementPartCode") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SettlementPartDesc") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SupplierCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SupplierName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SupplyProportion") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_SettlementPakAndSpareParts"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.SettlementPakAndSparePartsRef.SettlementPakAndSparePartsVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Year") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_SettlementPakAndSpareParts_Version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.SettlementParts.SettlementPart", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Model") + .HasColumnType("nvarchar(max)"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SettlementPartCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("SettlementPartDesc") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.Property("Uom") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Period", "CustomerCode", "Version", "SettlementPartCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_settlement_part"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.SettlementParts.SettlementPartVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Year") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_settlement_part_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.StorageLocations.CustomerStorageLocation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("CustomerDesc") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("Storagelocation") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Storagelocation", "CustomerCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_customerlocation"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.TaskJob", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActionName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("Creator") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DownFileName") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("Email") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("Error") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FileName") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("RealDownFileName") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("RealFileName") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("ServiceName") + .HasMaxLength(300) + .HasColumnType("nvarchar(300)"); + + b.Property("State") + .HasColumnType("nvarchar(max)"); + + b.Property("TaskId") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Type") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Set_TaskJob"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.VWKanBan.KanBanSettle", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Batch") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("Extend") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Flag") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("Kanban") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("PartType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Relation") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SettleDate") + .HasColumnType("datetime2"); + + b.Property("SettleInputDate") + .HasColumnType("datetime2"); + + b.Property("State") + .HasColumnType("nvarchar(max)"); + + b.Property("SupplierCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasColumnType("nvarchar(450)"); + + b.Property("Year") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Version", "Kanban", "MaterialCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_KanBanSettle"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.VWKanBan.KanBanVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_KanBanSettle_Version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.VWScrapClaims.ScrapClaims", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Amt") + .HasColumnType("decimal(18,2)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("Extend") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialDesc") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Period") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Year") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_ScrapClaims"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.VWScrapClaims.ScrapClaimsVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_ScrapClaims_Version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.VWSparePart.SparePart", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccountNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("AmountNoTax") + .HasColumnType("decimal(18,2)"); + + b.Property("BatchNo") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DeliveryLineNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("DeliveryOrderNo") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("Extend") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("FactoryName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("GermanInvoiceNo") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("InvoicedQty") + .HasColumnType("decimal(18,2)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LineNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("MaterialDesc") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("PurchaseOrderNo") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PurchaseOrderNoItem") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PurchaseOrderNoText") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PurchasePriceNoTax") + .HasColumnType("decimal(18,2)"); + + b.Property("PurchaseType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ReceiptQty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SpareDate") + .HasColumnType("datetime2"); + + b.Property("TaxCode") + .HasColumnType("nvarchar(max)"); + + b.Property("TaxRate") + .HasColumnType("decimal(18,2)"); + + b.Property("Unit") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Version", "PurchaseOrderNo", "MaterialCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_SparePart"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.VWSparePart.SparePartVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_WMSSparePart_Version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS_KanBan.WMSKanBanSettle", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Batch") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DeliveryOrderNo") + .HasColumnType("nvarchar(max)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("Extend") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Flag") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("Kanban") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("PartType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Relation") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SettleDate") + .HasColumnType("datetime2"); + + b.Property("SettleInputDate") + .HasColumnType("datetime2"); + + b.Property("State") + .HasColumnType("nvarchar(max)"); + + b.Property("SupplierCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasColumnType("nvarchar(450)"); + + b.Property("WMSActualGoodsDate") + .HasColumnType("nvarchar(max)"); + + b.Property("WMSDeliverGoodsState") + .HasColumnType("nvarchar(max)"); + + b.Property("WMSDeliveryNote") + .HasColumnType("nvarchar(max)"); + + b.Property("WMSDeliveryQty") + .HasColumnType("decimal(18,2)"); + + b.Property("WMSKanBanState") + .HasColumnType("nvarchar(max)"); + + b.Property("Year") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Version", "Kanban", "MaterialCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_WMSKanBanSettle"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS_KanBan.WMSKanBanVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_WMSKanBanSettle_Version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS_SparePart.WMSSparePart", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccountNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("AmountNoTax") + .HasColumnType("decimal(18,2)"); + + b.Property("BatchNo") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DeliveryLineNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("DeliveryOrderNo") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("Extend") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("FactoryName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("GermanInvoiceNo") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("InvoicedQty") + .HasColumnType("decimal(18,2)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LineNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("MaterialDesc") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("PurchaseOrderNo") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PurchaseOrderNoItem") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PurchaseOrderNoText") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PurchasePriceNoTax") + .HasColumnType("decimal(18,2)"); + + b.Property("PurchaseType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ReceiptQty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SpareDate") + .HasColumnType("datetime2"); + + b.Property("TaxCode") + .HasColumnType("nvarchar(max)"); + + b.Property("TaxRate") + .HasColumnType("decimal(18,2)"); + + b.Property("Unit") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("WMSDeliverGoodsState") + .HasColumnType("nvarchar(max)"); + + b.Property("WMSDeliveryNote") + .HasColumnType("nvarchar(max)"); + + b.Property("WMSKanBanState") + .HasColumnType("nvarchar(max)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Version", "PurchaseOrderNo", "MaterialCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_WMSSparePart"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.EstimatedInventories.EstimatedInventoryDetail", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BillNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasColumnType("nvarchar(max)"); + + b.Property("InvoiceQty") + .HasColumnType("decimal(18,2)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("MaterialDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("MaterialDocument") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("MaterialDocumentLine") + .HasColumnType("nvarchar(450)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("PostingDate") + .HasColumnType("datetime2"); + + b.Property("PurchaseDocument") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("PurchaseLine") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ReceiveQty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Source") + .HasColumnType("nvarchar(max)"); + + b.Property("StorageLocation") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("SupplierCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("SupplierDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("MaterialDocument", "MaterialDocumentLine", "MaterialCode", "Version") + .IsUnique() + .HasFilter("[MaterialDocumentLine] IS NOT NULL"); + + b.ToTable("Set_estdetail"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.EstimatedStockDiffReports.EstimatedStockDiffReport", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CreatorName") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomCode") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomName") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DocumentNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DocumentStatus") + .HasColumnType("int"); + + b.Property("DocumentType") + .HasColumnType("int"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasColumnType("nvarchar(max)"); + + b.Property("Year") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("BranchId", "DocumentNumber") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_estimate_stock_report"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.EstimatedStockDiffReports.EstimatedStockDiffReportDetail", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DiffQty") + .HasColumnType("decimal(18,2)"); + + b.Property("DocumentId") + .HasColumnType("uniqueidentifier"); + + b.Property("DocumentNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("EstimationQty") + .HasColumnType("decimal(18,2)"); + + b.Property("EstimationType") + .HasColumnType("nvarchar(max)"); + + b.Property("EstimationTypeDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("FgQty") + .HasColumnType("decimal(18,2)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("ItemCode") + .HasColumnType("nvarchar(450)"); + + b.Property("ItemDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("StockQty") + .HasColumnType("decimal(18,2)"); + + b.Property("UnSettledQty") + .HasColumnType("decimal(18,2)"); + + b.Property("Version") + .HasColumnType("nvarchar(max)"); + + b.Property("Year") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("BranchId", "DocumentId", "ItemCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_estimate_stock_report_detail"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.FISes.FIS", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccountDate") + .HasColumnType("datetime2"); + + b.Property("BeginTime") + .HasColumnType("datetime2"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("CP5Time") + .HasColumnType("datetime2"); + + b.Property("CP7Time") + .HasColumnType("datetime2"); + + b.Property("ChassisNumber") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ChassisNumber2") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("EndTime") + .HasColumnType("datetime2"); + + b.Property("ErpMaterialCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Extend1") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FISYear") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("KENNCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Model") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("OrderBillNum") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Period") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SequenceNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("SettleState") + .HasColumnType("int"); + + b.Property("SettledQty") + .HasColumnType("decimal(18,2)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("UnSettleVersion") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("WMSBillNum") + .HasColumnType("nvarchar(max)"); + + b.Property("WMSState") + .HasColumnType("nvarchar(max)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("ChassisNumber2", "KENNCode"); + + b.HasIndex("ChassisNumber2", "Version", "KENNCode", "ItemCode"); + + b.ToTable("Set_fis"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.FISes.FISExtend", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BeginTime") + .HasColumnType("datetime2"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("CP5Time") + .HasColumnType("datetime2"); + + b.Property("CP7Time") + .HasColumnType("datetime2"); + + b.Property("ChassisNumber") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ChassisNumber2") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("EndTime") + .HasColumnType("datetime2"); + + b.Property("ErpMaterialCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Extend1") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FISYear") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("KENNCode") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Model") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("OrderBillNum") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Period") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SequenceNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("SettleState") + .HasColumnType("int"); + + b.Property("SettledQty") + .HasColumnType("decimal(18,2)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("ChassisNumber2", "Version", "Model", "ItemCode") + .IsUnique() + .HasFilter("[Model] IS NOT NULL"); + + b.ToTable("Set_fis_extend"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.FISes.FISVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BeginDate") + .HasColumnType("datetime2"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("EndDate") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Model") + .HasColumnType("nvarchar(max)"); + + b.Property("Period") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.ToTable("Set_fis_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Inventories.InventoryDetail", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AppraisalCategory") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("AppraisalDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("EndingInventoryQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasColumnType("nvarchar(max)"); + + b.Property("InputQty") + .HasColumnType("decimal(18,2)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("MaterialDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("OpeningInventoryQty") + .HasColumnType("decimal(18,2)"); + + b.Property("OutputQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("StorageLocation") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("StorageLocationDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("Unit") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Version", "MaterialCode", "StorageLocation") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_inventory"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.JFCarConsigns.JFCarConsign", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("MaterialDesc") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PABillNum") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Qty") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasMaxLength(36) + .HasColumnType("int"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("CustomerCode", "MaterialCode", "PABillNum", "Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_jfcarconsign"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.JFCarKBs.JFCarKB", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BillNum") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsignQty") + .HasColumnType("decimal(18,2)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InStockQty") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("MaterialDesc") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("OnLineDateTime") + .HasColumnType("datetime2"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasMaxLength(36) + .HasColumnType("int"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("CustomerCode", "MaterialCode", "BillNum", "Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_jfcarkb"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.JFNotConsignReports.JFNotConsignReport", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BeginTime") + .HasColumnType("datetime2"); + + b.Property("BranchId") + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CreatorName") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomCode") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomName") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DocumentNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DocumentStatus") + .HasColumnType("int"); + + b.Property("DocumentType") + .HasColumnType("int"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("EndTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("BranchId", "DocumentNumber") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_jf_not_kb_consign_report"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.JFNotConsignReports.JFNotConsignReportDetail", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BillNum") + .HasColumnType("nvarchar(450)"); + + b.Property("BranchId") + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("ConsignQty") + .HasColumnType("decimal(18,2)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomCode") + .HasColumnType("nvarchar(450)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DocumentId") + .HasColumnType("uniqueidentifier"); + + b.Property("DocumentNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("InStockQty") + .HasColumnType("decimal(18,2)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .HasColumnType("nvarchar(450)"); + + b.Property("MaterialDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("OnLineDateTime") + .HasColumnType("datetime2"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("Version") + .HasColumnType("nvarchar(450)"); + + b.Property("Year") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId", "Version", "CustomCode", "MaterialCode", "BillNum") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_jf_not_kb_consign_report_detail"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.MaterialRelationships.MaterialRelationship", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AppraisalCategory") + .HasColumnType("nvarchar(max)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ErpMaterialCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("MaterialProperty") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SettleMaterialCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ShipMaterailCode") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("ErpMaterialCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_relationship"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Prebatches.Prebatch", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("CarCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("KENNCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("YearKennCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.ToTable("Set_prebatch"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs.InvoiceSettledDiff", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("CP7ScrapQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ClaimQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DiffPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("DiffQty") + .HasColumnType("decimal(18,2)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasColumnType("nvarchar(max)"); + + b.Property("InvoiceAmt") + .HasColumnType("decimal(18,2)"); + + b.Property("InvoicePrice") + .HasColumnType("decimal(18,2)"); + + b.Property("InvoiceQty") + .HasColumnType("decimal(18,2)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SalePrice") + .HasColumnType("decimal(18,2)"); + + b.Property("SapMaterialCode") + .HasColumnType("nvarchar(max)"); + + b.Property("SapMaterialGroup") + .HasColumnType("nvarchar(max)"); + + b.Property("SettleQty") + .HasColumnType("decimal(18,2)"); + + b.Property("Version") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Set_InvoiceSettledDiff"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs.InvoiceSettledDiffVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CreatorName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CustomCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CustomName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ProjectName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Year") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_InvoiceSettledDiffVersion"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports.SecondaryActuralAdjustmentReport", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CreatorName") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomCode") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomName") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DocumentNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DocumentStatus") + .HasColumnType("int"); + + b.Property("DocumentType") + .HasColumnType("int"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasColumnType("nvarchar(max)"); + + b.Property("Year") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("BranchId", "DocumentNumber") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_sec_act_adjustment_report"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports.SecondaryActuralAdjustmentReportDetail", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("Buyer") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomItemCode") + .HasColumnType("nvarchar(450)"); + + b.Property("CustomItemDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomSubItemCode") + .HasColumnType("nvarchar(450)"); + + b.Property("CustomSubItemDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomSubItemPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("CustomSubItemSumQty") + .HasColumnType("decimal(18,2)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DocumentId") + .HasColumnType("uniqueidentifier"); + + b.Property("DocumentNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ErpSubItemActualQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ErpSubItemCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ErpSubItemQty") + .HasColumnType("decimal(18,2)"); + + b.Property("HasChanged") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("OfflineQty") + .HasColumnType("decimal(18,2)"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SumPriceNoTax") + .HasColumnType("decimal(18,2)"); + + b.Property("SumPriceWithTax") + .HasColumnType("decimal(18,2)"); + + b.Property("SupplierCode") + .HasColumnType("nvarchar(450)"); + + b.Property("SupplierDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("SupplyProportion") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasColumnType("nvarchar(450)"); + + b.Property("Year") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("BranchId", "DocumentId", "Version", "CustomItemCode", "CustomSubItemCode", "SupplierCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_sec_act_adjustment_report_detail"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.SecondaryActuralDiffReports.SecondaryActuralDiffReport", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CreatorName") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomCode") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomName") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DocumentNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DocumentStatus") + .HasColumnType("int"); + + b.Property("DocumentType") + .HasColumnType("int"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasColumnType("nvarchar(max)"); + + b.Property("Year") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("BranchId", "DocumentNumber") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_sec_act_diff_report"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.SecondaryActuralDiffReports.SecondaryActuralDiffReportDetail", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActNoTaxAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("ActPaymentPartyQty") + .HasColumnType("decimal(18,2)"); + + b.Property("BranchId") + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomItemCode") + .HasColumnType("nvarchar(450)"); + + b.Property("CustomItemDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomSubItemCode") + .HasColumnType("nvarchar(450)"); + + b.Property("CustomSubItemDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DiffAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("DiffQty") + .HasColumnType("decimal(18,2)"); + + b.Property("DocumentId") + .HasColumnType("uniqueidentifier"); + + b.Property("DocumentNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ErpSubItemCode") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("StaPaymentPartyQty") + .HasColumnType("decimal(18,2)"); + + b.Property("StdNoTaxAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("SupplierCode") + .HasColumnType("nvarchar(450)"); + + b.Property("SupplierDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasColumnType("nvarchar(450)"); + + b.Property("Year") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("BranchId", "DocumentId", "Version", "CustomItemCode", "CustomSubItemCode", "SupplierCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_sec_act_diff_report_detail"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.SendUnsettledDiffReports.SendUnsettledDiffReport", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BeginTime") + .HasColumnType("datetime2"); + + b.Property("BeginVersion") + .HasColumnType("nvarchar(max)"); + + b.Property("BranchId") + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CreatorName") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomCode") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomName") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DocumentNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DocumentStatus") + .HasColumnType("int"); + + b.Property("DocumentType") + .HasColumnType("int"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("EndTime") + .HasColumnType("datetime2"); + + b.Property("EndVersion") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("BranchId", "DocumentNumber") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_send_unsettled_report"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.SendUnsettledDiffReports.SendUnsettledDiffReportDetail", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("CP5Time") + .HasColumnType("datetime2"); + + b.Property("ChassisNumber") + .HasColumnType("nvarchar(450)"); + + b.Property("ChassisNumber2") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DocumentId") + .HasColumnType("uniqueidentifier"); + + b.Property("DocumentNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("Extend1") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FISYear") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("ItemCode") + .HasColumnType("nvarchar(450)"); + + b.Property("ItemDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("KENNCode") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Model") + .HasColumnType("nvarchar(max)"); + + b.Property("OrderBillNum") + .HasColumnType("nvarchar(max)"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SequenceNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("SettledQty") + .HasColumnType("decimal(18,2)"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("Version") + .HasColumnType("nvarchar(450)"); + + b.Property("Year") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("BranchId", "DocumentId", "Version", "ChassisNumber", "ItemCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_send_unsettled_report_detail"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.StockFisDiffReports.StockFisDiffReport", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CreatorName") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomCode") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomName") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DocumentNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DocumentStatus") + .HasColumnType("int"); + + b.Property("DocumentType") + .HasColumnType("int"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasColumnType("nvarchar(max)"); + + b.Property("Year") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("BranchId", "DocumentNumber") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_stock_fis_diff_report"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.StockFisDiffReports.StockFisDiffReportDetail", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomCode") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DiffQty") + .HasColumnType("decimal(18,2)"); + + b.Property("DocumentId") + .HasColumnType("uniqueidentifier"); + + b.Property("DocumentNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("EstimationType") + .HasColumnType("nvarchar(max)"); + + b.Property("FisQty") + .HasColumnType("decimal(18,2)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("ItemCode") + .HasColumnType("nvarchar(450)"); + + b.Property("ItemDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("StockQty") + .HasColumnType("decimal(18,2)"); + + b.Property("Version") + .HasColumnType("nvarchar(max)"); + + b.Property("Year") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("BranchId", "DocumentId", "ItemCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_stock_fis_diff_report_detail"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.StockSettledDiffReports.StockSettledDiffReport", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CreatorName") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomCode") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomName") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DocumentNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DocumentStatus") + .HasColumnType("int"); + + b.Property("DocumentType") + .HasColumnType("int"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasColumnType("nvarchar(max)"); + + b.Property("Year") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("BranchId", "DocumentNumber") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_stock_settled_report"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.StockSettledDiffReports.StockSettledDiffReportDetail", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomCode") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DiffQty") + .HasColumnType("decimal(18,2)"); + + b.Property("DocumentId") + .HasColumnType("uniqueidentifier"); + + b.Property("DocumentNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("EstimationType") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("ItemCode") + .HasColumnType("nvarchar(450)"); + + b.Property("ItemDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("R3SettledQty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("StockQty") + .HasColumnType("decimal(18,2)"); + + b.Property("Version") + .HasColumnType("nvarchar(max)"); + + b.Property("Year") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("BranchId", "DocumentId", "ItemCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_stock_settled_report_detail"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.StockUnsettledDiffReports.StockUnsettledDiffReport", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CreatorName") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomCode") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomName") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DocumentNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DocumentStatus") + .HasColumnType("int"); + + b.Property("DocumentType") + .HasColumnType("int"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasColumnType("nvarchar(max)"); + + b.Property("Year") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("BranchId", "DocumentNumber") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_stock_unsettled_report"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.StockUnsettledDiffReports.StockUnsettledDiffReportDetail", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomCode") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DiffQty") + .HasColumnType("decimal(18,2)"); + + b.Property("DocumentId") + .HasColumnType("uniqueidentifier"); + + b.Property("DocumentNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("EstimationType") + .HasColumnType("nvarchar(max)"); + + b.Property("FisUnSettledQty") + .HasColumnType("decimal(18,2)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("ItemCode") + .HasColumnType("nvarchar(450)"); + + b.Property("ItemDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("StockQty") + .HasColumnType("decimal(18,2)"); + + b.Property("Version") + .HasColumnType("nvarchar(max)"); + + b.Property("Year") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("BranchId", "DocumentId", "ItemCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_stock_unsettled_report_detail"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.SupplierItemSetUps.SupplierItemSetUp", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasColumnType("nvarchar(450)"); + + b.Property("CustomerSupplierCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ErpItemCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ErpSupplierCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("ErpSupplierCode", "ErpItemCode", "CustomerSupplierCode", "CustomerCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_supplier_item_setup"); + }); + + modelBuilder.Entity("Win.Sfs.Shared.DomainBase.UpstreamDocument", b => + { + b.Property("UpstreamDocumentId") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BTNotConsignReportId") + .HasColumnType("uniqueidentifier"); + + b.Property("BTSeqKBDiffReportId") + .HasColumnType("uniqueidentifier"); + + b.Property("EstimatedStockDiffReportId") + .HasColumnType("uniqueidentifier"); + + b.Property("JFNotConsignReportId") + .HasColumnType("uniqueidentifier"); + + b.Property("SecondaryActuralAdjustmentReportId") + .HasColumnType("uniqueidentifier"); + + b.Property("SecondaryActuralDiffReportId") + .HasColumnType("uniqueidentifier"); + + b.Property("SendUnsettledDiffReportId") + .HasColumnType("uniqueidentifier"); + + b.Property("Seq") + .HasColumnType("int"); + + b.Property("StockFisDiffReportId") + .HasColumnType("uniqueidentifier"); + + b.Property("StockSettledDiffReportId") + .HasColumnType("uniqueidentifier"); + + b.Property("StockUnsettledDiffReportId") + .HasColumnType("uniqueidentifier"); + + b.Property("UpstreamDocumentNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("UpstreamDocumentType") + .HasColumnType("int"); + + b.HasKey("UpstreamDocumentId"); + + b.HasIndex("BTNotConsignReportId"); + + b.HasIndex("BTSeqKBDiffReportId"); + + b.HasIndex("EstimatedStockDiffReportId"); + + b.HasIndex("JFNotConsignReportId"); + + b.HasIndex("SecondaryActuralAdjustmentReportId"); + + b.HasIndex("SecondaryActuralDiffReportId"); + + b.HasIndex("SendUnsettledDiffReportId"); + + b.HasIndex("StockFisDiffReportId"); + + b.HasIndex("StockSettledDiffReportId"); + + b.HasIndex("StockUnsettledDiffReportId"); + + b.ToTable("UpstreamDocument"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.BTNotConsignReports.BTNotConsignReportDetail", b => + { + b.HasOne("Win.Sfs.SettleAccount.BTNotConsignReports.BTNotConsignReport", null) + .WithMany("BTNotConsignReportDetails") + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.BTSeqKBDiffReports.BTSeqKBDiffReportDetail", b => + { + b.HasOne("Win.Sfs.SettleAccount.BTSeqKBDiffReports.BTSeqKBDiffReport", null) + .WithMany("BTSeqKBDiffReportDetails") + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.EstimatedStockDiffReports.EstimatedStockDiffReportDetail", b => + { + b.HasOne("Win.Sfs.SettleAccount.EstimatedStockDiffReports.EstimatedStockDiffReport", null) + .WithMany("EstimatedStockDiffReportDetails") + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.JFNotConsignReports.JFNotConsignReportDetail", b => + { + b.HasOne("Win.Sfs.SettleAccount.JFNotConsignReports.JFNotConsignReport", null) + .WithMany("JFNotConsignReportDetails") + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports.SecondaryActuralAdjustmentReportDetail", b => + { + b.HasOne("Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports.SecondaryActuralAdjustmentReport", null) + .WithMany("SecondaryActuralAdjustmentReportDetails") + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.SecondaryActuralDiffReports.SecondaryActuralDiffReportDetail", b => + { + b.HasOne("Win.Sfs.SettleAccount.SecondaryActuralDiffReports.SecondaryActuralDiffReport", null) + .WithMany("SecondaryActuralDiffReportDetails") + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.StockFisDiffReports.StockFisDiffReportDetail", b => + { + b.HasOne("Win.Sfs.SettleAccount.StockFisDiffReports.StockFisDiffReport", null) + .WithMany("StockFisDiffReportDetails") + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.StockSettledDiffReports.StockSettledDiffReportDetail", b => + { + b.HasOne("Win.Sfs.SettleAccount.StockSettledDiffReports.StockSettledDiffReport", null) + .WithMany("StockSettledDiffReportDetails") + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.StockUnsettledDiffReports.StockUnsettledDiffReportDetail", b => + { + b.HasOne("Win.Sfs.SettleAccount.StockUnsettledDiffReports.StockUnsettledDiffReport", null) + .WithMany("StockUnsettledDiffReportDetails") + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + }); + + modelBuilder.Entity("Win.Sfs.Shared.DomainBase.UpstreamDocument", b => + { + b.HasOne("Win.Sfs.SettleAccount.BTNotConsignReports.BTNotConsignReport", null) + .WithMany("UpstreamDocuments") + .HasForeignKey("BTNotConsignReportId"); + + b.HasOne("Win.Sfs.SettleAccount.BTSeqKBDiffReports.BTSeqKBDiffReport", null) + .WithMany("UpstreamDocuments") + .HasForeignKey("BTSeqKBDiffReportId"); + + b.HasOne("Win.Sfs.SettleAccount.EstimatedStockDiffReports.EstimatedStockDiffReport", null) + .WithMany("UpstreamDocuments") + .HasForeignKey("EstimatedStockDiffReportId"); + + b.HasOne("Win.Sfs.SettleAccount.JFNotConsignReports.JFNotConsignReport", null) + .WithMany("UpstreamDocuments") + .HasForeignKey("JFNotConsignReportId"); + + b.HasOne("Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports.SecondaryActuralAdjustmentReport", null) + .WithMany("UpstreamDocuments") + .HasForeignKey("SecondaryActuralAdjustmentReportId"); + + b.HasOne("Win.Sfs.SettleAccount.SecondaryActuralDiffReports.SecondaryActuralDiffReport", null) + .WithMany("UpstreamDocuments") + .HasForeignKey("SecondaryActuralDiffReportId"); + + b.HasOne("Win.Sfs.SettleAccount.SendUnsettledDiffReports.SendUnsettledDiffReport", null) + .WithMany("UpstreamDocuments") + .HasForeignKey("SendUnsettledDiffReportId"); + + b.HasOne("Win.Sfs.SettleAccount.StockFisDiffReports.StockFisDiffReport", null) + .WithMany("UpstreamDocuments") + .HasForeignKey("StockFisDiffReportId"); + + b.HasOne("Win.Sfs.SettleAccount.StockSettledDiffReports.StockSettledDiffReport", null) + .WithMany("UpstreamDocuments") + .HasForeignKey("StockSettledDiffReportId"); + + b.HasOne("Win.Sfs.SettleAccount.StockUnsettledDiffReports.StockUnsettledDiffReport", null) + .WithMany("UpstreamDocuments") + .HasForeignKey("StockUnsettledDiffReportId"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.BTNotConsignReports.BTNotConsignReport", b => + { + b.Navigation("BTNotConsignReportDetails"); + + b.Navigation("UpstreamDocuments"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.BTSeqKBDiffReports.BTSeqKBDiffReport", b => + { + b.Navigation("BTSeqKBDiffReportDetails"); + + b.Navigation("UpstreamDocuments"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.EstimatedStockDiffReports.EstimatedStockDiffReport", b => + { + b.Navigation("EstimatedStockDiffReportDetails"); + + b.Navigation("UpstreamDocuments"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.JFNotConsignReports.JFNotConsignReport", b => + { + b.Navigation("JFNotConsignReportDetails"); + + b.Navigation("UpstreamDocuments"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports.SecondaryActuralAdjustmentReport", b => + { + b.Navigation("SecondaryActuralAdjustmentReportDetails"); + + b.Navigation("UpstreamDocuments"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.SecondaryActuralDiffReports.SecondaryActuralDiffReport", b => + { + b.Navigation("SecondaryActuralDiffReportDetails"); + + b.Navigation("UpstreamDocuments"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.SendUnsettledDiffReports.SendUnsettledDiffReport", b => + { + b.Navigation("UpstreamDocuments"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.StockFisDiffReports.StockFisDiffReport", b => + { + b.Navigation("StockFisDiffReportDetails"); + + b.Navigation("UpstreamDocuments"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.StockSettledDiffReports.StockSettledDiffReport", b => + { + b.Navigation("StockSettledDiffReportDetails"); + + b.Navigation("UpstreamDocuments"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.StockUnsettledDiffReports.StockUnsettledDiffReport", b => + { + b.Navigation("StockUnsettledDiffReportDetails"); + + b.Navigation("UpstreamDocuments"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211129095823_init.cs b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211129095823_init.cs new file mode 100644 index 00000000..06968179 --- /dev/null +++ b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211129095823_init.cs @@ -0,0 +1,4385 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace Win.Sfs.SettleAccount.Migrations +{ + public partial class init : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "Set_bom", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Factory = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + ParentItemCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ParentItemDesc = table.Column(type: "nvarchar(2048)", maxLength: 2048, nullable: true), + ChildItemCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ChildItemDesc = table.Column(type: "nvarchar(2048)", maxLength: 2048, nullable: true), + ChildItemUom = table.Column(type: "nvarchar(max)", nullable: true), + Qty = table.Column(type: "decimal(18,2)", nullable: false), + OperateProcess = table.Column(type: "int", nullable: false), + ScrapPercent = table.Column(type: "decimal(18,2)", nullable: false), + BomType = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + EffectiveTime = table.Column(type: "datetime2", nullable: false), + ExpireTime = table.Column(type: "datetime2", nullable: false), + IssuePosition = table.Column(type: "nvarchar(max)", nullable: true), + BomLevel = table.Column(type: "int", nullable: false), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_bom", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_bom_version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Factory = table.Column(type: "nvarchar(max)", nullable: true), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_bom_version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_bt_not_kb_consign_report", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", maxLength: 36, nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true), + DocumentNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + DocumentType = table.Column(type: "int", nullable: false), + DocumentStatus = table.Column(type: "int", nullable: false), + BeginTime = table.Column(type: "datetime2", nullable: false), + EndTime = table.Column(type: "datetime2", nullable: false), + CustomCode = table.Column(type: "nvarchar(max)", nullable: true), + CustomName = table.Column(type: "nvarchar(max)", nullable: true), + CreatorName = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_bt_not_kb_consign_report", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_bt_seq_kb_diff_report", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", maxLength: 36, nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true), + DocumentNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + DocumentType = table.Column(type: "int", nullable: false), + DocumentStatus = table.Column(type: "int", nullable: false), + Year = table.Column(type: "nvarchar(max)", nullable: true), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(max)", nullable: true), + CustomCode = table.Column(type: "nvarchar(max)", nullable: true), + CustomName = table.Column(type: "nvarchar(max)", nullable: true), + CreatorName = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_bt_seq_kb_diff_report", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_btcarconsign", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(450)", nullable: false), + MaterialCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Qty = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false), + KBCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + State = table.Column(type: "int", maxLength: 36, nullable: false), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_btcarconsign", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_btcarconsign_version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_btcarconsign_version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_btcarkb", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + DateTime = table.Column(type: "datetime2", nullable: false), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + MaterialCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + MaterialDesc = table.Column(type: "nvarchar(max)", nullable: true), + NeedQty = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false), + OrderKBCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ReceiveAreaCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ReceiveAreaName = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + DeliveryDateTime = table.Column(type: "datetime2", nullable: false), + ConsignQty = table.Column(type: "decimal(18,2)", nullable: false), + State = table.Column(type: "int", maxLength: 36, nullable: false), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_btcarkb", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_btcarkb_version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + DateTime = table.Column(type: "datetime2", nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_btcarkb_version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_btcarseq", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Period = table.Column(type: "nvarchar(1024)", maxLength: 1024, nullable: true), + DT = table.Column(type: "datetime2", nullable: false), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + VIN = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + BarCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + OnLineDateTime = table.Column(type: "datetime2", nullable: false), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_btcarseq", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_btcarseq_version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + DT = table.Column(type: "datetime2", nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_btcarseq_version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_btcarseqfirst", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Period = table.Column(type: "nvarchar(max)", nullable: true), + DT = table.Column(type: "datetime2", nullable: false), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(450)", nullable: false), + BarCode = table.Column(type: "nvarchar(450)", nullable: true), + OnLineDateTime = table.Column(type: "datetime2", nullable: false), + VIN = table.Column(type: "nvarchar(450)", nullable: true), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_btcarseqfirst", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_btcarseqfirst_version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + DT = table.Column(type: "datetime2", nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_btcarseqfirst_version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_btcarseqsecond", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Period = table.Column(type: "nvarchar(max)", nullable: true), + DateTime = table.Column(type: "datetime2", nullable: false), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(450)", nullable: false), + PlanTypeRemark = table.Column(type: "nvarchar(max)", nullable: true), + Code = table.Column(type: "nvarchar(max)", nullable: true), + OnLineDateTime = table.Column(type: "datetime2", nullable: false), + VIN = table.Column(type: "nvarchar(450)", nullable: true), + EngineCode = table.Column(type: "nvarchar(max)", nullable: true), + BarCode = table.Column(type: "nvarchar(450)", nullable: true), + CarName = table.Column(type: "nvarchar(max)", nullable: true), + CMSerie = table.Column(type: "nvarchar(max)", nullable: true), + CMSerieRemark = table.Column(type: "nvarchar(max)", nullable: true), + CarType = table.Column(type: "nvarchar(max)", nullable: true), + Color = table.Column(type: "nvarchar(max)", nullable: true), + TopSeq = table.Column(type: "nvarchar(max)", nullable: true), + InColor = table.Column(type: "nvarchar(max)", nullable: true), + CarModelShort = table.Column(type: "nvarchar(max)", nullable: true), + OrderStateNum = table.Column(type: "nvarchar(max)", nullable: true), + StateName = table.Column(type: "nvarchar(max)", nullable: true), + SpecialCarTypeRemark = table.Column(type: "nvarchar(max)", nullable: true), + PlanDate = table.Column(type: "datetime2", nullable: false), + PlanSeq = table.Column(type: "int", nullable: false), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_btcarseqsecond", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_btcarseqsecond_version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + DateTime = table.Column(type: "datetime2", nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_btcarseqsecond_version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_carmaterialconfig", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + CarCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + MaterialCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Qty = table.Column(type: "decimal(18,2)", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_carmaterialconfig", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_code", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Project = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Value = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Description = table.Column(type: "nvarchar(max)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_code", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_control", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Version = table.Column(type: "nvarchar(max)", nullable: true), + State = table.Column(type: "int", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_control", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_customer", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Code = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Name = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + Description = table.Column(type: "nvarchar(2048)", maxLength: 2048, nullable: true), + Address = table.Column(type: "nvarchar(2048)", maxLength: 2048, nullable: true), + Contact = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + ContactPhone = table.Column(type: "nvarchar(max)", nullable: true), + ContactEmail = table.Column(type: "nvarchar(max)", nullable: true), + ContactFax = table.Column(type: "nvarchar(max)", nullable: true), + TaxRate = table.Column(type: "decimal(18,2)", nullable: true), + CurrencyId = table.Column(type: "uniqueidentifier", nullable: false), + CustomerType = table.Column(type: "int", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", maxLength: 36, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_customer", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_customer_bom", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + CustomerCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + ParentItemCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + ChildItemCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + Qty = table.Column(type: "decimal(18,2)", nullable: false), + EffectiveTime = table.Column(type: "datetime2", nullable: false), + FailureTime = table.Column(type: "datetime2", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_customer_bom", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_customerlocation", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerDesc = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Storagelocation = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + State = table.Column(type: "int", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_customerlocation", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_estdetail", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + MaterialDocument = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + MaterialDocumentLine = table.Column(type: "nvarchar(450)", nullable: true), + BillNumber = table.Column(type: "nvarchar(max)", nullable: true), + PostingDate = table.Column(type: "datetime2", nullable: false), + MaterialCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + MaterialDesc = table.Column(type: "nvarchar(max)", nullable: true), + ReceiveQty = table.Column(type: "decimal(18,2)", nullable: false), + InvoiceQty = table.Column(type: "decimal(18,2)", nullable: false), + SupplierCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + SupplierDesc = table.Column(type: "nvarchar(max)", nullable: true), + PurchaseDocument = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + PurchaseLine = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Source = table.Column(type: "nvarchar(max)", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + StorageLocation = table.Column(type: "nvarchar(max)", nullable: false), + Factory = table.Column(type: "nvarchar(max)", nullable: true), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_estdetail", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_estimate_stock_report", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", maxLength: 36, nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true), + DocumentNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + DocumentType = table.Column(type: "int", nullable: false), + DocumentStatus = table.Column(type: "int", nullable: false), + Year = table.Column(type: "nvarchar(max)", nullable: true), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(max)", nullable: true), + CustomCode = table.Column(type: "nvarchar(max)", nullable: true), + CustomName = table.Column(type: "nvarchar(max)", nullable: true), + CreatorName = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_estimate_stock_report", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_estinventory_version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Factory = table.Column(type: "nvarchar(max)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_estinventory_version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_estsum", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Postingperiod = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + MaterialCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + MaterialDesc = table.Column(type: "nvarchar(max)", nullable: true), + Qty = table.Column(type: "decimal(18,2)", nullable: false), + SupplierCode = table.Column(type: "nvarchar(max)", nullable: true), + SupplierDesc = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + PurchaseDocument = table.Column(type: "nvarchar(max)", nullable: true), + PurchaseLine = table.Column(type: "nvarchar(max)", nullable: true), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_estsum", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_estsum_verion", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Factory = table.Column(type: "nvarchar(max)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_estsum_verion", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_factory", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + CustomerCode = table.Column(type: "nvarchar(max)", nullable: true), + Code = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Desc = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_factory", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_fis", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + BeginTime = table.Column(type: "datetime2", nullable: false), + EndTime = table.Column(type: "datetime2", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + FISYear = table.Column(type: "nvarchar(max)", nullable: true), + OrderBillNum = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + KENNCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + ItemCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Model = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Extend1 = table.Column(type: "nvarchar(max)", nullable: true), + ChassisNumber = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Qty = table.Column(type: "decimal(18,2)", nullable: false), + CP5Time = table.Column(type: "datetime2", nullable: false), + SequenceNumber = table.Column(type: "nvarchar(max)", nullable: true), + ChassisNumber2 = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + CP7Time = table.Column(type: "datetime2", nullable: false), + SettledQty = table.Column(type: "decimal(18,2)", nullable: false), + State = table.Column(type: "int", nullable: false), + SettleState = table.Column(type: "int", nullable: false), + ErpMaterialCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + WMSState = table.Column(type: "nvarchar(max)", nullable: true), + WMSBillNum = table.Column(type: "nvarchar(max)", nullable: true), + UnSettleVersion = table.Column(type: "nvarchar(max)", nullable: true), + AccountDate = table.Column(type: "datetime2", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_fis", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_fis_extend", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + BeginTime = table.Column(type: "datetime2", nullable: false), + EndTime = table.Column(type: "datetime2", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + FISYear = table.Column(type: "nvarchar(max)", nullable: true), + OrderBillNum = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + KENNCode = table.Column(type: "nvarchar(max)", nullable: true), + ItemCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Model = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Extend1 = table.Column(type: "nvarchar(max)", nullable: true), + ChassisNumber = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Qty = table.Column(type: "decimal(18,2)", nullable: false), + CP5Time = table.Column(type: "datetime2", nullable: false), + SequenceNumber = table.Column(type: "nvarchar(max)", nullable: true), + ChassisNumber2 = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CP7Time = table.Column(type: "datetime2", nullable: false), + SettledQty = table.Column(type: "decimal(18,2)", nullable: false), + State = table.Column(type: "int", nullable: false), + SettleState = table.Column(type: "int", nullable: false), + ErpMaterialCode = table.Column(type: "nvarchar(max)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_fis_extend", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_fis_th", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Factory = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + OrderBillNum = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + MaterialCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ErpMaterialCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Model = table.Column(type: "nvarchar(450)", nullable: true), + KENNCode = table.Column(type: "nvarchar(max)", nullable: true), + ChassisNumber = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ChassisNumber2 = table.Column(type: "nvarchar(450)", nullable: true), + Qty = table.Column(type: "decimal(18,2)", nullable: false), + CP5Time = table.Column(type: "datetime2", nullable: false), + CP7Time = table.Column(type: "datetime2", nullable: false), + SettledQty = table.Column(type: "decimal(18,2)", nullable: false), + SequenceNumber = table.Column(type: "nvarchar(max)", nullable: true), + State = table.Column(type: "int", nullable: false), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + BeginTime = table.Column(type: "datetime2", nullable: false), + EndTime = table.Column(type: "datetime2", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Extend1 = table.Column(type: "nvarchar(max)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_fis_th", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_fis_version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Factory = table.Column(type: "nvarchar(max)", nullable: true), + Model = table.Column(type: "nvarchar(max)", nullable: true), + BeginDate = table.Column(type: "datetime2", nullable: false), + EndDate = table.Column(type: "datetime2", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_fis_version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_hqcon", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + MaterialCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + MaterialDesc = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), + VIN = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + Qty = table.Column(type: "decimal(18,2)", nullable: false), + State = table.Column(type: "int", nullable: false), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_hqcon", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_hqcon_version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_hqcon_version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_hqkb", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + MaterialCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + MaterialDesc = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), + NeedQty = table.Column(type: "decimal(18,2)", nullable: false), + KBCode = table.Column(type: "nvarchar(max)", nullable: true), + VIN = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + ConsignQty = table.Column(type: "decimal(18,2)", nullable: false), + State = table.Column(type: "int", nullable: false), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + CreateTime = table.Column(type: "datetime2", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_hqkb", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_hqkb_version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_hqkb_version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_hqspcon", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + MaterialCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + MaterialDesc = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), + KBCode = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + Qty = table.Column(type: "decimal(18,2)", nullable: false), + State = table.Column(type: "int", nullable: false), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + KBCodeExtend = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_hqspcon", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_hqspcon_version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_hqspcon_version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_hqspkb", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + MaterialCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + MaterialDesc = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), + NeedQty = table.Column(type: "decimal(18,2)", nullable: false), + KBCode = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + ConsignQty = table.Column(type: "decimal(18,2)", nullable: false), + State = table.Column(type: "int", nullable: false), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + CreateTime = table.Column(type: "datetime2", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_hqspkb", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_hqspkb_version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_hqspkb_version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_importmap", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ProjectName = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + OldColumnName = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + NewColumnName = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + IsCheck = table.Column(type: "bit", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_importmap", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_inventory", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + MaterialDesc = table.Column(type: "nvarchar(max)", nullable: true), + AppraisalDesc = table.Column(type: "nvarchar(max)", nullable: true), + StorageLocationDesc = table.Column(type: "nvarchar(max)", nullable: true), + Price = table.Column(type: "decimal(18,2)", nullable: false), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Factory = table.Column(type: "nvarchar(max)", nullable: true), + MaterialCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + InputQty = table.Column(type: "decimal(18,2)", nullable: false), + OutputQty = table.Column(type: "decimal(18,2)", nullable: false), + OpeningInventoryQty = table.Column(type: "decimal(18,2)", nullable: false), + EndingInventoryQty = table.Column(type: "decimal(18,2)", nullable: false), + AppraisalCategory = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + StorageLocation = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Unit = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_inventory", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_inventory_version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Factory = table.Column(type: "nvarchar(450)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_inventory_version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_Invoice", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Period = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Version = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Factory = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + MaterialCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + MaterialDesc = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Qty = table.Column(type: "decimal(18,2)", nullable: false), + Amt = table.Column(type: "decimal(18,2)", nullable: false), + Extend = table.Column(type: "nvarchar(max)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_Invoice", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_InvoiceSettledDiff", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Version = table.Column(type: "nvarchar(max)", nullable: true), + SapMaterialGroup = table.Column(type: "nvarchar(max)", nullable: true), + SapMaterialCode = table.Column(type: "nvarchar(max)", nullable: true), + Factory = table.Column(type: "nvarchar(max)", nullable: true), + MaterialCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + MaterialDesc = table.Column(type: "nvarchar(max)", nullable: true), + InvoiceQty = table.Column(type: "decimal(18,2)", nullable: false), + InvoiceAmt = table.Column(type: "decimal(18,2)", nullable: false), + InvoicePrice = table.Column(type: "decimal(18,2)", nullable: false), + SettleQty = table.Column(type: "decimal(18,2)", nullable: false), + DiffQty = table.Column(type: "decimal(18,2)", nullable: false), + CP7ScrapQty = table.Column(type: "decimal(18,2)", nullable: false), + ClaimQty = table.Column(type: "decimal(18,2)", nullable: false), + SalePrice = table.Column(type: "decimal(18,2)", nullable: false), + DiffPrice = table.Column(type: "decimal(18,2)", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_InvoiceSettledDiff", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_InvoiceSettledDiffVersion", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Period = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Version = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + CustomCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + CustomName = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + CreatorName = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ProjectName = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_InvoiceSettledDiffVersion", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_InvoiceVersion", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Period = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Version = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + CustomerCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_InvoiceVersion", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_item_invoice_price", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Factory = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + MaterialCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + MaterialDesc = table.Column(type: "nvarchar(max)", nullable: true), + UM = table.Column(type: "nvarchar(max)", nullable: true), + Sales = table.Column(type: "nvarchar(max)", nullable: true), + SubAcct = table.Column(type: "nvarchar(max)", nullable: true), + CC = table.Column(type: "nvarchar(max)", nullable: true), + Backorder = table.Column(type: "nvarchar(max)", nullable: true), + Price = table.Column(type: "decimal(18,2)", nullable: false), + ExtendedPrice = table.Column(type: "decimal(18,2)", nullable: false), + ExtendedMargin = table.Column(type: "decimal(18,2)", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_item_invoice_price", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_item_invoice_price_version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Period = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Version = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + CustomerCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Factory = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_item_invoice_price_version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_jf_not_kb_consign_report", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", maxLength: 36, nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true), + DocumentNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + DocumentType = table.Column(type: "int", nullable: false), + DocumentStatus = table.Column(type: "int", nullable: false), + BeginTime = table.Column(type: "datetime2", nullable: false), + EndTime = table.Column(type: "datetime2", nullable: false), + CustomCode = table.Column(type: "nvarchar(max)", nullable: true), + CustomName = table.Column(type: "nvarchar(max)", nullable: true), + CreatorName = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_jf_not_kb_consign_report", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_jfcarconsign", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(450)", nullable: false), + MaterialCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + MaterialDesc = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + Qty = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false), + PABillNum = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + State = table.Column(type: "int", maxLength: 36, nullable: false), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_jfcarconsign", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_jfcarconsign_version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_jfcarconsign_version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_jfcarkb", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(450)", nullable: false), + BillNum = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + OnLineDateTime = table.Column(type: "datetime2", nullable: false), + MaterialCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + MaterialDesc = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + InStockQty = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false), + State = table.Column(type: "int", maxLength: 36, nullable: false), + ConsignQty = table.Column(type: "decimal(18,2)", nullable: false), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_jfcarkb", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_jfcarkb_version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_jfcarkb_version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_KanBanSettle", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(max)", nullable: true), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(450)", nullable: true), + Kanban = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: false), + Relation = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), + Factory = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + MaterialCode = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: false), + PartType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + SupplierCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + SettleInputDate = table.Column(type: "datetime2", nullable: false), + Batch = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Flag = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Qty = table.Column(type: "decimal(18,2)", nullable: false), + SettleDate = table.Column(type: "datetime2", nullable: false), + State = table.Column(type: "nvarchar(max)", nullable: true), + Extend = table.Column(type: "nvarchar(max)", nullable: true), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_KanBanSettle", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_KanBanSettle_Version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_KanBanSettle_Version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_material", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Factory = table.Column(type: "nvarchar(max)", nullable: true), + MaterialCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + MaterialDesc = table.Column(type: "nvarchar(max)", nullable: true), + Unit = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + EstimateType = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + EstimateTypeDesc = table.Column(type: "nvarchar(max)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_material", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_MaterialRelationshipDetail", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Version = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + CustomerCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ErpMaterialCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + MaterialDesc = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + MaterialProperty = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + SettleMaterialCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ShipMaterailCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + AppraisalCategory = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Qty = table.Column(type: "decimal(18,2)", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_MaterialRelationshipDetail", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_MaterialRelationshipVersion", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Period = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Version = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + CustomerCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Factory = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_MaterialRelationshipVersion", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_prebatch", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + KENNCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + State = table.Column(type: "int", nullable: false), + CarCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + YearKennCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_prebatch", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_PriceList", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + CustomerCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Version = table.Column(type: "nvarchar(max)", nullable: true), + BeginDate = table.Column(type: "datetime2", nullable: false), + EndDate = table.Column(type: "datetime2", nullable: false), + Price = table.Column(type: "decimal(18,2)", nullable: false), + MaterialCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Type = table.Column(type: "int", nullable: false), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_PriceList", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_PriceListVersion", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Period = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Version = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Factory = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_PriceListVersion", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_relationship", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ErpMaterialCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + MaterialDesc = table.Column(type: "nvarchar(max)", nullable: true), + MaterialProperty = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + SettleMaterialCode = table.Column(type: "nvarchar(max)", nullable: true), + ShipMaterailCode = table.Column(type: "nvarchar(max)", nullable: true), + AppraisalCategory = table.Column(type: "nvarchar(max)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_relationship", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_ScrapClaims", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Period = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Version = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Type = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + MaterialCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + MaterialDesc = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Qty = table.Column(type: "decimal(18,2)", nullable: false), + Amt = table.Column(type: "decimal(18,2)", nullable: false), + Extend = table.Column(type: "nvarchar(max)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_ScrapClaims", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_ScrapClaims_Version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_ScrapClaims_Version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_sec_act_adjustment_report", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", maxLength: 36, nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true), + DocumentNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + DocumentType = table.Column(type: "int", nullable: false), + DocumentStatus = table.Column(type: "int", nullable: false), + Year = table.Column(type: "nvarchar(max)", nullable: true), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(max)", nullable: true), + CustomCode = table.Column(type: "nvarchar(max)", nullable: true), + CustomName = table.Column(type: "nvarchar(max)", nullable: true), + CreatorName = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_sec_act_adjustment_report", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_sec_act_diff_report", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", maxLength: 36, nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true), + DocumentNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + DocumentType = table.Column(type: "int", nullable: false), + DocumentStatus = table.Column(type: "int", nullable: false), + Year = table.Column(type: "nvarchar(max)", nullable: true), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(max)", nullable: true), + CustomCode = table.Column(type: "nvarchar(max)", nullable: true), + CustomName = table.Column(type: "nvarchar(max)", nullable: true), + CreatorName = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_sec_act_diff_report", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_sec_adj", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(450)", nullable: true), + CustomerMaterialCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerComponentCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + SupplierCode = table.Column(type: "nvarchar(450)", nullable: true), + Qty = table.Column(type: "decimal(18,2)", nullable: false), + Amt = table.Column(type: "decimal(18,2)", nullable: false), + Total = table.Column(type: "decimal(18,2)", nullable: false), + HasChanged = table.Column(type: "nvarchar(max)", nullable: true), + Buyer = table.Column(type: "nvarchar(max)", nullable: true), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_sec_adj", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_sec_adj_version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Version = table.Column(type: "nvarchar(450)", nullable: true), + CustomerCode = table.Column(type: "nvarchar(max)", nullable: true), + Factory = table.Column(type: "nvarchar(max)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_sec_adj_version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_sec_dis", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(max)", nullable: true), + SupplierCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Qty = table.Column(type: "decimal(18,2)", nullable: false), + Amt = table.Column(type: "decimal(18,2)", nullable: false), + Total = table.Column(type: "decimal(18,2)", nullable: false), + HasChanged = table.Column(type: "nvarchar(max)", nullable: true), + Buyer = table.Column(type: "nvarchar(max)", nullable: true), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_sec_dis", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_sec_dis_version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(max)", nullable: true), + Factory = table.Column(type: "nvarchar(max)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_sec_dis_version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_sec_ratio", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Version = table.Column(type: "nvarchar(450)", nullable: true), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomItemCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomItemPrice = table.Column(type: "decimal(18,2)", nullable: false), + CustomSubItemCode = table.Column(type: "nvarchar(450)", nullable: true), + CustomSubItemPrice = table.Column(type: "decimal(18,2)", nullable: false), + SupplierCode = table.Column(type: "nvarchar(450)", nullable: true), + SupplierDesc = table.Column(type: "nvarchar(max)", nullable: true), + SupplyProportion = table.Column(type: "nvarchar(max)", nullable: true), + SupplyProportionPrice = table.Column(type: "decimal(18,2)", nullable: false), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_sec_ratio", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_sec_ratio_version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(max)", nullable: false), + Period = table.Column(type: "nvarchar(max)", nullable: false), + Version = table.Column(type: "nvarchar(450)", nullable: true), + CustomerCode = table.Column(type: "nvarchar(max)", nullable: true), + Factory = table.Column(type: "nvarchar(max)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_sec_ratio_version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_SecMatchBase", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Version = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Index = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + IsSettle = table.Column(type: "nvarchar(max)", nullable: true), + Factory = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Model = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + PartType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + SettleMentPartCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + MaterialPartCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + MaterialDesc = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + SupplierCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + SupplierName = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + UsedNumber = table.Column(type: "decimal(18,2)", maxLength: 50, nullable: false), + SupplyProportion = table.Column(type: "decimal(18,2)", maxLength: 50, nullable: false), + Buyer = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Price = table.Column(type: "decimal(18,2)", nullable: false), + SettlementPrice = table.Column(type: "decimal(18,2)", nullable: false), + DiffPrice = table.Column(type: "decimal(18,2)", nullable: false), + SettlementNumber = table.Column(type: "decimal(18,2)", nullable: false), + TheoreticalSettlementNumber = table.Column(type: "decimal(18,2)", nullable: false), + RealSettlementNumber = table.Column(type: "decimal(18,2)", nullable: false), + RealSettlementPrice = table.Column(type: "decimal(18,2)", nullable: false), + IsDiffNumber = table.Column(type: "bit", nullable: false), + DiffAmount = table.Column(type: "decimal(18,2)", nullable: false), + Remark = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_SecMatchBase", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_send_unsettled_report", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + BeginVersion = table.Column(type: "nvarchar(max)", nullable: true), + EndVersion = table.Column(type: "nvarchar(max)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", maxLength: 36, nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true), + DocumentNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + DocumentType = table.Column(type: "int", nullable: false), + DocumentStatus = table.Column(type: "int", nullable: false), + BeginTime = table.Column(type: "datetime2", nullable: false), + EndTime = table.Column(type: "datetime2", nullable: false), + CustomCode = table.Column(type: "nvarchar(max)", nullable: true), + CustomName = table.Column(type: "nvarchar(max)", nullable: true), + CreatorName = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_send_unsettled_report", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_send_unsettled_report_detail", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(max)", nullable: true), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(450)", nullable: true), + DocumentId = table.Column(type: "uniqueidentifier", nullable: false), + DocumentNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + OrderBillNum = table.Column(type: "nvarchar(max)", nullable: true), + KENNCode = table.Column(type: "nvarchar(max)", nullable: true), + ItemCode = table.Column(type: "nvarchar(450)", nullable: true), + ItemDesc = table.Column(type: "nvarchar(max)", nullable: true), + Model = table.Column(type: "nvarchar(max)", nullable: true), + Qty = table.Column(type: "decimal(18,2)", nullable: false), + CP5Time = table.Column(type: "datetime2", nullable: false), + FISYear = table.Column(type: "nvarchar(max)", nullable: true), + Extend1 = table.Column(type: "nvarchar(max)", nullable: true), + SequenceNumber = table.Column(type: "nvarchar(max)", nullable: true), + ChassisNumber = table.Column(type: "nvarchar(450)", nullable: true), + ChassisNumber2 = table.Column(type: "nvarchar(max)", nullable: true), + SettledQty = table.Column(type: "decimal(18,2)", nullable: false), + Status = table.Column(type: "int", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", maxLength: 36, nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_send_unsettled_report_detail", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_Settle", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + SettleYear = table.Column(type: "nvarchar(max)", nullable: true), + KENNCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ChassisNumber = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Model = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CP5A = table.Column(type: "datetime2", nullable: false), + CP7 = table.Column(type: "datetime2", nullable: false), + MaterialCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Qty = table.Column(type: "decimal(18,2)", nullable: false), + SettlementID = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + SettlementSupplier = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + state = table.Column(type: "int", nullable: false), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_Settle", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_Settle_Version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Factory = table.Column(type: "nvarchar(max)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_Settle_Version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_settlement_part", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Factory = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Model = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + SettlementPartCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + SettlementPartDesc = table.Column(type: "nvarchar(2048)", maxLength: 2048, nullable: true), + Price = table.Column(type: "decimal(18,2)", nullable: false), + Uom = table.Column(type: "nvarchar(max)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_settlement_part", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_settlement_part_version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Period = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Version = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Factory = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + CustomerCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_settlement_part_version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_SettlementCrossReference", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Period = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Model = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Factory = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + PartType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + SettlementMaterialCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + BomMaterialCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + MaterialDesc = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + SupplierCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + SupplierDesc = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + Buyer = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Version = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + CustomerCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_SettlementCrossReference", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_SettlementCrossReference_Version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Period = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Version = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + CustomerCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Factory = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_SettlementCrossReference_Version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_SettlementPakAndSpareParts", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Period = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ApplicableFunction = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + SettlementPartCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + SettlementPartDesc = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ErpSparePartCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ErpSparePartName = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + PartType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + QADCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + SupplierCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + SupplierName = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ProductLine = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + PerCarNum = table.Column(type: "decimal(18,2)", maxLength: 50, nullable: false), + Price = table.Column(type: "decimal(18,2)", maxLength: 50, nullable: false), + SupplyProportion = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + QuantityPrice = table.Column(type: "decimal(18,2)", maxLength: 50, nullable: false), + Version = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + CustomerCode = table.Column(type: "nvarchar(max)", nullable: true), + Model = table.Column(type: "nvarchar(max)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_SettlementPakAndSpareParts", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_SettlementPakAndSpareParts_Version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Period = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Version = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + CustomerCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Factory = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_SettlementPakAndSpareParts_Version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_SparePart", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + LineNumber = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + PurchaseType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + PurchaseOrderNo = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + PurchaseOrderNoItem = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + PurchaseOrderNoText = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ReceiptQty = table.Column(type: "decimal(18,2)", nullable: false), + InvoicedQty = table.Column(type: "decimal(18,2)", nullable: false), + AmountNoTax = table.Column(type: "decimal(18,2)", nullable: false), + PurchasePriceNoTax = table.Column(type: "decimal(18,2)", nullable: false), + AccountNum = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + MaterialCode = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: false), + MaterialDesc = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + SpareDate = table.Column(type: "datetime2", nullable: false), + DeliveryOrderNo = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + DeliveryLineNum = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + BatchNo = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Unit = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + TaxRate = table.Column(type: "decimal(18,2)", nullable: false), + TaxCode = table.Column(type: "nvarchar(max)", nullable: true), + GermanInvoiceNo = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), + Factory = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + FactoryName = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Extend = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_SparePart", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_stock_fis_diff_report", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", maxLength: 36, nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true), + DocumentNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + DocumentType = table.Column(type: "int", nullable: false), + DocumentStatus = table.Column(type: "int", nullable: false), + Year = table.Column(type: "nvarchar(max)", nullable: true), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(max)", nullable: true), + CustomCode = table.Column(type: "nvarchar(max)", nullable: true), + CustomName = table.Column(type: "nvarchar(max)", nullable: true), + CreatorName = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_stock_fis_diff_report", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_stock_settled_report", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", maxLength: 36, nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true), + DocumentNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + DocumentType = table.Column(type: "int", nullable: false), + DocumentStatus = table.Column(type: "int", nullable: false), + Year = table.Column(type: "nvarchar(max)", nullable: true), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(max)", nullable: true), + CustomCode = table.Column(type: "nvarchar(max)", nullable: true), + CustomName = table.Column(type: "nvarchar(max)", nullable: true), + CreatorName = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_stock_settled_report", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_stock_unsettled_report", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", maxLength: 36, nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true), + DocumentNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + DocumentType = table.Column(type: "int", nullable: false), + DocumentStatus = table.Column(type: "int", nullable: false), + Year = table.Column(type: "nvarchar(max)", nullable: true), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(max)", nullable: true), + CustomCode = table.Column(type: "nvarchar(max)", nullable: true), + CustomName = table.Column(type: "nvarchar(max)", nullable: true), + CreatorName = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_stock_unsettled_report", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_supplier_item_setup", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ErpItemCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerSupplierCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ErpSupplierCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(450)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_supplier_item_setup", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_TaskJob", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Type = table.Column(type: "nvarchar(max)", nullable: true), + State = table.Column(type: "nvarchar(max)", nullable: true), + TaskId = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ActionName = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Error = table.Column(type: "nvarchar(max)", nullable: true), + Creator = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Email = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + FileName = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), + RealFileName = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), + RealDownFileName = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), + DownFileName = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), + ServiceName = table.Column(type: "nvarchar(300)", maxLength: 300, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_TaskJob", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_Unsettle", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + SettleYear = table.Column(type: "nvarchar(max)", nullable: true), + KENNCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ChassisNumber = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Model = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CP5A = table.Column(type: "datetime2", nullable: false), + CP7 = table.Column(type: "datetime2", nullable: true), + MaterialCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Qty = table.Column(type: "decimal(18,2)", nullable: false), + SettlementID = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + SettlementSupplier = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + state = table.Column(type: "int", nullable: false), + UnsettledReason = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_Unsettle", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_Unsettle_Version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Factory = table.Column(type: "nvarchar(max)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_Unsettle_Version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_WMSKanBanSettle", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(max)", nullable: true), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(450)", nullable: true), + Kanban = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: false), + Relation = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), + Factory = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + MaterialCode = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: false), + PartType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + SupplierCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + SettleInputDate = table.Column(type: "datetime2", nullable: false), + Batch = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Flag = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Qty = table.Column(type: "decimal(18,2)", nullable: false), + SettleDate = table.Column(type: "datetime2", nullable: false), + State = table.Column(type: "nvarchar(max)", nullable: true), + WMSDeliveryNote = table.Column(type: "nvarchar(max)", nullable: true), + WMSActualGoodsDate = table.Column(type: "nvarchar(max)", nullable: true), + WMSDeliveryQty = table.Column(type: "decimal(18,2)", nullable: false), + WMSDeliverGoodsState = table.Column(type: "nvarchar(max)", nullable: true), + WMSKanBanState = table.Column(type: "nvarchar(max)", nullable: true), + DeliveryOrderNo = table.Column(type: "nvarchar(max)", nullable: true), + Extend = table.Column(type: "nvarchar(max)", nullable: true), + ParentId = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_WMSKanBanSettle", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_WMSKanBanSettle_Version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_WMSKanBanSettle_Version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_WMSSparePart", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + LineNumber = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + PurchaseType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + PurchaseOrderNo = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + PurchaseOrderNoItem = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + PurchaseOrderNoText = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ReceiptQty = table.Column(type: "decimal(18,2)", nullable: false), + InvoicedQty = table.Column(type: "decimal(18,2)", nullable: false), + AmountNoTax = table.Column(type: "decimal(18,2)", nullable: false), + PurchasePriceNoTax = table.Column(type: "decimal(18,2)", nullable: false), + AccountNum = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + MaterialCode = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: false), + MaterialDesc = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + SpareDate = table.Column(type: "datetime2", nullable: false), + DeliveryOrderNo = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + DeliveryLineNum = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + BatchNo = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Unit = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + TaxRate = table.Column(type: "decimal(18,2)", nullable: false), + TaxCode = table.Column(type: "nvarchar(max)", nullable: true), + GermanInvoiceNo = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), + Factory = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + FactoryName = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Extend = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: true), + WMSDeliveryNote = table.Column(type: "nvarchar(max)", nullable: true), + WMSDeliverGoodsState = table.Column(type: "nvarchar(max)", nullable: true), + WMSKanBanState = table.Column(type: "nvarchar(max)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_WMSSparePart", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_WMSSparePart_Version", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Period = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false), + CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_WMSSparePart_Version", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Set_bt_not_kb_consign_report_detail", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + CustomCode = table.Column(type: "nvarchar(450)", nullable: true), + OrderKBCode = table.Column(type: "nvarchar(450)", nullable: true), + MaterialCode = table.Column(type: "nvarchar(450)", nullable: true), + MaterialDesc = table.Column(type: "nvarchar(max)", nullable: true), + NeedQty = table.Column(type: "decimal(18,2)", nullable: false), + ConsignQty = table.Column(type: "decimal(18,2)", nullable: false), + DeliveryDateTime = table.Column(type: "datetime2", nullable: false), + State = table.Column(type: "int", nullable: false), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", maxLength: 36, nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true), + Year = table.Column(type: "nvarchar(max)", nullable: true), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(450)", nullable: true), + DocumentId = table.Column(type: "uniqueidentifier", nullable: false), + DocumentNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_bt_not_kb_consign_report_detail", x => x.Id); + table.ForeignKey( + name: "FK_Set_bt_not_kb_consign_report_detail_Set_bt_not_kb_consign_report_DocumentId", + column: x => x.DocumentId, + principalTable: "Set_bt_not_kb_consign_report", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "Set_bt_seq_kb_diff_report_detail", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + CustomCode = table.Column(type: "nvarchar(450)", nullable: true), + DT = table.Column(type: "datetime2", nullable: false), + MaterialCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + SeqQty = table.Column(type: "decimal(18,2)", nullable: false), + KBQty = table.Column(type: "decimal(18,2)", nullable: false), + DiffQty = table.Column(type: "decimal(18,2)", nullable: false), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", maxLength: 36, nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true), + Year = table.Column(type: "nvarchar(max)", nullable: true), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(450)", nullable: true), + DocumentId = table.Column(type: "uniqueidentifier", nullable: false), + DocumentNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_bt_seq_kb_diff_report_detail", x => x.Id); + table.ForeignKey( + name: "FK_Set_bt_seq_kb_diff_report_detail_Set_bt_seq_kb_diff_report_DocumentId", + column: x => x.DocumentId, + principalTable: "Set_bt_seq_kb_diff_report", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "Set_estimate_stock_report_detail", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ItemCode = table.Column(type: "nvarchar(450)", nullable: true), + ItemDesc = table.Column(type: "nvarchar(max)", nullable: true), + EstimationType = table.Column(type: "nvarchar(max)", nullable: true), + EstimationTypeDesc = table.Column(type: "nvarchar(max)", nullable: true), + EstimationQty = table.Column(type: "decimal(18,2)", nullable: false), + StockQty = table.Column(type: "decimal(18,2)", nullable: false), + FgQty = table.Column(type: "decimal(18,2)", nullable: false), + UnSettledQty = table.Column(type: "decimal(18,2)", nullable: false), + DiffQty = table.Column(type: "decimal(18,2)", nullable: false), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", maxLength: 36, nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true), + Year = table.Column(type: "nvarchar(max)", nullable: true), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(max)", nullable: true), + DocumentId = table.Column(type: "uniqueidentifier", nullable: false), + DocumentNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_estimate_stock_report_detail", x => x.Id); + table.ForeignKey( + name: "FK_Set_estimate_stock_report_detail_Set_estimate_stock_report_DocumentId", + column: x => x.DocumentId, + principalTable: "Set_estimate_stock_report", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "Set_jf_not_kb_consign_report_detail", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + CustomCode = table.Column(type: "nvarchar(450)", nullable: true), + BillNum = table.Column(type: "nvarchar(450)", nullable: true), + OnLineDateTime = table.Column(type: "datetime2", nullable: false), + MaterialCode = table.Column(type: "nvarchar(450)", nullable: true), + MaterialDesc = table.Column(type: "nvarchar(max)", nullable: true), + InStockQty = table.Column(type: "decimal(18,2)", nullable: false), + State = table.Column(type: "int", nullable: false), + ConsignQty = table.Column(type: "decimal(18,2)", nullable: false), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", maxLength: 36, nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true), + Year = table.Column(type: "nvarchar(max)", nullable: true), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(450)", nullable: true), + DocumentId = table.Column(type: "uniqueidentifier", nullable: false), + DocumentNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_jf_not_kb_consign_report_detail", x => x.Id); + table.ForeignKey( + name: "FK_Set_jf_not_kb_consign_report_detail_Set_jf_not_kb_consign_report_DocumentId", + column: x => x.DocumentId, + principalTable: "Set_jf_not_kb_consign_report", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "Set_sec_act_adjustment_report_detail", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Year = table.Column(type: "nvarchar(max)", nullable: true), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(450)", nullable: true), + DocumentId = table.Column(type: "uniqueidentifier", nullable: false), + DocumentNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + CustomItemCode = table.Column(type: "nvarchar(450)", nullable: true), + CustomItemDesc = table.Column(type: "nvarchar(max)", nullable: true), + OfflineQty = table.Column(type: "decimal(18,2)", nullable: false), + CustomSubItemCode = table.Column(type: "nvarchar(450)", nullable: true), + ErpSubItemCode = table.Column(type: "nvarchar(max)", nullable: true), + CustomSubItemDesc = table.Column(type: "nvarchar(max)", nullable: true), + ErpSubItemQty = table.Column(type: "decimal(18,2)", nullable: false), + ErpSubItemActualQty = table.Column(type: "decimal(18,2)", nullable: false), + SupplierCode = table.Column(type: "nvarchar(450)", nullable: true), + SupplierDesc = table.Column(type: "nvarchar(max)", nullable: true), + SupplyProportion = table.Column(type: "nvarchar(max)", nullable: true), + CustomSubItemPrice = table.Column(type: "decimal(18,2)", nullable: false), + CustomSubItemSumQty = table.Column(type: "decimal(18,2)", nullable: false), + SumPriceNoTax = table.Column(type: "decimal(18,2)", nullable: false), + SumPriceWithTax = table.Column(type: "decimal(18,2)", nullable: false), + HasChanged = table.Column(type: "nvarchar(max)", nullable: true), + Buyer = table.Column(type: "nvarchar(max)", nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", maxLength: 36, nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_sec_act_adjustment_report_detail", x => x.Id); + table.ForeignKey( + name: "FK_Set_sec_act_adjustment_report_detail_Set_sec_act_adjustment_report_DocumentId", + column: x => x.DocumentId, + principalTable: "Set_sec_act_adjustment_report", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "Set_sec_act_diff_report_detail", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + CustomItemCode = table.Column(type: "nvarchar(450)", nullable: true), + CustomItemDesc = table.Column(type: "nvarchar(max)", nullable: true), + CustomSubItemCode = table.Column(type: "nvarchar(450)", nullable: true), + ErpSubItemCode = table.Column(type: "nvarchar(max)", nullable: true), + CustomSubItemDesc = table.Column(type: "nvarchar(max)", nullable: true), + SupplierCode = table.Column(type: "nvarchar(450)", nullable: true), + SupplierDesc = table.Column(type: "nvarchar(max)", nullable: true), + StaPaymentPartyQty = table.Column(type: "decimal(18,2)", nullable: false), + ActPaymentPartyQty = table.Column(type: "decimal(18,2)", nullable: false), + DiffQty = table.Column(type: "decimal(18,2)", nullable: false), + StdNoTaxAmount = table.Column(type: "decimal(18,2)", nullable: false), + ActNoTaxAmount = table.Column(type: "decimal(18,2)", nullable: false), + DiffAmount = table.Column(type: "decimal(18,2)", nullable: false), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", maxLength: 36, nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true), + Year = table.Column(type: "nvarchar(max)", nullable: true), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(450)", nullable: true), + DocumentId = table.Column(type: "uniqueidentifier", nullable: false), + DocumentNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_sec_act_diff_report_detail", x => x.Id); + table.ForeignKey( + name: "FK_Set_sec_act_diff_report_detail_Set_sec_act_diff_report_DocumentId", + column: x => x.DocumentId, + principalTable: "Set_sec_act_diff_report", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "Set_stock_fis_diff_report_detail", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ItemCode = table.Column(type: "nvarchar(450)", nullable: true), + ItemDesc = table.Column(type: "nvarchar(max)", nullable: true), + EstimationType = table.Column(type: "nvarchar(max)", nullable: true), + CustomCode = table.Column(type: "nvarchar(max)", nullable: true), + FisQty = table.Column(type: "decimal(18,2)", nullable: false), + StockQty = table.Column(type: "decimal(18,2)", nullable: false), + DiffQty = table.Column(type: "decimal(18,2)", nullable: false), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", maxLength: 36, nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true), + Year = table.Column(type: "nvarchar(max)", nullable: true), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(max)", nullable: true), + DocumentId = table.Column(type: "uniqueidentifier", nullable: false), + DocumentNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_stock_fis_diff_report_detail", x => x.Id); + table.ForeignKey( + name: "FK_Set_stock_fis_diff_report_detail_Set_stock_fis_diff_report_DocumentId", + column: x => x.DocumentId, + principalTable: "Set_stock_fis_diff_report", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "Set_stock_settled_report_detail", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ItemCode = table.Column(type: "nvarchar(450)", nullable: true), + ItemDesc = table.Column(type: "nvarchar(max)", nullable: true), + EstimationType = table.Column(type: "nvarchar(max)", nullable: true), + CustomCode = table.Column(type: "nvarchar(max)", nullable: true), + R3SettledQty = table.Column(type: "decimal(18,2)", nullable: false), + StockQty = table.Column(type: "decimal(18,2)", nullable: false), + DiffQty = table.Column(type: "decimal(18,2)", nullable: false), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", maxLength: 36, nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true), + Year = table.Column(type: "nvarchar(max)", nullable: true), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(max)", nullable: true), + DocumentId = table.Column(type: "uniqueidentifier", nullable: false), + DocumentNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_stock_settled_report_detail", x => x.Id); + table.ForeignKey( + name: "FK_Set_stock_settled_report_detail_Set_stock_settled_report_DocumentId", + column: x => x.DocumentId, + principalTable: "Set_stock_settled_report", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "Set_stock_unsettled_report_detail", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ItemCode = table.Column(type: "nvarchar(450)", nullable: true), + ItemDesc = table.Column(type: "nvarchar(max)", nullable: true), + CustomCode = table.Column(type: "nvarchar(max)", nullable: true), + EstimationType = table.Column(type: "nvarchar(max)", nullable: true), + FisUnSettledQty = table.Column(type: "decimal(18,2)", nullable: false), + StockQty = table.Column(type: "decimal(18,2)", nullable: false), + DiffQty = table.Column(type: "decimal(18,2)", nullable: false), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", maxLength: 36, nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Remark = table.Column(type: "nvarchar(max)", nullable: true), + Year = table.Column(type: "nvarchar(max)", nullable: true), + Period = table.Column(type: "nvarchar(max)", nullable: true), + Version = table.Column(type: "nvarchar(max)", nullable: true), + DocumentId = table.Column(type: "uniqueidentifier", nullable: false), + DocumentNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_stock_unsettled_report_detail", x => x.Id); + table.ForeignKey( + name: "FK_Set_stock_unsettled_report_detail_Set_stock_unsettled_report_DocumentId", + column: x => x.DocumentId, + principalTable: "Set_stock_unsettled_report", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "UpstreamDocument", + columns: table => new + { + UpstreamDocumentId = table.Column(type: "uniqueidentifier", nullable: false), + UpstreamDocumentNumber = table.Column(type: "nvarchar(max)", nullable: true), + UpstreamDocumentType = table.Column(type: "int", nullable: false), + Seq = table.Column(type: "int", nullable: false), + BTNotConsignReportId = table.Column(type: "uniqueidentifier", nullable: true), + BTSeqKBDiffReportId = table.Column(type: "uniqueidentifier", nullable: true), + EstimatedStockDiffReportId = table.Column(type: "uniqueidentifier", nullable: true), + JFNotConsignReportId = table.Column(type: "uniqueidentifier", nullable: true), + SecondaryActuralAdjustmentReportId = table.Column(type: "uniqueidentifier", nullable: true), + SecondaryActuralDiffReportId = table.Column(type: "uniqueidentifier", nullable: true), + SendUnsettledDiffReportId = table.Column(type: "uniqueidentifier", nullable: true), + StockFisDiffReportId = table.Column(type: "uniqueidentifier", nullable: true), + StockSettledDiffReportId = table.Column(type: "uniqueidentifier", nullable: true), + StockUnsettledDiffReportId = table.Column(type: "uniqueidentifier", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_UpstreamDocument", x => x.UpstreamDocumentId); + table.ForeignKey( + name: "FK_UpstreamDocument_Set_bt_not_kb_consign_report_BTNotConsignReportId", + column: x => x.BTNotConsignReportId, + principalTable: "Set_bt_not_kb_consign_report", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_UpstreamDocument_Set_bt_seq_kb_diff_report_BTSeqKBDiffReportId", + column: x => x.BTSeqKBDiffReportId, + principalTable: "Set_bt_seq_kb_diff_report", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_UpstreamDocument_Set_estimate_stock_report_EstimatedStockDiffReportId", + column: x => x.EstimatedStockDiffReportId, + principalTable: "Set_estimate_stock_report", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_UpstreamDocument_Set_jf_not_kb_consign_report_JFNotConsignReportId", + column: x => x.JFNotConsignReportId, + principalTable: "Set_jf_not_kb_consign_report", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_UpstreamDocument_Set_sec_act_adjustment_report_SecondaryActuralAdjustmentReportId", + column: x => x.SecondaryActuralAdjustmentReportId, + principalTable: "Set_sec_act_adjustment_report", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_UpstreamDocument_Set_sec_act_diff_report_SecondaryActuralDiffReportId", + column: x => x.SecondaryActuralDiffReportId, + principalTable: "Set_sec_act_diff_report", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_UpstreamDocument_Set_send_unsettled_report_SendUnsettledDiffReportId", + column: x => x.SendUnsettledDiffReportId, + principalTable: "Set_send_unsettled_report", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_UpstreamDocument_Set_stock_fis_diff_report_StockFisDiffReportId", + column: x => x.StockFisDiffReportId, + principalTable: "Set_stock_fis_diff_report", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_UpstreamDocument_Set_stock_settled_report_StockSettledDiffReportId", + column: x => x.StockSettledDiffReportId, + principalTable: "Set_stock_settled_report", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_UpstreamDocument_Set_stock_unsettled_report_StockUnsettledDiffReportId", + column: x => x.StockUnsettledDiffReportId, + principalTable: "Set_stock_unsettled_report", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateIndex( + name: "IX_Set_bom_ParentItemCode_ChildItemCode_Version", + table: "Set_bom", + columns: new[] { "ParentItemCode", "ChildItemCode", "Version" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_bt_not_kb_consign_report_BranchId_DocumentNumber", + table: "Set_bt_not_kb_consign_report", + columns: new[] { "BranchId", "DocumentNumber" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_bt_not_kb_consign_report_detail_BranchId_DocumentId_Version_CustomCode_MaterialCode_OrderKBCode", + table: "Set_bt_not_kb_consign_report_detail", + columns: new[] { "BranchId", "DocumentId", "Version", "CustomCode", "MaterialCode", "OrderKBCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_bt_not_kb_consign_report_detail_DocumentId", + table: "Set_bt_not_kb_consign_report_detail", + column: "DocumentId"); + + migrationBuilder.CreateIndex( + name: "IX_Set_bt_seq_kb_diff_report_BranchId_DocumentNumber", + table: "Set_bt_seq_kb_diff_report", + columns: new[] { "BranchId", "DocumentNumber" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_bt_seq_kb_diff_report_detail_BranchId_DocumentId_Version_DT_CustomCode_MaterialCode", + table: "Set_bt_seq_kb_diff_report_detail", + columns: new[] { "BranchId", "DocumentId", "Version", "DT", "CustomCode", "MaterialCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_bt_seq_kb_diff_report_detail_DocumentId", + table: "Set_bt_seq_kb_diff_report_detail", + column: "DocumentId"); + + migrationBuilder.CreateIndex( + name: "IX_Set_btcarconsign_CustomerCode_MaterialCode_KBCode_Version", + table: "Set_btcarconsign", + columns: new[] { "CustomerCode", "MaterialCode", "KBCode", "Version" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_btcarkb_CustomerCode_MaterialCode_OrderKBCode_Version", + table: "Set_btcarkb", + columns: new[] { "CustomerCode", "MaterialCode", "OrderKBCode", "Version" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_btcarseq_CustomerCode_BarCode_VIN_Version", + table: "Set_btcarseq", + columns: new[] { "CustomerCode", "BarCode", "VIN", "Version" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_btcarseqfirst_CustomerCode_BarCode_VIN_Version", + table: "Set_btcarseqfirst", + columns: new[] { "CustomerCode", "BarCode", "VIN", "Version" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_btcarseqsecond_CustomerCode_BarCode_VIN_Version", + table: "Set_btcarseqsecond", + columns: new[] { "CustomerCode", "BarCode", "VIN", "Version" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_carmaterialconfig_CarCode_MaterialCode", + table: "Set_carmaterialconfig", + columns: new[] { "CarCode", "MaterialCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_code_Project_Value", + table: "Set_code", + columns: new[] { "Project", "Value" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_control_Year_Period", + table: "Set_control", + columns: new[] { "Year", "Period" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_customer_BranchId_Code", + table: "Set_customer", + columns: new[] { "BranchId", "Code" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_customer_bom_BranchId_CustomerCode_ParentItemCode_ChildItemCode", + table: "Set_customer_bom", + columns: new[] { "BranchId", "CustomerCode", "ParentItemCode", "ChildItemCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_customerlocation_Storagelocation_CustomerCode", + table: "Set_customerlocation", + columns: new[] { "Storagelocation", "CustomerCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_estdetail_MaterialDocument_MaterialDocumentLine_MaterialCode_Version", + table: "Set_estdetail", + columns: new[] { "MaterialDocument", "MaterialDocumentLine", "MaterialCode", "Version" }, + unique: true, + filter: "[MaterialDocumentLine] IS NOT NULL"); + + migrationBuilder.CreateIndex( + name: "IX_Set_estimate_stock_report_BranchId_DocumentNumber", + table: "Set_estimate_stock_report", + columns: new[] { "BranchId", "DocumentNumber" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_estimate_stock_report_detail_BranchId_DocumentId_ItemCode", + table: "Set_estimate_stock_report_detail", + columns: new[] { "BranchId", "DocumentId", "ItemCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_estimate_stock_report_detail_DocumentId", + table: "Set_estimate_stock_report_detail", + column: "DocumentId"); + + migrationBuilder.CreateIndex( + name: "IX_Set_factory_Code", + table: "Set_factory", + column: "Code", + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_fis_ChassisNumber2_KENNCode", + table: "Set_fis", + columns: new[] { "ChassisNumber2", "KENNCode" }); + + migrationBuilder.CreateIndex( + name: "IX_Set_fis_ChassisNumber2_Version_KENNCode_ItemCode", + table: "Set_fis", + columns: new[] { "ChassisNumber2", "Version", "KENNCode", "ItemCode" }); + + migrationBuilder.CreateIndex( + name: "IX_Set_fis_extend_ChassisNumber2_Version_Model_ItemCode", + table: "Set_fis_extend", + columns: new[] { "ChassisNumber2", "Version", "Model", "ItemCode" }, + unique: true, + filter: "[Model] IS NOT NULL"); + + migrationBuilder.CreateIndex( + name: "IX_Set_fis_th_ChassisNumber2_Version_Model_MaterialCode", + table: "Set_fis_th", + columns: new[] { "ChassisNumber2", "Version", "Model", "MaterialCode" }, + unique: true, + filter: "[ChassisNumber2] IS NOT NULL AND [Model] IS NOT NULL"); + + migrationBuilder.CreateIndex( + name: "IX_Set_hqcon_CustomerCode_MaterialCode_VIN_Version", + table: "Set_hqcon", + columns: new[] { "CustomerCode", "MaterialCode", "VIN", "Version" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_hqkb_CustomerCode_MaterialCode_VIN_Version", + table: "Set_hqkb", + columns: new[] { "CustomerCode", "MaterialCode", "VIN", "Version" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_hqspcon_CustomerCode_MaterialCode_KBCode_KBCodeExtend_Version", + table: "Set_hqspcon", + columns: new[] { "CustomerCode", "MaterialCode", "KBCode", "KBCodeExtend", "Version" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_hqspkb_CustomerCode_MaterialCode_KBCode_Version", + table: "Set_hqspkb", + columns: new[] { "CustomerCode", "MaterialCode", "KBCode", "Version" }, + unique: true, + filter: "[MaterialCode] IS NOT NULL"); + + migrationBuilder.CreateIndex( + name: "IX_Set_inventory_Version_MaterialCode_StorageLocation", + table: "Set_inventory", + columns: new[] { "Version", "MaterialCode", "StorageLocation" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_inventory_version_Version_Factory", + table: "Set_inventory_version", + columns: new[] { "Version", "Factory" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_item_invoice_price_Period_Version_MaterialCode", + table: "Set_item_invoice_price", + columns: new[] { "Period", "Version", "MaterialCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_jf_not_kb_consign_report_BranchId_DocumentNumber", + table: "Set_jf_not_kb_consign_report", + columns: new[] { "BranchId", "DocumentNumber" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_jf_not_kb_consign_report_detail_DocumentId_Version_CustomCode_MaterialCode_BillNum", + table: "Set_jf_not_kb_consign_report_detail", + columns: new[] { "DocumentId", "Version", "CustomCode", "MaterialCode", "BillNum" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_jfcarconsign_CustomerCode_MaterialCode_PABillNum_Version", + table: "Set_jfcarconsign", + columns: new[] { "CustomerCode", "MaterialCode", "PABillNum", "Version" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_jfcarkb_CustomerCode_MaterialCode_BillNum_Version", + table: "Set_jfcarkb", + columns: new[] { "CustomerCode", "MaterialCode", "BillNum", "Version" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_KanBanSettle_Version_Kanban_MaterialCode", + table: "Set_KanBanSettle", + columns: new[] { "Version", "Kanban", "MaterialCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_KanBanSettle_Version_Version", + table: "Set_KanBanSettle_Version", + column: "Version", + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_material_MaterialCode", + table: "Set_material", + column: "MaterialCode", + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_relationship_ErpMaterialCode", + table: "Set_relationship", + column: "ErpMaterialCode", + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_ScrapClaims_Version_Version", + table: "Set_ScrapClaims_Version", + column: "Version", + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_sec_act_adjustment_report_BranchId_DocumentNumber", + table: "Set_sec_act_adjustment_report", + columns: new[] { "BranchId", "DocumentNumber" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_sec_act_adjustment_report_detail_BranchId_DocumentId_Version_CustomItemCode_CustomSubItemCode_SupplierCode", + table: "Set_sec_act_adjustment_report_detail", + columns: new[] { "BranchId", "DocumentId", "Version", "CustomItemCode", "CustomSubItemCode", "SupplierCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_sec_act_adjustment_report_detail_DocumentId", + table: "Set_sec_act_adjustment_report_detail", + column: "DocumentId"); + + migrationBuilder.CreateIndex( + name: "IX_Set_sec_act_diff_report_BranchId_DocumentNumber", + table: "Set_sec_act_diff_report", + columns: new[] { "BranchId", "DocumentNumber" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_sec_act_diff_report_detail_BranchId_DocumentId_Version_CustomItemCode_CustomSubItemCode_SupplierCode", + table: "Set_sec_act_diff_report_detail", + columns: new[] { "BranchId", "DocumentId", "Version", "CustomItemCode", "CustomSubItemCode", "SupplierCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_sec_act_diff_report_detail_DocumentId", + table: "Set_sec_act_diff_report_detail", + column: "DocumentId"); + + migrationBuilder.CreateIndex( + name: "IX_Set_sec_adj_Version_CustomerComponentCode_CustomerMaterialCode_SupplierCode", + table: "Set_sec_adj", + columns: new[] { "Version", "CustomerComponentCode", "CustomerMaterialCode", "SupplierCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_sec_adj_version_Version", + table: "Set_sec_adj_version", + column: "Version", + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_sec_dis_SupplierCode", + table: "Set_sec_dis", + column: "SupplierCode", + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_sec_dis_version_Version", + table: "Set_sec_dis_version", + column: "Version", + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_sec_ratio_Version_CustomItemCode_CustomSubItemCode_SupplierCode", + table: "Set_sec_ratio", + columns: new[] { "Version", "CustomItemCode", "CustomSubItemCode", "SupplierCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_sec_ratio_version_Version", + table: "Set_sec_ratio_version", + column: "Version", + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_send_unsettled_report_BranchId_DocumentNumber", + table: "Set_send_unsettled_report", + columns: new[] { "BranchId", "DocumentNumber" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_send_unsettled_report_detail_BranchId_DocumentId_Version_ChassisNumber_ItemCode", + table: "Set_send_unsettled_report_detail", + columns: new[] { "BranchId", "DocumentId", "Version", "ChassisNumber", "ItemCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_Settle_state", + table: "Set_Settle", + column: "state"); + + migrationBuilder.CreateIndex( + name: "IX_Set_Settle_Version_ChassisNumber_MaterialCode_KENNCode", + table: "Set_Settle", + columns: new[] { "Version", "ChassisNumber", "MaterialCode", "KENNCode" }); + + migrationBuilder.CreateIndex( + name: "IX_Set_Settle_Version_Version", + table: "Set_Settle_Version", + column: "Version", + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_settlement_part_Period_CustomerCode_Version_SettlementPartCode", + table: "Set_settlement_part", + columns: new[] { "Period", "CustomerCode", "Version", "SettlementPartCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_SettlementCrossReference_Version_SettlementMaterialCode_BomMaterialCode", + table: "Set_SettlementCrossReference", + columns: new[] { "Version", "SettlementMaterialCode", "BomMaterialCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_SparePart_Version_PurchaseOrderNo_MaterialCode", + table: "Set_SparePart", + columns: new[] { "Version", "PurchaseOrderNo", "MaterialCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_stock_fis_diff_report_BranchId_DocumentNumber", + table: "Set_stock_fis_diff_report", + columns: new[] { "BranchId", "DocumentNumber" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_stock_fis_diff_report_detail_BranchId_DocumentId_ItemCode", + table: "Set_stock_fis_diff_report_detail", + columns: new[] { "BranchId", "DocumentId", "ItemCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_stock_fis_diff_report_detail_DocumentId", + table: "Set_stock_fis_diff_report_detail", + column: "DocumentId"); + + migrationBuilder.CreateIndex( + name: "IX_Set_stock_settled_report_BranchId_DocumentNumber", + table: "Set_stock_settled_report", + columns: new[] { "BranchId", "DocumentNumber" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_stock_settled_report_detail_BranchId_DocumentId_ItemCode", + table: "Set_stock_settled_report_detail", + columns: new[] { "BranchId", "DocumentId", "ItemCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_stock_settled_report_detail_DocumentId", + table: "Set_stock_settled_report_detail", + column: "DocumentId"); + + migrationBuilder.CreateIndex( + name: "IX_Set_stock_unsettled_report_BranchId_DocumentNumber", + table: "Set_stock_unsettled_report", + columns: new[] { "BranchId", "DocumentNumber" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_stock_unsettled_report_detail_BranchId_DocumentId_ItemCode", + table: "Set_stock_unsettled_report_detail", + columns: new[] { "BranchId", "DocumentId", "ItemCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_stock_unsettled_report_detail_DocumentId", + table: "Set_stock_unsettled_report_detail", + column: "DocumentId"); + + migrationBuilder.CreateIndex( + name: "IX_Set_supplier_item_setup_ErpSupplierCode_ErpItemCode_CustomerSupplierCode_CustomerCode", + table: "Set_supplier_item_setup", + columns: new[] { "ErpSupplierCode", "ErpItemCode", "CustomerSupplierCode", "CustomerCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_Unsettle_state", + table: "Set_Unsettle", + column: "state"); + + migrationBuilder.CreateIndex( + name: "IX_Set_Unsettle_Version_ChassisNumber_MaterialCode", + table: "Set_Unsettle", + columns: new[] { "Version", "ChassisNumber", "MaterialCode" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_Set_Unsettle_Version_Version", + table: "Set_Unsettle_Version", + column: "Version", + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_WMSKanBanSettle_Version_Kanban_MaterialCode", + table: "Set_WMSKanBanSettle", + columns: new[] { "Version", "Kanban", "MaterialCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_WMSKanBanSettle_Version_Version", + table: "Set_WMSKanBanSettle_Version", + column: "Version", + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_WMSSparePart_Version_PurchaseOrderNo_MaterialCode", + table: "Set_WMSSparePart", + columns: new[] { "Version", "PurchaseOrderNo", "MaterialCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_Set_WMSSparePart_Version_Version", + table: "Set_WMSSparePart_Version", + column: "Version", + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_UpstreamDocument_BTNotConsignReportId", + table: "UpstreamDocument", + column: "BTNotConsignReportId"); + + migrationBuilder.CreateIndex( + name: "IX_UpstreamDocument_BTSeqKBDiffReportId", + table: "UpstreamDocument", + column: "BTSeqKBDiffReportId"); + + migrationBuilder.CreateIndex( + name: "IX_UpstreamDocument_EstimatedStockDiffReportId", + table: "UpstreamDocument", + column: "EstimatedStockDiffReportId"); + + migrationBuilder.CreateIndex( + name: "IX_UpstreamDocument_JFNotConsignReportId", + table: "UpstreamDocument", + column: "JFNotConsignReportId"); + + migrationBuilder.CreateIndex( + name: "IX_UpstreamDocument_SecondaryActuralAdjustmentReportId", + table: "UpstreamDocument", + column: "SecondaryActuralAdjustmentReportId"); + + migrationBuilder.CreateIndex( + name: "IX_UpstreamDocument_SecondaryActuralDiffReportId", + table: "UpstreamDocument", + column: "SecondaryActuralDiffReportId"); + + migrationBuilder.CreateIndex( + name: "IX_UpstreamDocument_SendUnsettledDiffReportId", + table: "UpstreamDocument", + column: "SendUnsettledDiffReportId"); + + migrationBuilder.CreateIndex( + name: "IX_UpstreamDocument_StockFisDiffReportId", + table: "UpstreamDocument", + column: "StockFisDiffReportId"); + + migrationBuilder.CreateIndex( + name: "IX_UpstreamDocument_StockSettledDiffReportId", + table: "UpstreamDocument", + column: "StockSettledDiffReportId"); + + migrationBuilder.CreateIndex( + name: "IX_UpstreamDocument_StockUnsettledDiffReportId", + table: "UpstreamDocument", + column: "StockUnsettledDiffReportId"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "Set_bom"); + + migrationBuilder.DropTable( + name: "Set_bom_version"); + + migrationBuilder.DropTable( + name: "Set_bt_not_kb_consign_report_detail"); + + migrationBuilder.DropTable( + name: "Set_bt_seq_kb_diff_report_detail"); + + migrationBuilder.DropTable( + name: "Set_btcarconsign"); + + migrationBuilder.DropTable( + name: "Set_btcarconsign_version"); + + migrationBuilder.DropTable( + name: "Set_btcarkb"); + + migrationBuilder.DropTable( + name: "Set_btcarkb_version"); + + migrationBuilder.DropTable( + name: "Set_btcarseq"); + + migrationBuilder.DropTable( + name: "Set_btcarseq_version"); + + migrationBuilder.DropTable( + name: "Set_btcarseqfirst"); + + migrationBuilder.DropTable( + name: "Set_btcarseqfirst_version"); + + migrationBuilder.DropTable( + name: "Set_btcarseqsecond"); + + migrationBuilder.DropTable( + name: "Set_btcarseqsecond_version"); + + migrationBuilder.DropTable( + name: "Set_carmaterialconfig"); + + migrationBuilder.DropTable( + name: "Set_code"); + + migrationBuilder.DropTable( + name: "Set_control"); + + migrationBuilder.DropTable( + name: "Set_customer"); + + migrationBuilder.DropTable( + name: "Set_customer_bom"); + + migrationBuilder.DropTable( + name: "Set_customerlocation"); + + migrationBuilder.DropTable( + name: "Set_estdetail"); + + migrationBuilder.DropTable( + name: "Set_estimate_stock_report_detail"); + + migrationBuilder.DropTable( + name: "Set_estinventory_version"); + + migrationBuilder.DropTable( + name: "Set_estsum"); + + migrationBuilder.DropTable( + name: "Set_estsum_verion"); + + migrationBuilder.DropTable( + name: "Set_factory"); + + migrationBuilder.DropTable( + name: "Set_fis"); + + migrationBuilder.DropTable( + name: "Set_fis_extend"); + + migrationBuilder.DropTable( + name: "Set_fis_th"); + + migrationBuilder.DropTable( + name: "Set_fis_version"); + + migrationBuilder.DropTable( + name: "Set_hqcon"); + + migrationBuilder.DropTable( + name: "Set_hqcon_version"); + + migrationBuilder.DropTable( + name: "Set_hqkb"); + + migrationBuilder.DropTable( + name: "Set_hqkb_version"); + + migrationBuilder.DropTable( + name: "Set_hqspcon"); + + migrationBuilder.DropTable( + name: "Set_hqspcon_version"); + + migrationBuilder.DropTable( + name: "Set_hqspkb"); + + migrationBuilder.DropTable( + name: "Set_hqspkb_version"); + + migrationBuilder.DropTable( + name: "Set_importmap"); + + migrationBuilder.DropTable( + name: "Set_inventory"); + + migrationBuilder.DropTable( + name: "Set_inventory_version"); + + migrationBuilder.DropTable( + name: "Set_Invoice"); + + migrationBuilder.DropTable( + name: "Set_InvoiceSettledDiff"); + + migrationBuilder.DropTable( + name: "Set_InvoiceSettledDiffVersion"); + + migrationBuilder.DropTable( + name: "Set_InvoiceVersion"); + + migrationBuilder.DropTable( + name: "Set_item_invoice_price"); + + migrationBuilder.DropTable( + name: "Set_item_invoice_price_version"); + + migrationBuilder.DropTable( + name: "Set_jf_not_kb_consign_report_detail"); + + migrationBuilder.DropTable( + name: "Set_jfcarconsign"); + + migrationBuilder.DropTable( + name: "Set_jfcarconsign_version"); + + migrationBuilder.DropTable( + name: "Set_jfcarkb"); + + migrationBuilder.DropTable( + name: "Set_jfcarkb_version"); + + migrationBuilder.DropTable( + name: "Set_KanBanSettle"); + + migrationBuilder.DropTable( + name: "Set_KanBanSettle_Version"); + + migrationBuilder.DropTable( + name: "Set_material"); + + migrationBuilder.DropTable( + name: "Set_MaterialRelationshipDetail"); + + migrationBuilder.DropTable( + name: "Set_MaterialRelationshipVersion"); + + migrationBuilder.DropTable( + name: "Set_prebatch"); + + migrationBuilder.DropTable( + name: "Set_PriceList"); + + migrationBuilder.DropTable( + name: "Set_PriceListVersion"); + + migrationBuilder.DropTable( + name: "Set_relationship"); + + migrationBuilder.DropTable( + name: "Set_ScrapClaims"); + + migrationBuilder.DropTable( + name: "Set_ScrapClaims_Version"); + + migrationBuilder.DropTable( + name: "Set_sec_act_adjustment_report_detail"); + + migrationBuilder.DropTable( + name: "Set_sec_act_diff_report_detail"); + + migrationBuilder.DropTable( + name: "Set_sec_adj"); + + migrationBuilder.DropTable( + name: "Set_sec_adj_version"); + + migrationBuilder.DropTable( + name: "Set_sec_dis"); + + migrationBuilder.DropTable( + name: "Set_sec_dis_version"); + + migrationBuilder.DropTable( + name: "Set_sec_ratio"); + + migrationBuilder.DropTable( + name: "Set_sec_ratio_version"); + + migrationBuilder.DropTable( + name: "Set_SecMatchBase"); + + migrationBuilder.DropTable( + name: "Set_send_unsettled_report_detail"); + + migrationBuilder.DropTable( + name: "Set_Settle"); + + migrationBuilder.DropTable( + name: "Set_Settle_Version"); + + migrationBuilder.DropTable( + name: "Set_settlement_part"); + + migrationBuilder.DropTable( + name: "Set_settlement_part_version"); + + migrationBuilder.DropTable( + name: "Set_SettlementCrossReference"); + + migrationBuilder.DropTable( + name: "Set_SettlementCrossReference_Version"); + + migrationBuilder.DropTable( + name: "Set_SettlementPakAndSpareParts"); + + migrationBuilder.DropTable( + name: "Set_SettlementPakAndSpareParts_Version"); + + migrationBuilder.DropTable( + name: "Set_SparePart"); + + migrationBuilder.DropTable( + name: "Set_stock_fis_diff_report_detail"); + + migrationBuilder.DropTable( + name: "Set_stock_settled_report_detail"); + + migrationBuilder.DropTable( + name: "Set_stock_unsettled_report_detail"); + + migrationBuilder.DropTable( + name: "Set_supplier_item_setup"); + + migrationBuilder.DropTable( + name: "Set_TaskJob"); + + migrationBuilder.DropTable( + name: "Set_Unsettle"); + + migrationBuilder.DropTable( + name: "Set_Unsettle_Version"); + + migrationBuilder.DropTable( + name: "Set_WMSKanBanSettle"); + + migrationBuilder.DropTable( + name: "Set_WMSKanBanSettle_Version"); + + migrationBuilder.DropTable( + name: "Set_WMSSparePart"); + + migrationBuilder.DropTable( + name: "Set_WMSSparePart_Version"); + + migrationBuilder.DropTable( + name: "UpstreamDocument"); + + migrationBuilder.DropTable( + name: "Set_bt_not_kb_consign_report"); + + migrationBuilder.DropTable( + name: "Set_bt_seq_kb_diff_report"); + + migrationBuilder.DropTable( + name: "Set_estimate_stock_report"); + + migrationBuilder.DropTable( + name: "Set_jf_not_kb_consign_report"); + + migrationBuilder.DropTable( + name: "Set_sec_act_adjustment_report"); + + migrationBuilder.DropTable( + name: "Set_sec_act_diff_report"); + + migrationBuilder.DropTable( + name: "Set_send_unsettled_report"); + + migrationBuilder.DropTable( + name: "Set_stock_fis_diff_report"); + + migrationBuilder.DropTable( + name: "Set_stock_settled_report"); + + migrationBuilder.DropTable( + name: "Set_stock_unsettled_report"); + } + } +} diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs index b623c84d..cd8058de 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs @@ -170,29 +170,6 @@ namespace Win.Sfs.SettleAccount.Entities.Prices var entityList = ObjectMapper.Map, List>(result); var _ls = entityList.Where(p=>p.EndDate.ToString().Contains("9999")).GroupBy(p => new { p.MaterialCode, p.CustomerCode,p.Type }).Select(p=>p.FirstOrDefault()); - - // List _ls = new List(); - //foreach (var itm in matialCodeList) - //{ - // var priceList= entityList.Where(p => p.MaterialCode == itm).Distinct().ToList(); - // var _list =priceList.OrderBy(p => p.BeginDate).ToList(); - // int i = 0;//查询下条记录 - // foreach (var price in _list) - // { - // i++; - // if (_list.Count == i) - // { - // price.EndDate = DateTime.MaxValue; - // break; - // } - // else - // { - // var _nextPrice = _list[i]; - // price.EndDate = _nextPrice.BeginDate.AddDays(-1); - // } - // _ls.Add(price); - // } - //} foreach (var itm in _ls) { itm.Update(GuidGenerator.Create(),version); diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs index 5e5481b5..1428f8d6 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs @@ -306,6 +306,44 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices return _taskid; } + /// + /// 大众发票与结算核对明细表 + /// + /// 上传的文件(前端已经限制只能上传一个附件) + /// + [HttpGet] + [Route("InvoiceSettledDetailDiff-Make")] + [DisableRequestSizeLimit] + + public async Task InvoiceSettledDetailDiffMake( + string version, + string materialCode, + string begin, + string end, + string cp7begin, + string cp7end, + string kenncode, + string chassisNumber + ) + { + + + List customConditionList = new List(); + customConditionList.Add(new CustomCondition() { Name = "Version", Value =string.IsNullOrEmpty(version) ?string.Empty:version }); + customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = string.IsNullOrEmpty(materialCode) ?string.Empty: materialCode }); + customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = string.IsNullOrEmpty(begin) ? string.Empty : materialCode }); + customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = string.IsNullOrEmpty(end) ? string.Empty : materialCode }); + customConditionList.Add(new CustomCondition() { Name = "Cp7BeginTime", Value = string.IsNullOrEmpty(cp7begin) ? string.Empty : cp7begin }); + customConditionList.Add(new CustomCondition() { Name = "Cp7EndTime", Value = string.IsNullOrEmpty(cp7end) ? string.Empty : cp7end }); + customConditionList.Add(new CustomCondition() { Name = "KennCode", Value = string.IsNullOrEmpty(kenncode) ? string.Empty : kenncode }); + customConditionList.Add(new CustomCondition() { Name = "ChassisNumber", Value = string.IsNullOrEmpty(chassisNumber) ? string.Empty : chassisNumber }); + var _taskid = await _service.ExportEnqueueAsync("大众发票与结算核对明细表", ExportExtentsion.Excel, CurrentUser, typeof(InvoiceSettledDetailDiffExportService), customConditionList, (rs) => + { + }); + return _taskid; + } + + /// /// 3.大众准时化结算数量差异比对表 /// @@ -338,30 +376,33 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices [Route("UnSettleDiffExport-Make")] [DisableRequestSizeLimit] - public async Task UnSettleDiffExportServiceMake(string version, string materialCode, string begin, string end) + public async Task UnSettleDiffExportServiceMake(string version, string type,string year,string materialCode,string sapMaterialCode, string begin, string end) { List customConditionList = new List(); customConditionList.Add(new CustomCondition() { Name = "Version", Value = version }); customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = materialCode }); customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = begin }); customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = end }); - var _taskid = await _service.ExportEnqueueAsync("大众准时化未结差异比对表", ExportExtentsion.Excel, CurrentUser, typeof(UnSettleDiffExportService), customConditionList, (rs) => - { - }); - return _taskid; - } - - - - - - - + customConditionList.Add(new CustomCondition() { Name = "Type", Value = type }); + customConditionList.Add(new CustomCondition() { Name = "Year", Value = year }); + customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = materialCode }); + customConditionList.Add(new CustomCondition() { Name = "SapMaterialCode", Value = sapMaterialCode }); + //var type = p_list.Where(p => p.Name == "Type").FirstOrDefault().Value; + //var year = p_list.Where(p => p.Name == "Year").FirstOrDefault().Value; + //var materialCode = p_list.Where(p => p.Name == "MaterialCode").FirstOrDefault().Value; + //var sapCode = p_list.Where(p => p.Name == "SapMaterialCode").FirstOrDefault().Value; + //var beginTime = p_list.Where(p => p.Name == "BegingTime").FirstOrDefault().Value; + //var endTime = p_list.Where(p => p.Name == "EndTime").FirstOrDefault().Value; + var _taskid = await _service.ExportEnqueueAsync("大众准时化未结差异比对表", ExportExtentsion.Excel, CurrentUser, typeof(UnSettleDiffExportService), customConditionList, (rs) => + { + }); + return _taskid; + } /// /// 结算总成和ERP总成价格对比 diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml b/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml index 4ecb29be..620c8b9c 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml @@ -2484,6 +2484,13 @@ 上传的文件(前端已经限制只能上传一个附件) + + + 大众发票与结算核对明细表 + + 上传的文件(前端已经限制只能上传一个附件) + + 3.大众准时化结算数量差异比对表 @@ -2491,7 +2498,7 @@ 上传的文件(前端已经限制只能上传一个附件) - + 6.大众准时化未结差异比对表 diff --git a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceList.cs b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceList.cs index 8c04b57a..a82e122e 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceList.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceList.cs @@ -8,6 +8,11 @@ using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.Entities.Prices { + public class ErpPrice + { + public string SapErpPartCode { set; get; } + public decimal SapPrice { set; get; } + } public class PriceList:FullAuditedAggregateRootBase { public PriceList() diff --git a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceListManager.cs b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceListManager.cs index 5a34dc83..770c59b7 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceListManager.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceListManager.cs @@ -78,20 +78,37 @@ namespace Win.Sfs.SettleAccount.Entities.Prices var pricelist = GetPriceList(version); - List _list = new List(); - foreach (var itm in pricelist) - { - var entity = entities.FirstOrDefault(p => p.Type == itm.Type && p.CustomerCode == itm.CustomerCode && p.MaterialCode == p.MaterialCode); - if (entity != null) - { - itm.Price = entity.Price; - entities.Remove(entity); - } - } + + //var LeftJoin = from emp in ListOfEmployees + // join dept in ListOfDepartment + // on emp.DeptID equals dept.ID into JoinedEmpDept + // from dept in JoinedEmpDept.DefaultIfEmpty() + + + var add= from itm1 in entities join itm2 in pricelist + on new { itm1.Type, itm1.CustomerCode, itm1.MaterialCode } equals new { itm2.Type, itm2.CustomerCode, itm2.MaterialCode } + into temp from itm3 in temp.DefaultIfEmpty() where itm3 == null select itm1; + + var update = from itm1 in entities + join itm2 in pricelist + on new { itm1.Type, itm1.CustomerCode, itm1.MaterialCode } equals new { itm2.Type, itm2.CustomerCode, itm2.MaterialCode } + where itm1.Price != itm2.Price + select new PriceList(itm2.Id, itm2.BeginDate, itm2.EndDate, itm1.Price, itm2.MaterialCode,itm2.Type, itm2.ParentId, itm2.Version); + + + + + + + + + + - await _repository.GetDbContext().BulkInsertAsync(entities); + await _repository.GetDbContext().BulkUpdateAsync(update.ToList()); + await _repository.GetDbContext().BulkInsertAsync(add.ToList()); var _first = _versionRepository.FirstOrDefault(p => p.Version == version); diff --git a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SettleAccountEntityBase.cs b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SettleAccountEntityBase.cs index e3e108ad..7794e52e 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SettleAccountEntityBase.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SettleAccountEntityBase.cs @@ -12,7 +12,7 @@ namespace Win.Sfs.SettleAccount.Entities public class CacheManager { public static List CacheMaterials { set; get; } - public static List CachePriceList { set; get; } + public static List CachePriceList { set; get; } } public interface ISettleAccountEntityBase diff --git a/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/ReportDetailBase.cs b/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/ReportDetailBase.cs index 038609bd..ec871bb9 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/ReportDetailBase.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/ReportDetailBase.cs @@ -10,32 +10,67 @@ namespace Win.Sfs.SettleAccount.Reports public class ReportDetailBase { + [ExporterHeader(DisplayName = "交货单号 ")] - public string WmsBillNum { set; get; } + public virtual string WmsBillNum { set; get; } [ExporterHeader(DisplayName = "实际发货日期 ")] - public DateTime CP5Time { set; get; } + public virtual DateTime CP5Time { set; get; } [ExporterHeader(DisplayName = "KENN号")] - public string KENNCode { set; get; } + public virtual string KENNCode { set; get; } [ExporterHeader(DisplayName = "底盘号")] - public string ChassisNumber { set; get; } + public virtual string ChassisNumber { set; get; } [ExporterHeader(DisplayName = "交货状态 ")] - public string WmsState { set; get; } + public virtual string WmsState { set; get; } [ExporterHeader(DisplayName = "物料号")] - public string SapMaterialCode { set; get; } + public virtual string SapMaterialCode { set; get; } [ExporterHeader(DisplayName = "物料描述 ")] - public string MaterialDesc { set; get; } + public virtual string MaterialDesc { set; get; } [ExporterHeader(DisplayName = "客户物料 ")] - public string MaterialCode { set; get; } + public virtual string MaterialCode { set; get; } [ExporterHeader(DisplayName = "组件组物料 ")] - public string ParentSapMaterialCode { set; get; } + public virtual string ParentSapMaterialCode { set; get; } [ExporterHeader(DisplayName = "组件组物料描述 ")] - public string ParentMaterialDesc { set; get; } + public virtual string ParentMaterialDesc { set; get; } [ExporterHeader(DisplayName = "物料组(车型) ")] - public string MaterialGroup { set; get; } + public virtual string MaterialGroup { set; get; } [ExporterHeader(DisplayName = "定价 ")] - public decimal Price { set; get; } + public virtual decimal Price { set; get; } [ExporterHeader(DisplayName = "金额 ")] - public decimal Amt { set; get; } + public virtual decimal Amt { set; get; } + + + + //public virtual string WmsBillNum { set; get; } + + //public virtual DateTime CP5Time { set; get; } + + //public virtual string KENNCode { set; get; } + + //public virtual string ChassisNumber { set; get; } + + //public virtual string WmsState { set; get; } + + //public virtual string SapMaterialCode { set; get; } + + //public virtual string MaterialDesc { set; get; } + + //public virtual string MaterialCode { set; get; } + + //public virtual string ParentSapMaterialCode { set; get; } + + //public virtual string ParentMaterialDesc { set; get; } + + //public virtual string MaterialGroup { set; get; } + + //public virtual decimal Price { set; get; } + + //public virtual decimal Amt { set; get; } + + + + + + } diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/ErpPartDapperRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/ErpPartDapperRepository.cs index 2c73e30a..ba27ba22 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/ErpPartDapperRepository.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/ErpPartDapperRepository.cs @@ -15,7 +15,7 @@ using Win.Sfs.SettleAccount.Reports; namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report { - + /// /// 主数据Dapper表 @@ -27,10 +27,10 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } - public virtual List GetDiffReport(List childList) where T : ReportDetailBase, new() + public virtual List GetSapList(List childList) where T : ReportDetailBase, new() { List _materialList = new List(); - List _priceList = new List(); + List _priceList = new List(); if (CacheManager.CacheMaterials != null) { _materialList = CacheManager.CacheMaterials; @@ -45,41 +45,91 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } else { - _priceList = DbConnection.Query("select MaterialCode,Price from Set_PriceList where version=(select max(version) from set_Set_PriceListVersion)").ToList(); + _priceList = DbConnection.Query("select Price SapPrice, MaterialCode SapErpPartCode from Set_PriceList where version=(select max(version) from Set_PriceListVersion)").ToList(); } + + + + + // List _list = new List(); + + + + var query=from itm1 in childList + join itm2 in _priceList on itm1.ParentSapMaterialCode equals itm2.SapErpPartCode into temp1 + from tm1 in temp1.DefaultIfEmpty(new ErpPrice()) + join itm3 in _materialList on itm1.ParentSapMaterialCode equals itm3.MaterialCode into temp2 + from tm2 in temp2.DefaultIfEmpty(new Material()) + select new T { + + + WmsBillNum = itm1.WmsBillNum, + CP5Time = itm1.CP5Time, + KENNCode = itm1.KENNCode, + ChassisNumber = itm1.ChassisNumber, + WmsState = itm1.WmsState, + SapMaterialCode = itm1.ParentSapMaterialCode, + MaterialDesc = itm1.ParentMaterialDesc, + MaterialCode = itm1.ParentSapMaterialCode, + ParentSapMaterialCode = itm1.ParentSapMaterialCode, + ParentMaterialDesc = itm1.ParentMaterialDesc, + Price =tm1.SapPrice, + Amt = tm1.SapPrice, + MaterialGroup = tm2.EstimateTypeDesc - List _list = new List(); - foreach (var itm in childList) - { - var parentMaterial = new T(); - parentMaterial.WmsBillNum = itm.WmsBillNum; - parentMaterial.CP5Time = itm.CP5Time; - parentMaterial.KENNCode = itm.KENNCode; - parentMaterial.ChassisNumber = itm.ChassisNumber; - parentMaterial.WmsState = itm.WmsState; - parentMaterial.SapMaterialCode = itm.ParentSapMaterialCode; - parentMaterial.MaterialDesc = itm.ParentMaterialDesc; - parentMaterial.MaterialCode = itm.ParentSapMaterialCode; - parentMaterial.ParentSapMaterialCode = itm.ParentSapMaterialCode; - parentMaterial.ParentMaterialDesc = itm.ParentMaterialDesc; - - var _price = _priceList.Where(p => p.MaterialCode == itm.ParentSapMaterialCode).FirstOrDefault(); - if (_price != null) - { - parentMaterial.Price = _price.Price; - parentMaterial.Amt = _price.Price; - } - var _material = _materialList.Where(p => p.MaterialCode == itm.ParentSapMaterialCode).FirstOrDefault(); - if (_material != null) - { - parentMaterial.MaterialGroup = _material.EstimateTypeDesc; - - } - _list.Add(parentMaterial); - } - return _list; + }; + + + + + //foreach (var itm in childList) + //{ + // var parentMaterial = new T(); + // parentMaterial.WmsBillNum = itm.WmsBillNum; + // parentMaterial.CP5Time = itm.CP5Time; + // parentMaterial.KENNCode = itm.KENNCode; + // parentMaterial.ChassisNumber = itm.ChassisNumber; + // parentMaterial.WmsState = itm.WmsState; + // parentMaterial.SapMaterialCode = itm.ParentSapMaterialCode; + // parentMaterial.MaterialDesc = itm.ParentMaterialDesc; + // parentMaterial.MaterialCode = itm.ParentSapMaterialCode; + // parentMaterial.ParentSapMaterialCode = itm.ParentSapMaterialCode; + // parentMaterial.ParentMaterialDesc = itm.ParentMaterialDesc; + + // var _price = _priceList.Where(p => p.SapErpPartCode == itm.ParentSapMaterialCode).FirstOrDefault(); + // if (_price != null) + // { + // parentMaterial.Price = _price.SapPrice; + // parentMaterial.Amt = _price.SapPrice; + + // } + // var _material = _materialList.Where(p => p.MaterialCode == itm.ParentSapMaterialCode).FirstOrDefault(); + // if (_material != null) + // { + // parentMaterial.MaterialGroup = _material.EstimateTypeDesc; + + // } + // _list.Add(parentMaterial); + //} + + return query.ToList(); + + } + public virtual List GetErpPartCodePriceList(string version) + { + string str = "SELECT\n" + + " ErpMaterialCode SapErpPartCode,\n" + + " SUM( PRICE ) SapPrice \n" + + " FROM \n" + + " Set_MaterialRelationshipDetail A\n" + + " LEFT JOIN ( SELECT SUM( AMT )/ SUM( Qty ) PRICE, MaterialCode FROM Set_Invoice WHERE VERSION = '{0}' GROUP BY MaterialCode ) B ON A.SettleMaterialCode = B.MaterialCode \n" + + "GROUP BY\n" + + " ErpMaterialCode"; + + var _list = DbConnection.Query(string.Format(str, version)); + return _list.ToList(); } } } diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDetailDiffDapperRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDetailDiffDapperRepository.cs index 11a6f149..1acf3d3c 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDetailDiffDapperRepository.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDetailDiffDapperRepository.cs @@ -1,4 +1,6 @@ -using Magicodes.ExporterAndImporter.Core; +using Dapper; +using Magicodes.ExporterAndImporter.Core; +using Magicodes.ExporterAndImporter.Excel; using System; using System.Collections.Generic; using System.Linq; @@ -11,18 +13,53 @@ using Win.Sfs.SettleAccount.Reports; namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report { - public class InvoiceSettledDetilDiff : ReportDetailBase + [ExcelExporter(MaxRowNumberOnASheet = 500000)] + public class InvoiceSettledDetailDiff + : ReportDetailBase { - //结算数量 + [ExporterHeader(DisplayName = "交货单号 ")] + public override string WmsBillNum { set; get; } + [ExporterHeader(DisplayName = "实际发货日期 ")] + public override DateTime CP5Time { set; get; } + [ExporterHeader(DisplayName = "KENN号")] + public override string KENNCode { set; get; } + [ExporterHeader(DisplayName = "底盘号")] + public override string ChassisNumber { set; get; } + [ExporterHeader(DisplayName = "交货状态 ")] + public override string WmsState { set; get; } + [ExporterHeader(DisplayName = "物料号")] + public override string SapMaterialCode { set; get; } + [ExporterHeader(DisplayName = "物料描述 ")] + public override string MaterialDesc { set; get; } + [ExporterHeader(DisplayName = "客户物料 ")] + public override string MaterialCode { set; get; } + [ExporterHeader(DisplayName = "组件组物料 ")] + public override string ParentSapMaterialCode { set; get; } + [ExporterHeader(DisplayName = "组件组物料描述 ")] + public override string ParentMaterialDesc { set; get; } + [ExporterHeader(DisplayName = "物料组(车型) ")] + public override string MaterialGroup { set; get; } + [ExporterHeader(DisplayName = "定价 ")] + public override decimal Price { set; get; } + [ExporterHeader(DisplayName = "金额 ")] + public override decimal Amt { set; get; } + + + //发运数量 + [ExporterHeader(DisplayName = "M100数量")] + public decimal Qty { set; get; } + + + //结算数量 [ExporterHeader(DisplayName = "结算数量")] - public decimal SettleQty { set; get; } + public decimal SettledQty { set; get; } //结算日期 [ExporterHeader(DisplayName = "结算日期")] - public decimal CP7Time { set; get; } + public DateTime CP7Time { set; get; } //结算与发货差异 [ExporterHeader(DisplayName = "结算与发货差异")] - public decimal DiffFisQty{ set; get; } + public decimal DiffSettleFisQty{ set; get; } //结算与开票差异 [ExporterHeader(DisplayName = "结算与开票差异")] public decimal DiffSettleInvQty { set; get; } @@ -42,8 +79,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "单价差异")] public decimal DiffPrice { set; get; } //总金额差异 - [ExporterHeader(DisplayName = "交货单号 ")] - + [ExporterHeader(DisplayName = "总金额差异")] public decimal AmtDiffPrice { set; get; } @@ -51,20 +87,107 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } - public class InvoiceSettledDetailDiffDapperRepository: DapperRepository, ITransientDependency + /// + /// 2.大众发票与结算核对明细表-准时化 + /// + public class InvoiceSettledDetailDiffDapperRepository : DapperRepository, ITransientDependency { public InvoiceSettledDetailDiffDapperRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) { } - public virtual List GetInvoiceSettledDetailDiffReportList(string version, string year, string tablename, string materialcode) + public virtual List GetInvoiceSettledDetailDiffReportList(string version, string materialCode, string begin, string end ,string cp7begin,string cp7end,string kennCode,string chassisNumber) { - List _list = new List(); + + List _list = new List(); + + string condition = " where 1=1 "; + + + if (!string.IsNullOrEmpty(materialCode)) + { + condition += string.Format(" d.MaterialCode='{0}' ", materialCode); + } + if (!string.IsNullOrEmpty(begin)) + { + condition += string.Format(" a.BeginTime>='{0}' ", begin); + } + if (!string.IsNullOrEmpty(end)) + { + condition += string.Format(" a.BeginTime<='{0}' ", end); + } + if (!string.IsNullOrEmpty(cp7begin)) + { + condition += string.Format(" B.cp7Time>='{0}' ", cp7begin); + } + if (!string.IsNullOrEmpty(cp7end)) + { + condition += string.Format(" B.cp7Time<='{0}' ", cp7end); + } + if (!string.IsNullOrEmpty(kennCode)) + { + condition += string.Format(" B.kenncode='{0}' ", kennCode); + } + if (!string.IsNullOrEmpty(chassisNumber)) + { + condition += string.Format(" B.chassisNumber='{0}' ", chassisNumber); + } + + string str = + "SELECT\n" + +" temp1.*,\n" + +" TEMP2.Price,(\n" + +" Isnull( temp2.Price, 0 ) * isnull( temp1.Qty, 0 )) Amt \n" + +"FROM\n" + +" (\n" + +" SELECT\n" + +" b.YEAR,\n" + +" b.KENNCode,\n" + +" b.MaterialCode,\n" + +" b.Model,\n" + +" b.ChassisNumber,\n" + +" a.Qty,\n" + +" a.BeginTime CP5Time,\n" + +" a.ChassisNumber2,\n" + +" B.CP7 CP7Time,\n" + +" B.QTY SettledQty,\n" + +" a.ErpMaterialCode ParentSapMaterialCode,\n" + +" a.WMSState,\n" + +" a.WMSBillNum,\n" + +" d.MaterialCode SapMaterialCode,\n" + +" d.MaterialDesc MaterialDesc,\n" + +" d.EstimateTypeDesc MaterialGroup,\n" + +" e.MaterialDesc ParentMaterialDesc,\n" + +" c.InvoicePrice,\n" + +" ( c.InvoicePrice * a.qty ) InvoiceAmt,\n" + +" ( c.InvoicePrice * a.Qty ) SettleAmt,\n" + +" a.Qty - IsNull( B.Qty, 0 ) DiffSettleFisQty,\n" + +" 0 DiffSettleInvQty \n" + +" FROM\n" + +" ( SELECT * FROM Set_Settle b WHERE b.Version = '{0}' ) b\n" + +" INNER JOIN Set_fis a ON b.ChassisNumber = a.ChassisNumber2 \n" + +" AND b.KENNCode = a.KENNCode \n" + +" AND b.MaterialCode = a.ItemCode\n" + +" LEFT JOIN ( SELECT SUM( amt )/ SUM( Qty ) InvoicePrice, MaterialCode FROM set_invoice WHERE version = '{0}' GROUP BY materialcode ) c ON a.ItemCode = c.MaterialCode\n" + +" LEFT JOIN set_material d ON a.ItemCode = d.CustomerPartCode\n" + +" LEFT JOIN set_material e ON a.ErpMaterialCode = e.MaterialCode {1} \n" + +" ) TEMP1\n" + +" LEFT JOIN (\n" + +" SELECT\n" + +" Price,\n" + +" MaterialCode \n" + +" FROM\n" + +" Set_PriceList \n" + +"WHERE\n" + +" version = ( SELECT Max( Version ) FROM Set_PriceList )) TEMP2 ON TEMP1.SapMaterialCode = TEMP2.MaterialCode"; + var _sql = string.Format(str, version,condition); + + var _query = DbConnection.Query(_sql, null, null, true, 1200, null); + _list=_query.ToList(); - string str = string.Empty; return _list; - + } } diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDiffDapperRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDiffDapperRepository.cs index df1371e9..4ffc2c92 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDiffDapperRepository.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDiffDapperRepository.cs @@ -52,10 +52,11 @@ string.Format(" '{0}' as Version ,", version)+"\n" + " (\n" + " b.InvoiceQty - ISnull(\n" + " c.Qty,\n" + -" IsNull( d.qty, 0 ))) DiffQty,\n" + +" IsNull( d.qty, 0 ))) DiffQty,\n" + " g.MaterialCode AS SapMaterialCode,\n" + -" g.MaterialDesc AS MaterialDesc \n" + +" g.MaterialDesc AS MaterialDesc, \n" + +" g.EstimateTypeDesc as SapMaterialGroup \n " + " FROM\n" + " (\n" + " SELECT\n" + diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleFisDiffDetailDapperRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleFisDiffDetailDapperRepository.cs index b3bfbef8..b3a2d5a0 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleFisDiffDetailDapperRepository.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleFisDiffDetailDapperRepository.cs @@ -37,6 +37,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "M100数量" )] public decimal Qty { set; get; } [ExporterHeader(DisplayName = "差异")] + public decimal DiffQty { set; get; } [ExporterHeader(DisplayName = "开票单价" )] public decimal Price{ set; get; } diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettleDiffDapperRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettleDiffDapperRepository.cs index 26521d6f..b47054f4 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettleDiffDapperRepository.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettleDiffDapperRepository.cs @@ -14,14 +14,42 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report { public class UnSettleDiff: ReportDetailBase { + + + [ExporterHeader(DisplayName = "交货单号 ")] + public override string WmsBillNum { set; get; } + [ExporterHeader(DisplayName = "实际发货日期 ")] + public override DateTime CP5Time { set; get; } + [ExporterHeader(DisplayName = "KENN号")] + public override string KENNCode { set; get; } + [ExporterHeader(DisplayName = "底盘号")] + public override string ChassisNumber { set; get; } + [ExporterHeader(DisplayName = "交货状态 ")] + public override string WmsState { set; get; } + [ExporterHeader(DisplayName = "物料号")] + public override string SapMaterialCode { set; get; } + [ExporterHeader(DisplayName = "物料描述 ")] + public override string MaterialDesc { set; get; } + [ExporterHeader(DisplayName = "客户物料 ")] + public override string MaterialCode { set; get; } + [ExporterHeader(DisplayName = "组件组物料 ")] + public override string ParentSapMaterialCode { set; get; } + [ExporterHeader(DisplayName = "组件组物料描述 ")] + public override string ParentMaterialDesc { set; get; } + [ExporterHeader(DisplayName = "物料组(车型) ")] + public override string MaterialGroup { set; get; } + [ExporterHeader(DisplayName = "定价 ")] + public override decimal Price { set; get; } + [ExporterHeader(DisplayName = "金额 ")] + public override decimal Amt { set; get; } + + [ExporterHeader(DisplayName = "结算平台未结数量")] public decimal Qty { set; get; } [ExporterHeader(DisplayName = "大众R3未结数量")] public decimal UNSettleQty { set; get; } - [ExporterHeader(DisplayName = "定价")] - public decimal Price { set; get; } - [ExporterHeader(DisplayName = "金额")] - public decimal Amt { set; get; } + + [ExporterHeader(DisplayName = "差异")] public decimal DiffQty { set; get; } [ExporterHeader(DisplayName = "差异金额")] @@ -164,8 +192,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " Price \n" + " FROM\n" + " Set_PriceList \n" + -"WHERE\n" + -" version = ( SELECT max( version ) FROM Set_PriceListVersion )) t2 ON t1.MaterialCode = t2.MaterialCode"; +" WHERE\n" + +" version = ( SELECT max( version ) FROM Set_PriceListVersion )) t2 ON t1.SapMaterialCode = t2.MaterialCode"; string _sql = string.Empty; diff --git a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/OutputService.cs b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/OutputService.cs index e5d6f65f..ce23f265 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/OutputService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/OutputService.cs @@ -1,8 +1,10 @@ using Magicodes.ExporterAndImporter.Core; using Magicodes.ExporterAndImporter.Excel; +using Microsoft.CSharp; using SettleAccount.Job.Domain; using Shouldly; using System; +using System.CodeDom.Compiler; using System.Collections.Generic; using System.Linq; using System.Text; @@ -55,23 +57,48 @@ namespace SettleAccount.Job.Services _fileContainer.SaveAsync(fileName, result.Result, true); var _task = new Win.Sfs.SettleAccount.Entities.TaskJob() { DownFileName = fileName }; _taskjobRepository.UpdateTaskJob(Id, _task); - //保存导出文件到服务器存成二进制 + + + + + + + + + + //保存导出文件到服务器存成二进制 } - public void Export(Guid Id, string fileName, List p_list, List p_list1) where T1 : class, new() - where T2: class, new() + public void Export(Guid Id, string fileName,Dictionary> p_dic) where T : class, new() { - ExcelExporter _exporter = new ExcelExporter();//导出Excel - var result = _exporter - .Append(p_list, "sheet1") - .SeparateBySheet() - .Append(p_list1) - .ExportAppendDataAsByteArray(); + //string methodName = (isDesc) ? "OrderByDescendingInternal" : "OrderByInternal"; + //var memberProp = typeof(T).GetProperty(propertyName); - - result.ShouldNotBeNull(); - _fileContainer.SaveAsync(fileName, result.Result, true); + //var method = typeof(QueryableExtension).GetMethod(methodName)?.MakeGenericMethod(typeof(T), memberProp?.PropertyType); + //var result = method?.Invoke(null, new object[] { query, memberProp }); + //return (IOrderedQueryable)result; + + + foreach (var itm in p_dic) + { + //.Append(p_list, "sheet1") + } + + + + + //ExcelExporter _exporter = new ExcelExporter();//导出Excel + //var result = _exporter + //.Append(p_list, "sheet1") + //.SeparateBySheet() + //.Append(p_list1) + //.ExportAppendDataAsByteArray(); + + + + //result.ShouldNotBeNull(); + //_fileContainer.SaveAsync(fileName, result.Result, true); var _task = new Win.Sfs.SettleAccount.Entities.TaskJob() { DownFileName = fileName }; _taskjobRepository.UpdateTaskJob(Id, _task); //保存导出文件到服务器存成二进制 diff --git a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/InvoiceSettledDetailDiffExportService.cs b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/InvoiceSettledDetailDiffExportService.cs new file mode 100644 index 00000000..e76626d3 --- /dev/null +++ b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/InvoiceSettledDetailDiffExportService.cs @@ -0,0 +1,87 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using TaskJob.EventArgs; +using TaskJob.Interfaces; +using Volo.Abp.DependencyInjection; +using Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs; +using Win.Sfs.SettleAccount.Repository.SettleAccount; +using Win.Sfs.SettleAccount.Repository.SettleAccountJob; +using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; + +namespace SettleAccount.Job.Services +{ + /// + /// 2.大众发票与结算核对明细表-准时化 + /// + public class InvoiceSettledDetailDiffExportService : ITransientDependency, IExportJob + { + + private readonly InvoiceSettledDetailDiffDapperRepository _dapperRepository; + private readonly ErpPartDapperRepository _erpdapperRepository; + + private readonly OutputService _outputService; + private readonly InputService _inputService; + + public InvoiceSettledDetailDiffExportService( + + ErpPartDapperRepository erpdapperRepository, + InvoiceSettledDetailDiffDapperRepository dapperRepository, + OutputService outputService, + InputService inputService + ) + { + _inputService = inputService; + _outputService = outputService; + _erpdapperRepository= erpdapperRepository; + //_repository = repository; + //_versionRepository = versionRepository; + _dapperRepository =dapperRepository; + } + + public string ExportFile(Guid id, List exportName, List p_list) + { + var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value; + var materialCode = p_list.Where(p => p.Name == "MaterialCode").FirstOrDefault().Value; + var begin = p_list.Where(p => p.Name == "BeginTime").FirstOrDefault().Value; + var end = p_list.Where(p => p.Name == "EndTime").FirstOrDefault().Value; + var cp7begin = p_list.Where(p => p.Name == "Cp7BeginTime").FirstOrDefault().Value; + var cp7end = p_list.Where(p => p.Name == "Cp7EndTime").FirstOrDefault().Value; + var kenncode = p_list.Where(p => p.Name == "KennCode").FirstOrDefault().Value; + var chassisNumber = p_list.Where(p => p.Name == "ChassisNumber").FirstOrDefault().Value; + var _ls = _dapperRepository.GetInvoiceSettledDetailDiffReportList(version, materialCode, begin, end, cp7begin, cp7end, kenncode, chassisNumber); + var _list = _ls.Where(p=>p.ParentSapMaterialCode!=p.SapMaterialCode).GroupBy(p =>new { p.ParentSapMaterialCode,p.ChassisNumber,p.KENNCode }).Select(p => p.FirstOrDefault()).ToList(); + + var rangeList = _erpdapperRepository.GetSapList(_list); + var erpPriceList= _erpdapperRepository.GetErpPartCodePriceList(version); + rangeList.ForEach(p => { + p.Qty = 1; + p.InvoiceQty = 1; + p.SettledQty = 1; + p.DiffSettleFisQty = 0; + p.DiffSettleInvQty = 0; + var _first= erpPriceList.FirstOrDefault(itm => itm.SapErpPartCode == p.SapMaterialCode); + if (_first != null) + { + p.InvoicePrice= _first.SapPrice; + } + p.DiffPrice = p.InvoicePrice - p.Price; + + }); + + + _ls.AddRange(rangeList); + _ls=_ls.OrderBy(p => p.ChassisNumber).ThenBy(p=>p.KENNCode).ThenBy(p=>p.SapMaterialCode).ToList(); + _outputService.Export(id, string.Format("大众发票与结算核对明细表_{0}.xlsx", Guid.NewGuid().ToString()), _ls); + + + + //_repository.Insert(_list); + //_versionRepository.Insert(_id, version, customerCode, customerCode, string.Empty, string.Empty, projectName); + return id.ToString(); + } + + } +} diff --git a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/InvoiceSettledDiffExportService.cs b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/InvoiceSettledDiffExportService.cs index 099b2b5f..7e08ed8f 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/InvoiceSettledDiffExportService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/InvoiceSettledDiffExportService.cs @@ -66,12 +66,12 @@ namespace SettleAccount.Job.Services SettleQty =itm. SettleQty , CP7ScrapQty =itm. CP7ScrapQty , ClaimQty =itm. ClaimQty , - DiffQty =itm. DiffQty , + DiffQty = itm.InvoiceQty-itm.SettleQty-itm.CP7ScrapQty-itm.ClaimQty,//开票数量-结算数量-CP7报废数量-索赔数量 SalePrice =itm. SalePrice , DiffPrice =itm. DiffPrice , SapMaterialCode =itm.SapMaterialCode , MaterialDesc=itm.MaterialDesc, - + SapMaterialGroup=itm.SapMaterialGroup, Factory = itm.Factory, diff --git a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettleDiffExportService.cs b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettleDiffExportService.cs index f21311c3..32d96606 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettleDiffExportService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettleDiffExportService.cs @@ -28,7 +28,7 @@ namespace SettleAccount.Job.Services.Report var materialCode = p_list.Where(p => p.Name == "MaterialCode").FirstOrDefault().Value; var sapCode = p_list.Where(p => p.Name == "SapMaterialCode").FirstOrDefault().Value; - var beginTime = p_list.Where(p => p.Name == "BegingTime").FirstOrDefault().Value; + var beginTime = p_list.Where(p => p.Name == "BeginTime").FirstOrDefault().Value; var endTime = p_list.Where(p => p.Name == "EndTime").FirstOrDefault().Value; var _first = exportName.FirstOrDefault(); @@ -68,7 +68,7 @@ namespace SettleAccount.Job.Services.Report // _lsExport.Add(dto); //} - _outputService.Export(id, _first, _lsExport); + _outputService.Export(id, _first, _ls); return id.ToString(); } } diff --git a/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobModule.cs b/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobModule.cs index fc2529e4..3388c4fb 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobModule.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobModule.cs @@ -119,8 +119,21 @@ namespace Win.Sfs.SettleAccount return implementationFactory.GetService(); } + if (key.Equals(typeof(InvoiceSettledDetailDiffExportService).FullName)) + { + return implementationFactory.GetService(); + } + if (key.Equals(typeof(UnSettleDiffExportService).FullName)) + { + return implementationFactory.GetService(); + } + + + else { + + throw new ArgumentException($"Not Support key:{key}"); } }; return accesor; diff --git a/vue/src/router/modules/fis.js b/vue/src/router/modules/fis.js index 4580960a..90e60076 100644 --- a/vue/src/router/modules/fis.js +++ b/vue/src/router/modules/fis.js @@ -106,16 +106,16 @@ const pgfis = { icon: '客户零件' } }, - // { - // path: '/pg-repeatR100', - // component: () => import('@/views/pg-fis/basedate/repeatR100'), - // name: 'pg-repeatR100',//命名路由 - // meta: { - // title: '系统内通知', - // roles: ['SettleAccount.Reports'], - // icon: '客户零件' - // } - // } + { + path: '/pg-repeatR100', + component: () => import('@/views/pg-fis/basedate/repeatR100'), + name: 'pg-repeatR100',//命名路由 + meta: { + title: '重复报文', + roles: ['SettleAccount.Reports'], + icon: '客户零件' + } + } ] } diff --git a/vue/src/views/pg-fis/basedate/assemblyCfg/detail.vue b/vue/src/views/pg-fis/basedate/assemblyCfg/detail.vue index 7cf4f451..0aafcee6 100644 --- a/vue/src/views/pg-fis/basedate/assemblyCfg/detail.vue +++ b/vue/src/views/pg-fis/basedate/assemblyCfg/detail.vue @@ -153,7 +153,7 @@ export default { formTitle: "", drawer: false, showExcelImport: false, - tableHeight: document.documentElement.clientHeight - 260, + tableHeight: document.documentElement.clientHeight - 30, isEdit: false, }; }, @@ -161,7 +161,7 @@ export default { var self = this; window.onresize = function () { var offsetHei = document.documentElement.clientHeight; - self.tableHeight = offsetHei - 190; + self.tableHeight = offsetHei - 30; }; }, created() { @@ -307,6 +307,6 @@ export default { diff --git a/vue/src/views/pg-fis/basedate/assemblyCfg/index.vue b/vue/src/views/pg-fis/basedate/assemblyCfg/index.vue index 46886ec2..f7670b83 100644 --- a/vue/src/views/pg-fis/basedate/assemblyCfg/index.vue +++ b/vue/src/views/pg-fis/basedate/assemblyCfg/index.vue @@ -133,12 +133,14 @@ @row-click="handleRowClick" > + - - - - - - - -