diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json b/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json index 13cd59a1..a8a51295 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json +++ b/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json @@ -10183,6 +10183,36 @@ "tr": "Cari Hesaplar", "en": "Current Accounts" }, + { + "resourceName": "Platform", + "key": "App.Accounting.PaymentStatus", + "tr": "Ödeme Durumları", + "en": "Payment Statuses" + }, + { + "resourceName": "Platform", + "key": "App.Accounting.CheckStatus", + "tr": "Çek Durumları", + "en": "Check Statuses" + }, + { + "resourceName": "Platform", + "key": "App.Accounting.CheckType", + "tr": "Çek Türleri", + "en": "Check Types" + }, + { + "resourceName": "Platform", + "key": "App.Accounting.InvoiceType", + "tr": "Fatura Türleri", + "en": "Invoice Types" + }, + { + "resourceName": "Platform", + "key": "App.Accounting.InvoiceStatus", + "tr": "Fatura Durumları", + "en": "Invoice Statuses" + }, { "resourceName": "Platform", "key": "App.Accounting.Waybill", diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Accounting.cs b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Accounting.cs index 6996def8..f8cd353d 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Accounting.cs +++ b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Accounting.cs @@ -1278,6 +1278,621 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende } #endregion + #region Invoice Type + listFormName = AppCodes.Accounting.InvoiceType; + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName)) + { + var listForm = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, + IsSubForm = false, + ShowNote = true, + LayoutJson = DefaultLayoutJson(), + CultureName = LanguageCodes.En, + ListFormCode = listFormName, + Name = listFormName, + Title = listFormName, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = listFormName, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.InvoiceType)), + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = DefaultFilterJson, + SortMode = GridOptions.SortModeSingle, + FilterRowJson = DefaultFilterRowJson, + HeaderFilterJson = DefaultHeaderFilterJson, + SearchPanelJson = DefaultSearchPanelJson, + GroupPanelJson = DefaultGroupPanelJson, + SelectionJson = DefaultSelectionSingleJson, + ColumnOptionJson = DefaultColumnOptionJson, + PermissionJson = DefaultPermissionJson(listFormName), + DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.InvoiceType)), + DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson, + PagerOptionJson = DefaultPagerOptionJson, + InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson, + EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 250, true, true, true, true, false), + EditingFormJson = JsonSerializer.Serialize(new List() { + new() { + Order=1, ColCount=1, ColSpan=1, ItemType="group", Items= [ + new EditingFormItemDto { Order = 2, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 3, DataField = "Description", ColSpan = 1, EditorType2=EditorTypes.dxTextArea }, + new EditingFormItemDto { Order = 4, DataField = "IsActive", ColSpan = 1, EditorType2=EditorTypes.dxCheckBox }, + ]} + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { FieldName = "IsActive", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value } + }), + }, autoSave: true + ); + + #region Invoice Type Fields + await _listFormFieldRepository.InsertManyAsync([ + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 350, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 1, + SortDirection = GridColumnOptions.SortOrderAsc, + AllowSearch = true, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Description", + Width = 500, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "IsActive", + Width = 100, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + } + ], autoSave: true); + #endregion + } + #endregion + + #region Invoice Status + listFormName = AppCodes.Accounting.InvoiceStatus; + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName)) + { + var listForm = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, + IsSubForm = false, + ShowNote = true, + LayoutJson = DefaultLayoutJson(), + CultureName = LanguageCodes.En, + ListFormCode = listFormName, + Name = listFormName, + Title = listFormName, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = listFormName, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.InvoiceStatus)), + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = DefaultFilterJson, + SortMode = GridOptions.SortModeSingle, + FilterRowJson = DefaultFilterRowJson, + HeaderFilterJson = DefaultHeaderFilterJson, + SearchPanelJson = DefaultSearchPanelJson, + GroupPanelJson = DefaultGroupPanelJson, + SelectionJson = DefaultSelectionSingleJson, + ColumnOptionJson = DefaultColumnOptionJson, + PermissionJson = DefaultPermissionJson(listFormName), + DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.InvoiceStatus)), + DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson, + PagerOptionJson = DefaultPagerOptionJson, + InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson, + EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 250, true, true, true, true, false), + EditingFormJson = JsonSerializer.Serialize(new List() { + new() { + Order=1, ColCount=1, ColSpan=1, ItemType="group", Items= [ + new EditingFormItemDto { Order = 2, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 3, DataField = "Description", ColSpan = 1, EditorType2=EditorTypes.dxTextArea }, + new EditingFormItemDto { Order = 4, DataField = "IsActive", ColSpan = 1, EditorType2=EditorTypes.dxCheckBox }, + ]} + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { FieldName = "IsActive", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value } + }), + }, autoSave: true + ); + + #region Invoice Status Fields + await _listFormFieldRepository.InsertManyAsync([ + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 350, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 1, + SortDirection = GridColumnOptions.SortOrderAsc, + AllowSearch = true, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Description", + Width = 500, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "IsActive", + Width = 100, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + } + ], autoSave: true); + #endregion + } + #endregion + + #region Payment Status + listFormName = AppCodes.Accounting.PaymentStatus; + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName)) + { + var listForm = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, + IsSubForm = false, + ShowNote = true, + LayoutJson = DefaultLayoutJson(), + CultureName = LanguageCodes.En, + ListFormCode = listFormName, + Name = listFormName, + Title = listFormName, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = listFormName, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.PaymentStatus)), + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = DefaultFilterJson, + SortMode = GridOptions.SortModeSingle, + FilterRowJson = DefaultFilterRowJson, + HeaderFilterJson = DefaultHeaderFilterJson, + SearchPanelJson = DefaultSearchPanelJson, + GroupPanelJson = DefaultGroupPanelJson, + SelectionJson = DefaultSelectionSingleJson, + ColumnOptionJson = DefaultColumnOptionJson, + PermissionJson = DefaultPermissionJson(listFormName), + DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.PaymentStatus)), + DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson, + PagerOptionJson = DefaultPagerOptionJson, + InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson, + EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 250, true, true, true, true, false), + EditingFormJson = JsonSerializer.Serialize(new List() { + new() { + Order=1, ColCount=1, ColSpan=1, ItemType="group", Items= [ + new EditingFormItemDto { Order = 2, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 3, DataField = "Description", ColSpan = 1, EditorType2=EditorTypes.dxTextArea }, + new EditingFormItemDto { Order = 4, DataField = "IsActive", ColSpan = 1, EditorType2=EditorTypes.dxCheckBox }, + ]} + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { FieldName = "IsActive", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value } + }), + }, autoSave: true + ); + + #region Payment Status Fields + await _listFormFieldRepository.InsertManyAsync([ + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 350, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 1, + SortDirection = GridColumnOptions.SortOrderAsc, + AllowSearch = true, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Description", + Width = 500, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "IsActive", + Width = 100, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + } + ], autoSave: true); + #endregion + } + #endregion + + #region Check Status + listFormName = AppCodes.Accounting.CheckStatus; + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName)) + { + var listForm = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, + IsSubForm = false, + ShowNote = true, + LayoutJson = DefaultLayoutJson(), + CultureName = LanguageCodes.En, + ListFormCode = listFormName, + Name = listFormName, + Title = listFormName, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = listFormName, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.CheckStatus)), + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = DefaultFilterJson, + SortMode = GridOptions.SortModeSingle, + FilterRowJson = DefaultFilterRowJson, + HeaderFilterJson = DefaultHeaderFilterJson, + SearchPanelJson = DefaultSearchPanelJson, + GroupPanelJson = DefaultGroupPanelJson, + SelectionJson = DefaultSelectionSingleJson, + ColumnOptionJson = DefaultColumnOptionJson, + PermissionJson = DefaultPermissionJson(listFormName), + DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.CheckStatus)), + DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson, + PagerOptionJson = DefaultPagerOptionJson, + InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson, + EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 250, true, true, true, true, false), + EditingFormJson = JsonSerializer.Serialize(new List() { + new() { + Order=1, ColCount=1, ColSpan=1, ItemType="group", Items= [ + new EditingFormItemDto { Order = 2, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 3, DataField = "Description", ColSpan = 1, EditorType2=EditorTypes.dxTextArea }, + new EditingFormItemDto { Order = 4, DataField = "IsActive", ColSpan = 1, EditorType2=EditorTypes.dxCheckBox }, + ]} + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { FieldName = "IsActive", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value } + }), + }, autoSave: true + ); + + #region Check Status Fields + await _listFormFieldRepository.InsertManyAsync([ + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 350, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 1, + SortDirection = GridColumnOptions.SortOrderAsc, + AllowSearch = true, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Description", + Width = 500, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "IsActive", + Width = 100, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + } + ], autoSave: true); + #endregion + } + #endregion + + #region Check Type + listFormName = AppCodes.Accounting.CheckType; + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName)) + { + var listForm = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, + IsSubForm = false, + ShowNote = true, + LayoutJson = DefaultLayoutJson(), + CultureName = LanguageCodes.En, + ListFormCode = listFormName, + Name = listFormName, + Title = listFormName, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = listFormName, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.CheckType)), + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = DefaultFilterJson, + SortMode = GridOptions.SortModeSingle, + FilterRowJson = DefaultFilterRowJson, + HeaderFilterJson = DefaultHeaderFilterJson, + SearchPanelJson = DefaultSearchPanelJson, + GroupPanelJson = DefaultGroupPanelJson, + SelectionJson = DefaultSelectionSingleJson, + ColumnOptionJson = DefaultColumnOptionJson, + PermissionJson = DefaultPermissionJson(listFormName), + DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.CheckType)), + DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson, + PagerOptionJson = DefaultPagerOptionJson, + InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson, + EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 250, true, true, true, true, false), + EditingFormJson = JsonSerializer.Serialize(new List() { + new() { + Order=1, ColCount=1, ColSpan=1, ItemType="group", Items= [ + new EditingFormItemDto { Order = 2, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 3, DataField = "Description", ColSpan = 1, EditorType2=EditorTypes.dxTextArea }, + new EditingFormItemDto { Order = 4, DataField = "IsActive", ColSpan = 1, EditorType2=EditorTypes.dxCheckBox }, + ]} + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { FieldName = "IsActive", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value } + }), + }, autoSave: true + ); + + #region Check Type Fields + await _listFormFieldRepository.InsertManyAsync([ + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 350, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 1, + SortDirection = GridColumnOptions.SortOrderAsc, + AllowSearch = true, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Description", + Width = 500, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "IsActive", + Width = 100, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + } + ], autoSave: true); + #endregion + } + #endregion + } } diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/MenusData.json b/api/src/Erp.Platform.DbMigrator/Seeds/MenusData.json index 3c0a4ba3..a22ae1c1 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/MenusData.json +++ b/api/src/Erp.Platform.DbMigrator/Seeds/MenusData.json @@ -3213,10 +3213,60 @@ "DisplayName": "App.Accounting.WaybillStatus", "Order": 2, "Url": "/admin/list/App.Accounting.WaybillStatus", - "Icon": "FcSwitch", + "Icon": "FcInfo", "RequiredPermissionName": "App.Accounting.WaybillStatus", "IsDisabled": false }, + { + "ParentCode": "App.Accounting.Definitions", + "Code": "App.Accounting.InvoiceType", + "DisplayName": "App.Accounting.InvoiceType", + "Order": 3, + "Url": "/admin/list/App.Accounting.InvoiceType", + "Icon": "FcTreeStructure", + "RequiredPermissionName": "App.Accounting.InvoiceType", + "IsDisabled": false + }, + { + "ParentCode": "App.Accounting.Definitions", + "Code": "App.Accounting.InvoiceStatus", + "DisplayName": "App.Accounting.InvoiceStatus", + "Order": 4, + "Url": "/admin/list/App.Accounting.InvoiceStatus", + "Icon": "FcApproval", + "RequiredPermissionName": "App.Accounting.InvoiceStatus", + "IsDisabled": false + }, + { + "ParentCode": "App.Accounting.Definitions", + "Code": "App.Accounting.PaymentStatus", + "DisplayName": "App.Accounting.PaymentStatus", + "Order": 5, + "Url": "/admin/list/App.Accounting.PaymentStatus", + "Icon": "FcMoneyTransfer", + "RequiredPermissionName": "App.Accounting.PaymentStatus", + "IsDisabled": false + }, + { + "ParentCode": "App.Accounting.Definitions", + "Code": "App.Accounting.CheckStatus", + "DisplayName": "App.Accounting.CheckStatus", + "Order": 6, + "Url": "/admin/list/App.Accounting.CheckStatus", + "Icon": "FcMultipleInputs", + "RequiredPermissionName": "App.Accounting.CheckStatus", + "IsDisabled": false + }, + { + "ParentCode": "App.Accounting.Definitions", + "Code": "App.Accounting.CheckType", + "DisplayName": "App.Accounting.CheckType", + "Order": 7, + "Url": "/admin/list/App.Accounting.CheckType", + "Icon": "FcFlow", + "RequiredPermissionName": "App.Accounting.CheckType", + "IsDisabled": false + }, { "ParentCode": "App.Accounting", "Code": "App.Accounting.Cash", diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/PermissionsData.json b/api/src/Erp.Platform.DbMigrator/Seeds/PermissionsData.json index 5d23b510..2865e063 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/PermissionsData.json +++ b/api/src/Erp.Platform.DbMigrator/Seeds/PermissionsData.json @@ -13306,6 +13306,321 @@ "MultiTenancySide": 3, "MenuGroup": "Erp" }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.InvoiceType", + "ParentName": null, + "DisplayName": "App.Accounting.InvoiceType", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.InvoiceType.Create", + "ParentName": "App.Accounting.InvoiceType", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.InvoiceType.Update", + "ParentName": "App.Accounting.InvoiceType", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.InvoiceType.Delete", + "ParentName": "App.Accounting.InvoiceType", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.InvoiceType.Export", + "ParentName": "App.Accounting.InvoiceType", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.InvoiceType.Import", + "ParentName": "App.Accounting.InvoiceType", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.InvoiceType.Note", + "ParentName": "App.Accounting.InvoiceType", + "DisplayName": "Note", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.InvoiceStatus", + "ParentName": null, + "DisplayName": "App.Accounting.InvoiceStatus", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.InvoiceStatus.Create", + "ParentName": "App.Accounting.InvoiceStatus", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.InvoiceStatus.Update", + "ParentName": "App.Accounting.InvoiceStatus", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.InvoiceStatus.Delete", + "ParentName": "App.Accounting.InvoiceStatus", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.InvoiceStatus.Export", + "ParentName": "App.Accounting.InvoiceStatus", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.InvoiceStatus.Import", + "ParentName": "App.Accounting.InvoiceStatus", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.InvoiceStatus.Note", + "ParentName": "App.Accounting.InvoiceStatus", + "DisplayName": "Note", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.PaymentStatus", + "ParentName": null, + "DisplayName": "App.Accounting.PaymentStatus", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.PaymentStatus.Create", + "ParentName": "App.Accounting.PaymentStatus", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.PaymentStatus.Update", + "ParentName": "App.Accounting.PaymentStatus", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.PaymentStatus.Delete", + "ParentName": "App.Accounting.PaymentStatus", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.PaymentStatus.Export", + "ParentName": "App.Accounting.PaymentStatus", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.PaymentStatus.Import", + "ParentName": "App.Accounting.PaymentStatus", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.PaymentStatus.Note", + "ParentName": "App.Accounting.PaymentStatus", + "DisplayName": "Note", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.CheckStatus", + "ParentName": null, + "DisplayName": "App.Accounting.CheckStatus", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.CheckStatus.Create", + "ParentName": "App.Accounting.CheckStatus", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.CheckStatus.Update", + "ParentName": "App.Accounting.CheckStatus", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.CheckStatus.Delete", + "ParentName": "App.Accounting.CheckStatus", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.CheckStatus.Export", + "ParentName": "App.Accounting.CheckStatus", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.CheckStatus.Import", + "ParentName": "App.Accounting.CheckStatus", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.CheckStatus.Note", + "ParentName": "App.Accounting.CheckStatus", + "DisplayName": "Note", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.CheckType", + "ParentName": null, + "DisplayName": "App.Accounting.CheckType", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.CheckType.Create", + "ParentName": "App.Accounting.CheckType", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.CheckType.Update", + "ParentName": "App.Accounting.CheckType", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.CheckType.Delete", + "ParentName": "App.Accounting.CheckType", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.CheckType.Export", + "ParentName": "App.Accounting.CheckType", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.CheckType.Import", + "ParentName": "App.Accounting.CheckType", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.CheckType.Note", + "ParentName": "App.Accounting.CheckType", + "DisplayName": "Note", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, { "GroupName": "App.Accounting", "Name": "App.Accounting.Waybill", diff --git a/api/src/Erp.Platform.Domain.Shared/Enums/TableNameEnum.cs b/api/src/Erp.Platform.Domain.Shared/Enums/TableNameEnum.cs index ea3b34b9..f44e6011 100644 --- a/api/src/Erp.Platform.Domain.Shared/Enums/TableNameEnum.cs +++ b/api/src/Erp.Platform.Domain.Shared/Enums/TableNameEnum.cs @@ -221,5 +221,13 @@ public enum TableNameEnum WaybillType, WaybillStatus, Waybill, - WaybillItem + WaybillItem, + InvoiceType, + InvoiceStatus, + PaymentStatus, + Invoice, + InvoiceItem, + CheckStatus, + CheckType, + CheckNote } diff --git a/api/src/Erp.Platform.Domain.Shared/TableNameResolver.cs b/api/src/Erp.Platform.Domain.Shared/TableNameResolver.cs index d2e584d8..edefaed4 100644 --- a/api/src/Erp.Platform.Domain.Shared/TableNameResolver.cs +++ b/api/src/Erp.Platform.Domain.Shared/TableNameResolver.cs @@ -216,12 +216,20 @@ public static class TableNameResolver // 🔹 ACCOUNTING { nameof(TableNameEnum.WaybillType), (TablePrefix.TenantByName, MenuPrefix.Accounting) }, { nameof(TableNameEnum.WaybillStatus), (TablePrefix.TenantByName, MenuPrefix.Accounting) }, + { nameof(TableNameEnum.InvoiceType), (TablePrefix.TenantByName, MenuPrefix.Accounting) }, + { nameof(TableNameEnum.InvoiceStatus), (TablePrefix.TenantByName, MenuPrefix.Accounting) }, + { nameof(TableNameEnum.PaymentStatus), (TablePrefix.TenantByName, MenuPrefix.Accounting) }, + { nameof(TableNameEnum.CheckStatus), (TablePrefix.TenantByName, MenuPrefix.Accounting) }, + { nameof(TableNameEnum.CheckType), (TablePrefix.TenantByName, MenuPrefix.Accounting) }, { nameof(TableNameEnum.Bank), (TablePrefix.BranchByName, MenuPrefix.Accounting) }, { nameof(TableNameEnum.BankAccount), (TablePrefix.BranchByName, MenuPrefix.Accounting) }, { nameof(TableNameEnum.Cash), (TablePrefix.BranchByName, MenuPrefix.Accounting) }, { nameof(TableNameEnum.CurrentAccount), (TablePrefix.BranchByName, MenuPrefix.Accounting) }, { nameof(TableNameEnum.Waybill), (TablePrefix.BranchByName, MenuPrefix.Accounting) }, { nameof(TableNameEnum.WaybillItem), (TablePrefix.BranchByName, MenuPrefix.Accounting) }, + { nameof(TableNameEnum.Invoice), (TablePrefix.BranchByName, MenuPrefix.Accounting) }, + { nameof(TableNameEnum.InvoiceItem), (TablePrefix.BranchByName, MenuPrefix.Accounting) }, + { nameof(TableNameEnum.CheckNote), (TablePrefix.BranchByName, MenuPrefix.Accounting) }, // 🔹 STORE { nameof(TableNameEnum.WarehouseType), (TablePrefix.TenantByName, MenuPrefix.Store) }, diff --git a/api/src/Erp.Platform.Domain/Data/SeedConsts.cs b/api/src/Erp.Platform.Domain/Data/SeedConsts.cs index 74f96b26..a59c6e20 100644 --- a/api/src/Erp.Platform.Domain/Data/SeedConsts.cs +++ b/api/src/Erp.Platform.Domain/Data/SeedConsts.cs @@ -571,6 +571,11 @@ public static class SeedConsts public const string WaybillStatus = Default + ".WaybillStatus"; public const string Waybill = Default + ".Waybill"; public const string WaybillItem = Default + ".WaybillItem"; + public const string InvoiceType = Default + ".InvoiceType"; + public const string InvoiceStatus = Default + ".InvoiceStatus"; + public const string PaymentStatus = Default + ".PaymentStatus"; + public const string CheckStatus = Default + ".CheckStatus"; + public const string CheckType = Default + ".CheckType"; } public static class Store diff --git a/api/src/Erp.Platform.Domain/Entities/Branch/Accounting/CheckNote.cs b/api/src/Erp.Platform.Domain/Entities/Branch/Accounting/CheckNote.cs new file mode 100644 index 00000000..e53d482e --- /dev/null +++ b/api/src/Erp.Platform.Domain/Entities/Branch/Accounting/CheckNote.cs @@ -0,0 +1,40 @@ +using System; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace Erp.Platform.Entities; + +public class CheckNote : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + public Guid? BranchId { get; set; } + + public string CheckNumber { get; set; } + public string BankName { get; set; } + public string BranchName { get; set; } + public string AccountNumber { get; set; } + + public string DrawerName { get; set; } + public string PayeeName { get; set; } + + public Guid CurrentAccountId { get; set; } + public CurrentAccount CurrentAccount { get; set; } + + public DateTime IssueDate { get; set; } + public DateTime DueDate { get; set; } + + public decimal Amount { get; set; } + public string Currency { get; set; } + + public Guid StatusId { get; set; } + public CheckStatus Status { get; set; } + + public Guid TypeId { get; set; } + public CheckType Type { get; set; } + + public DateTime? BankingDate { get; set; } + public DateTime? CollectionDate { get; set; } + + public string EndorsedTo { get; set; } + public string Notes { get; set; } +} diff --git a/api/src/Erp.Platform.Domain/Entities/Branch/Accounting/CurrentAccount.cs b/api/src/Erp.Platform.Domain/Entities/Branch/Accounting/CurrentAccount.cs index de64e773..a8c1adf1 100644 --- a/api/src/Erp.Platform.Domain/Entities/Branch/Accounting/CurrentAccount.cs +++ b/api/src/Erp.Platform.Domain/Entities/Branch/Accounting/CurrentAccount.cs @@ -1,4 +1,6 @@ using System; +using System.Collections; +using System.Collections.Generic; using Volo.Abp.Domain.Entities.Auditing; using Volo.Abp.MultiTenancy; @@ -28,4 +30,8 @@ public class CurrentAccount : FullAuditedEntity, IMultiTenant public PaymentTerm? PaymentTerm { get; set; } public bool IsActive { get; set; } + + public ICollection Waybills { get; set; } + public ICollection Invoices { get; set; } + public ICollection Checks { get; set; } } diff --git a/api/src/Erp.Platform.Domain/Entities/Branch/Accounting/Invoice.cs b/api/src/Erp.Platform.Domain/Entities/Branch/Accounting/Invoice.cs new file mode 100644 index 00000000..f2bddee3 --- /dev/null +++ b/api/src/Erp.Platform.Domain/Entities/Branch/Accounting/Invoice.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace Erp.Platform.Entities; + +public class Invoice : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + public Guid? BranchId { get; set; } + + public string InvoiceNumber { get; set; } + public Guid InvoiceTypeId { get; set; } + public InvoiceType InvoiceType { get; set; } + + public Guid CurrentAccountId { get; set; } + public CurrentAccount CurrentAccount { get; set; } + + public DateTime InvoiceDate { get; set; } + public DateTime DueDate { get; set; } + public DateTime? DeliveryDate { get; set; } + + public decimal Subtotal { get; set; } + public decimal TaxAmount { get; set; } + public decimal DiscountAmount { get; set; } + public decimal TotalAmount { get; set; } + public decimal PaidAmount { get; set; } + public decimal RemainingAmount { get; set; } + public string Currency { get; set; } + + public Guid StatusId { get; set; } + public InvoiceStatus Status { get; set; } + + public Guid PaymentStatusId { get; set; } + public PaymentStatus PaymentStatus { get; set; } + + public Guid? WaybillId { get; set; } + + public string Notes { get; set; } + + public ICollection Items { get; set; } +} diff --git a/api/src/Erp.Platform.Domain/Entities/Branch/Accounting/InvoiceItem.cs b/api/src/Erp.Platform.Domain/Entities/Branch/Accounting/InvoiceItem.cs new file mode 100644 index 00000000..efcb85ea --- /dev/null +++ b/api/src/Erp.Platform.Domain/Entities/Branch/Accounting/InvoiceItem.cs @@ -0,0 +1,30 @@ +using System; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace Erp.Platform.Entities; + +public class InvoiceItem : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public Guid InvoiceId { get; set; } + public Invoice Invoice { get; set; } + + public Guid? MaterialId { get; set; } + public Material Material { get; set; } + public string Uom { get; set; } + + public string Description { get; set; } + + public decimal Quantity { get; set; } + public decimal UnitPrice { get; set; } + public decimal LineTotal { get; set; } + + public decimal DiscountRate { get; set; } + public decimal DiscountAmount { get; set; } + + public decimal TaxRate { get; set; } + public decimal TaxAmount { get; set; } + public decimal NetAmount { get; set; } +} diff --git a/api/src/Erp.Platform.Domain/Entities/Branch/Accounting/Waybill.cs b/api/src/Erp.Platform.Domain/Entities/Branch/Accounting/Waybill.cs index 51c2da76..59dc48eb 100644 --- a/api/src/Erp.Platform.Domain/Entities/Branch/Accounting/Waybill.cs +++ b/api/src/Erp.Platform.Domain/Entities/Branch/Accounting/Waybill.cs @@ -20,10 +20,10 @@ public class Waybill : FullAuditedEntity, IMultiTenant public DateTime WaybillDate { get; set; } public DateTime? DeliveryDate { get; set; } - public double Subtotal { get; set; } - public double TaxAmount { get; set; } - public double DiscountAmount { get; set; } - public double TotalAmount { get; set; } + public decimal Subtotal { get; set; } + public decimal TaxAmount { get; set; } + public decimal DiscountAmount { get; set; } + public decimal TotalAmount { get; set; } public string Currency { get; set; } public Guid WaybillStatusId { get; set; } diff --git a/api/src/Erp.Platform.Domain/Entities/Branch/Accounting/WaybillItem.cs b/api/src/Erp.Platform.Domain/Entities/Branch/Accounting/WaybillItem.cs index 5932894b..4db011b2 100644 --- a/api/src/Erp.Platform.Domain/Entities/Branch/Accounting/WaybillItem.cs +++ b/api/src/Erp.Platform.Domain/Entities/Branch/Accounting/WaybillItem.cs @@ -7,25 +7,24 @@ namespace Erp.Platform.Entities; public class WaybillItem : FullAuditedEntity, IMultiTenant { public Guid? TenantId { get; set; } - public Guid? BranchId { get; set; } public Guid WaybillId { get; set; } public Waybill Waybill { get; set; } public Guid? MaterialId { get; set; } public Material Material { get; set; } - + public string Uom { get; set; } + public string Description { get; set; } - public double Quantity { get; set; } - public string Unit { get; set; } - public double UnitPrice { get; set; } - public double LineTotal { get; set; } + public decimal Quantity { get; set; } + public decimal UnitPrice { get; set; } + public decimal LineTotal { get; set; } - public double DiscountRate { get; set; } - public double DiscountAmount { get; set; } + public decimal DiscountRate { get; set; } + public decimal DiscountAmount { get; set; } - public double TaxRate { get; set; } - public double TaxAmount { get; set; } - public double NetAmount { get; set; } + public decimal TaxRate { get; set; } + public decimal TaxAmount { get; set; } + public decimal NetAmount { get; set; } } diff --git a/api/src/Erp.Platform.Domain/Entities/Tenant/Accounting/CheckStatus.cs b/api/src/Erp.Platform.Domain/Entities/Tenant/Accounting/CheckStatus.cs new file mode 100644 index 00000000..59e75af4 --- /dev/null +++ b/api/src/Erp.Platform.Domain/Entities/Tenant/Accounting/CheckStatus.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace Erp.Platform.Entities; + +public class CheckStatus : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public string Name { get; set; } + public string Description { get; set; } + public bool IsActive { get; set; } + + public ICollection Checks { get; set; } +} diff --git a/api/src/Erp.Platform.Domain/Entities/Tenant/Accounting/CheckType.cs b/api/src/Erp.Platform.Domain/Entities/Tenant/Accounting/CheckType.cs new file mode 100644 index 00000000..28b88b53 --- /dev/null +++ b/api/src/Erp.Platform.Domain/Entities/Tenant/Accounting/CheckType.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace Erp.Platform.Entities; + +public class CheckType : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public string Name { get; set; } + public string Description { get; set; } + public bool IsActive { get; set; } + + public ICollection Checks { get; set; } +} diff --git a/api/src/Erp.Platform.Domain/Entities/Tenant/Accounting/InvoiceStatus.cs b/api/src/Erp.Platform.Domain/Entities/Tenant/Accounting/InvoiceStatus.cs new file mode 100644 index 00000000..6c9a924f --- /dev/null +++ b/api/src/Erp.Platform.Domain/Entities/Tenant/Accounting/InvoiceStatus.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace Erp.Platform.Entities; + +public class InvoiceStatus : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public string Name { get; set; } + public string Description { get; set; } + public bool IsActive { get; set; } + + public ICollection Invoices { get; set; } +} diff --git a/api/src/Erp.Platform.Domain/Entities/Tenant/Accounting/InvoiceType.cs b/api/src/Erp.Platform.Domain/Entities/Tenant/Accounting/InvoiceType.cs new file mode 100644 index 00000000..0e3388bc --- /dev/null +++ b/api/src/Erp.Platform.Domain/Entities/Tenant/Accounting/InvoiceType.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace Erp.Platform.Entities; + +public class InvoiceType : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public string Name { get; set; } + public string Description { get; set; } + public bool IsActive { get; set; } + + public ICollection Invoices { get; set; } +} diff --git a/api/src/Erp.Platform.Domain/Entities/Tenant/Accounting/PaymentStatus.cs b/api/src/Erp.Platform.Domain/Entities/Tenant/Accounting/PaymentStatus.cs new file mode 100644 index 00000000..163f2621 --- /dev/null +++ b/api/src/Erp.Platform.Domain/Entities/Tenant/Accounting/PaymentStatus.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace Erp.Platform.Entities; + +public class PaymentStatus : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public string Name { get; set; } + public string Description { get; set; } + public bool IsActive { get; set; } + + public ICollection Invoices { get; set; } +} diff --git a/api/src/Erp.Platform.Domain/Entities/Tenant/Accounting/WaybillStatus.cs b/api/src/Erp.Platform.Domain/Entities/Tenant/Accounting/WaybillStatus.cs index ff78c619..42a7a366 100644 --- a/api/src/Erp.Platform.Domain/Entities/Tenant/Accounting/WaybillStatus.cs +++ b/api/src/Erp.Platform.Domain/Entities/Tenant/Accounting/WaybillStatus.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using Volo.Abp.Domain.Entities.Auditing; using Volo.Abp.MultiTenancy; @@ -11,4 +12,6 @@ public class WaybillStatus : FullAuditedEntity, IMultiTenant public string Name { get; set; } public string Description { get; set; } public bool IsActive { get; set; } + + public ICollection Waybills { get; set; } } diff --git a/api/src/Erp.Platform.Domain/Entities/Tenant/Accounting/WaybillType.cs b/api/src/Erp.Platform.Domain/Entities/Tenant/Accounting/WaybillType.cs index 76afe974..203a9684 100644 --- a/api/src/Erp.Platform.Domain/Entities/Tenant/Accounting/WaybillType.cs +++ b/api/src/Erp.Platform.Domain/Entities/Tenant/Accounting/WaybillType.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using Volo.Abp.Domain.Entities.Auditing; using Volo.Abp.MultiTenancy; @@ -11,4 +12,6 @@ public class WaybillType : FullAuditedEntity, IMultiTenant public string Name { get; set; } public string Description { get; set; } public bool IsActive { get; set; } + + public ICollection Waybills { get; set; } } diff --git a/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/Material.cs b/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/Material.cs index 887aa1ba..50131833 100644 --- a/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/Material.cs +++ b/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/Material.cs @@ -37,5 +37,7 @@ public class Material : FullAuditedEntity, IMultiTenant public List PurchaseOrderItems { get; set; } public List SalesOrderItems { get; set; } public List MovementItems { get; set; } + public List WaybillItems { get; set; } + public List InvoiceItems { get; set; } } diff --git a/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs b/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs index ec4aa340..c78854fa 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs @@ -302,6 +302,13 @@ public class PlatformDbContext : public DbSet WaybillStatuses { get; set; } public DbSet Waybills { get; set; } public DbSet WaybillItems { get; set; } + public DbSet InvoiceTypes { get; set; } + public DbSet InvoiceStatuses { get; set; } + public DbSet PaymentStatuses { get; set; } + public DbSet CheckStatuses { get; set; } + public DbSet CheckTypes { get; set; } + public DbSet Invoices { get; set; } + public DbSet InvoiceItems { get; set; } #endregion public PlatformDbContext(DbContextOptions options) @@ -3895,5 +3902,248 @@ public class PlatformDbContext : b.Property(x => x.Description).HasMaxLength(500); b.Property(x => x.IsActive).HasDefaultValue(true); }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Waybill)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.WaybillNumber).IsRequired().HasMaxLength(50); + b.Property(x => x.WaybillTypeId).IsRequired(); + b.Property(x => x.CurrentAccountId).IsRequired(); + + b.Property(x => x.WaybillDate).IsRequired(); + + b.Property(x => x.Subtotal).HasDefaultValue(0).HasPrecision(18, 2); + b.Property(x => x.TaxAmount).HasDefaultValue(0).HasPrecision(18, 2); + b.Property(x => x.DiscountAmount).HasDefaultValue(0).HasPrecision(18, 2); + b.Property(x => x.TotalAmount).HasDefaultValue(0).HasPrecision(18, 2); + + b.Property(x => x.Currency).IsRequired().HasMaxLength(10); + b.Property(x => x.WaybillStatusId).IsRequired(); + + b.Property(x => x.IsInvoiced).HasDefaultValue(false); + + b.Property(x => x.DeliveryAddress).HasMaxLength(500); + b.Property(x => x.ReceiverName).HasMaxLength(200); + b.Property(x => x.ReceiverPhone).HasMaxLength(50); + b.Property(x => x.CarrierCompany).HasMaxLength(100); + b.Property(x => x.TrackingNumber).HasMaxLength(100); + b.Property(x => x.Notes).HasMaxLength(1000); + + b.HasOne(x => x.CurrentAccount) + .WithMany(ca => ca.Waybills) + .HasForeignKey(x => x.CurrentAccountId) + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne(x => x.WaybillType) + .WithMany(wt => wt.Waybills) + .HasForeignKey(x => x.WaybillTypeId) + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne(x => x.WaybillStatus) + .WithMany(ws => ws.Waybills) + .HasForeignKey(x => x.WaybillStatusId) + .OnDelete(DeleteBehavior.Restrict); + }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.WaybillItem)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.WaybillId).IsRequired(); + b.Property(x => x.MaterialId).IsRequired(); + b.Property(x => x.Uom).HasMaxLength(64); + + b.Property(x => x.Description).IsRequired().HasMaxLength(500); + + b.Property(x => x.Quantity).HasPrecision(18, 2).HasDefaultValue(0); + b.Property(x => x.UnitPrice).HasPrecision(18, 2).HasDefaultValue(0); + b.Property(x => x.LineTotal).HasPrecision(18, 2).HasDefaultValue(0); + b.Property(x => x.DiscountRate).HasPrecision(18, 2).HasDefaultValue(0); + b.Property(x => x.DiscountAmount).HasPrecision(18, 2).HasDefaultValue(0); + b.Property(x => x.TaxRate).HasPrecision(18, 2).HasDefaultValue(0); + b.Property(x => x.TaxAmount).HasPrecision(18, 2).HasDefaultValue(0); + b.Property(x => x.NetAmount).HasPrecision(18, 2).HasDefaultValue(0); + + b.HasOne(x => x.Waybill) + .WithMany(ws => ws.Items) + .HasForeignKey(x => x.WaybillId) + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne(x => x.Material) + .WithMany(ws => ws.WaybillItems) + .HasForeignKey(x => x.MaterialId) + .OnDelete(DeleteBehavior.Restrict); + }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.InvoiceType)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.Name).IsRequired().HasMaxLength(50); + b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.IsActive).HasDefaultValue(true); + }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.InvoiceStatus)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.Name).IsRequired().HasMaxLength(50); + b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.IsActive).HasDefaultValue(true); + }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.PaymentStatus)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.Name).IsRequired().HasMaxLength(50); + b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.IsActive).HasDefaultValue(true); + }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Invoice)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.InvoiceNumber).IsRequired().HasMaxLength(50); + b.Property(x => x.InvoiceTypeId).IsRequired(); + b.Property(x => x.CurrentAccountId).IsRequired(); + b.Property(x => x.InvoiceDate).IsRequired(); + b.Property(x => x.DueDate).IsRequired(); + + b.Property(x => x.Subtotal).HasDefaultValue(0).HasPrecision(18, 2); + b.Property(x => x.TaxAmount).HasDefaultValue(0).HasPrecision(18, 2); + b.Property(x => x.DiscountAmount).HasDefaultValue(0).HasPrecision(18, 2); + b.Property(x => x.TotalAmount).HasDefaultValue(0).HasPrecision(18, 2); + b.Property(x => x.PaidAmount).HasDefaultValue(0).HasPrecision(18, 2); + b.Property(x => x.RemainingAmount).HasDefaultValue(0).HasPrecision(18, 2); + b.Property(x => x.Currency).IsRequired().HasMaxLength(10); + + b.Property(x => x.StatusId).IsRequired(); + b.Property(x => x.Notes).HasMaxLength(1000); + + b.HasOne(x => x.CurrentAccount) + .WithMany(ca => ca.Invoices) + .HasForeignKey(x => x.CurrentAccountId) + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne(x => x.InvoiceType) + .WithMany(ca => ca.Invoices) + .HasForeignKey(x => x.InvoiceTypeId) + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne(x => x.Status) + .WithMany(ca => ca.Invoices) + .HasForeignKey(x => x.StatusId) + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne(x => x.PaymentStatus) + .WithMany(ca => ca.Invoices) + .HasForeignKey(x => x.PaymentStatusId) + .OnDelete(DeleteBehavior.Restrict); + }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.InvoiceItem)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.InvoiceId).IsRequired(); + b.Property(x => x.MaterialId).IsRequired(); + b.Property(x => x.Uom).HasMaxLength(64).IsRequired(); + + b.Property(x => x.Description).IsRequired().HasMaxLength(500); + + b.Property(x => x.Quantity).HasDefaultValue(0).HasPrecision(18, 2); + b.Property(x => x.UnitPrice).HasDefaultValue(0).HasPrecision(18, 2); + b.Property(x => x.LineTotal).HasDefaultValue(0).HasPrecision(18, 2); + + b.Property(x => x.DiscountRate).HasDefaultValue(0).HasPrecision(18, 2); + b.Property(x => x.DiscountAmount).HasDefaultValue(0).HasPrecision(18, 2); + + b.Property(x => x.TaxRate).HasDefaultValue(0).HasPrecision(18, 2); + b.Property(x => x.TaxAmount).HasDefaultValue(0).HasPrecision(18, 2); + b.Property(x => x.NetAmount).HasDefaultValue(0).HasPrecision(18, 2); + + b.HasOne(x => x.Invoice) + .WithMany(ca => ca.Items) + .HasForeignKey(x => x.InvoiceId) + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne(x => x.Material) + .WithMany(ca => ca.InvoiceItems) + .HasForeignKey(x => x.MaterialId) + .OnDelete(DeleteBehavior.Restrict); + }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.CheckStatus)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.Name).IsRequired().HasMaxLength(50); + b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.IsActive).HasDefaultValue(true); + }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.CheckType)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.Name).IsRequired().HasMaxLength(50); + b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.IsActive).HasDefaultValue(true); + }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.CheckNote)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.CheckNumber).IsRequired().HasMaxLength(50); + b.Property(x => x.BankName).HasMaxLength(200); + b.Property(x => x.BranchName).HasMaxLength(200); + b.Property(x => x.AccountNumber).HasMaxLength(100); + + b.Property(x => x.DrawerName).HasMaxLength(200); + b.Property(x => x.PayeeName).HasMaxLength(200); + + b.Property(x => x.IssueDate).IsRequired(); + b.Property(x => x.DueDate).IsRequired(); + + b.Property(x => x.Amount).HasDefaultValue(0).HasPrecision(18, 2); + b.Property(x => x.Currency).HasMaxLength(10).IsRequired(); + + b.Property(x => x.StatusId).IsRequired(); + b.Property(x => x.TypeId).IsRequired(); + + b.Property(x => x.EndorsedTo).HasMaxLength(200); + b.Property(x => x.Notes).HasMaxLength(1000); + + // FK → CurrentAccount (ZORUNLU) + b.HasOne(x => x.CurrentAccount) + .WithMany(ca => ca.Checks) + .HasForeignKey(x => x.CurrentAccountId) + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne(x => x.Status) + .WithMany(ca => ca.Checks) + .HasForeignKey(x => x.StatusId) + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne(x => x.Type) + .WithMany(ca => ca.Checks) + .HasForeignKey(x => x.TypeId) + .OnDelete(DeleteBehavior.Restrict); + }); } } \ No newline at end of file diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251208185357_Initial.Designer.cs b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251208215226_Initial.Designer.cs similarity index 95% rename from api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251208185357_Initial.Designer.cs rename to api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251208215226_Initial.Designer.cs index 7e8bd8f2..7617e72e 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251208185357_Initial.Designer.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251208215226_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace Erp.Platform.Migrations { [DbContext(typeof(PlatformDbContext))] - [Migration("20251208185357_Initial")] + [Migration("20251208215226_Initial")] partial class Initial { /// @@ -2202,6 +2202,240 @@ namespace Erp.Platform.Migrations b.ToTable("Net_T_Certificate", (string)null); }); + modelBuilder.Entity("Erp.Platform.Entities.CheckNote", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccountNumber") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Amount") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("BankName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("BankingDate") + .HasColumnType("datetime2"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("BranchName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("CheckNumber") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CollectionDate") + .HasColumnType("datetime2"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Currency") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("CurrentAccountId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DrawerName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("DueDate") + .HasColumnType("datetime2"); + + b.Property("EndorsedTo") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IssueDate") + .HasColumnType("datetime2"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Notes") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("PayeeName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("StatusId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TypeId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("CurrentAccountId"); + + b.HasIndex("StatusId"); + + b.HasIndex("TypeId"); + + b.ToTable("Acc_B_CheckNote", (string)null); + }); + + modelBuilder.Entity("Erp.Platform.Entities.CheckStatus", b => + { + b.Property("Id") + .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("Description") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("IsActive") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); + + 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(50) + .HasColumnType("nvarchar(50)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("Acc_T_CheckStatus", (string)null); + }); + + modelBuilder.Entity("Erp.Platform.Entities.CheckType", b => + { + b.Property("Id") + .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("Description") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("IsActive") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); + + 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(50) + .HasColumnType("nvarchar(50)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("Acc_T_CheckType", (string)null); + }); + modelBuilder.Entity("Erp.Platform.Entities.City", b => { b.Property("Id") @@ -5683,6 +5917,363 @@ namespace Erp.Platform.Migrations b.ToTable("Str_T_Inventory", (string)null); }); + modelBuilder.Entity("Erp.Platform.Entities.Invoice", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Currency") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("CurrentAccountId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DeliveryDate") + .HasColumnType("datetime2"); + + b.Property("DiscountAmount") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("DueDate") + .HasColumnType("datetime2"); + + b.Property("InvoiceDate") + .HasColumnType("datetime2"); + + b.Property("InvoiceNumber") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvoiceTypeId") + .HasColumnType("uniqueidentifier"); + + 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("Notes") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("PaidAmount") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("PaymentStatusId") + .HasColumnType("uniqueidentifier"); + + b.Property("RemainingAmount") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("StatusId") + .HasColumnType("uniqueidentifier"); + + b.Property("Subtotal") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("TaxAmount") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TotalAmount") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("WaybillId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("CurrentAccountId"); + + b.HasIndex("InvoiceTypeId"); + + b.HasIndex("PaymentStatusId"); + + b.HasIndex("StatusId"); + + b.ToTable("Acc_B_Invoice", (string)null); + }); + + modelBuilder.Entity("Erp.Platform.Entities.InvoiceItem", b => + { + b.Property("Id") + .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("Description") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("DiscountAmount") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("DiscountRate") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("InvoiceId") + .HasColumnType("uniqueidentifier"); + + 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("LineTotal") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("MaterialId") + .HasColumnType("uniqueidentifier"); + + b.Property("NetAmount") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("Quantity") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("TaxAmount") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("TaxRate") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UnitPrice") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("InvoiceId"); + + b.HasIndex("MaterialId"); + + b.ToTable("Acc_B_InvoiceItem", (string)null); + }); + + modelBuilder.Entity("Erp.Platform.Entities.InvoiceStatus", b => + { + b.Property("Id") + .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("Description") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("IsActive") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); + + 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(50) + .HasColumnType("nvarchar(50)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("Acc_T_InvoiceStatus", (string)null); + }); + + modelBuilder.Entity("Erp.Platform.Entities.InvoiceType", b => + { + b.Property("Id") + .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("Description") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("IsActive") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); + + 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(50) + .HasColumnType("nvarchar(50)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("Acc_T_InvoiceType", (string)null); + }); + modelBuilder.Entity("Erp.Platform.Entities.IpRestriction", b => { b.Property("Id") @@ -9281,6 +9872,64 @@ namespace Erp.Platform.Migrations b.ToTable("Adm_T_PaymentMethod", (string)null); }); + modelBuilder.Entity("Erp.Platform.Entities.PaymentStatus", b => + { + b.Property("Id") + .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("Description") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("IsActive") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); + + 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(50) + .HasColumnType("nvarchar(50)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("Acc_T_PaymentStatus", (string)null); + }); + modelBuilder.Entity("Erp.Platform.Entities.PaymentTerm", b => { b.Property("Id") @@ -14967,7 +15616,8 @@ namespace Erp.Platform.Migrations .HasColumnType("uniqueidentifier"); b.Property("CarrierCompany") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); b.Property("CreationTime") .HasColumnType("datetime2") @@ -14978,7 +15628,9 @@ namespace Erp.Platform.Migrations .HasColumnName("CreatorId"); b.Property("Currency") - .HasColumnType("nvarchar(max)"); + .IsRequired() + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); b.Property("CurrentAccountId") .HasColumnType("uniqueidentifier"); @@ -14992,13 +15644,17 @@ namespace Erp.Platform.Migrations .HasColumnName("DeletionTime"); b.Property("DeliveryAddress") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); b.Property("DeliveryDate") .HasColumnType("datetime2"); - b.Property("DiscountAmount") - .HasColumnType("float"); + b.Property("DiscountAmount") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); b.Property("InvoiceId") .HasColumnType("uniqueidentifier"); @@ -15010,7 +15666,9 @@ namespace Erp.Platform.Migrations .HasColumnName("IsDeleted"); b.Property("IsInvoiced") - .HasColumnType("bit"); + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); b.Property("LastModificationTime") .HasColumnType("datetime2") @@ -15021,35 +15679,50 @@ namespace Erp.Platform.Migrations .HasColumnName("LastModifierId"); b.Property("Notes") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); b.Property("ReceiverName") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); b.Property("ReceiverPhone") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); - b.Property("Subtotal") - .HasColumnType("float"); + b.Property("Subtotal") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); - b.Property("TaxAmount") - .HasColumnType("float"); + b.Property("TaxAmount") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); b.Property("TenantId") .HasColumnType("uniqueidentifier") .HasColumnName("TenantId"); - b.Property("TotalAmount") - .HasColumnType("float"); + b.Property("TotalAmount") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); b.Property("TrackingNumber") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); b.Property("WaybillDate") .HasColumnType("datetime2"); b.Property("WaybillNumber") - .HasColumnType("nvarchar(max)"); + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); b.Property("WaybillStatusId") .HasColumnType("uniqueidentifier"); @@ -15065,7 +15738,7 @@ namespace Erp.Platform.Migrations b.HasIndex("WaybillTypeId"); - b.ToTable("Waybills"); + b.ToTable("Acc_B_Waybill", (string)null); }); modelBuilder.Entity("Erp.Platform.Entities.WaybillItem", b => @@ -15073,9 +15746,6 @@ namespace Erp.Platform.Migrations b.Property("Id") .HasColumnType("uniqueidentifier"); - b.Property("BranchId") - .HasColumnType("uniqueidentifier"); - b.Property("CreationTime") .HasColumnType("datetime2") .HasColumnName("CreationTime"); @@ -15093,13 +15763,21 @@ namespace Erp.Platform.Migrations .HasColumnName("DeletionTime"); b.Property("Description") - .HasColumnType("nvarchar(max)"); + .IsRequired() + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); - b.Property("DiscountAmount") - .HasColumnType("float"); + b.Property("DiscountAmount") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); - b.Property("DiscountRate") - .HasColumnType("float"); + b.Property("DiscountRate") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); b.Property("IsDeleted") .ValueGeneratedOnAdd() @@ -15115,33 +15793,52 @@ namespace Erp.Platform.Migrations .HasColumnType("uniqueidentifier") .HasColumnName("LastModifierId"); - b.Property("LineTotal") - .HasColumnType("float"); + b.Property("LineTotal") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); - b.Property("MaterialId") + b.Property("MaterialId") .HasColumnType("uniqueidentifier"); - b.Property("NetAmount") - .HasColumnType("float"); + b.Property("NetAmount") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); - b.Property("Quantity") - .HasColumnType("float"); + b.Property("Quantity") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); - b.Property("TaxAmount") - .HasColumnType("float"); + b.Property("TaxAmount") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); - b.Property("TaxRate") - .HasColumnType("float"); + b.Property("TaxRate") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); b.Property("TenantId") .HasColumnType("uniqueidentifier") .HasColumnName("TenantId"); - b.Property("Unit") - .HasColumnType("nvarchar(max)"); + b.Property("UnitPrice") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); - b.Property("UnitPrice") - .HasColumnType("float"); + b.Property("Uom") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); b.Property("WaybillId") .HasColumnType("uniqueidentifier"); @@ -15152,7 +15849,7 @@ namespace Erp.Platform.Migrations b.HasIndex("WaybillId"); - b.ToTable("WaybillItems"); + b.ToTable("Acc_B_WaybillItem", (string)null); }); modelBuilder.Entity("Erp.Platform.Entities.WaybillStatus", b => @@ -19066,6 +19763,33 @@ namespace Erp.Platform.Migrations b.Navigation("Training"); }); + modelBuilder.Entity("Erp.Platform.Entities.CheckNote", b => + { + b.HasOne("Erp.Platform.Entities.CurrentAccount", "CurrentAccount") + .WithMany("Checks") + .HasForeignKey("CurrentAccountId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.CheckStatus", "Status") + .WithMany("Checks") + .HasForeignKey("StatusId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.CheckType", "Type") + .WithMany("Checks") + .HasForeignKey("TypeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CurrentAccount"); + + b.Navigation("Status"); + + b.Navigation("Type"); + }); + modelBuilder.Entity("Erp.Platform.Entities.City", b => { b.HasOne("Erp.Platform.Entities.Country", null) @@ -19390,6 +20114,60 @@ namespace Erp.Platform.Migrations b.Navigation("WorkCenter"); }); + modelBuilder.Entity("Erp.Platform.Entities.Invoice", b => + { + b.HasOne("Erp.Platform.Entities.CurrentAccount", "CurrentAccount") + .WithMany("Invoices") + .HasForeignKey("CurrentAccountId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.InvoiceType", "InvoiceType") + .WithMany("Invoices") + .HasForeignKey("InvoiceTypeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.PaymentStatus", "PaymentStatus") + .WithMany("Invoices") + .HasForeignKey("PaymentStatusId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.InvoiceStatus", "Status") + .WithMany("Invoices") + .HasForeignKey("StatusId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CurrentAccount"); + + b.Navigation("InvoiceType"); + + b.Navigation("PaymentStatus"); + + b.Navigation("Status"); + }); + + modelBuilder.Entity("Erp.Platform.Entities.InvoiceItem", b => + { + b.HasOne("Erp.Platform.Entities.Invoice", "Invoice") + .WithMany("Items") + .HasForeignKey("InvoiceId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.Material", "Material") + .WithMany("InvoiceItems") + .HasForeignKey("MaterialId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Invoice"); + + b.Navigation("Material"); + }); + modelBuilder.Entity("Erp.Platform.Entities.JobPosition", b => { b.HasOne("Erp.Platform.Entities.Department", "Department") @@ -20584,21 +21362,21 @@ namespace Erp.Platform.Migrations modelBuilder.Entity("Erp.Platform.Entities.Waybill", b => { b.HasOne("Erp.Platform.Entities.CurrentAccount", "CurrentAccount") - .WithMany() + .WithMany("Waybills") .HasForeignKey("CurrentAccountId") - .OnDelete(DeleteBehavior.Cascade) + .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Erp.Platform.Entities.WaybillStatus", "WaybillStatus") - .WithMany() + .WithMany("Waybills") .HasForeignKey("WaybillStatusId") - .OnDelete(DeleteBehavior.Cascade) + .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Erp.Platform.Entities.WaybillType", "WaybillType") - .WithMany() + .WithMany("Waybills") .HasForeignKey("WaybillTypeId") - .OnDelete(DeleteBehavior.Cascade) + .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("CurrentAccount"); @@ -20611,13 +21389,15 @@ namespace Erp.Platform.Migrations modelBuilder.Entity("Erp.Platform.Entities.WaybillItem", b => { b.HasOne("Erp.Platform.Entities.Material", "Material") - .WithMany() - .HasForeignKey("MaterialId"); + .WithMany("WaybillItems") + .HasForeignKey("MaterialId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); b.HasOne("Erp.Platform.Entities.Waybill", "Waybill") .WithMany("Items") .HasForeignKey("WaybillId") - .OnDelete(DeleteBehavior.Cascade) + .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("Material"); @@ -21007,6 +21787,16 @@ namespace Erp.Platform.Migrations b.Navigation("ProjectPhases"); }); + modelBuilder.Entity("Erp.Platform.Entities.CheckStatus", b => + { + b.Navigation("Checks"); + }); + + modelBuilder.Entity("Erp.Platform.Entities.CheckType", b => + { + b.Navigation("Checks"); + }); + modelBuilder.Entity("Erp.Platform.Entities.City", b => { b.Navigation("Districts"); @@ -21038,6 +21828,15 @@ namespace Erp.Platform.Migrations b.Navigation("Cities"); }); + modelBuilder.Entity("Erp.Platform.Entities.CurrentAccount", b => + { + b.Navigation("Checks"); + + b.Navigation("Invoices"); + + b.Navigation("Waybills"); + }); + modelBuilder.Entity("Erp.Platform.Entities.CustomEntity", b => { b.Navigation("Fields"); @@ -21123,6 +21922,21 @@ namespace Erp.Platform.Migrations b.Navigation("Faults"); }); + modelBuilder.Entity("Erp.Platform.Entities.Invoice", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("Erp.Platform.Entities.InvoiceStatus", b => + { + b.Navigation("Invoices"); + }); + + modelBuilder.Entity("Erp.Platform.Entities.InvoiceType", b => + { + b.Navigation("Invoices"); + }); + modelBuilder.Entity("Erp.Platform.Entities.Location", b => { b.Navigation("MovementItems"); @@ -21144,6 +21958,8 @@ namespace Erp.Platform.Migrations b.Navigation("Boms"); + b.Navigation("InvoiceItems"); + b.Navigation("MovementItems"); b.Navigation("PurchaseOrderItems"); @@ -21158,6 +21974,8 @@ namespace Erp.Platform.Migrations b.Navigation("Suppliers"); + b.Navigation("WaybillItems"); + b.Navigation("WorkorderMaterials"); }); @@ -21225,6 +22043,11 @@ namespace Erp.Platform.Migrations b.Navigation("Quotations"); }); + modelBuilder.Entity("Erp.Platform.Entities.PaymentStatus", b => + { + b.Navigation("Invoices"); + }); + modelBuilder.Entity("Erp.Platform.Entities.PaymentTerm", b => { b.Navigation("PurchaseOrders"); @@ -21465,6 +22288,16 @@ namespace Erp.Platform.Migrations b.Navigation("Items"); }); + modelBuilder.Entity("Erp.Platform.Entities.WaybillStatus", b => + { + b.Navigation("Waybills"); + }); + + modelBuilder.Entity("Erp.Platform.Entities.WaybillType", b => + { + b.Navigation("Waybills"); + }); + modelBuilder.Entity("Erp.Platform.Entities.Workcenter", b => { b.Navigation("Operations"); diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251208185357_Initial.cs b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251208215226_Initial.cs similarity index 96% rename from api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251208185357_Initial.cs rename to api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251208215226_Initial.cs index be81d3d9..8963ff57 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251208185357_Initial.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251208215226_Initial.cs @@ -490,6 +490,116 @@ namespace Erp.Platform.Migrations table.PrimaryKey("PK_Acc_B_Cash", x => x.Id); }); + migrationBuilder.CreateTable( + name: "Acc_T_CheckStatus", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + Name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + Description = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), + IsActive = table.Column(type: "bit", nullable: false, defaultValue: 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) + }, + constraints: table => + { + table.PrimaryKey("PK_Acc_T_CheckStatus", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Acc_T_CheckType", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + Name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + Description = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), + IsActive = table.Column(type: "bit", nullable: false, defaultValue: 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) + }, + constraints: table => + { + table.PrimaryKey("PK_Acc_T_CheckType", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Acc_T_InvoiceStatus", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + Name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + Description = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), + IsActive = table.Column(type: "bit", nullable: false, defaultValue: 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) + }, + constraints: table => + { + table.PrimaryKey("PK_Acc_T_InvoiceStatus", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Acc_T_InvoiceType", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + Name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + Description = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), + IsActive = table.Column(type: "bit", nullable: false, defaultValue: 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) + }, + constraints: table => + { + table.PrimaryKey("PK_Acc_T_InvoiceType", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Acc_T_PaymentStatus", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + Name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + Description = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), + IsActive = table.Column(type: "bit", nullable: false, defaultValue: 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) + }, + constraints: table => + { + table.PrimaryKey("PK_Acc_T_PaymentStatus", x => x.Id); + }); + migrationBuilder.CreateTable( name: "Acc_T_WaybillStatus", columns: table => new @@ -5103,6 +5213,55 @@ namespace Erp.Platform.Migrations onDelete: ReferentialAction.Restrict); }); + migrationBuilder.CreateTable( + name: "Acc_B_CheckNote", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: true), + CheckNumber = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + BankName = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), + BranchName = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), + AccountNumber = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), + DrawerName = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), + PayeeName = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), + CurrentAccountId = table.Column(type: "uniqueidentifier", nullable: false), + IssueDate = table.Column(type: "datetime2", nullable: false), + DueDate = table.Column(type: "datetime2", nullable: false), + Amount = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + Currency = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: false), + StatusId = table.Column(type: "uniqueidentifier", nullable: false), + TypeId = table.Column(type: "uniqueidentifier", nullable: false), + BankingDate = table.Column(type: "datetime2", nullable: true), + CollectionDate = table.Column(type: "datetime2", nullable: true), + EndorsedTo = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), + Notes = table.Column(type: "nvarchar(1000)", maxLength: 1000, 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) + }, + constraints: table => + { + table.PrimaryKey("PK_Acc_B_CheckNote", x => x.Id); + table.ForeignKey( + name: "FK_Acc_B_CheckNote_Acc_T_CheckStatus_StatusId", + column: x => x.StatusId, + principalTable: "Acc_T_CheckStatus", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Acc_B_CheckNote_Acc_T_CheckType_TypeId", + column: x => x.TypeId, + principalTable: "Acc_T_CheckType", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + migrationBuilder.CreateTable( name: "Acc_B_CurrentAccount", columns: table => new @@ -5141,31 +5300,92 @@ namespace Erp.Platform.Migrations }); migrationBuilder.CreateTable( - name: "Waybills", + name: "Acc_B_Invoice", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), TenantId = table.Column(type: "uniqueidentifier", nullable: true), BranchId = table.Column(type: "uniqueidentifier", nullable: true), - WaybillNumber = table.Column(type: "nvarchar(max)", nullable: true), + InvoiceNumber = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + InvoiceTypeId = table.Column(type: "uniqueidentifier", nullable: false), + CurrentAccountId = table.Column(type: "uniqueidentifier", nullable: false), + InvoiceDate = table.Column(type: "datetime2", nullable: false), + DueDate = table.Column(type: "datetime2", nullable: false), + DeliveryDate = table.Column(type: "datetime2", nullable: true), + Subtotal = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + TaxAmount = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + DiscountAmount = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + TotalAmount = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + PaidAmount = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + RemainingAmount = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + Currency = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: false), + StatusId = table.Column(type: "uniqueidentifier", nullable: false), + PaymentStatusId = table.Column(type: "uniqueidentifier", nullable: false), + WaybillId = table.Column(type: "uniqueidentifier", nullable: true), + Notes = table.Column(type: "nvarchar(1000)", maxLength: 1000, 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) + }, + constraints: table => + { + table.PrimaryKey("PK_Acc_B_Invoice", x => x.Id); + table.ForeignKey( + name: "FK_Acc_B_Invoice_Acc_B_CurrentAccount_CurrentAccountId", + column: x => x.CurrentAccountId, + principalTable: "Acc_B_CurrentAccount", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Acc_B_Invoice_Acc_T_InvoiceStatus_StatusId", + column: x => x.StatusId, + principalTable: "Acc_T_InvoiceStatus", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Acc_B_Invoice_Acc_T_InvoiceType_InvoiceTypeId", + column: x => x.InvoiceTypeId, + principalTable: "Acc_T_InvoiceType", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Acc_B_Invoice_Acc_T_PaymentStatus_PaymentStatusId", + column: x => x.PaymentStatusId, + principalTable: "Acc_T_PaymentStatus", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Acc_B_Waybill", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: true), + WaybillNumber = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), WaybillTypeId = table.Column(type: "uniqueidentifier", nullable: false), CurrentAccountId = table.Column(type: "uniqueidentifier", nullable: false), WaybillDate = table.Column(type: "datetime2", nullable: false), DeliveryDate = table.Column(type: "datetime2", nullable: true), - Subtotal = table.Column(type: "float", nullable: false), - TaxAmount = table.Column(type: "float", nullable: false), - DiscountAmount = table.Column(type: "float", nullable: false), - TotalAmount = table.Column(type: "float", nullable: false), - Currency = table.Column(type: "nvarchar(max)", nullable: true), + Subtotal = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + TaxAmount = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + DiscountAmount = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + TotalAmount = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + Currency = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: false), WaybillStatusId = table.Column(type: "uniqueidentifier", nullable: false), - IsInvoiced = table.Column(type: "bit", nullable: false), + IsInvoiced = table.Column(type: "bit", nullable: false, defaultValue: false), InvoiceId = table.Column(type: "uniqueidentifier", nullable: true), - DeliveryAddress = table.Column(type: "nvarchar(max)", nullable: true), - ReceiverName = table.Column(type: "nvarchar(max)", nullable: true), - ReceiverPhone = table.Column(type: "nvarchar(max)", nullable: true), - CarrierCompany = table.Column(type: "nvarchar(max)", nullable: true), - TrackingNumber = table.Column(type: "nvarchar(max)", nullable: true), - Notes = table.Column(type: "nvarchar(max)", nullable: true), + DeliveryAddress = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), + ReceiverName = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), + ReceiverPhone = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + CarrierCompany = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), + TrackingNumber = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), + Notes = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), @@ -5176,46 +5396,45 @@ namespace Erp.Platform.Migrations }, constraints: table => { - table.PrimaryKey("PK_Waybills", x => x.Id); + table.PrimaryKey("PK_Acc_B_Waybill", x => x.Id); table.ForeignKey( - name: "FK_Waybills_Acc_B_CurrentAccount_CurrentAccountId", + name: "FK_Acc_B_Waybill_Acc_B_CurrentAccount_CurrentAccountId", column: x => x.CurrentAccountId, principalTable: "Acc_B_CurrentAccount", principalColumn: "Id", - onDelete: ReferentialAction.Cascade); + onDelete: ReferentialAction.Restrict); table.ForeignKey( - name: "FK_Waybills_Acc_T_WaybillStatus_WaybillStatusId", + name: "FK_Acc_B_Waybill_Acc_T_WaybillStatus_WaybillStatusId", column: x => x.WaybillStatusId, principalTable: "Acc_T_WaybillStatus", principalColumn: "Id", - onDelete: ReferentialAction.Cascade); + onDelete: ReferentialAction.Restrict); table.ForeignKey( - name: "FK_Waybills_Acc_T_WaybillType_WaybillTypeId", + name: "FK_Acc_B_Waybill_Acc_T_WaybillType_WaybillTypeId", column: x => x.WaybillTypeId, principalTable: "Acc_T_WaybillType", principalColumn: "Id", - onDelete: ReferentialAction.Cascade); + onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( - name: "WaybillItems", + name: "Acc_B_InvoiceItem", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), TenantId = table.Column(type: "uniqueidentifier", nullable: true), - BranchId = table.Column(type: "uniqueidentifier", nullable: true), - WaybillId = table.Column(type: "uniqueidentifier", nullable: false), - MaterialId = table.Column(type: "uniqueidentifier", nullable: true), - Description = table.Column(type: "nvarchar(max)", nullable: true), - Quantity = table.Column(type: "float", nullable: false), - Unit = table.Column(type: "nvarchar(max)", nullable: true), - UnitPrice = table.Column(type: "float", nullable: false), - LineTotal = table.Column(type: "float", nullable: false), - DiscountRate = table.Column(type: "float", nullable: false), - DiscountAmount = table.Column(type: "float", nullable: false), - TaxRate = table.Column(type: "float", nullable: false), - TaxAmount = table.Column(type: "float", nullable: false), - NetAmount = table.Column(type: "float", nullable: false), + InvoiceId = table.Column(type: "uniqueidentifier", nullable: false), + MaterialId = table.Column(type: "uniqueidentifier", nullable: false), + Uom = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + Description = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: false), + Quantity = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + UnitPrice = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + LineTotal = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + DiscountRate = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + DiscountAmount = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + TaxRate = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + TaxAmount = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + NetAmount = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), @@ -5226,18 +5445,62 @@ namespace Erp.Platform.Migrations }, constraints: table => { - table.PrimaryKey("PK_WaybillItems", x => x.Id); + table.PrimaryKey("PK_Acc_B_InvoiceItem", x => x.Id); table.ForeignKey( - name: "FK_WaybillItems_Scp_T_Material_MaterialId", + name: "FK_Acc_B_InvoiceItem_Acc_B_Invoice_InvoiceId", + column: x => x.InvoiceId, + principalTable: "Acc_B_Invoice", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Acc_B_InvoiceItem_Scp_T_Material_MaterialId", column: x => x.MaterialId, principalTable: "Scp_T_Material", - principalColumn: "Id"); - table.ForeignKey( - name: "FK_WaybillItems_Waybills_WaybillId", - column: x => x.WaybillId, - principalTable: "Waybills", principalColumn: "Id", - onDelete: ReferentialAction.Cascade); + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Acc_B_WaybillItem", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + WaybillId = table.Column(type: "uniqueidentifier", nullable: false), + MaterialId = table.Column(type: "uniqueidentifier", nullable: false), + Uom = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + Description = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: false), + Quantity = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + UnitPrice = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + LineTotal = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + DiscountRate = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + DiscountAmount = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + TaxRate = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + TaxAmount = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + NetAmount = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + 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) + }, + constraints: table => + { + table.PrimaryKey("PK_Acc_B_WaybillItem", x => x.Id); + table.ForeignKey( + name: "FK_Acc_B_WaybillItem_Acc_B_Waybill_WaybillId", + column: x => x.WaybillId, + principalTable: "Acc_B_Waybill", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Acc_B_WaybillItem_Scp_T_Material_MaterialId", + column: x => x.MaterialId, + principalTable: "Scp_T_Material", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( @@ -8190,6 +8453,21 @@ namespace Erp.Platform.Migrations table: "Acc_B_BankAccount", column: "BankId"); + migrationBuilder.CreateIndex( + name: "IX_Acc_B_CheckNote_CurrentAccountId", + table: "Acc_B_CheckNote", + column: "CurrentAccountId"); + + migrationBuilder.CreateIndex( + name: "IX_Acc_B_CheckNote_StatusId", + table: "Acc_B_CheckNote", + column: "StatusId"); + + migrationBuilder.CreateIndex( + name: "IX_Acc_B_CheckNote_TypeId", + table: "Acc_B_CheckNote", + column: "TypeId"); + migrationBuilder.CreateIndex( name: "IX_Acc_B_CurrentAccount_PartnerId", table: "Acc_B_CurrentAccount", @@ -8200,6 +8478,61 @@ namespace Erp.Platform.Migrations table: "Acc_B_CurrentAccount", column: "PaymentTermId"); + migrationBuilder.CreateIndex( + name: "IX_Acc_B_Invoice_CurrentAccountId", + table: "Acc_B_Invoice", + column: "CurrentAccountId"); + + migrationBuilder.CreateIndex( + name: "IX_Acc_B_Invoice_InvoiceTypeId", + table: "Acc_B_Invoice", + column: "InvoiceTypeId"); + + migrationBuilder.CreateIndex( + name: "IX_Acc_B_Invoice_PaymentStatusId", + table: "Acc_B_Invoice", + column: "PaymentStatusId"); + + migrationBuilder.CreateIndex( + name: "IX_Acc_B_Invoice_StatusId", + table: "Acc_B_Invoice", + column: "StatusId"); + + migrationBuilder.CreateIndex( + name: "IX_Acc_B_InvoiceItem_InvoiceId", + table: "Acc_B_InvoiceItem", + column: "InvoiceId"); + + migrationBuilder.CreateIndex( + name: "IX_Acc_B_InvoiceItem_MaterialId", + table: "Acc_B_InvoiceItem", + column: "MaterialId"); + + migrationBuilder.CreateIndex( + name: "IX_Acc_B_Waybill_CurrentAccountId", + table: "Acc_B_Waybill", + column: "CurrentAccountId"); + + migrationBuilder.CreateIndex( + name: "IX_Acc_B_Waybill_WaybillStatusId", + table: "Acc_B_Waybill", + column: "WaybillStatusId"); + + migrationBuilder.CreateIndex( + name: "IX_Acc_B_Waybill_WaybillTypeId", + table: "Acc_B_Waybill", + column: "WaybillTypeId"); + + migrationBuilder.CreateIndex( + name: "IX_Acc_B_WaybillItem_MaterialId", + table: "Acc_B_WaybillItem", + column: "MaterialId"); + + migrationBuilder.CreateIndex( + name: "IX_Acc_B_WaybillItem_WaybillId", + table: "Acc_B_WaybillItem", + column: "WaybillId"); + migrationBuilder.CreateIndex( name: "IX_Adm_T_BlogCategory_Slug", table: "Adm_T_BlogCategory", @@ -9488,30 +9821,13 @@ namespace Erp.Platform.Migrations table: "Str_T_Zone", column: "ZoneTypeId"); - migrationBuilder.CreateIndex( - name: "IX_WaybillItems_MaterialId", - table: "WaybillItems", - column: "MaterialId"); - - migrationBuilder.CreateIndex( - name: "IX_WaybillItems_WaybillId", - table: "WaybillItems", - column: "WaybillId"); - - migrationBuilder.CreateIndex( - name: "IX_Waybills_CurrentAccountId", - table: "Waybills", - column: "CurrentAccountId"); - - migrationBuilder.CreateIndex( - name: "IX_Waybills_WaybillStatusId", - table: "Waybills", - column: "WaybillStatusId"); - - migrationBuilder.CreateIndex( - name: "IX_Waybills_WaybillTypeId", - table: "Waybills", - column: "WaybillTypeId"); + migrationBuilder.AddForeignKey( + name: "FK_Acc_B_CheckNote_Acc_B_CurrentAccount_CurrentAccountId", + table: "Acc_B_CheckNote", + column: "CurrentAccountId", + principalTable: "Acc_B_CurrentAccount", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); migrationBuilder.AddForeignKey( name: "FK_Acc_B_CurrentAccount_Adm_T_Partner_PartnerId", @@ -9703,6 +10019,15 @@ namespace Erp.Platform.Migrations migrationBuilder.DropTable( name: "Acc_B_Cash"); + migrationBuilder.DropTable( + name: "Acc_B_CheckNote"); + + migrationBuilder.DropTable( + name: "Acc_B_InvoiceItem"); + + migrationBuilder.DropTable( + name: "Acc_B_WaybillItem"); + migrationBuilder.DropTable( name: "Adm_T_About"); @@ -10060,9 +10385,6 @@ namespace Erp.Platform.Migrations migrationBuilder.DropTable( name: "Str_T_PutawayCondition"); - migrationBuilder.DropTable( - name: "WaybillItems"); - migrationBuilder.DropTable( name: "AbpEntityChanges"); @@ -10078,6 +10400,18 @@ namespace Erp.Platform.Migrations migrationBuilder.DropTable( name: "AbpUsers"); + migrationBuilder.DropTable( + name: "Acc_T_CheckStatus"); + + migrationBuilder.DropTable( + name: "Acc_T_CheckType"); + + migrationBuilder.DropTable( + name: "Acc_B_Invoice"); + + migrationBuilder.DropTable( + name: "Acc_B_Waybill"); + migrationBuilder.DropTable( name: "Adm_T_BlogCategory"); @@ -10196,10 +10530,25 @@ namespace Erp.Platform.Migrations name: "Str_T_Putaway"); migrationBuilder.DropTable( - name: "Waybills"); + name: "AbpAuditLogs"); migrationBuilder.DropTable( - name: "AbpAuditLogs"); + name: "Acc_T_InvoiceStatus"); + + migrationBuilder.DropTable( + name: "Acc_T_InvoiceType"); + + migrationBuilder.DropTable( + name: "Acc_T_PaymentStatus"); + + migrationBuilder.DropTable( + name: "Acc_B_CurrentAccount"); + + migrationBuilder.DropTable( + name: "Acc_T_WaybillStatus"); + + migrationBuilder.DropTable( + name: "Acc_T_WaybillType"); migrationBuilder.DropTable( name: "Crd_B_RegistrationType"); @@ -10279,15 +10628,6 @@ namespace Erp.Platform.Migrations migrationBuilder.DropTable( name: "Str_T_ReferenceType"); - migrationBuilder.DropTable( - name: "Acc_B_CurrentAccount"); - - migrationBuilder.DropTable( - name: "Acc_T_WaybillStatus"); - - migrationBuilder.DropTable( - name: "Acc_T_WaybillType"); - migrationBuilder.DropTable( name: "Sas_T_Branch"); diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs index d1b7da33..0c671c11 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs @@ -2199,6 +2199,240 @@ namespace Erp.Platform.Migrations b.ToTable("Net_T_Certificate", (string)null); }); + modelBuilder.Entity("Erp.Platform.Entities.CheckNote", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccountNumber") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Amount") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("BankName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("BankingDate") + .HasColumnType("datetime2"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("BranchName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("CheckNumber") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CollectionDate") + .HasColumnType("datetime2"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Currency") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("CurrentAccountId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DrawerName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("DueDate") + .HasColumnType("datetime2"); + + b.Property("EndorsedTo") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IssueDate") + .HasColumnType("datetime2"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Notes") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("PayeeName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("StatusId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TypeId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("CurrentAccountId"); + + b.HasIndex("StatusId"); + + b.HasIndex("TypeId"); + + b.ToTable("Acc_B_CheckNote", (string)null); + }); + + modelBuilder.Entity("Erp.Platform.Entities.CheckStatus", b => + { + b.Property("Id") + .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("Description") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("IsActive") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); + + 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(50) + .HasColumnType("nvarchar(50)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("Acc_T_CheckStatus", (string)null); + }); + + modelBuilder.Entity("Erp.Platform.Entities.CheckType", b => + { + b.Property("Id") + .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("Description") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("IsActive") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); + + 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(50) + .HasColumnType("nvarchar(50)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("Acc_T_CheckType", (string)null); + }); + modelBuilder.Entity("Erp.Platform.Entities.City", b => { b.Property("Id") @@ -5680,6 +5914,363 @@ namespace Erp.Platform.Migrations b.ToTable("Str_T_Inventory", (string)null); }); + modelBuilder.Entity("Erp.Platform.Entities.Invoice", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Currency") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("CurrentAccountId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DeliveryDate") + .HasColumnType("datetime2"); + + b.Property("DiscountAmount") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("DueDate") + .HasColumnType("datetime2"); + + b.Property("InvoiceDate") + .HasColumnType("datetime2"); + + b.Property("InvoiceNumber") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvoiceTypeId") + .HasColumnType("uniqueidentifier"); + + 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("Notes") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("PaidAmount") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("PaymentStatusId") + .HasColumnType("uniqueidentifier"); + + b.Property("RemainingAmount") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("StatusId") + .HasColumnType("uniqueidentifier"); + + b.Property("Subtotal") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("TaxAmount") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TotalAmount") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("WaybillId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("CurrentAccountId"); + + b.HasIndex("InvoiceTypeId"); + + b.HasIndex("PaymentStatusId"); + + b.HasIndex("StatusId"); + + b.ToTable("Acc_B_Invoice", (string)null); + }); + + modelBuilder.Entity("Erp.Platform.Entities.InvoiceItem", b => + { + b.Property("Id") + .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("Description") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("DiscountAmount") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("DiscountRate") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("InvoiceId") + .HasColumnType("uniqueidentifier"); + + 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("LineTotal") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("MaterialId") + .HasColumnType("uniqueidentifier"); + + b.Property("NetAmount") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("Quantity") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("TaxAmount") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("TaxRate") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UnitPrice") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("InvoiceId"); + + b.HasIndex("MaterialId"); + + b.ToTable("Acc_B_InvoiceItem", (string)null); + }); + + modelBuilder.Entity("Erp.Platform.Entities.InvoiceStatus", b => + { + b.Property("Id") + .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("Description") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("IsActive") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); + + 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(50) + .HasColumnType("nvarchar(50)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("Acc_T_InvoiceStatus", (string)null); + }); + + modelBuilder.Entity("Erp.Platform.Entities.InvoiceType", b => + { + b.Property("Id") + .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("Description") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("IsActive") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); + + 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(50) + .HasColumnType("nvarchar(50)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("Acc_T_InvoiceType", (string)null); + }); + modelBuilder.Entity("Erp.Platform.Entities.IpRestriction", b => { b.Property("Id") @@ -9278,6 +9869,64 @@ namespace Erp.Platform.Migrations b.ToTable("Adm_T_PaymentMethod", (string)null); }); + modelBuilder.Entity("Erp.Platform.Entities.PaymentStatus", b => + { + b.Property("Id") + .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("Description") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("IsActive") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); + + 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(50) + .HasColumnType("nvarchar(50)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("Acc_T_PaymentStatus", (string)null); + }); + modelBuilder.Entity("Erp.Platform.Entities.PaymentTerm", b => { b.Property("Id") @@ -14964,7 +15613,8 @@ namespace Erp.Platform.Migrations .HasColumnType("uniqueidentifier"); b.Property("CarrierCompany") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); b.Property("CreationTime") .HasColumnType("datetime2") @@ -14975,7 +15625,9 @@ namespace Erp.Platform.Migrations .HasColumnName("CreatorId"); b.Property("Currency") - .HasColumnType("nvarchar(max)"); + .IsRequired() + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); b.Property("CurrentAccountId") .HasColumnType("uniqueidentifier"); @@ -14989,13 +15641,17 @@ namespace Erp.Platform.Migrations .HasColumnName("DeletionTime"); b.Property("DeliveryAddress") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); b.Property("DeliveryDate") .HasColumnType("datetime2"); - b.Property("DiscountAmount") - .HasColumnType("float"); + b.Property("DiscountAmount") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); b.Property("InvoiceId") .HasColumnType("uniqueidentifier"); @@ -15007,7 +15663,9 @@ namespace Erp.Platform.Migrations .HasColumnName("IsDeleted"); b.Property("IsInvoiced") - .HasColumnType("bit"); + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); b.Property("LastModificationTime") .HasColumnType("datetime2") @@ -15018,35 +15676,50 @@ namespace Erp.Platform.Migrations .HasColumnName("LastModifierId"); b.Property("Notes") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); b.Property("ReceiverName") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); b.Property("ReceiverPhone") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); - b.Property("Subtotal") - .HasColumnType("float"); + b.Property("Subtotal") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); - b.Property("TaxAmount") - .HasColumnType("float"); + b.Property("TaxAmount") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); b.Property("TenantId") .HasColumnType("uniqueidentifier") .HasColumnName("TenantId"); - b.Property("TotalAmount") - .HasColumnType("float"); + b.Property("TotalAmount") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); b.Property("TrackingNumber") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); b.Property("WaybillDate") .HasColumnType("datetime2"); b.Property("WaybillNumber") - .HasColumnType("nvarchar(max)"); + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); b.Property("WaybillStatusId") .HasColumnType("uniqueidentifier"); @@ -15062,7 +15735,7 @@ namespace Erp.Platform.Migrations b.HasIndex("WaybillTypeId"); - b.ToTable("Waybills"); + b.ToTable("Acc_B_Waybill", (string)null); }); modelBuilder.Entity("Erp.Platform.Entities.WaybillItem", b => @@ -15070,9 +15743,6 @@ namespace Erp.Platform.Migrations b.Property("Id") .HasColumnType("uniqueidentifier"); - b.Property("BranchId") - .HasColumnType("uniqueidentifier"); - b.Property("CreationTime") .HasColumnType("datetime2") .HasColumnName("CreationTime"); @@ -15090,13 +15760,21 @@ namespace Erp.Platform.Migrations .HasColumnName("DeletionTime"); b.Property("Description") - .HasColumnType("nvarchar(max)"); + .IsRequired() + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); - b.Property("DiscountAmount") - .HasColumnType("float"); + b.Property("DiscountAmount") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); - b.Property("DiscountRate") - .HasColumnType("float"); + b.Property("DiscountRate") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); b.Property("IsDeleted") .ValueGeneratedOnAdd() @@ -15112,33 +15790,52 @@ namespace Erp.Platform.Migrations .HasColumnType("uniqueidentifier") .HasColumnName("LastModifierId"); - b.Property("LineTotal") - .HasColumnType("float"); + b.Property("LineTotal") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); - b.Property("MaterialId") + b.Property("MaterialId") .HasColumnType("uniqueidentifier"); - b.Property("NetAmount") - .HasColumnType("float"); + b.Property("NetAmount") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); - b.Property("Quantity") - .HasColumnType("float"); + b.Property("Quantity") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); - b.Property("TaxAmount") - .HasColumnType("float"); + b.Property("TaxAmount") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); - b.Property("TaxRate") - .HasColumnType("float"); + b.Property("TaxRate") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); b.Property("TenantId") .HasColumnType("uniqueidentifier") .HasColumnName("TenantId"); - b.Property("Unit") - .HasColumnType("nvarchar(max)"); + b.Property("UnitPrice") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); - b.Property("UnitPrice") - .HasColumnType("float"); + b.Property("Uom") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); b.Property("WaybillId") .HasColumnType("uniqueidentifier"); @@ -15149,7 +15846,7 @@ namespace Erp.Platform.Migrations b.HasIndex("WaybillId"); - b.ToTable("WaybillItems"); + b.ToTable("Acc_B_WaybillItem", (string)null); }); modelBuilder.Entity("Erp.Platform.Entities.WaybillStatus", b => @@ -19063,6 +19760,33 @@ namespace Erp.Platform.Migrations b.Navigation("Training"); }); + modelBuilder.Entity("Erp.Platform.Entities.CheckNote", b => + { + b.HasOne("Erp.Platform.Entities.CurrentAccount", "CurrentAccount") + .WithMany("Checks") + .HasForeignKey("CurrentAccountId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.CheckStatus", "Status") + .WithMany("Checks") + .HasForeignKey("StatusId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.CheckType", "Type") + .WithMany("Checks") + .HasForeignKey("TypeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CurrentAccount"); + + b.Navigation("Status"); + + b.Navigation("Type"); + }); + modelBuilder.Entity("Erp.Platform.Entities.City", b => { b.HasOne("Erp.Platform.Entities.Country", null) @@ -19387,6 +20111,60 @@ namespace Erp.Platform.Migrations b.Navigation("WorkCenter"); }); + modelBuilder.Entity("Erp.Platform.Entities.Invoice", b => + { + b.HasOne("Erp.Platform.Entities.CurrentAccount", "CurrentAccount") + .WithMany("Invoices") + .HasForeignKey("CurrentAccountId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.InvoiceType", "InvoiceType") + .WithMany("Invoices") + .HasForeignKey("InvoiceTypeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.PaymentStatus", "PaymentStatus") + .WithMany("Invoices") + .HasForeignKey("PaymentStatusId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.InvoiceStatus", "Status") + .WithMany("Invoices") + .HasForeignKey("StatusId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CurrentAccount"); + + b.Navigation("InvoiceType"); + + b.Navigation("PaymentStatus"); + + b.Navigation("Status"); + }); + + modelBuilder.Entity("Erp.Platform.Entities.InvoiceItem", b => + { + b.HasOne("Erp.Platform.Entities.Invoice", "Invoice") + .WithMany("Items") + .HasForeignKey("InvoiceId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.Material", "Material") + .WithMany("InvoiceItems") + .HasForeignKey("MaterialId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Invoice"); + + b.Navigation("Material"); + }); + modelBuilder.Entity("Erp.Platform.Entities.JobPosition", b => { b.HasOne("Erp.Platform.Entities.Department", "Department") @@ -20581,21 +21359,21 @@ namespace Erp.Platform.Migrations modelBuilder.Entity("Erp.Platform.Entities.Waybill", b => { b.HasOne("Erp.Platform.Entities.CurrentAccount", "CurrentAccount") - .WithMany() + .WithMany("Waybills") .HasForeignKey("CurrentAccountId") - .OnDelete(DeleteBehavior.Cascade) + .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Erp.Platform.Entities.WaybillStatus", "WaybillStatus") - .WithMany() + .WithMany("Waybills") .HasForeignKey("WaybillStatusId") - .OnDelete(DeleteBehavior.Cascade) + .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Erp.Platform.Entities.WaybillType", "WaybillType") - .WithMany() + .WithMany("Waybills") .HasForeignKey("WaybillTypeId") - .OnDelete(DeleteBehavior.Cascade) + .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("CurrentAccount"); @@ -20608,13 +21386,15 @@ namespace Erp.Platform.Migrations modelBuilder.Entity("Erp.Platform.Entities.WaybillItem", b => { b.HasOne("Erp.Platform.Entities.Material", "Material") - .WithMany() - .HasForeignKey("MaterialId"); + .WithMany("WaybillItems") + .HasForeignKey("MaterialId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); b.HasOne("Erp.Platform.Entities.Waybill", "Waybill") .WithMany("Items") .HasForeignKey("WaybillId") - .OnDelete(DeleteBehavior.Cascade) + .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("Material"); @@ -21004,6 +21784,16 @@ namespace Erp.Platform.Migrations b.Navigation("ProjectPhases"); }); + modelBuilder.Entity("Erp.Platform.Entities.CheckStatus", b => + { + b.Navigation("Checks"); + }); + + modelBuilder.Entity("Erp.Platform.Entities.CheckType", b => + { + b.Navigation("Checks"); + }); + modelBuilder.Entity("Erp.Platform.Entities.City", b => { b.Navigation("Districts"); @@ -21035,6 +21825,15 @@ namespace Erp.Platform.Migrations b.Navigation("Cities"); }); + modelBuilder.Entity("Erp.Platform.Entities.CurrentAccount", b => + { + b.Navigation("Checks"); + + b.Navigation("Invoices"); + + b.Navigation("Waybills"); + }); + modelBuilder.Entity("Erp.Platform.Entities.CustomEntity", b => { b.Navigation("Fields"); @@ -21120,6 +21919,21 @@ namespace Erp.Platform.Migrations b.Navigation("Faults"); }); + modelBuilder.Entity("Erp.Platform.Entities.Invoice", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("Erp.Platform.Entities.InvoiceStatus", b => + { + b.Navigation("Invoices"); + }); + + modelBuilder.Entity("Erp.Platform.Entities.InvoiceType", b => + { + b.Navigation("Invoices"); + }); + modelBuilder.Entity("Erp.Platform.Entities.Location", b => { b.Navigation("MovementItems"); @@ -21141,6 +21955,8 @@ namespace Erp.Platform.Migrations b.Navigation("Boms"); + b.Navigation("InvoiceItems"); + b.Navigation("MovementItems"); b.Navigation("PurchaseOrderItems"); @@ -21155,6 +21971,8 @@ namespace Erp.Platform.Migrations b.Navigation("Suppliers"); + b.Navigation("WaybillItems"); + b.Navigation("WorkorderMaterials"); }); @@ -21222,6 +22040,11 @@ namespace Erp.Platform.Migrations b.Navigation("Quotations"); }); + modelBuilder.Entity("Erp.Platform.Entities.PaymentStatus", b => + { + b.Navigation("Invoices"); + }); + modelBuilder.Entity("Erp.Platform.Entities.PaymentTerm", b => { b.Navigation("PurchaseOrders"); @@ -21462,6 +22285,16 @@ namespace Erp.Platform.Migrations b.Navigation("Items"); }); + modelBuilder.Entity("Erp.Platform.Entities.WaybillStatus", b => + { + b.Navigation("Waybills"); + }); + + modelBuilder.Entity("Erp.Platform.Entities.WaybillType", b => + { + b.Navigation("Waybills"); + }); + modelBuilder.Entity("Erp.Platform.Entities.Workcenter", b => { b.Navigation("Operations"); diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json index f11e7e36..ac7d9bbc 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json +++ b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json @@ -6732,5 +6732,120 @@ "description": "Malzeme iadeleri için kullanılan irsaliye türü", "isActive": true } - ] + ], + "InvoiceTypes": [ + { + "name": "Satış", + "description": "Satış faturası türü", + "isActive": true + }, + { + "name": "Satın Alma", + "description": "Satın alma faturası türü", + "isActive": true + }, + { + "name": "İade", + "description": "İade faturası türü", + "isActive": true + }, + { + "name": "Proforma", + "description": "Proforma faturası türü", + "isActive": true + } + ], + "InvoiceStatuses": [ + { + "name": "Taslak", + "description": "Faturanın taslak aşamasında olduğunu ifade eder", + "isActive": true + }, + { + "name": "Onaylandı", + "description": "Faturanın onaylandığını ifade eder", + "isActive": true + }, + { + "name": "Gönderildi", + "description": "Faturanın gönderildiğini ifade eder", + "isActive": true + }, + { + "name": "Ödendi", + "description": "Faturanın ödendiğini ifade eder", + "isActive": true + }, + { + "name": "İptal Edildi", + "description": "Faturanın iptal edildiğini ifade eder", + "isActive": true + } + ], + "PaymentStatuses": [ + { + "name": "Ödenmemiş", + "description": "Faturanın ödenmemiş olduğunu ifade eder", + "isActive": true + }, + { + "name": "Kısmen Ödenmiş", + "description": "Faturanın kısmen ödendiğini ifade eder", + "isActive": true + }, + { + "name": "Tamamen Ödenmiş", + "description": "Faturanın tamamen ödendiğini ifade eder", + "isActive": true + }, + { + "name": "Vadesi Geçmiş", + "description": "Faturanın gecikmiş olduğunu ifade eder", + "isActive": true + } + ], + "CheckStatuses": [ + { + "name": "Cüzdanda", + "description": "Çek henüz bankaya verilmemiştir", + "isActive": true + }, + { + "name": "Hesaba Yatırıldı", + "description": "Çek bankaya yatırılmıştır", + "isActive": true + }, + { + "name": "Tahsil Edildi", + "description": "Çek tahsil edilmiştir", + "isActive": true + }, + { + "name": "İade Oldu", + "description": "Çek iade olmuştur", + "isActive": true + }, + { + "name": "Ciro Edildi", + "description": "Çek ciro edilmiştir", + "isActive": true + }, + { + "name": "İptal Edildi", + "description": "Çek iptal edilmiştir", + "isActive": true + } + ], + "CheckTypes": [ + { + "name": "Alınan", + "description": "Alınan çekler", + "isActive": true + }, + { + "name": "Verilen", + "description": "Verilen çekler", + "isActive": true + } + ] } \ No newline at end of file diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs index 63c1b0a7..250a46d8 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs @@ -14,7 +14,7 @@ using System.Linq; using System.Collections.Generic; using Volo.Abp.Identity; using Volo.Abp.Timing; -using System.Security.Cryptography.Xml; +using Volo.Abp; namespace Erp.Platform.Data.Seeds; @@ -149,6 +149,11 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency private readonly IRepository _movementItemRepository; private readonly IRepository _waybillStatusRepository; private readonly IRepository _waybillTypeRepository; + private readonly IRepository _invoiceTypeRepository; + private readonly IRepository _invoiceStatusRepository; + private readonly IRepository _paymentStatusRepository; + private readonly IRepository _checkStatusRepository; + private readonly IRepository _checkTypeRepository; public TenantDataSeeder( IClock clock, @@ -279,7 +284,12 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency IRepository movementRepository, IRepository movementItemRepository, IRepository waybillStatusRepository, - IRepository waybillTypeRepository + IRepository waybillTypeRepository, + IRepository invoiceTypeRepository, + IRepository invoiceStatusRepository, + IRepository paymentStatusRepository, + IRepository checkStatusRepository, + IRepository checkTypeRepository ) { _clock = clock; @@ -412,6 +422,11 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency _movementItemRepository = movementItemRepository; _waybillStatusRepository = waybillStatusRepository; _waybillTypeRepository = waybillTypeRepository; + _invoiceTypeRepository = invoiceTypeRepository; + _invoiceStatusRepository = invoiceStatusRepository; + _paymentStatusRepository = paymentStatusRepository; + _checkStatusRepository = checkStatusRepository; + _checkTypeRepository = checkTypeRepository; } private static IConfigurationRoot BuildConfiguration() @@ -2878,6 +2893,76 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency IsActive = item.IsActive }, autoSave: true); } + + foreach (var item in items.InvoiceTypes) + { + var exists = await _invoiceTypeRepository.AnyAsync(x => x.Name == item.Name); + if (exists) + continue; + + await _invoiceTypeRepository.InsertAsync(new InvoiceType + { + Name = item.Name, + Description = item.Description, + IsActive = item.IsActive + }, autoSave: true); + } + + foreach (var item in items.InvoiceStatuses) + { + var exists = await _invoiceStatusRepository.AnyAsync(x => x.Name == item.Name); + if (exists) + continue; + + await _invoiceStatusRepository.InsertAsync(new InvoiceStatus + { + Name = item.Name, + Description = item.Description, + IsActive = item.IsActive + }, autoSave: true); + } + + foreach (var item in items.PaymentStatuses) + { + var exists = await _paymentStatusRepository.AnyAsync(x => x.Name == item.Name); + if (exists) + continue; + + await _paymentStatusRepository.InsertAsync(new PaymentStatus + { + Name = item.Name, + Description = item.Description, + IsActive = item.IsActive + }, autoSave: true); + } + + foreach (var item in items.CheckStatuses) + { + var exists = await _checkStatusRepository.AnyAsync(x => x.Name == item.Name); + if (exists) + continue; + + await _checkStatusRepository.InsertAsync(new CheckStatus + { + Name = item.Name, + Description = item.Description, + IsActive = item.IsActive + }, autoSave: true); + } + + foreach (var item in items.CheckTypes) + { + var exists = await _checkTypeRepository.AnyAsync(x => x.Name == item.Name); + if (exists) + continue; + + await _checkTypeRepository.InsertAsync(new CheckType + { + Name = item.Name, + Description = item.Description, + IsActive = item.IsActive + }, autoSave: true); + } } } diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs index b53090c5..a2f8822f 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs @@ -151,6 +151,46 @@ public class TenantSeederDto //Accounting public List WaybillTypes { get; set; } public List WaybillStatuses { get; set; } + public List InvoiceTypes { get; set; } + public List InvoiceStatuses { get; set; } + public List PaymentStatuses { get; set; } + public List CheckStatuses { get; set; } + public List CheckTypes { get; set; } +} + +public class CheckTypeSeedDto +{ + public string Name { get; set; } + public string Description { get; set; } + public bool IsActive { get; set; } +} + +public class CheckStatusSeedDto +{ + public string Name { get; set; } + public string Description { get; set; } + public bool IsActive { get; set; } +} + +public class PaymentStatusSeedDto +{ + public string Name { get; set; } + public string Description { get; set; } + public bool IsActive { get; set; } +} + +public class InvoiceStatusSeedDto +{ + public string Name { get; set; } + public string Description { get; set; } + public bool IsActive { get; set; } +} + +public class InvoiceTypeSeedDto +{ + public string Name { get; set; } + public string Description { get; set; } + public bool IsActive { get; set; } } public class WaybillTypeSeedDto