From 5e1626237175e7b636ef7f39290dcdc3d983c5a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sedat=20=C3=96zt=C3=BCrk?= Date: Tue, 25 Nov 2025 22:55:52 +0300 Subject: [PATCH] Accounting --- .../Seeds/ListFormSeeder_Accounting.cs | 534 +++++++++++++++++- .../Seeds/ListFormSeeder_Administration.cs | 4 +- .../Seeds/ListFormSeeder_Saas.cs | 4 +- .../Seeds/MenusData.json | 44 +- .../Enums/TableNameEnum.cs | 2 + .../TableNameResolver.cs | 2 + .../Branch/BranchSeedManager.cs | 118 +++- .../Branch/BranchSeederDto.cs | 42 ++ .../Branch/Seeds/BranchData.json | 104 +++- .../Erp.Platform.Domain/Data/SeedConsts.cs | 2 + .../Entities/Branch/Accounting/Bank.cs | 2 +- .../Entities/Branch/Accounting/Cash.cs | 19 + .../Branch/Accounting/CurrentAccount.cs | 31 + .../Entities/Tenant/Administration/Contact.cs | 2 +- .../Entities/Tenant/Administration/Lawyer.cs | 2 +- .../EntityFrameworkCore/PlatformDbContext.cs | 36 +- ....cs => 20251125193313_Initial.Designer.cs} | 217 ++++++- ...9_Initial.cs => 20251125193313_Initial.cs} | 98 +++- .../PlatformDbContextModelSnapshot.cs | 215 ++++++- .../Tenants/TenantSeederDto.cs | 2 +- 20 files changed, 1400 insertions(+), 80 deletions(-) create mode 100644 api/src/Erp.Platform.Domain/Entities/Branch/Accounting/Cash.cs create mode 100644 api/src/Erp.Platform.Domain/Entities/Branch/Accounting/CurrentAccount.cs rename api/src/Erp.Platform.EntityFrameworkCore/Migrations/{20251125115039_Initial.Designer.cs => 20251125193313_Initial.Designer.cs} (98%) rename api/src/Erp.Platform.EntityFrameworkCore/Migrations/{20251125115039_Initial.cs => 20251125193313_Initial.cs} (98%) diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Accounting.cs b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Accounting.cs index 14385dad..d67de393 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Accounting.cs +++ b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Accounting.cs @@ -82,14 +82,14 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.Bank)), DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson, PagerOptionJson = DefaultPagerOptionJson, - EditingOptionJson = DefaultEditingOptionJson(listFormName, 600, 600, true, true, true, true, false), + EditingOptionJson = DefaultEditingOptionJson(listFormName, 600, 400, 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 = "BranchId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 1, DataField = "BranchId", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 2, DataField = "Code", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox}, new EditingFormItemDto { Order = 3, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 4, DataField = "IdentifierCode", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox}, new EditingFormItemDto { Order = 5, DataField = "Address1", ColSpan = 1, EditorType2=EditorTypes.dxTextBox }, new EditingFormItemDto { Order = 6, DataField = "Address2", ColSpan = 1, EditorType2=EditorTypes.dxTextBox }, new EditingFormItemDto { Order = 7, DataField = "Country", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, @@ -159,14 +159,12 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende ListFormCode = listForm.ListFormCode, CultureName = LanguageCodes.En, SourceDbType = DbType.String, - FieldName = "Name", - Width = 150, + FieldName = "Code", + Width = 200, ListOrderNo = 3, Visible = true, IsActive = true, IsDeleted = false, - SortIndex = 1, - SortDirection = GridColumnOptions.SortOrderAsc, AllowSearch = true, ValidationRuleJson = DefaultValidationRuleRequiredJson, ColumnCustomizationJson = DefaultColumnCustomizationJson, @@ -177,12 +175,14 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende ListFormCode = listForm.ListFormCode, CultureName = LanguageCodes.En, SourceDbType = DbType.String, - FieldName = "IdentifierCode", - Width = 150, + FieldName = "Name", + Width = 200, ListOrderNo = 4, Visible = true, IsActive = true, IsDeleted = false, + SortIndex = 1, + SortDirection = GridColumnOptions.SortOrderAsc, AllowSearch = true, ValidationRuleJson = DefaultValidationRuleRequiredJson, ColumnCustomizationJson = DefaultColumnCustomizationJson, @@ -330,7 +330,7 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende CultureName = LanguageCodes.En, SourceDbType = DbType.String, FieldName = "Email", - Width = 150, + Width = 200, ListOrderNo = 12, Visible = true, IsActive = true, @@ -510,6 +510,520 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende }, }) ); + + #region Cash + listFormName = AppCodes.Accounting.Cash; + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName)) + { + var listForm = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + ShowNote = true, + LayoutJson = DefaultLayoutJson, + CultureName = LanguageCodes.En, + ListFormCode = listFormName, + Name = listFormName, + Title = listFormName, + Description = listFormName, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = true, + IsOrganizationUnit = false, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Cash)), + 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.Cash)), + DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson, + PagerOptionJson = DefaultPagerOptionJson, + EditingOptionJson = DefaultEditingOptionJson(listFormName, 600, 300, true, true, true, true, false), + EditingFormJson = JsonSerializer.Serialize(new List() { + new() { + Order=1, ColCount=1, ColSpan=1, ItemType="group", Items = + [ + new EditingFormItemDto { Order = 1, DataField = "BranchId", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 2, DataField = "Code", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 3, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 4, DataField = "Description", ColSpan = 1, EditorType2=EditorTypes.dxTextArea }, + new EditingFormItemDto { Order = 5, DataField = "Currency", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.NumberStandartFormat }, + new EditingFormItemDto { Order = 6, DataField = "IsActive", ColSpan = 1, EditorType2=EditorTypes.dxCheckBox }, + ]} + }), + InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson, + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { FieldName = "Currency", FieldDbType = DbType.String, Value = "TRY", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "IsActive", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value } + }) + } + , autoSave: true); + + #region Cash Fields + await _listFormFieldRepository.InsertManyAsync([ + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 0, + Visible = false, + IsActive = true, + IsDeleted = false, + SortIndex = 0, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "BranchId", + Width = 150, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + LookupJson = JsonSerializer.Serialize( + new LookupDto { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = LookupQueryValues.BranchValues, + } + ), + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Code", + Width = 150, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 150, + ListOrderNo = 4, + 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 = 300, + ListOrderNo = 5, + 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.String, + FieldName = "Currency", + Width = 150, + ListOrderNo = 6, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Currency), "Code", "Name"), + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Decimal, + FieldName = "Balance", + Format = "fixedPoint", + Alignment = "right", + Width = 100, + ListOrderNo = 7, + 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 = 8, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + } + ], autoSave: true); + #endregion + } + #endregion + + #region CurrentAccount + listFormName = AppCodes.Accounting.CurrentAccount; + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName)) + { + var listForm = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + ShowNote = true, + LayoutJson = DefaultLayoutJson, + CultureName = LanguageCodes.En, + ListFormCode = listFormName, + Name = listFormName, + Title = listFormName, + Description = listFormName, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = true, + IsOrganizationUnit = false, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.CurrentAccount)), + 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.CurrentAccount)), + DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson, + PagerOptionJson = DefaultPagerOptionJson, + EditingOptionJson = DefaultEditingOptionJson(listFormName, 600, 500, true, true, true, true, false), + EditingFormJson = JsonSerializer.Serialize(new List() { + new() { + Order=1, ColCount=1, ColSpan=1, ItemType="group", Items = + [ + new EditingFormItemDto { Order = 1, DataField = "BranchId", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 2, DataField = "PartnerId", ColSpan = 1, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 3, DataField = "Code", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 4, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 5, DataField = "Description", ColSpan = 1, EditorType2=EditorTypes.dxTextArea }, + new EditingFormItemDto { Order = 6, DataField = "TaxNumber", ColSpan = 1, EditorType2=EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order = 7, DataField = "TaxOffice", ColSpan = 1, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 8, DataField = "CreditLimit", ColSpan = 1, EditorType2=EditorTypes.dxNumberBox, EditorOptions=EditorOptionValues.NumberStandartFormat }, + new EditingFormItemDto { Order = 9, DataField = "Currency", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 10, DataField = "Risk", ColSpan = 1, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 11, DataField = "PaymentTermId", ColSpan = 1, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 12, DataField = "IsActive", ColSpan = 1, EditorType2=EditorTypes.dxCheckBox }, + ]} + }), + InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson, + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { FieldName = "Currency", FieldDbType = DbType.String, Value = "TRY", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "CreditLimit", FieldDbType = DbType.Decimal, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "IsActive", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "Risk", FieldDbType = DbType.String, Value = "Low", CustomValueType = FieldCustomValueTypeEnum.Value } + }) + } + , autoSave: true); + + #region CurrentAccount Fields + await _listFormFieldRepository.InsertManyAsync([ + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 0, + Visible = false, + IsActive = true, + IsDeleted = false, + SortIndex = 0, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "BranchId", + Width = 150, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + LookupJson = JsonSerializer.Serialize( + new LookupDto { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = LookupQueryValues.BranchValues, + } + ), + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "PartnerId", + Width = 250, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Partner), "Id", "Name"), + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Code", + Width = 150, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 150, + ListOrderNo = 5, + 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 = 300, + ListOrderNo = 6, + 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.Int64, + FieldName = "TaxNumber", + Width = 100, + ListOrderNo = 7, + 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.String, + FieldName = "TaxOffice", + Width = 100, + ListOrderNo = 8, + 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.Decimal, + FieldName = "CreditLimit", + Format = "fixedPoint", + Alignment = "right", + Width = 100, + ListOrderNo = 9, + 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.Decimal, + FieldName = "Balance", + Format = "fixedPoint", + Alignment = "right", + Width = 100, + ListOrderNo = 10, + 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.String, + FieldName = "Currency", + Width = 150, + ListOrderNo = 11, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Currency), "Code", "Name"), + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() + { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Risk", + Width = 100, + ListOrderNo = 12, + Visible = true, + IsActive = true, + IsDeleted = false, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.StaticData, + DisplayExpr = "name", + ValueExpr = "key", + LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] { + new () { Key = "Low", Name = "Low" }, + new () { Key = "Medium", Name = "Medium" }, + new () { Key = "High", Name = "High" }, + new () { Key = "Blocked", Name = "Blocked" }, + }), + }), + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() + { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "PaymentTermId", + Width = 100, + ListOrderNo = 13, + Visible = true, + IsActive = true, + IsDeleted = false, + LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.PaymentTerm), "Id", "Name"), + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "IsActive", + Width = 100, + ListOrderNo = 13, + 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/ListFormSeeder_Administration.cs b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Administration.cs index a5a54426..248366cb 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Administration.cs +++ b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Administration.cs @@ -3553,7 +3553,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep new EditingFormItemDto { Order = 2, DataField = "PhoneNumber", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox, EditorOptions=EditorOptionValues.PhoneEditorOptions }, new EditingFormItemDto { Order = 3, DataField = "Email", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, new EditingFormItemDto { Order = 4, DataField = "Location", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 5, DataField = "TaxNumber", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 5, DataField = "TaxNumber", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxNumberBox }, new EditingFormItemDto { Order = 6, DataField = "BankJson", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextArea, EditorOptions="{\"height\":100}" }, new EditingFormItemDto { Order = 7, DataField = "WorkHoursJson", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextArea, EditorOptions="{\"height\":100}" }, new EditingFormItemDto { Order = 8, DataField = "MapJson", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextArea, EditorOptions="{\"height\":100}" }, @@ -5644,7 +5644,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep new EditingFormItemDto { Order = 5, DataField = "FaxNumber", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox, EditorOptions=EditorOptionValues.PhoneEditorOptions }, new EditingFormItemDto { Order = 6, DataField = "Address", ColSpan = 1, EditorType2 = EditorTypes.dxTextArea }, new EditingFormItemDto { Order = 7, DataField = "TaxOffice", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 8, DataField = "TaxNumber", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 8, DataField = "TaxNumber", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox }, new EditingFormItemDto { Order = 9, DataField = "Description", ColSpan = 1, EditorType2 = EditorTypes.dxTextArea }, new EditingFormItemDto { Order = 10, DataField = "Status", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, ]} diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Saas.cs b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Saas.cs index fbc19c8c..e7f6349d 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Saas.cs +++ b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Saas.cs @@ -82,7 +82,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency ColumnOptionJson = DefaultColumnOptionJson, PermissionJson = DefaultPermissionJson(TenantManagementPermissions.Tenants.Create, TenantManagementPermissions.Tenants.Default, TenantManagementPermissions.Tenants.Update, TenantManagementPermissions.Tenants.Delete, TenantManagementPermissions.Tenants.Default + ".Export", TenantManagementPermissions.Tenants.Default + ".Import", TenantManagementPermissions.Tenants.Default + ".Note"), PagerOptionJson = DefaultPagerOptionJson, - EditingOptionJson = DefaultEditingOptionJson(TenantManagementPermissions.Tenants.Default, 800, 700, true, true, true, true, false), + EditingOptionJson = DefaultEditingOptionJson(TenantManagementPermissions.Tenants.Default, 800, 650, true, true, true, true, false), EditingFormJson = JsonSerializer.Serialize(new List() { new() { Order=1, ColCount=1, ColSpan=1, ItemType="group", Items = @@ -555,7 +555,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency ColumnOptionJson = DefaultColumnOptionJson, PermissionJson = DefaultPermissionJson(listFormName), PagerOptionJson = DefaultPagerOptionJson, - EditingOptionJson = DefaultEditingOptionJson(listFormName, 800, 700, true, true, true, true, false), + EditingOptionJson = DefaultEditingOptionJson(listFormName, 800, 650, true, true, true, true, false), EditingFormJson = JsonSerializer.Serialize(new List() { new() { Order=1, ColCount=1, ColSpan=1, ItemType="group", Items = diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/MenusData.json b/api/src/Erp.Platform.DbMigrator/Seeds/MenusData.json index 9b9834b1..e97f267e 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/MenusData.json +++ b/api/src/Erp.Platform.DbMigrator/Seeds/MenusData.json @@ -2968,13 +2968,23 @@ "RequiredPermissionName": null, "IsDisabled": false }, + { + "ParentCode": "App.Accounting", + "Code": "App.Accounting.Cash", + "DisplayName": "App.Accounting.Cash", + "Order": 1, + "Url": "/admin/list/App.Accounting.Cash", + "Icon": "FcCurrencyExchange", + "RequiredPermissionName": "App.Accounting.Cash", + "IsDisabled": false + }, { "ParentCode": "App.Accounting", "Code": "App.Accounting.Bank", "DisplayName": "App.Accounting.Bank", - "Order": 1, + "Order": 2, "Url": "/admin/list/App.Accounting.Bank", - "Icon": "FcMoneyTransfer", + "Icon": "FcHome", "RequiredPermissionName": "App.Accounting.Bank", "IsDisabled": false }, @@ -2982,8 +2992,8 @@ "ParentCode": "App.Accounting", "Code": "App.Accounting.CurrentAccount", "DisplayName": "App.Accounting.CurrentAccount", - "Order": 2, - "Url": "/admin/accounting/current-accounts", + "Order": 3, + "Url": "/admin/list/App.Accounting.CurrentAccount", "Icon": "FcDebt", "RequiredPermissionName": "App.Accounting.CurrentAccount", "IsDisabled": false @@ -2992,7 +3002,7 @@ "ParentCode": "App.Accounting", "Code": "App.Accounting.Waybill", "DisplayName": "App.Accounting.Waybill", - "Order": 3, + "Order": 4, "Url": "/admin/accounting/waybills", "Icon": "FcSurvey", "RequiredPermissionName": "App.Accounting.Waybill", @@ -3002,37 +3012,17 @@ "ParentCode": "App.Accounting", "Code": "App.Accounting.Invoice", "DisplayName": "App.Accounting.Invoice", - "Order": 4, + "Order": 5, "Url": "/admin/accounting/invoices", "Icon": "FcSalesPerformance", "RequiredPermissionName": "App.Accounting.Invoice", "IsDisabled": false }, - { - "ParentCode": "App.Accounting", - "Code": "App.Accounting.Cash", - "DisplayName": "App.Accounting.Cash", - "Order": 5, - "Url": "/admin/accounting/cash", - "Icon": "FcMoneyTransfer", - "RequiredPermissionName": "App.Accounting.Cash", - "IsDisabled": false - }, - { - "ParentCode": "App.Accounting", - "Code": "App.Accounting.Bank", - "DisplayName": "App.Accounting.Bank", - "Order": 6, - "Url": "/admin/accounting/bank", - "Icon": "FcSalesPerformance", - "RequiredPermissionName": "App.Accounting.Bank", - "IsDisabled": false - }, { "ParentCode": "App.Accounting", "Code": "App.Accounting.CheckNote", "DisplayName": "App.Accounting.CheckNote", - "Order": 7, + "Order": 6, "Url": "/admin/accounting/check-note", "Icon": "FcInspection", "RequiredPermissionName": "App.Accounting.CheckNote", diff --git a/api/src/Erp.Platform.Domain.Shared/Enums/TableNameEnum.cs b/api/src/Erp.Platform.Domain.Shared/Enums/TableNameEnum.cs index 1d959cab..150a079a 100644 --- a/api/src/Erp.Platform.Domain.Shared/Enums/TableNameEnum.cs +++ b/api/src/Erp.Platform.Domain.Shared/Enums/TableNameEnum.cs @@ -55,6 +55,8 @@ public enum TableNameEnum Uom, Bank, BankAccount, + Cash, + CurrentAccount, Schedule, ScheduleLesson, Program, diff --git a/api/src/Erp.Platform.Domain.Shared/TableNameResolver.cs b/api/src/Erp.Platform.Domain.Shared/TableNameResolver.cs index 326d45d9..35c20155 100644 --- a/api/src/Erp.Platform.Domain.Shared/TableNameResolver.cs +++ b/api/src/Erp.Platform.Domain.Shared/TableNameResolver.cs @@ -204,6 +204,8 @@ public static class TableNameResolver // 🔹 ACCOUNTING { nameof(TableNameEnum.Bank), (TablePrefix.TenantByName, MenuPrefix.Accounting) }, { nameof(TableNameEnum.BankAccount), (TablePrefix.TenantByName, MenuPrefix.Accounting) }, + { nameof(TableNameEnum.Cash), (TablePrefix.TenantByName, MenuPrefix.Accounting) }, + { nameof(TableNameEnum.CurrentAccount), (TablePrefix.TenantByName, MenuPrefix.Accounting) }, // 🔹 STORE { nameof(TableNameEnum.WarehouseType), (TablePrefix.TenantByName, MenuPrefix.Store) }, diff --git a/api/src/Erp.Platform.Domain/Branch/BranchSeedManager.cs b/api/src/Erp.Platform.Domain/Branch/BranchSeedManager.cs index e9518837..d87bc965 100644 --- a/api/src/Erp.Platform.Domain/Branch/BranchSeedManager.cs +++ b/api/src/Erp.Platform.Domain/Branch/BranchSeedManager.cs @@ -20,6 +20,9 @@ public class BranchSeedManager : DomainService private readonly IRepository _lessonPeriodRepository; private readonly IRepository _scheduleRepository; private readonly IRepository _mealRepository; + private readonly IRepository _bankRepository; + private readonly IRepository _cashRepository; + private readonly IRepository _currentAccountRepository; public BranchSeedManager( IRepository branchRepository, @@ -30,7 +33,10 @@ public class BranchSeedManager : DomainService IRepository levelRepository, IRepository lessonPeriodRepository, IRepository scheduleRepository, - IRepository mealRepository + IRepository mealRepository, + IRepository bankRepository, + IRepository cashRepository, + IRepository currentAccountRepository ) { _branchRepository = branchRepository; @@ -42,6 +48,9 @@ public class BranchSeedManager : DomainService _lessonPeriodRepository = lessonPeriodRepository; _scheduleRepository = scheduleRepository; _mealRepository = mealRepository; + _bankRepository = bankRepository; + _cashRepository = cashRepository; + _currentAccountRepository = currentAccountRepository; } public async Task SeedRecordsAsync(Guid? tenantId, Guid branchId) @@ -380,6 +389,113 @@ public class BranchSeedManager : DomainService result.Details.Add(mealLog); } + if (items.Banks.Count > 0) + { + var bankLog = CreateLog(nameof(Bank)); + foreach (var item in items.Banks) + { + var exists = await _bankRepository.AnyAsync(x => x.Code == item.Code && x.BranchId == branchId); + + if (!exists) + { + await _bankRepository.InsertAsync(new() + { + TenantId = tenantId, + BranchId = branchId, + Code = item.Code, + Name = item.Name, + Address1 = item.Address1, + Address2 = item.Address2, + Country = item.Country, + City = item.City, + District = item.District, + PostalCode = item.PostalCode, + PhoneNumber = item.PhoneNumber, + Email = item.Email + }); + + bankLog.InsertedCount++; + bankLog.InsertedItems.Add( + $"{{ " + + $"\"code\": \"{item.Code}\", " + + $"\"name\": \"{item.Name}\", " + + $"}}" + ); + } + } + result.Details.Add(bankLog); + } + + if (items.Cashes.Count > 0) + { + var cashLog = CreateLog(nameof(Cash)); + foreach (var item in items.Cashes) + { + var exists = await _cashRepository.AnyAsync(x => x.Code == item.Code && x.BranchId == branchId); + + if (!exists) + { + await _cashRepository.InsertAsync(new() + { + TenantId = tenantId, + BranchId = branchId, + Code = item.Code, + Name = item.Name, + Description = item.Description, + Currency = item.Currency, + Balance = item.Balance, + IsActive = item.IsActive + }); + + cashLog.InsertedCount++; + cashLog.InsertedItems.Add( + $"{{ " + + $"\"code\": \"{item.Code}\", " + + $"\"name\": \"{item.Name}\", " + + $"}}" + ); + } + } + result.Details.Add(cashLog); + } + + if (items.CurrentAccounts.Count > 0) + { + var currentAccountLog = CreateLog(nameof(CurrentAccount)); + foreach (var item in items.CurrentAccounts) + { + var exists = await _currentAccountRepository.AnyAsync(x => x.Code == item.Code && x.BranchId == branchId); + + if (!exists) + { + await _currentAccountRepository.InsertAsync(new() + { + TenantId = tenantId, + BranchId = branchId, + Code = item.Code, + Name = item.Name, + Description = item.Description, + TaxNumber = item.TaxNumber, + TaxOffice = item.TaxOffice, + CreditLimit = item.CreditLimit, + Balance = item.Balance, + Currency = item.Currency, + Risk = item.Risk, + IsActive = item.IsActive + }); + + currentAccountLog.InsertedCount++; + currentAccountLog.InsertedItems.Add( + $"{{ " + + $"\"code\": \"{item.Code}\", " + + $"\"name\": \"{item.Name}\", " + + $"}}" + ); + } + } + result.Details.Add(currentAccountLog); + } + result.Success = true; result.Message = $"Seed işlemi başarıyla tamamlandı. Toplam {result.TotalInsertedCount} kayıt eklendi."; return result; diff --git a/api/src/Erp.Platform.Domain/Branch/BranchSeederDto.cs b/api/src/Erp.Platform.Domain/Branch/BranchSeederDto.cs index 5b532405..5c9ca1e7 100644 --- a/api/src/Erp.Platform.Domain/Branch/BranchSeederDto.cs +++ b/api/src/Erp.Platform.Domain/Branch/BranchSeederDto.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using Erp.Platform.Entities; namespace Erp.Platform.Branchs; @@ -13,6 +14,47 @@ public class BranchSeederDto public List LessonPeriods { get; set; } public List Schedules { get; set; } public List Meals { get; set; } + public List Banks { get; set; } + public List Cashes { get; set; } + public List CurrentAccounts { get; set; } +} + +public class CurrentAccountSeedDto +{ + public string Code { get; set; } + public string Name { get; set; } + public string Description { get; set; } + public long? TaxNumber { get; set; } + public string TaxOffice { get; set; } + public decimal CreditLimit { get; set; } + public decimal Balance { get; set; } + public string Currency { get; set; } + public string Risk { get; set; } //Low, Medium, High, Blocked + public bool IsActive { get; set; } +} + +public class CashSeedDto +{ + public string Code { get; set; } + public string Name { get; set; } + public string Description { get; set; } + public string Currency { get; set; } + public decimal Balance { get; set; } + public bool IsActive { get; set; } +} + +public class BankSeedDto +{ + public string Code { get; set; } + public string Name { get; set; } + public string Address1 { get; set; } + public string Address2 { get; set; } + public string Country { get; set; } + public string City { get; set; } + public string District { get; set; } + public string PostalCode { get; set; } + public string PhoneNumber { get; set; } + public string Email { get; set; } } public class MealSeedDto diff --git a/api/src/Erp.Platform.Domain/Branch/Seeds/BranchData.json b/api/src/Erp.Platform.Domain/Branch/Seeds/BranchData.json index 3eb842ea..0ca91908 100644 --- a/api/src/Erp.Platform.Domain/Branch/Seeds/BranchData.json +++ b/api/src/Erp.Platform.Domain/Branch/Seeds/BranchData.json @@ -840,5 +840,107 @@ "totalCalorie": 490, "materials": "Mercimek Çorbası|Tavuk Şinitzel|Bulgur Pilavı|Salata|Meyve" } + ], + "Banks": [ + { + "code": "BANK001", + "name": "Garanti BBVA - Levent Şubesi", + "address1": "Büyükdere Cad. No: 199", + "address2": "Kule 3 Kat: 12", + "country": "TR", + "city": null, + "district": null, + "postalCode": "34394", + "phoneNumber": "2124440000", + "email": "levent@garantibbva.com" + }, + { + "code": "BANK002", + "name": "Akbank - Ümraniye Sanayi Şubesi", + "address1": "Sanayi Mah. Alemdağ Cad. No: 45", + "address2": "", + "country": "TR", + "city": null, + "district": null, + "postalCode": "34773", + "phoneNumber": "2164442525", + "email": "umraniyesanayi@akbank.com" + }, + { + "code": "BANK003", + "name": "Yapı Kredi - Kadıköy Şubesi", + "address1": "Bahariye Cad. No: 12", + "address2": "Kat: 2", + "country": "Türkiye", + "city": null, + "district": null, + "postalCode": "34710", + "phoneNumber": "2164440444", + "email": "kadikoy@yapikredi.com.tr" + } + ], + "Cashes": [ + { + "code": "KASA001", + "name": "Merkez Kasa", + "description": "Merkez ofis nakit kasası", + "currency": "TRY", + "balance": 185000.75, + "isActive": true + }, + { + "code": "KASA002", + "name": "USD Kasa", + "description": "Döviz kasası", + "currency": "USD", + "balance": 15250.00, + "isActive": true + }, + { + "code": "KASA003", + "name": "Geçici Tahsilat Kasası", + "description": "Geçici tahsilatlar için kullanılan kasa", + "currency": "TRY", + "balance": 4500.00, + "isActive": false + } + ], + "CurrentAccounts": [ + { + "code": "CA001", + "name": "ABC Tedarik A.Ş.", + "description": "Ana tedarikçi firma", + "taxNumber": 12345678901, + "taxOffice": "Beylikdüzü V.D.", + "creditLimit": 250000.00, + "balance": -45250.75, + "currency": "TRY", + "risk": "Low", + "isActive": true + }, + { + "code": "CA002", + "name": "XYZ Müşteri Ltd.", + "description": "Perakende müşteri", + "taxNumber": 98765432102, + "taxOffice": "Kadıköy V.D.", + "creditLimit": 150000.00, + "balance": 32500.00, + "currency": "TRY", + "risk": "Medium", + "isActive": true + }, + { + "code": "CA003", + "name": "DEF İnşaat A.Ş.", + "description": "Hem müşteri hem tedarikçi", + "taxNumber": 5555666677, + "taxOffice": "Ümraniye V.D.", + "creditLimit": 350000.00, + "balance": -22000.50, + "currency": "TRY", + "risk": "High", + "isActive": false + } ] -} +} \ No newline at end of file diff --git a/api/src/Erp.Platform.Domain/Data/SeedConsts.cs b/api/src/Erp.Platform.Domain/Data/SeedConsts.cs index 3f4574e6..caa9c119 100644 --- a/api/src/Erp.Platform.Domain/Data/SeedConsts.cs +++ b/api/src/Erp.Platform.Domain/Data/SeedConsts.cs @@ -542,6 +542,8 @@ public static class SeedConsts public const string Default = Prefix.App + ".Accounting"; public const string Bank = Default + ".Bank"; public const string BankAccount = Default + ".BankAccount"; + public const string Cash = Default + ".Cash"; + public const string CurrentAccount = Default + ".CurrentAccount"; } public static class Store diff --git a/api/src/Erp.Platform.Domain/Entities/Branch/Accounting/Bank.cs b/api/src/Erp.Platform.Domain/Entities/Branch/Accounting/Bank.cs index e1820109..50233ddf 100644 --- a/api/src/Erp.Platform.Domain/Entities/Branch/Accounting/Bank.cs +++ b/api/src/Erp.Platform.Domain/Entities/Branch/Accounting/Bank.cs @@ -9,8 +9,8 @@ public class Bank : FullAuditedEntity, IMultiTenant public Guid? TenantId { get; set; } public Guid? BranchId { get; set; } + public string Code { get; set; } public string Name { get; set; } - public string IdentifierCode { get; set; } public string Address1 { get; set; } public string Address2 { get; set; } public string Country { get; set; } diff --git a/api/src/Erp.Platform.Domain/Entities/Branch/Accounting/Cash.cs b/api/src/Erp.Platform.Domain/Entities/Branch/Accounting/Cash.cs new file mode 100644 index 00000000..99a6b037 --- /dev/null +++ b/api/src/Erp.Platform.Domain/Entities/Branch/Accounting/Cash.cs @@ -0,0 +1,19 @@ +using System; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace Erp.Platform.Entities; + +public class Cash : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + public Guid? BranchId { get; set; } + + public string Code { get; set; } + public string Name { get; set; } + public string Description { get; set; } + + public string Currency { get; set; } + public decimal Balance { get; set; } + public bool IsActive { 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 new file mode 100644 index 00000000..de64e773 --- /dev/null +++ b/api/src/Erp.Platform.Domain/Entities/Branch/Accounting/CurrentAccount.cs @@ -0,0 +1,31 @@ +using System; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace Erp.Platform.Entities; + +public class CurrentAccount : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + public Guid? BranchId { get; set; } + + public Guid? PartnerId { get; set; } + public Partner? Partner { get; set; } + + public string Code { get; set; } + public string Name { get; set; } + public string Description { get; set; } + + public long? TaxNumber { get; set; } + public string TaxOffice { get; set; } + + public decimal CreditLimit { get; set; } + public decimal Balance { get; set; } + public string Currency { get; set; } + public string Risk { get; set; } //Low, Medium, High, Blocked + + public Guid? PaymentTermId { get; set; } + public PaymentTerm? PaymentTerm { get; set; } + + public bool IsActive { get; set; } +} diff --git a/api/src/Erp.Platform.Domain/Entities/Tenant/Administration/Contact.cs b/api/src/Erp.Platform.Domain/Entities/Tenant/Administration/Contact.cs index 39ab0a4a..886f0c90 100644 --- a/api/src/Erp.Platform.Domain/Entities/Tenant/Administration/Contact.cs +++ b/api/src/Erp.Platform.Domain/Entities/Tenant/Administration/Contact.cs @@ -12,7 +12,7 @@ public class Contact : FullAuditedEntity, IMultiTenant public string PhoneNumber { get; set; } public string Email { get; set; } public string Location { get; set; } - public string TaxNumber { get; set; } + public long? TaxNumber { get; set; } // JSON string kolonlar public string BankJson { get; set; } diff --git a/api/src/Erp.Platform.Domain/Entities/Tenant/Administration/Lawyer.cs b/api/src/Erp.Platform.Domain/Entities/Tenant/Administration/Lawyer.cs index 58aac63d..fa623f9d 100644 --- a/api/src/Erp.Platform.Domain/Entities/Tenant/Administration/Lawyer.cs +++ b/api/src/Erp.Platform.Domain/Entities/Tenant/Administration/Lawyer.cs @@ -12,7 +12,7 @@ public class Lawyer : FullAuditedEntity, IMultiTenant public string Email { get; set; } public string Address { get; set; } public string TaxOffice { get; set; } - public string TaxNumber { get; set; } + public long? TaxNumber { get; set; } public string MobileNumber { get; set; } public string PhoneNumber { get; set; } diff --git a/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs b/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs index f20a3d1e..965c8157 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs @@ -228,6 +228,8 @@ public class PlatformDbContext : #region Accounting public DbSet Banks { get; set; } public DbSet BankAccounts { get; set; } + public DbSet CashAccounts { get; set; } + public DbSet CurrentAccounts { get; set; } #endregion #region Store @@ -1337,7 +1339,6 @@ public class PlatformDbContext : b.Property(x => x.Email).HasMaxLength(100); b.Property(x => x.Address).HasMaxLength(250); b.Property(x => x.TaxOffice).HasMaxLength(50); - b.Property(x => x.TaxNumber).HasMaxLength(20); b.Property(x => x.PhoneNumber).HasMaxLength(20); b.Property(x => x.MobileNumber).HasMaxLength(20); @@ -1589,7 +1590,6 @@ public class PlatformDbContext : b.Property(x => x.PhoneNumber).HasMaxLength(20); b.Property(x => x.Email).HasMaxLength(150); b.Property(x => x.Location).HasMaxLength(150); - b.Property(x => x.TaxNumber).HasMaxLength(50); b.Property(x => x.BankJson).HasColumnType("text"); b.Property(x => x.WorkHoursJson).HasColumnType("text"); @@ -1719,7 +1719,7 @@ public class PlatformDbContext : b.ConfigureByConvention(); b.Property(x => x.Name).IsRequired().HasMaxLength(128); - b.Property(x => x.IdentifierCode).HasMaxLength(64); + b.Property(x => x.Code).HasMaxLength(64); b.Property(x => x.Address1).HasMaxLength(256); b.Property(x => x.Address2).HasMaxLength(256); b.Property(x => x.District).HasMaxLength(128); @@ -1749,6 +1749,35 @@ public class PlatformDbContext : .OnDelete(DeleteBehavior.Restrict); }); + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Cash)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.Code).IsRequired().HasMaxLength(50); + b.Property(x => x.Name).IsRequired().HasMaxLength(100); + b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Currency).IsRequired().HasMaxLength(10); + b.Property(x => x.Balance).HasPrecision(18, 4).HasDefaultValue(0); + b.Property(x => x.IsActive).HasDefaultValue(true); + }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.CurrentAccount)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(p => p.Code).IsRequired().HasMaxLength(50); + b.Property(p => p.Name).IsRequired().HasMaxLength(100); + b.Property(p => p.Description).HasMaxLength(500); + b.Property(p => p.TaxOffice).HasMaxLength(128); + b.Property(p => p.CreditLimit).HasPrecision(18, 4).HasDefaultValue(0); + b.Property(p => p.Balance).HasPrecision(18, 4).HasDefaultValue(0); + b.Property(p => p.Currency).IsRequired().HasMaxLength(10); + b.Property(p => p.Risk).HasMaxLength(10); + b.Property(p => p.IsActive).HasDefaultValue(true); + }); + builder.Entity(b => { b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.EmploymentType)), Prefix.DbSchema); @@ -1940,7 +1969,6 @@ public class PlatformDbContext : b.Property(x => x.Bonus).HasPrecision(18, 2); b.Property(x => x.GrossSalary).HasPrecision(18, 2); b.Property(x => x.NetSalary).HasPrecision(18, 2); - b.Property(x => x.TaxNumber).HasPrecision(18, 2); b.Property(x => x.SocialSecurity).HasPrecision(18, 2); }); diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251125115039_Initial.Designer.cs b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251125193313_Initial.Designer.cs similarity index 98% rename from api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251125115039_Initial.Designer.cs rename to api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251125193313_Initial.Designer.cs index 41564609..096817c0 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251125115039_Initial.Designer.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251125193313_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace Erp.Platform.Migrations { [DbContext(typeof(PlatformDbContext))] - [Migration("20251125115039_Initial")] + [Migration("20251125193313_Initial")] partial class Initial { /// @@ -1144,6 +1144,10 @@ namespace Erp.Platform.Migrations .HasMaxLength(128) .HasColumnType("nvarchar(128)"); + b.Property("Code") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + b.Property("Country") .HasMaxLength(128) .HasColumnType("nvarchar(128)"); @@ -1172,10 +1176,6 @@ namespace Erp.Platform.Migrations .HasMaxLength(128) .HasColumnType("nvarchar(128)"); - b.Property("IdentifierCode") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - b.Property("IsDeleted") .ValueGeneratedOnAdd() .HasColumnType("bit") @@ -1646,6 +1646,83 @@ namespace Erp.Platform.Migrations b.ToTable("Sas_T_BranchUsers", (string)null); }); + modelBuilder.Entity("Erp.Platform.Entities.Cash", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Balance") + .ValueGeneratedOnAdd() + .HasPrecision(18, 4) + .HasColumnType("decimal(18,4)") + .HasDefaultValue(0m); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + 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("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(100) + .HasColumnType("nvarchar(100)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("Acc_T_Cash", (string)null); + }); + modelBuilder.Entity("Erp.Platform.Entities.Certificate", b => { b.Property("Id") @@ -2439,9 +2516,8 @@ namespace Erp.Platform.Migrations .HasMaxLength(20) .HasColumnType("nvarchar(20)"); - b.Property("TaxNumber") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + b.Property("TaxNumber") + .HasColumnType("bigint"); b.Property("TenantId") .HasColumnType("uniqueidentifier") @@ -2979,6 +3055,110 @@ namespace Erp.Platform.Migrations b.ToTable("Sas_H_Currency", (string)null); }); + modelBuilder.Entity("Erp.Platform.Entities.CurrentAccount", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Balance") + .ValueGeneratedOnAdd() + .HasPrecision(18, 4) + .HasColumnType("decimal(18,4)") + .HasDefaultValue(0m); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CreditLimit") + .ValueGeneratedOnAdd() + .HasPrecision(18, 4) + .HasColumnType("decimal(18,4)") + .HasDefaultValue(0m); + + b.Property("Currency") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + 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(100) + .HasColumnType("nvarchar(100)"); + + b.Property("PartnerId") + .HasColumnType("uniqueidentifier"); + + b.Property("PaymentTermId") + .HasColumnType("uniqueidentifier"); + + b.Property("Risk") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("TaxNumber") + .HasColumnType("bigint"); + + b.Property("TaxOffice") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("PartnerId"); + + b.HasIndex("PaymentTermId"); + + b.ToTable("Acc_T_CurrentAccount", (string)null); + }); + modelBuilder.Entity("Erp.Platform.Entities.CustomComponent", b => { b.Property("Id") @@ -5152,9 +5332,8 @@ namespace Erp.Platform.Migrations .HasMaxLength(10) .HasColumnType("nvarchar(10)"); - b.Property("TaxNumber") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); + b.Property("TaxNumber") + .HasColumnType("bigint"); b.Property("TaxOffice") .HasMaxLength(50) @@ -8681,7 +8860,6 @@ namespace Erp.Platform.Migrations .HasColumnType("nvarchar(max)"); b.Property("TaxNumber") - .HasPrecision(18, 2) .HasColumnType("bigint"); b.Property("TenantId") @@ -15374,6 +15552,21 @@ namespace Erp.Platform.Migrations b.Navigation("Entity"); }); + modelBuilder.Entity("Erp.Platform.Entities.CurrentAccount", b => + { + b.HasOne("Erp.Platform.Entities.Partner", "Partner") + .WithMany() + .HasForeignKey("PartnerId"); + + b.HasOne("Erp.Platform.Entities.PaymentTerm", "PaymentTerm") + .WithMany() + .HasForeignKey("PaymentTermId"); + + b.Navigation("Partner"); + + b.Navigation("PaymentTerm"); + }); + modelBuilder.Entity("Erp.Platform.Entities.CustomEntityField", b => { b.HasOne("Erp.Platform.Entities.CustomEntity", "Entity") diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251125115039_Initial.cs b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251125193313_Initial.cs similarity index 98% rename from api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251125115039_Initial.cs rename to api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251125193313_Initial.cs index 86a91db4..2bbce0c0 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251125115039_Initial.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251125193313_Initial.cs @@ -441,8 +441,8 @@ namespace Erp.Platform.Migrations Id = table.Column(type: "uniqueidentifier", nullable: false), TenantId = table.Column(type: "uniqueidentifier", nullable: true), BranchId = table.Column(type: "uniqueidentifier", nullable: true), + Code = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), - IdentifierCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), Address1 = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), Address2 = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), Country = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), @@ -464,6 +464,32 @@ namespace Erp.Platform.Migrations table.PrimaryKey("PK_Acc_T_Bank", x => x.Id); }); + migrationBuilder.CreateTable( + name: "Acc_T_Cash", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: true), + Code = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + Name = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + Description = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), + Currency = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: false), + Balance = table.Column(type: "decimal(18,4)", precision: 18, scale: 4, nullable: false, defaultValue: 0m), + 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_Cash", x => x.Id); + }); + migrationBuilder.CreateTable( name: "Adm_T_About", columns: table => new @@ -542,7 +568,7 @@ namespace Erp.Platform.Migrations PhoneNumber = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true), Email = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: true), Location = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: true), - TaxNumber = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + TaxNumber = table.Column(type: "bigint", nullable: true), BankJson = table.Column(type: "text", nullable: true), WorkHoursJson = table.Column(type: "text", nullable: true), MapJson = table.Column(type: "text", nullable: true), @@ -679,7 +705,7 @@ namespace Erp.Platform.Migrations Email = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), Address = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: true), TaxOffice = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), - TaxNumber = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true), + TaxNumber = table.Column(type: "bigint", nullable: true), MobileNumber = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true), PhoneNumber = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true), FaxNumber = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true), @@ -1210,7 +1236,7 @@ namespace Erp.Platform.Migrations Bonus = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: true), GrossSalary = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: true), NetSalary = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: true), - TaxNumber = table.Column(type: "bigint", precision: 18, scale: 2, nullable: true), + TaxNumber = table.Column(type: "bigint", nullable: true), SocialSecurity = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: true), Status = table.Column(type: "nvarchar(max)", nullable: true), PaymentDate = table.Column(type: "datetime2", nullable: true), @@ -2605,10 +2631,10 @@ namespace Erp.Platform.Migrations Strategy = table.Column(type: "nvarchar(max)", nullable: false), IsActive = table.Column(type: "bit", nullable: false, defaultValue: true), WarehouseId = table.Column(type: "uniqueidentifier", nullable: false), - TargetZoneId = table.Column(type: "uniqueidentifier", nullable: true), - TargetLocationId = table.Column(type: "uniqueidentifier", nullable: true), MaterialTypeId = table.Column(type: "uniqueidentifier", nullable: true), MaterialGroupId = table.Column(type: "uniqueidentifier", nullable: true), + TargetZoneId = table.Column(type: "uniqueidentifier", nullable: true), + TargetLocationId = table.Column(type: "uniqueidentifier", nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), @@ -4350,6 +4376,43 @@ namespace Erp.Platform.Migrations onDelete: ReferentialAction.Restrict); }); + migrationBuilder.CreateTable( + name: "Acc_T_CurrentAccount", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: true), + PartnerId = table.Column(type: "uniqueidentifier", nullable: true), + Code = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + Name = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + Description = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), + TaxNumber = table.Column(type: "bigint", nullable: true), + TaxOffice = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + CreditLimit = table.Column(type: "decimal(18,4)", precision: 18, scale: 4, nullable: false, defaultValue: 0m), + Balance = table.Column(type: "decimal(18,4)", precision: 18, scale: 4, nullable: false, defaultValue: 0m), + Currency = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: false), + Risk = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: true), + PaymentTermId = table.Column(type: "uniqueidentifier", 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_CurrentAccount", x => x.Id); + table.ForeignKey( + name: "FK_Acc_T_CurrentAccount_Scp_T_PaymentTerm_PaymentTermId", + column: x => x.PaymentTermId, + principalTable: "Scp_T_PaymentTerm", + principalColumn: "Id"); + }); + migrationBuilder.CreateTable( name: "Adm_T_BlogPost", columns: table => new @@ -6548,6 +6611,16 @@ namespace Erp.Platform.Migrations table: "Acc_T_BankAccount", column: "BankId"); + migrationBuilder.CreateIndex( + name: "IX_Acc_T_CurrentAccount_PartnerId", + table: "Acc_T_CurrentAccount", + column: "PartnerId"); + + migrationBuilder.CreateIndex( + name: "IX_Acc_T_CurrentAccount_PaymentTermId", + table: "Acc_T_CurrentAccount", + column: "PaymentTermId"); + migrationBuilder.CreateIndex( name: "IX_Adm_T_BlogCategory_Slug", table: "Adm_T_BlogCategory", @@ -7446,6 +7519,13 @@ namespace Erp.Platform.Migrations table: "Workorders", column: "WorkcenterId"); + migrationBuilder.AddForeignKey( + name: "FK_Acc_T_CurrentAccount_Adm_T_Partner_PartnerId", + table: "Acc_T_CurrentAccount", + column: "PartnerId", + principalTable: "Adm_T_Partner", + principalColumn: "Id"); + migrationBuilder.AddForeignKey( name: "FK_Adm_T_BlogPost_Hr_T_Employee_EmployeeId", table: "Adm_T_BlogPost", @@ -7617,6 +7697,12 @@ namespace Erp.Platform.Migrations migrationBuilder.DropTable( name: "AbpUserTokens"); + migrationBuilder.DropTable( + name: "Acc_T_Cash"); + + migrationBuilder.DropTable( + name: "Acc_T_CurrentAccount"); + migrationBuilder.DropTable( name: "Adm_T_About"); diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs index 801b22f7..31c238aa 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs @@ -1141,6 +1141,10 @@ namespace Erp.Platform.Migrations .HasMaxLength(128) .HasColumnType("nvarchar(128)"); + b.Property("Code") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + b.Property("Country") .HasMaxLength(128) .HasColumnType("nvarchar(128)"); @@ -1169,10 +1173,6 @@ namespace Erp.Platform.Migrations .HasMaxLength(128) .HasColumnType("nvarchar(128)"); - b.Property("IdentifierCode") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - b.Property("IsDeleted") .ValueGeneratedOnAdd() .HasColumnType("bit") @@ -1643,6 +1643,83 @@ namespace Erp.Platform.Migrations b.ToTable("Sas_T_BranchUsers", (string)null); }); + modelBuilder.Entity("Erp.Platform.Entities.Cash", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Balance") + .ValueGeneratedOnAdd() + .HasPrecision(18, 4) + .HasColumnType("decimal(18,4)") + .HasDefaultValue(0m); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + 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("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(100) + .HasColumnType("nvarchar(100)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("Acc_T_Cash", (string)null); + }); + modelBuilder.Entity("Erp.Platform.Entities.Certificate", b => { b.Property("Id") @@ -2436,9 +2513,8 @@ namespace Erp.Platform.Migrations .HasMaxLength(20) .HasColumnType("nvarchar(20)"); - b.Property("TaxNumber") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + b.Property("TaxNumber") + .HasColumnType("bigint"); b.Property("TenantId") .HasColumnType("uniqueidentifier") @@ -2976,6 +3052,110 @@ namespace Erp.Platform.Migrations b.ToTable("Sas_H_Currency", (string)null); }); + modelBuilder.Entity("Erp.Platform.Entities.CurrentAccount", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Balance") + .ValueGeneratedOnAdd() + .HasPrecision(18, 4) + .HasColumnType("decimal(18,4)") + .HasDefaultValue(0m); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CreditLimit") + .ValueGeneratedOnAdd() + .HasPrecision(18, 4) + .HasColumnType("decimal(18,4)") + .HasDefaultValue(0m); + + b.Property("Currency") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + 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(100) + .HasColumnType("nvarchar(100)"); + + b.Property("PartnerId") + .HasColumnType("uniqueidentifier"); + + b.Property("PaymentTermId") + .HasColumnType("uniqueidentifier"); + + b.Property("Risk") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("TaxNumber") + .HasColumnType("bigint"); + + b.Property("TaxOffice") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("PartnerId"); + + b.HasIndex("PaymentTermId"); + + b.ToTable("Acc_T_CurrentAccount", (string)null); + }); + modelBuilder.Entity("Erp.Platform.Entities.CustomComponent", b => { b.Property("Id") @@ -5149,9 +5329,8 @@ namespace Erp.Platform.Migrations .HasMaxLength(10) .HasColumnType("nvarchar(10)"); - b.Property("TaxNumber") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); + b.Property("TaxNumber") + .HasColumnType("bigint"); b.Property("TaxOffice") .HasMaxLength(50) @@ -8678,7 +8857,6 @@ namespace Erp.Platform.Migrations .HasColumnType("nvarchar(max)"); b.Property("TaxNumber") - .HasPrecision(18, 2) .HasColumnType("bigint"); b.Property("TenantId") @@ -15371,6 +15549,21 @@ namespace Erp.Platform.Migrations b.Navigation("Entity"); }); + modelBuilder.Entity("Erp.Platform.Entities.CurrentAccount", b => + { + b.HasOne("Erp.Platform.Entities.Partner", "Partner") + .WithMany() + .HasForeignKey("PartnerId"); + + b.HasOne("Erp.Platform.Entities.PaymentTerm", "PaymentTerm") + .WithMany() + .HasForeignKey("PaymentTermId"); + + b.Navigation("Partner"); + + b.Navigation("PaymentTerm"); + }); + modelBuilder.Entity("Erp.Platform.Entities.CustomEntityField", b => { b.HasOne("Erp.Platform.Entities.CustomEntity", "Entity") diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs index ae1909b7..6e480229 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs @@ -960,7 +960,7 @@ public class ContactSeedDto public string PhoneNumber { get; set; } public string Email { get; set; } public string Location { get; set; } - public string TaxNumber { get; set; } + public long TaxNumber { get; set; } public BankDto Bank { get; set; } public WorkHoursDto WorkHour { get; set; } public MapDto Map { get; set; }