diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json b/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json index bde94c88..2aa1c5cb 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json +++ b/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json @@ -10225,6 +10225,12 @@ "tr": "Faturalar", "en": "Invoices" }, + { + "resourceName": "Platform", + "key": "App.Accounting.InvoiceItem", + "tr": "Fatura Ürünleri", + "en": "Invoice Items" + }, { "resourceName": "Platform", "key": "App.Accounting.Cash", diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Accounting.cs b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Accounting.cs index a0b5484c..e6861884 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Accounting.cs +++ b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Accounting.cs @@ -2243,6 +2243,668 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende } #endregion + #region Invoice + listFormName = AppCodes.Accounting.Invoice; + 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.Invoice)), + 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.Invoice)), + DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson, + PagerOptionJson = DefaultPagerOptionJson, + InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson, + EditingOptionJson = DefaultEditingOptionJson(listFormName, 800, 300, true, true, true, true, false), + EditingFormJson = JsonSerializer.Serialize(new List() { + new() { + Order=1, ColCount=2, ColSpan=1, ItemType="group", Items= [ + new EditingFormItemDto { Order = 1, DataField = "BranchId", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 2, DataField = "InvoiceTypeId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 3, DataField = "CurrentAccountId", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 4, DataField = "StatusId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 5, DataField = "InvoiceNumber", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 6, DataField = "PaymentStatusId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 7, DataField = "InvoiceDate", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxDateBox, EditorOptions = EditorOptionValues.DateFormat }, + new EditingFormItemDto { Order = 8, DataField = "DueDate", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxDateBox, EditorOptions = EditorOptionValues.DateFormat }, + new EditingFormItemDto { Order = 9, DataField = "Currency", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 10, DataField = "Notes", ColSpan = 1, EditorType2 = EditorTypes.dxTextArea, EditorOptions=EditorOptionValues.ShowClearButton }, + ]} + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { FieldName = "Currency", FieldDbType = DbType.String, Value = "TRY", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "InvoiceDate", FieldDbType = DbType.Date, Value = "@DATE", CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { FieldName = "DueDate", FieldDbType = DbType.Date, Value = "@DATE", CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + }), + CommandColumnJson = JsonSerializer.Serialize(new CommandColumnDto[] { + new() { + Hint = "Ödeme Kaydet", + Text ="Ödeme Kaydet", + UrlTarget="_blank", + AuthName = listFormName, + Url=$"/admin/form/{SeederUtils.GetDefaultFormCodes(listFormName)}/@Id", + IsVisible = true, + VisibleExpression = "(e) => e.row.data.RemainingAmount == 0" + }, + new() { + Hint = "Items", + Text ="Items", + UrlTarget="_blank", + AuthName = listFormName, + Url=$"/admin/form/{SeederUtils.GetDefaultFormCodes(listFormName)}/@Id", + IsVisible = true + }, + }), + }, autoSave: true + ); + + #region Invoice 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.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 = "InvoiceTypeId", + Width = 150, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.InvoiceType), "Id", "Name"), + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "CurrentAccountId", + Width = 150, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.CurrentAccount), "Id", "Name"), + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "StatusId", + Width = 150, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.InvoiceStatus), "Id", "Name"), + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "InvoiceNumber", + Width = 100, + ListOrderNo = 6, + 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.Date, + FieldName = "InvoiceDate", + Width = 100, + ListOrderNo = 7, + Visible = true, + IsActive = true, + IsDeleted = false, + LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.CurrentAccount), "Id", "Name"), + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Date, + FieldName = "DueDate", + Width = 100, + ListOrderNo = 8, + Visible = true, + IsActive = true, + IsDeleted = false, + LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.CurrentAccount), "Id", "Name"), + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Currency", + Width = 100, + ListOrderNo = 9, + Visible = true, + IsActive = true, + IsDeleted = false, + 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.Guid, + FieldName = "PaymentStatusId", + Width = 150, + ListOrderNo = 10, + Visible = true, + IsActive = true, + IsDeleted = false, + LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.PaymentStatus), "Id", "Name"), + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Notes", + Width = 200, + ListOrderNo = 11, + Visible = true, + IsActive = true, + IsDeleted = false, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Decimal, + FieldName = "Subtotal", + Format = "fixedPoint", + Alignment = "right", + Width = 100, + ListOrderNo = 12, + Visible = true, + IsActive = true, + IsDeleted = false, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Decimal, + FieldName = "TaxAmount", + Format = "fixedPoint", + Alignment = "right", + Width = 100, + ListOrderNo = 13, + Visible = true, + IsActive = true, + IsDeleted = false, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Decimal, + FieldName = "DiscountAmount", + Format = "fixedPoint", + Alignment = "right", + Width = 100, + ListOrderNo = 14, + Visible = true, + IsActive = true, + IsDeleted = false, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Decimal, + FieldName = "TotalAmount", + Format = "fixedPoint", + Alignment = "right", + Width = 100, + ListOrderNo = 15, + Visible = true, + IsActive = true, + IsDeleted = false, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Decimal, + FieldName = "PaidAmount", + Format = "fixedPoint", + Alignment = "right", + Width = 100, + ListOrderNo = 16, + Visible = true, + IsActive = true, + IsDeleted = false, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Decimal, + FieldName = "RemainingAmount", + Format = "fixedPoint", + Alignment = "right", + Width = 100, + ListOrderNo = 17, + Visible = true, + IsActive = true, + IsDeleted = false, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + ], autoSave: true); + #endregion + } + #endregion + + #region Invoice Items + listFormName = AppCodes.Accounting.InvoiceItem; + 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.InvoiceItem)), + 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.InvoiceItem)), + DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson, + PagerOptionJson = DefaultPagerOptionJson, + InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson, + EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 470, 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 = "MaterialId", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 2, DataField = "Uom", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 3, DataField = "Quantity", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxNumberBox, EditorOptions = EditorOptionValues.NumberStandartFormat }, + new EditingFormItemDto { Order = 4, DataField = "UnitPrice", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxNumberBox, EditorOptions = EditorOptionValues.NumberStandartFormat }, + new EditingFormItemDto { Order = 5, DataField = "LineTotal", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxNumberBox, EditorOptions = EditorOptionValues.NumberStandartFormat }, + new EditingFormItemDto { Order = 6, DataField = "DiscountRate", ColSpan = 1, EditorType2=EditorTypes.dxNumberBox, EditorOptions = EditorOptionValues.NumberStandartFormat }, + new EditingFormItemDto { Order = 7, DataField = "DiscountAmount", ColSpan = 1, EditorType2=EditorTypes.dxNumberBox, EditorOptions = EditorOptionValues.NumberStandartFormat }, + new EditingFormItemDto { Order = 8, DataField = "TaxRate", ColSpan = 1, EditorType2=EditorTypes.dxNumberBox, EditorOptions = EditorOptionValues.NumberStandartFormat }, + new EditingFormItemDto { Order = 9, DataField = "TaxAmount", ColSpan = 1, EditorType2=EditorTypes.dxNumberBox, EditorOptions = EditorOptionValues.NumberStandartFormat }, + new EditingFormItemDto { Order = 10, DataField = "NetAmount", ColSpan = 1, EditorType2=EditorTypes.dxNumberBox, EditorOptions = EditorOptionValues.NumberStandartFormat }, + new EditingFormItemDto { Order = 11, DataField = "Description", ColSpan = 1, EditorType2=EditorTypes.dxTextArea }, + ]} + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { FieldName = "Uom", FieldDbType = DbType.String, Value = "Adet", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "Quantity", FieldDbType = DbType.Decimal, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "UnitPrice", FieldDbType = DbType.Decimal, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "LineTotal", FieldDbType = DbType.Decimal, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "DiscountRate", FieldDbType = DbType.Decimal, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "DiscountAmount", FieldDbType = DbType.Decimal, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "TaxRate", FieldDbType = DbType.Decimal, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "TaxAmount", FieldDbType = DbType.Decimal, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "NetAmount", FieldDbType = DbType.Decimal, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value }, + + }), + }, autoSave: true + ); + + #region Invoice Item 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.Guid, + FieldName = "MaterialId", + Width = 250, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Material), "Id", "Name"), + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Uom", + Width = 100, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Uom), "Name", "Name"), + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Decimal, + FieldName = "Quantity", + Format = "fixedPoint", + Alignment = "right", + Width = 100, + 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.Decimal, + FieldName = "UnitPrice", + Format = "fixedPoint", + Alignment = "right", + Width = 100, + ListOrderNo = 5, + 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.Decimal, + FieldName = "LineTotal", + Format = "fixedPoint", + Alignment = "right", + Width = 100, + ListOrderNo = 6, + 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.Decimal, + FieldName = "DiscountRate", + 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.Decimal, + FieldName = "DiscountAmount", + Format = "fixedPoint", + Alignment = "right", + 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 = "TaxRate", + 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 = "TaxAmount", + 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.Decimal, + FieldName = "NetAmount", + Format = "fixedPoint", + Alignment = "right", + Width = 100, + ListOrderNo = 11, + 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 = "Description", + Width = 500, + ListOrderNo = 12, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + ], autoSave: true); + #endregion + } + #endregion + + // Invoice ve Invoice Item arasında Sub Forms ilişkisinin kurulması + await utils.CloneFormLayoutAsync( + AppCodes.Accounting.Invoice, + JsonSerializer.Serialize( + new List() { + new { + TabType = ListFormTabTypeEnum.List, + TabTitle = AppCodes.Accounting.InvoiceItem, + Code = AppCodes.Accounting.InvoiceItem, + Relation = new List() { + new { + ParentFieldName = "Id", + DbType = DbType.Guid, + ChildFieldName = "InvoiceId" + }, + } + }, + } + ) + ); + + } } diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/MenusData.json b/api/src/Erp.Platform.DbMigrator/Seeds/MenusData.json index 2e49cdd4..d5f34a7b 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/MenusData.json +++ b/api/src/Erp.Platform.DbMigrator/Seeds/MenusData.json @@ -3312,7 +3312,7 @@ "Code": "App.Accounting.Invoice", "DisplayName": "App.Accounting.Invoice", "Order": 6, - "Url": "/admin/accounting/invoices", + "Url": "/admin/list/App.Accounting.Invoice", "Icon": "FcSalesPerformance", "RequiredPermissionName": "App.Accounting.Invoice", "IsDisabled": false diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/PermissionsData.json b/api/src/Erp.Platform.DbMigrator/Seeds/PermissionsData.json index 2865e063..4a719661 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/PermissionsData.json +++ b/api/src/Erp.Platform.DbMigrator/Seeds/PermissionsData.json @@ -13747,6 +13747,69 @@ "MultiTenancySide": 3, "MenuGroup": "Erp" }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.InvoiceItem", + "ParentName": null, + "DisplayName": "App.Accounting.InvoiceItem", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.InvoiceItem.Create", + "ParentName": "App.Accounting.InvoiceItem", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.InvoiceItem.Update", + "ParentName": "App.Accounting.InvoiceItem", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.InvoiceItem.Delete", + "ParentName": "App.Accounting.InvoiceItem", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.InvoiceItem.Export", + "ParentName": "App.Accounting.InvoiceItem", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.InvoiceItem.Import", + "ParentName": "App.Accounting.InvoiceItem", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.InvoiceItem.Note", + "ParentName": "App.Accounting.InvoiceItem", + "DisplayName": "Note", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, { "GroupName": "App.Accounting", "Name": "App.Accounting.Cash", diff --git a/api/src/Erp.Platform.Domain/Data/SeedConsts.cs b/api/src/Erp.Platform.Domain/Data/SeedConsts.cs index fa7ed521..dbd9be64 100644 --- a/api/src/Erp.Platform.Domain/Data/SeedConsts.cs +++ b/api/src/Erp.Platform.Domain/Data/SeedConsts.cs @@ -577,6 +577,8 @@ public static class SeedConsts public const string CheckStatus = Default + ".CheckStatus"; public const string CheckType = Default + ".CheckType"; public const string CheckNote = Default + ".CheckNote"; + public const string Invoice = Default + ".Invoice"; + public const string InvoiceItem = Default + ".InvoiceItem"; } public static class Store diff --git a/api/src/Erp.Platform.Domain/Entities/Branch/Accounting/Invoice.cs b/api/src/Erp.Platform.Domain/Entities/Branch/Accounting/Invoice.cs index f2bddee3..47a4e7d0 100644 --- a/api/src/Erp.Platform.Domain/Entities/Branch/Accounting/Invoice.cs +++ b/api/src/Erp.Platform.Domain/Entities/Branch/Accounting/Invoice.cs @@ -10,29 +10,29 @@ 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? CurrentAccountId { get; set; } + public CurrentAccount? CurrentAccount { get; set; } public Guid StatusId { get; set; } public InvoiceStatus Status { get; set; } - public Guid PaymentStatusId { get; set; } + public string InvoiceNumber { get; set; } + + public DateTime InvoiceDate { get; set; } // Fatura Tarihi + public DateTime DueDate { get; set; } // Vade Tarihi + + public decimal Subtotal { get; set; } // Ara Toplam + public decimal TaxAmount { get; set; } // Vergi Tutarı + public decimal DiscountAmount { get; set; } // İndirim Tutarı + public decimal TotalAmount { get; set; } // Genel Toplam + public decimal PaidAmount { get; set; } // Ödenen Tutar + public decimal RemainingAmount { get; set; } // Kalan Tutar + public string Currency { get; set; } // Para Birimi + + public Guid PaymentStatusId { get; set; } public PaymentStatus PaymentStatus { get; set; } public Guid? WaybillId { 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 index efcb85ea..2cf83511 100644 --- a/api/src/Erp.Platform.Domain/Entities/Branch/Accounting/InvoiceItem.cs +++ b/api/src/Erp.Platform.Domain/Entities/Branch/Accounting/InvoiceItem.cs @@ -15,16 +15,16 @@ public class InvoiceItem : FullAuditedEntity, IMultiTenant public Material Material { get; set; } public string Uom { get; set; } + public decimal Quantity { get; set; } // Miktar + public decimal UnitPrice { get; set; } // Birim Fiyat + public decimal LineTotal { get; set; } // Miktar x Birim Fiyat + + public decimal DiscountRate { get; set; } // İndirim Yüzdesi + public decimal DiscountAmount { get; set; } // Hesaplanan indirim tutarı + + public decimal TaxRate { get; set; } // Vergi Yüzdesi + public decimal TaxAmount { get; set; } // Hesaplanan vergi tutarı + public decimal NetAmount { get; set; } // Vergi sonrası tutar + 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 59dc48eb..0947e68d 100644 --- a/api/src/Erp.Platform.Domain/Entities/Branch/Accounting/Waybill.cs +++ b/api/src/Erp.Platform.Domain/Entities/Branch/Accounting/Waybill.cs @@ -14,8 +14,8 @@ public class Waybill : FullAuditedEntity, IMultiTenant public Guid WaybillTypeId { get; set; } public WaybillType WaybillType { get; set; } - public Guid CurrentAccountId { get; set; } - public CurrentAccount CurrentAccount { get; set; } + public Guid? CurrentAccountId { get; set; } + public CurrentAccount? CurrentAccount { get; set; } public DateTime WaybillDate { get; set; } public DateTime? DeliveryDate { get; set; } diff --git a/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs b/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs index cf1490a2..93cac44b 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs @@ -3910,7 +3910,6 @@ public class PlatformDbContext : 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(); @@ -3934,7 +3933,8 @@ public class PlatformDbContext : b.HasOne(x => x.CurrentAccount) .WithMany(ca => ca.Waybills) .HasForeignKey(x => x.CurrentAccountId) - .OnDelete(DeleteBehavior.Restrict); + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(false); b.HasOne(x => x.WaybillType) .WithMany(wt => wt.Waybills) @@ -4015,7 +4015,6 @@ public class PlatformDbContext : 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(); @@ -4033,7 +4032,8 @@ public class PlatformDbContext : b.HasOne(x => x.CurrentAccount) .WithMany(ca => ca.Invoices) .HasForeignKey(x => x.CurrentAccountId) - .OnDelete(DeleteBehavior.Restrict); + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(false); b.HasOne(x => x.InvoiceType) .WithMany(ca => ca.Invoices) @@ -4060,7 +4060,7 @@ public class PlatformDbContext : 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.Description).HasMaxLength(500); b.Property(x => x.Quantity).HasDefaultValue(0).HasPrecision(18, 2); b.Property(x => x.UnitPrice).HasDefaultValue(0).HasPrecision(18, 2); diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251209191500_Initial.Designer.cs b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251209203306_Initial.Designer.cs similarity index 99% rename from api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251209191500_Initial.Designer.cs rename to api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251209203306_Initial.Designer.cs index a147afaf..6a998cf0 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251209191500_Initial.Designer.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251209203306_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace Erp.Platform.Migrations { [DbContext(typeof(PlatformDbContext))] - [Migration("20251209191500_Initial")] + [Migration("20251209203306_Initial")] partial class Initial { /// @@ -5938,7 +5938,7 @@ namespace Erp.Platform.Migrations .HasMaxLength(10) .HasColumnType("nvarchar(10)"); - b.Property("CurrentAccountId") + b.Property("CurrentAccountId") .HasColumnType("uniqueidentifier"); b.Property("DeleterId") @@ -5949,9 +5949,6 @@ namespace Erp.Platform.Migrations .HasColumnType("datetime2") .HasColumnName("DeletionTime"); - b.Property("DeliveryDate") - .HasColumnType("datetime2"); - b.Property("DiscountAmount") .ValueGeneratedOnAdd() .HasPrecision(18, 2) @@ -6068,7 +6065,6 @@ namespace Erp.Platform.Migrations .HasColumnName("DeletionTime"); b.Property("Description") - .IsRequired() .HasMaxLength(500) .HasColumnType("nvarchar(500)"); @@ -15632,7 +15628,7 @@ namespace Erp.Platform.Migrations .HasMaxLength(10) .HasColumnType("nvarchar(10)"); - b.Property("CurrentAccountId") + b.Property("CurrentAccountId") .HasColumnType("uniqueidentifier"); b.Property("DeleterId") @@ -20118,8 +20114,7 @@ namespace Erp.Platform.Migrations b.HasOne("Erp.Platform.Entities.CurrentAccount", "CurrentAccount") .WithMany("Invoices") .HasForeignKey("CurrentAccountId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); + .OnDelete(DeleteBehavior.Restrict); b.HasOne("Erp.Platform.Entities.InvoiceType", "InvoiceType") .WithMany("Invoices") @@ -21363,8 +21358,7 @@ namespace Erp.Platform.Migrations b.HasOne("Erp.Platform.Entities.CurrentAccount", "CurrentAccount") .WithMany("Waybills") .HasForeignKey("CurrentAccountId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); + .OnDelete(DeleteBehavior.Restrict); b.HasOne("Erp.Platform.Entities.WaybillStatus", "WaybillStatus") .WithMany("Waybills") diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251209191500_Initial.cs b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251209203306_Initial.cs similarity index 99% rename from api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251209191500_Initial.cs rename to api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251209203306_Initial.cs index 3a96f6aa..f773dde2 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251209191500_Initial.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251209203306_Initial.cs @@ -5306,12 +5306,12 @@ 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), - InvoiceNumber = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), InvoiceTypeId = table.Column(type: "uniqueidentifier", nullable: false), - CurrentAccountId = table.Column(type: "uniqueidentifier", nullable: false), + CurrentAccountId = table.Column(type: "uniqueidentifier", nullable: true), + StatusId = table.Column(type: "uniqueidentifier", nullable: false), + InvoiceNumber = table.Column(type: "nvarchar(50)", maxLength: 50, 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), @@ -5319,7 +5319,6 @@ namespace Erp.Platform.Migrations 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), @@ -5369,7 +5368,7 @@ namespace Erp.Platform.Migrations 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), + CurrentAccountId = table.Column(type: "uniqueidentifier", nullable: true), WaybillDate = 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), @@ -5426,7 +5425,6 @@ namespace Erp.Platform.Migrations 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), @@ -5435,6 +5433,7 @@ namespace Erp.Platform.Migrations 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), + Description = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs index 201f6cec..e8060b39 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs @@ -5935,7 +5935,7 @@ namespace Erp.Platform.Migrations .HasMaxLength(10) .HasColumnType("nvarchar(10)"); - b.Property("CurrentAccountId") + b.Property("CurrentAccountId") .HasColumnType("uniqueidentifier"); b.Property("DeleterId") @@ -5946,9 +5946,6 @@ namespace Erp.Platform.Migrations .HasColumnType("datetime2") .HasColumnName("DeletionTime"); - b.Property("DeliveryDate") - .HasColumnType("datetime2"); - b.Property("DiscountAmount") .ValueGeneratedOnAdd() .HasPrecision(18, 2) @@ -6065,7 +6062,6 @@ namespace Erp.Platform.Migrations .HasColumnName("DeletionTime"); b.Property("Description") - .IsRequired() .HasMaxLength(500) .HasColumnType("nvarchar(500)"); @@ -15629,7 +15625,7 @@ namespace Erp.Platform.Migrations .HasMaxLength(10) .HasColumnType("nvarchar(10)"); - b.Property("CurrentAccountId") + b.Property("CurrentAccountId") .HasColumnType("uniqueidentifier"); b.Property("DeleterId") @@ -20115,8 +20111,7 @@ namespace Erp.Platform.Migrations b.HasOne("Erp.Platform.Entities.CurrentAccount", "CurrentAccount") .WithMany("Invoices") .HasForeignKey("CurrentAccountId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); + .OnDelete(DeleteBehavior.Restrict); b.HasOne("Erp.Platform.Entities.InvoiceType", "InvoiceType") .WithMany("Invoices") @@ -21360,8 +21355,7 @@ namespace Erp.Platform.Migrations b.HasOne("Erp.Platform.Entities.CurrentAccount", "CurrentAccount") .WithMany("Waybills") .HasForeignKey("CurrentAccountId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); + .OnDelete(DeleteBehavior.Restrict); b.HasOne("Erp.Platform.Entities.WaybillStatus", "WaybillStatus") .WithMany("Waybills")