Acccounting Invoice, CheckNote düzenlemesi

This commit is contained in:
Sedat Öztürk 2025-12-09 00:56:32 +03:00
parent a2788c1d41
commit 5eded551e3
28 changed files with 3942 additions and 204 deletions

View file

@ -10183,6 +10183,36 @@
"tr": "Cari Hesaplar",
"en": "Current Accounts"
},
{
"resourceName": "Platform",
"key": "App.Accounting.PaymentStatus",
"tr": "Ödeme Durumları",
"en": "Payment Statuses"
},
{
"resourceName": "Platform",
"key": "App.Accounting.CheckStatus",
"tr": "Çek Durumları",
"en": "Check Statuses"
},
{
"resourceName": "Platform",
"key": "App.Accounting.CheckType",
"tr": "Çek Türleri",
"en": "Check Types"
},
{
"resourceName": "Platform",
"key": "App.Accounting.InvoiceType",
"tr": "Fatura Türleri",
"en": "Invoice Types"
},
{
"resourceName": "Platform",
"key": "App.Accounting.InvoiceStatus",
"tr": "Fatura Durumları",
"en": "Invoice Statuses"
},
{
"resourceName": "Platform",
"key": "App.Accounting.Waybill",

View file

@ -1278,6 +1278,621 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende
}
#endregion
#region Invoice Type
listFormName = AppCodes.Accounting.InvoiceType;
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
{
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
ExportJson = DefaultExportJson,
IsSubForm = false,
ShowNote = true,
LayoutJson = DefaultLayoutJson(),
CultureName = LanguageCodes.En,
ListFormCode = listFormName,
Name = listFormName,
Title = listFormName,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
IsTenant = true,
IsBranch = false,
IsOrganizationUnit = false,
Description = listFormName,
SelectCommandType = SelectCommandTypeEnum.Table,
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.InvoiceType)),
KeyFieldName = "Id",
KeyFieldDbSourceType = DbType.Guid,
DefaultFilter = DefaultFilterJson,
SortMode = GridOptions.SortModeSingle,
FilterRowJson = DefaultFilterRowJson,
HeaderFilterJson = DefaultHeaderFilterJson,
SearchPanelJson = DefaultSearchPanelJson,
GroupPanelJson = DefaultGroupPanelJson,
SelectionJson = DefaultSelectionSingleJson,
ColumnOptionJson = DefaultColumnOptionJson,
PermissionJson = DefaultPermissionJson(listFormName),
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.InvoiceType)),
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
PagerOptionJson = DefaultPagerOptionJson,
InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson,
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 250, true, true, true, true, false),
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>() {
new() {
Order=1, ColCount=1, ColSpan=1, ItemType="group", Items= [
new EditingFormItemDto { Order = 2, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 3, DataField = "Description", ColSpan = 1, EditorType2=EditorTypes.dxTextArea },
new EditingFormItemDto { Order = 4, DataField = "IsActive", ColSpan = 1, EditorType2=EditorTypes.dxCheckBox },
]}
}),
FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] {
new() { FieldName = "IsActive", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value }
}),
}, autoSave: true
);
#region Invoice Type Fields
await _listFormFieldRepository.InsertManyAsync([
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Guid,
FieldName = "Id",
Width = 100,
ListOrderNo = 1,
Visible = false,
IsActive = true,
IsDeleted = false,
ValidationRuleJson = DefaultValidationRuleRequiredJson,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "Name",
Width = 350,
ListOrderNo = 3,
Visible = true,
IsActive = true,
IsDeleted = false,
SortIndex = 1,
SortDirection = GridColumnOptions.SortOrderAsc,
AllowSearch = true,
ValidationRuleJson = DefaultValidationRuleRequiredJson,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "Description",
Width = 500,
ListOrderNo = 4,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Boolean,
FieldName = "IsActive",
Width = 100,
ListOrderNo = 5,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
}
], autoSave: true);
#endregion
}
#endregion
#region Invoice Status
listFormName = AppCodes.Accounting.InvoiceStatus;
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
{
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
ExportJson = DefaultExportJson,
IsSubForm = false,
ShowNote = true,
LayoutJson = DefaultLayoutJson(),
CultureName = LanguageCodes.En,
ListFormCode = listFormName,
Name = listFormName,
Title = listFormName,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
IsTenant = true,
IsBranch = false,
IsOrganizationUnit = false,
Description = listFormName,
SelectCommandType = SelectCommandTypeEnum.Table,
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.InvoiceStatus)),
KeyFieldName = "Id",
KeyFieldDbSourceType = DbType.Guid,
DefaultFilter = DefaultFilterJson,
SortMode = GridOptions.SortModeSingle,
FilterRowJson = DefaultFilterRowJson,
HeaderFilterJson = DefaultHeaderFilterJson,
SearchPanelJson = DefaultSearchPanelJson,
GroupPanelJson = DefaultGroupPanelJson,
SelectionJson = DefaultSelectionSingleJson,
ColumnOptionJson = DefaultColumnOptionJson,
PermissionJson = DefaultPermissionJson(listFormName),
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.InvoiceStatus)),
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
PagerOptionJson = DefaultPagerOptionJson,
InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson,
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 250, true, true, true, true, false),
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>() {
new() {
Order=1, ColCount=1, ColSpan=1, ItemType="group", Items= [
new EditingFormItemDto { Order = 2, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 3, DataField = "Description", ColSpan = 1, EditorType2=EditorTypes.dxTextArea },
new EditingFormItemDto { Order = 4, DataField = "IsActive", ColSpan = 1, EditorType2=EditorTypes.dxCheckBox },
]}
}),
FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] {
new() { FieldName = "IsActive", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value }
}),
}, autoSave: true
);
#region Invoice Status Fields
await _listFormFieldRepository.InsertManyAsync([
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Guid,
FieldName = "Id",
Width = 100,
ListOrderNo = 1,
Visible = false,
IsActive = true,
IsDeleted = false,
ValidationRuleJson = DefaultValidationRuleRequiredJson,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "Name",
Width = 350,
ListOrderNo = 3,
Visible = true,
IsActive = true,
IsDeleted = false,
SortIndex = 1,
SortDirection = GridColumnOptions.SortOrderAsc,
AllowSearch = true,
ValidationRuleJson = DefaultValidationRuleRequiredJson,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "Description",
Width = 500,
ListOrderNo = 4,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Boolean,
FieldName = "IsActive",
Width = 100,
ListOrderNo = 5,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
}
], autoSave: true);
#endregion
}
#endregion
#region Payment Status
listFormName = AppCodes.Accounting.PaymentStatus;
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
{
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
ExportJson = DefaultExportJson,
IsSubForm = false,
ShowNote = true,
LayoutJson = DefaultLayoutJson(),
CultureName = LanguageCodes.En,
ListFormCode = listFormName,
Name = listFormName,
Title = listFormName,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
IsTenant = true,
IsBranch = false,
IsOrganizationUnit = false,
Description = listFormName,
SelectCommandType = SelectCommandTypeEnum.Table,
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.PaymentStatus)),
KeyFieldName = "Id",
KeyFieldDbSourceType = DbType.Guid,
DefaultFilter = DefaultFilterJson,
SortMode = GridOptions.SortModeSingle,
FilterRowJson = DefaultFilterRowJson,
HeaderFilterJson = DefaultHeaderFilterJson,
SearchPanelJson = DefaultSearchPanelJson,
GroupPanelJson = DefaultGroupPanelJson,
SelectionJson = DefaultSelectionSingleJson,
ColumnOptionJson = DefaultColumnOptionJson,
PermissionJson = DefaultPermissionJson(listFormName),
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.PaymentStatus)),
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
PagerOptionJson = DefaultPagerOptionJson,
InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson,
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 250, true, true, true, true, false),
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>() {
new() {
Order=1, ColCount=1, ColSpan=1, ItemType="group", Items= [
new EditingFormItemDto { Order = 2, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 3, DataField = "Description", ColSpan = 1, EditorType2=EditorTypes.dxTextArea },
new EditingFormItemDto { Order = 4, DataField = "IsActive", ColSpan = 1, EditorType2=EditorTypes.dxCheckBox },
]}
}),
FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] {
new() { FieldName = "IsActive", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value }
}),
}, autoSave: true
);
#region Payment Status Fields
await _listFormFieldRepository.InsertManyAsync([
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Guid,
FieldName = "Id",
Width = 100,
ListOrderNo = 1,
Visible = false,
IsActive = true,
IsDeleted = false,
ValidationRuleJson = DefaultValidationRuleRequiredJson,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "Name",
Width = 350,
ListOrderNo = 3,
Visible = true,
IsActive = true,
IsDeleted = false,
SortIndex = 1,
SortDirection = GridColumnOptions.SortOrderAsc,
AllowSearch = true,
ValidationRuleJson = DefaultValidationRuleRequiredJson,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "Description",
Width = 500,
ListOrderNo = 4,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Boolean,
FieldName = "IsActive",
Width = 100,
ListOrderNo = 5,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
}
], autoSave: true);
#endregion
}
#endregion
#region Check Status
listFormName = AppCodes.Accounting.CheckStatus;
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
{
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
ExportJson = DefaultExportJson,
IsSubForm = false,
ShowNote = true,
LayoutJson = DefaultLayoutJson(),
CultureName = LanguageCodes.En,
ListFormCode = listFormName,
Name = listFormName,
Title = listFormName,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
IsTenant = true,
IsBranch = false,
IsOrganizationUnit = false,
Description = listFormName,
SelectCommandType = SelectCommandTypeEnum.Table,
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.CheckStatus)),
KeyFieldName = "Id",
KeyFieldDbSourceType = DbType.Guid,
DefaultFilter = DefaultFilterJson,
SortMode = GridOptions.SortModeSingle,
FilterRowJson = DefaultFilterRowJson,
HeaderFilterJson = DefaultHeaderFilterJson,
SearchPanelJson = DefaultSearchPanelJson,
GroupPanelJson = DefaultGroupPanelJson,
SelectionJson = DefaultSelectionSingleJson,
ColumnOptionJson = DefaultColumnOptionJson,
PermissionJson = DefaultPermissionJson(listFormName),
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.CheckStatus)),
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
PagerOptionJson = DefaultPagerOptionJson,
InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson,
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 250, true, true, true, true, false),
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>() {
new() {
Order=1, ColCount=1, ColSpan=1, ItemType="group", Items= [
new EditingFormItemDto { Order = 2, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 3, DataField = "Description", ColSpan = 1, EditorType2=EditorTypes.dxTextArea },
new EditingFormItemDto { Order = 4, DataField = "IsActive", ColSpan = 1, EditorType2=EditorTypes.dxCheckBox },
]}
}),
FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] {
new() { FieldName = "IsActive", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value }
}),
}, autoSave: true
);
#region Check Status Fields
await _listFormFieldRepository.InsertManyAsync([
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Guid,
FieldName = "Id",
Width = 100,
ListOrderNo = 1,
Visible = false,
IsActive = true,
IsDeleted = false,
ValidationRuleJson = DefaultValidationRuleRequiredJson,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "Name",
Width = 350,
ListOrderNo = 3,
Visible = true,
IsActive = true,
IsDeleted = false,
SortIndex = 1,
SortDirection = GridColumnOptions.SortOrderAsc,
AllowSearch = true,
ValidationRuleJson = DefaultValidationRuleRequiredJson,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "Description",
Width = 500,
ListOrderNo = 4,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Boolean,
FieldName = "IsActive",
Width = 100,
ListOrderNo = 5,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
}
], autoSave: true);
#endregion
}
#endregion
#region Check Type
listFormName = AppCodes.Accounting.CheckType;
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
{
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
ExportJson = DefaultExportJson,
IsSubForm = false,
ShowNote = true,
LayoutJson = DefaultLayoutJson(),
CultureName = LanguageCodes.En,
ListFormCode = listFormName,
Name = listFormName,
Title = listFormName,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
IsTenant = true,
IsBranch = false,
IsOrganizationUnit = false,
Description = listFormName,
SelectCommandType = SelectCommandTypeEnum.Table,
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.CheckType)),
KeyFieldName = "Id",
KeyFieldDbSourceType = DbType.Guid,
DefaultFilter = DefaultFilterJson,
SortMode = GridOptions.SortModeSingle,
FilterRowJson = DefaultFilterRowJson,
HeaderFilterJson = DefaultHeaderFilterJson,
SearchPanelJson = DefaultSearchPanelJson,
GroupPanelJson = DefaultGroupPanelJson,
SelectionJson = DefaultSelectionSingleJson,
ColumnOptionJson = DefaultColumnOptionJson,
PermissionJson = DefaultPermissionJson(listFormName),
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.CheckType)),
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
PagerOptionJson = DefaultPagerOptionJson,
InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson,
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 250, true, true, true, true, false),
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>() {
new() {
Order=1, ColCount=1, ColSpan=1, ItemType="group", Items= [
new EditingFormItemDto { Order = 2, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 3, DataField = "Description", ColSpan = 1, EditorType2=EditorTypes.dxTextArea },
new EditingFormItemDto { Order = 4, DataField = "IsActive", ColSpan = 1, EditorType2=EditorTypes.dxCheckBox },
]}
}),
FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] {
new() { FieldName = "IsActive", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value }
}),
}, autoSave: true
);
#region Check Type Fields
await _listFormFieldRepository.InsertManyAsync([
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Guid,
FieldName = "Id",
Width = 100,
ListOrderNo = 1,
Visible = false,
IsActive = true,
IsDeleted = false,
ValidationRuleJson = DefaultValidationRuleRequiredJson,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "Name",
Width = 350,
ListOrderNo = 3,
Visible = true,
IsActive = true,
IsDeleted = false,
SortIndex = 1,
SortDirection = GridColumnOptions.SortOrderAsc,
AllowSearch = true,
ValidationRuleJson = DefaultValidationRuleRequiredJson,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "Description",
Width = 500,
ListOrderNo = 4,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Boolean,
FieldName = "IsActive",
Width = 100,
ListOrderNo = 5,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
}
], autoSave: true);
#endregion
}
#endregion
}
}

View file

@ -3213,10 +3213,60 @@
"DisplayName": "App.Accounting.WaybillStatus",
"Order": 2,
"Url": "/admin/list/App.Accounting.WaybillStatus",
"Icon": "FcSwitch",
"Icon": "FcInfo",
"RequiredPermissionName": "App.Accounting.WaybillStatus",
"IsDisabled": false
},
{
"ParentCode": "App.Accounting.Definitions",
"Code": "App.Accounting.InvoiceType",
"DisplayName": "App.Accounting.InvoiceType",
"Order": 3,
"Url": "/admin/list/App.Accounting.InvoiceType",
"Icon": "FcTreeStructure",
"RequiredPermissionName": "App.Accounting.InvoiceType",
"IsDisabled": false
},
{
"ParentCode": "App.Accounting.Definitions",
"Code": "App.Accounting.InvoiceStatus",
"DisplayName": "App.Accounting.InvoiceStatus",
"Order": 4,
"Url": "/admin/list/App.Accounting.InvoiceStatus",
"Icon": "FcApproval",
"RequiredPermissionName": "App.Accounting.InvoiceStatus",
"IsDisabled": false
},
{
"ParentCode": "App.Accounting.Definitions",
"Code": "App.Accounting.PaymentStatus",
"DisplayName": "App.Accounting.PaymentStatus",
"Order": 5,
"Url": "/admin/list/App.Accounting.PaymentStatus",
"Icon": "FcMoneyTransfer",
"RequiredPermissionName": "App.Accounting.PaymentStatus",
"IsDisabled": false
},
{
"ParentCode": "App.Accounting.Definitions",
"Code": "App.Accounting.CheckStatus",
"DisplayName": "App.Accounting.CheckStatus",
"Order": 6,
"Url": "/admin/list/App.Accounting.CheckStatus",
"Icon": "FcMultipleInputs",
"RequiredPermissionName": "App.Accounting.CheckStatus",
"IsDisabled": false
},
{
"ParentCode": "App.Accounting.Definitions",
"Code": "App.Accounting.CheckType",
"DisplayName": "App.Accounting.CheckType",
"Order": 7,
"Url": "/admin/list/App.Accounting.CheckType",
"Icon": "FcFlow",
"RequiredPermissionName": "App.Accounting.CheckType",
"IsDisabled": false
},
{
"ParentCode": "App.Accounting",
"Code": "App.Accounting.Cash",

View file

@ -13306,6 +13306,321 @@
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.InvoiceType",
"ParentName": null,
"DisplayName": "App.Accounting.InvoiceType",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.InvoiceType.Create",
"ParentName": "App.Accounting.InvoiceType",
"DisplayName": "Create",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.InvoiceType.Update",
"ParentName": "App.Accounting.InvoiceType",
"DisplayName": "Update",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.InvoiceType.Delete",
"ParentName": "App.Accounting.InvoiceType",
"DisplayName": "Delete",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.InvoiceType.Export",
"ParentName": "App.Accounting.InvoiceType",
"DisplayName": "Export",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.InvoiceType.Import",
"ParentName": "App.Accounting.InvoiceType",
"DisplayName": "Import",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.InvoiceType.Note",
"ParentName": "App.Accounting.InvoiceType",
"DisplayName": "Note",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.InvoiceStatus",
"ParentName": null,
"DisplayName": "App.Accounting.InvoiceStatus",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.InvoiceStatus.Create",
"ParentName": "App.Accounting.InvoiceStatus",
"DisplayName": "Create",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.InvoiceStatus.Update",
"ParentName": "App.Accounting.InvoiceStatus",
"DisplayName": "Update",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.InvoiceStatus.Delete",
"ParentName": "App.Accounting.InvoiceStatus",
"DisplayName": "Delete",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.InvoiceStatus.Export",
"ParentName": "App.Accounting.InvoiceStatus",
"DisplayName": "Export",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.InvoiceStatus.Import",
"ParentName": "App.Accounting.InvoiceStatus",
"DisplayName": "Import",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.InvoiceStatus.Note",
"ParentName": "App.Accounting.InvoiceStatus",
"DisplayName": "Note",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.PaymentStatus",
"ParentName": null,
"DisplayName": "App.Accounting.PaymentStatus",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.PaymentStatus.Create",
"ParentName": "App.Accounting.PaymentStatus",
"DisplayName": "Create",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.PaymentStatus.Update",
"ParentName": "App.Accounting.PaymentStatus",
"DisplayName": "Update",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.PaymentStatus.Delete",
"ParentName": "App.Accounting.PaymentStatus",
"DisplayName": "Delete",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.PaymentStatus.Export",
"ParentName": "App.Accounting.PaymentStatus",
"DisplayName": "Export",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.PaymentStatus.Import",
"ParentName": "App.Accounting.PaymentStatus",
"DisplayName": "Import",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.PaymentStatus.Note",
"ParentName": "App.Accounting.PaymentStatus",
"DisplayName": "Note",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.CheckStatus",
"ParentName": null,
"DisplayName": "App.Accounting.CheckStatus",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.CheckStatus.Create",
"ParentName": "App.Accounting.CheckStatus",
"DisplayName": "Create",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.CheckStatus.Update",
"ParentName": "App.Accounting.CheckStatus",
"DisplayName": "Update",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.CheckStatus.Delete",
"ParentName": "App.Accounting.CheckStatus",
"DisplayName": "Delete",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.CheckStatus.Export",
"ParentName": "App.Accounting.CheckStatus",
"DisplayName": "Export",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.CheckStatus.Import",
"ParentName": "App.Accounting.CheckStatus",
"DisplayName": "Import",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.CheckStatus.Note",
"ParentName": "App.Accounting.CheckStatus",
"DisplayName": "Note",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.CheckType",
"ParentName": null,
"DisplayName": "App.Accounting.CheckType",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.CheckType.Create",
"ParentName": "App.Accounting.CheckType",
"DisplayName": "Create",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.CheckType.Update",
"ParentName": "App.Accounting.CheckType",
"DisplayName": "Update",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.CheckType.Delete",
"ParentName": "App.Accounting.CheckType",
"DisplayName": "Delete",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.CheckType.Export",
"ParentName": "App.Accounting.CheckType",
"DisplayName": "Export",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.CheckType.Import",
"ParentName": "App.Accounting.CheckType",
"DisplayName": "Import",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.CheckType.Note",
"ParentName": "App.Accounting.CheckType",
"DisplayName": "Note",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.Waybill",

View file

@ -221,5 +221,13 @@ public enum TableNameEnum
WaybillType,
WaybillStatus,
Waybill,
WaybillItem
WaybillItem,
InvoiceType,
InvoiceStatus,
PaymentStatus,
Invoice,
InvoiceItem,
CheckStatus,
CheckType,
CheckNote
}

View file

@ -216,12 +216,20 @@ public static class TableNameResolver
// 🔹 ACCOUNTING
{ nameof(TableNameEnum.WaybillType), (TablePrefix.TenantByName, MenuPrefix.Accounting) },
{ nameof(TableNameEnum.WaybillStatus), (TablePrefix.TenantByName, MenuPrefix.Accounting) },
{ nameof(TableNameEnum.InvoiceType), (TablePrefix.TenantByName, MenuPrefix.Accounting) },
{ nameof(TableNameEnum.InvoiceStatus), (TablePrefix.TenantByName, MenuPrefix.Accounting) },
{ nameof(TableNameEnum.PaymentStatus), (TablePrefix.TenantByName, MenuPrefix.Accounting) },
{ nameof(TableNameEnum.CheckStatus), (TablePrefix.TenantByName, MenuPrefix.Accounting) },
{ nameof(TableNameEnum.CheckType), (TablePrefix.TenantByName, MenuPrefix.Accounting) },
{ nameof(TableNameEnum.Bank), (TablePrefix.BranchByName, MenuPrefix.Accounting) },
{ nameof(TableNameEnum.BankAccount), (TablePrefix.BranchByName, MenuPrefix.Accounting) },
{ nameof(TableNameEnum.Cash), (TablePrefix.BranchByName, MenuPrefix.Accounting) },
{ nameof(TableNameEnum.CurrentAccount), (TablePrefix.BranchByName, MenuPrefix.Accounting) },
{ nameof(TableNameEnum.Waybill), (TablePrefix.BranchByName, MenuPrefix.Accounting) },
{ nameof(TableNameEnum.WaybillItem), (TablePrefix.BranchByName, MenuPrefix.Accounting) },
{ nameof(TableNameEnum.Invoice), (TablePrefix.BranchByName, MenuPrefix.Accounting) },
{ nameof(TableNameEnum.InvoiceItem), (TablePrefix.BranchByName, MenuPrefix.Accounting) },
{ nameof(TableNameEnum.CheckNote), (TablePrefix.BranchByName, MenuPrefix.Accounting) },
// 🔹 STORE
{ nameof(TableNameEnum.WarehouseType), (TablePrefix.TenantByName, MenuPrefix.Store) },

View file

@ -571,6 +571,11 @@ public static class SeedConsts
public const string WaybillStatus = Default + ".WaybillStatus";
public const string Waybill = Default + ".Waybill";
public const string WaybillItem = Default + ".WaybillItem";
public const string InvoiceType = Default + ".InvoiceType";
public const string InvoiceStatus = Default + ".InvoiceStatus";
public const string PaymentStatus = Default + ".PaymentStatus";
public const string CheckStatus = Default + ".CheckStatus";
public const string CheckType = Default + ".CheckType";
}
public static class Store

View file

@ -0,0 +1,40 @@
using System;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;
namespace Erp.Platform.Entities;
public class CheckNote : FullAuditedEntity<Guid>, IMultiTenant
{
public Guid? TenantId { get; set; }
public Guid? BranchId { get; set; }
public string CheckNumber { get; set; }
public string BankName { get; set; }
public string BranchName { get; set; }
public string AccountNumber { get; set; }
public string DrawerName { get; set; }
public string PayeeName { get; set; }
public Guid CurrentAccountId { get; set; }
public CurrentAccount CurrentAccount { get; set; }
public DateTime IssueDate { get; set; }
public DateTime DueDate { get; set; }
public decimal Amount { get; set; }
public string Currency { get; set; }
public Guid StatusId { get; set; }
public CheckStatus Status { get; set; }
public Guid TypeId { get; set; }
public CheckType Type { get; set; }
public DateTime? BankingDate { get; set; }
public DateTime? CollectionDate { get; set; }
public string EndorsedTo { get; set; }
public string Notes { get; set; }
}

View file

@ -1,4 +1,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;
@ -28,4 +30,8 @@ public class CurrentAccount : FullAuditedEntity<Guid>, IMultiTenant
public PaymentTerm? PaymentTerm { get; set; }
public bool IsActive { get; set; }
public ICollection<Waybill> Waybills { get; set; }
public ICollection<Invoice> Invoices { get; set; }
public ICollection<CheckNote> Checks { get; set; }
}

View file

@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;
namespace Erp.Platform.Entities;
public class Invoice : FullAuditedEntity<Guid>, IMultiTenant
{
public Guid? TenantId { get; set; }
public Guid? BranchId { get; set; }
public string InvoiceNumber { get; set; }
public Guid InvoiceTypeId { get; set; }
public InvoiceType InvoiceType { get; set; }
public Guid CurrentAccountId { get; set; }
public CurrentAccount CurrentAccount { get; set; }
public DateTime InvoiceDate { get; set; }
public DateTime DueDate { get; set; }
public DateTime? DeliveryDate { get; set; }
public decimal Subtotal { get; set; }
public decimal TaxAmount { get; set; }
public decimal DiscountAmount { get; set; }
public decimal TotalAmount { get; set; }
public decimal PaidAmount { get; set; }
public decimal RemainingAmount { get; set; }
public string Currency { get; set; }
public Guid StatusId { get; set; }
public InvoiceStatus Status { get; set; }
public Guid PaymentStatusId { get; set; }
public PaymentStatus PaymentStatus { get; set; }
public Guid? WaybillId { get; set; }
public string Notes { get; set; }
public ICollection<InvoiceItem> Items { get; set; }
}

View file

@ -0,0 +1,30 @@
using System;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;
namespace Erp.Platform.Entities;
public class InvoiceItem : FullAuditedEntity<Guid>, IMultiTenant
{
public Guid? TenantId { get; set; }
public Guid InvoiceId { get; set; }
public Invoice Invoice { get; set; }
public Guid? MaterialId { get; set; }
public Material Material { get; set; }
public string Uom { get; set; }
public string Description { get; set; }
public decimal Quantity { get; set; }
public decimal UnitPrice { get; set; }
public decimal LineTotal { get; set; }
public decimal DiscountRate { get; set; }
public decimal DiscountAmount { get; set; }
public decimal TaxRate { get; set; }
public decimal TaxAmount { get; set; }
public decimal NetAmount { get; set; }
}

View file

@ -20,10 +20,10 @@ public class Waybill : FullAuditedEntity<Guid>, IMultiTenant
public DateTime WaybillDate { get; set; }
public DateTime? DeliveryDate { get; set; }
public double Subtotal { get; set; }
public double TaxAmount { get; set; }
public double DiscountAmount { get; set; }
public double TotalAmount { get; set; }
public decimal Subtotal { get; set; }
public decimal TaxAmount { get; set; }
public decimal DiscountAmount { get; set; }
public decimal TotalAmount { get; set; }
public string Currency { get; set; }
public Guid WaybillStatusId { get; set; }

View file

@ -7,25 +7,24 @@ namespace Erp.Platform.Entities;
public class WaybillItem : FullAuditedEntity<Guid>, IMultiTenant
{
public Guid? TenantId { get; set; }
public Guid? BranchId { get; set; }
public Guid WaybillId { get; set; }
public Waybill Waybill { get; set; }
public Guid? MaterialId { get; set; }
public Material Material { get; set; }
public string Uom { get; set; }
public string Description { get; set; }
public double Quantity { get; set; }
public string Unit { get; set; }
public double UnitPrice { get; set; }
public double LineTotal { get; set; }
public decimal Quantity { get; set; }
public decimal UnitPrice { get; set; }
public decimal LineTotal { get; set; }
public double DiscountRate { get; set; }
public double DiscountAmount { get; set; }
public decimal DiscountRate { get; set; }
public decimal DiscountAmount { get; set; }
public double TaxRate { get; set; }
public double TaxAmount { get; set; }
public double NetAmount { get; set; }
public decimal TaxRate { get; set; }
public decimal TaxAmount { get; set; }
public decimal NetAmount { get; set; }
}

View file

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;
namespace Erp.Platform.Entities;
public class CheckStatus : FullAuditedEntity<Guid>, IMultiTenant
{
public Guid? TenantId { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public bool IsActive { get; set; }
public ICollection<CheckNote> Checks { get; set; }
}

View file

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;
namespace Erp.Platform.Entities;
public class CheckType : FullAuditedEntity<Guid>, IMultiTenant
{
public Guid? TenantId { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public bool IsActive { get; set; }
public ICollection<CheckNote> Checks { get; set; }
}

View file

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;
namespace Erp.Platform.Entities;
public class InvoiceStatus : FullAuditedEntity<Guid>, IMultiTenant
{
public Guid? TenantId { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public bool IsActive { get; set; }
public ICollection<Invoice> Invoices { get; set; }
}

View file

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;
namespace Erp.Platform.Entities;
public class InvoiceType : FullAuditedEntity<Guid>, IMultiTenant
{
public Guid? TenantId { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public bool IsActive { get; set; }
public ICollection<Invoice> Invoices { get; set; }
}

View file

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;
namespace Erp.Platform.Entities;
public class PaymentStatus : FullAuditedEntity<Guid>, IMultiTenant
{
public Guid? TenantId { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public bool IsActive { get; set; }
public ICollection<Invoice> Invoices { get; set; }
}

View file

@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;
@ -11,4 +12,6 @@ public class WaybillStatus : FullAuditedEntity<Guid>, IMultiTenant
public string Name { get; set; }
public string Description { get; set; }
public bool IsActive { get; set; }
public ICollection<Waybill> Waybills { get; set; }
}

View file

@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;
@ -11,4 +12,6 @@ public class WaybillType : FullAuditedEntity<Guid>, IMultiTenant
public string Name { get; set; }
public string Description { get; set; }
public bool IsActive { get; set; }
public ICollection<Waybill> Waybills { get; set; }
}

View file

@ -37,5 +37,7 @@ public class Material : FullAuditedEntity<Guid>, IMultiTenant
public List<PurchaseOrderItem> PurchaseOrderItems { get; set; }
public List<SalesOrderItem> SalesOrderItems { get; set; }
public List<MovementItem> MovementItems { get; set; }
public List<WaybillItem> WaybillItems { get; set; }
public List<InvoiceItem> InvoiceItems { get; set; }
}

View file

@ -302,6 +302,13 @@ public class PlatformDbContext :
public DbSet<WaybillStatus> WaybillStatuses { get; set; }
public DbSet<Waybill> Waybills { get; set; }
public DbSet<WaybillItem> WaybillItems { get; set; }
public DbSet<InvoiceType> InvoiceTypes { get; set; }
public DbSet<InvoiceStatus> InvoiceStatuses { get; set; }
public DbSet<PaymentStatus> PaymentStatuses { get; set; }
public DbSet<CheckStatus> CheckStatuses { get; set; }
public DbSet<CheckType> CheckTypes { get; set; }
public DbSet<Invoice> Invoices { get; set; }
public DbSet<InvoiceItem> InvoiceItems { get; set; }
#endregion
public PlatformDbContext(DbContextOptions<PlatformDbContext> options)
@ -3895,5 +3902,248 @@ public class PlatformDbContext :
b.Property(x => x.Description).HasMaxLength(500);
b.Property(x => x.IsActive).HasDefaultValue(true);
});
builder.Entity<Waybill>(b =>
{
b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Waybill)), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.WaybillNumber).IsRequired().HasMaxLength(50);
b.Property(x => x.WaybillTypeId).IsRequired();
b.Property(x => x.CurrentAccountId).IsRequired();
b.Property(x => x.WaybillDate).IsRequired();
b.Property(x => x.Subtotal).HasDefaultValue(0).HasPrecision(18, 2);
b.Property(x => x.TaxAmount).HasDefaultValue(0).HasPrecision(18, 2);
b.Property(x => x.DiscountAmount).HasDefaultValue(0).HasPrecision(18, 2);
b.Property(x => x.TotalAmount).HasDefaultValue(0).HasPrecision(18, 2);
b.Property(x => x.Currency).IsRequired().HasMaxLength(10);
b.Property(x => x.WaybillStatusId).IsRequired();
b.Property(x => x.IsInvoiced).HasDefaultValue(false);
b.Property(x => x.DeliveryAddress).HasMaxLength(500);
b.Property(x => x.ReceiverName).HasMaxLength(200);
b.Property(x => x.ReceiverPhone).HasMaxLength(50);
b.Property(x => x.CarrierCompany).HasMaxLength(100);
b.Property(x => x.TrackingNumber).HasMaxLength(100);
b.Property(x => x.Notes).HasMaxLength(1000);
b.HasOne(x => x.CurrentAccount)
.WithMany(ca => ca.Waybills)
.HasForeignKey(x => x.CurrentAccountId)
.OnDelete(DeleteBehavior.Restrict);
b.HasOne(x => x.WaybillType)
.WithMany(wt => wt.Waybills)
.HasForeignKey(x => x.WaybillTypeId)
.OnDelete(DeleteBehavior.Restrict);
b.HasOne(x => x.WaybillStatus)
.WithMany(ws => ws.Waybills)
.HasForeignKey(x => x.WaybillStatusId)
.OnDelete(DeleteBehavior.Restrict);
});
builder.Entity<WaybillItem>(b =>
{
b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.WaybillItem)), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.WaybillId).IsRequired();
b.Property(x => x.MaterialId).IsRequired();
b.Property(x => x.Uom).HasMaxLength(64);
b.Property(x => x.Description).IsRequired().HasMaxLength(500);
b.Property(x => x.Quantity).HasPrecision(18, 2).HasDefaultValue(0);
b.Property(x => x.UnitPrice).HasPrecision(18, 2).HasDefaultValue(0);
b.Property(x => x.LineTotal).HasPrecision(18, 2).HasDefaultValue(0);
b.Property(x => x.DiscountRate).HasPrecision(18, 2).HasDefaultValue(0);
b.Property(x => x.DiscountAmount).HasPrecision(18, 2).HasDefaultValue(0);
b.Property(x => x.TaxRate).HasPrecision(18, 2).HasDefaultValue(0);
b.Property(x => x.TaxAmount).HasPrecision(18, 2).HasDefaultValue(0);
b.Property(x => x.NetAmount).HasPrecision(18, 2).HasDefaultValue(0);
b.HasOne(x => x.Waybill)
.WithMany(ws => ws.Items)
.HasForeignKey(x => x.WaybillId)
.OnDelete(DeleteBehavior.Restrict);
b.HasOne(x => x.Material)
.WithMany(ws => ws.WaybillItems)
.HasForeignKey(x => x.MaterialId)
.OnDelete(DeleteBehavior.Restrict);
});
builder.Entity<InvoiceType>(b =>
{
b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.InvoiceType)), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Name).IsRequired().HasMaxLength(50);
b.Property(x => x.Description).HasMaxLength(500);
b.Property(x => x.IsActive).HasDefaultValue(true);
});
builder.Entity<InvoiceStatus>(b =>
{
b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.InvoiceStatus)), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Name).IsRequired().HasMaxLength(50);
b.Property(x => x.Description).HasMaxLength(500);
b.Property(x => x.IsActive).HasDefaultValue(true);
});
builder.Entity<PaymentStatus>(b =>
{
b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.PaymentStatus)), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Name).IsRequired().HasMaxLength(50);
b.Property(x => x.Description).HasMaxLength(500);
b.Property(x => x.IsActive).HasDefaultValue(true);
});
builder.Entity<Invoice>(b =>
{
b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Invoice)), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.InvoiceNumber).IsRequired().HasMaxLength(50);
b.Property(x => x.InvoiceTypeId).IsRequired();
b.Property(x => x.CurrentAccountId).IsRequired();
b.Property(x => x.InvoiceDate).IsRequired();
b.Property(x => x.DueDate).IsRequired();
b.Property(x => x.Subtotal).HasDefaultValue(0).HasPrecision(18, 2);
b.Property(x => x.TaxAmount).HasDefaultValue(0).HasPrecision(18, 2);
b.Property(x => x.DiscountAmount).HasDefaultValue(0).HasPrecision(18, 2);
b.Property(x => x.TotalAmount).HasDefaultValue(0).HasPrecision(18, 2);
b.Property(x => x.PaidAmount).HasDefaultValue(0).HasPrecision(18, 2);
b.Property(x => x.RemainingAmount).HasDefaultValue(0).HasPrecision(18, 2);
b.Property(x => x.Currency).IsRequired().HasMaxLength(10);
b.Property(x => x.StatusId).IsRequired();
b.Property(x => x.Notes).HasMaxLength(1000);
b.HasOne(x => x.CurrentAccount)
.WithMany(ca => ca.Invoices)
.HasForeignKey(x => x.CurrentAccountId)
.OnDelete(DeleteBehavior.Restrict);
b.HasOne(x => x.InvoiceType)
.WithMany(ca => ca.Invoices)
.HasForeignKey(x => x.InvoiceTypeId)
.OnDelete(DeleteBehavior.Restrict);
b.HasOne(x => x.Status)
.WithMany(ca => ca.Invoices)
.HasForeignKey(x => x.StatusId)
.OnDelete(DeleteBehavior.Restrict);
b.HasOne(x => x.PaymentStatus)
.WithMany(ca => ca.Invoices)
.HasForeignKey(x => x.PaymentStatusId)
.OnDelete(DeleteBehavior.Restrict);
});
builder.Entity<InvoiceItem>(b =>
{
b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.InvoiceItem)), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.InvoiceId).IsRequired();
b.Property(x => x.MaterialId).IsRequired();
b.Property(x => x.Uom).HasMaxLength(64).IsRequired();
b.Property(x => x.Description).IsRequired().HasMaxLength(500);
b.Property(x => x.Quantity).HasDefaultValue(0).HasPrecision(18, 2);
b.Property(x => x.UnitPrice).HasDefaultValue(0).HasPrecision(18, 2);
b.Property(x => x.LineTotal).HasDefaultValue(0).HasPrecision(18, 2);
b.Property(x => x.DiscountRate).HasDefaultValue(0).HasPrecision(18, 2);
b.Property(x => x.DiscountAmount).HasDefaultValue(0).HasPrecision(18, 2);
b.Property(x => x.TaxRate).HasDefaultValue(0).HasPrecision(18, 2);
b.Property(x => x.TaxAmount).HasDefaultValue(0).HasPrecision(18, 2);
b.Property(x => x.NetAmount).HasDefaultValue(0).HasPrecision(18, 2);
b.HasOne(x => x.Invoice)
.WithMany(ca => ca.Items)
.HasForeignKey(x => x.InvoiceId)
.OnDelete(DeleteBehavior.Restrict);
b.HasOne(x => x.Material)
.WithMany(ca => ca.InvoiceItems)
.HasForeignKey(x => x.MaterialId)
.OnDelete(DeleteBehavior.Restrict);
});
builder.Entity<CheckStatus>(b =>
{
b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.CheckStatus)), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Name).IsRequired().HasMaxLength(50);
b.Property(x => x.Description).HasMaxLength(500);
b.Property(x => x.IsActive).HasDefaultValue(true);
});
builder.Entity<CheckType>(b =>
{
b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.CheckType)), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Name).IsRequired().HasMaxLength(50);
b.Property(x => x.Description).HasMaxLength(500);
b.Property(x => x.IsActive).HasDefaultValue(true);
});
builder.Entity<CheckNote>(b =>
{
b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.CheckNote)), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.CheckNumber).IsRequired().HasMaxLength(50);
b.Property(x => x.BankName).HasMaxLength(200);
b.Property(x => x.BranchName).HasMaxLength(200);
b.Property(x => x.AccountNumber).HasMaxLength(100);
b.Property(x => x.DrawerName).HasMaxLength(200);
b.Property(x => x.PayeeName).HasMaxLength(200);
b.Property(x => x.IssueDate).IsRequired();
b.Property(x => x.DueDate).IsRequired();
b.Property(x => x.Amount).HasDefaultValue(0).HasPrecision(18, 2);
b.Property(x => x.Currency).HasMaxLength(10).IsRequired();
b.Property(x => x.StatusId).IsRequired();
b.Property(x => x.TypeId).IsRequired();
b.Property(x => x.EndorsedTo).HasMaxLength(200);
b.Property(x => x.Notes).HasMaxLength(1000);
// FK → CurrentAccount (ZORUNLU)
b.HasOne(x => x.CurrentAccount)
.WithMany(ca => ca.Checks)
.HasForeignKey(x => x.CurrentAccountId)
.OnDelete(DeleteBehavior.Restrict);
b.HasOne(x => x.Status)
.WithMany(ca => ca.Checks)
.HasForeignKey(x => x.StatusId)
.OnDelete(DeleteBehavior.Restrict);
b.HasOne(x => x.Type)
.WithMany(ca => ca.Checks)
.HasForeignKey(x => x.TypeId)
.OnDelete(DeleteBehavior.Restrict);
});
}
}

View file

@ -490,6 +490,116 @@ namespace Erp.Platform.Migrations
table.PrimaryKey("PK_Acc_B_Cash", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Acc_T_CheckStatus",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
Description = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
IsActive = table.Column<bool>(type: "bit", nullable: false, defaultValue: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Acc_T_CheckStatus", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Acc_T_CheckType",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
Description = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
IsActive = table.Column<bool>(type: "bit", nullable: false, defaultValue: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Acc_T_CheckType", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Acc_T_InvoiceStatus",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
Description = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
IsActive = table.Column<bool>(type: "bit", nullable: false, defaultValue: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Acc_T_InvoiceStatus", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Acc_T_InvoiceType",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
Description = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
IsActive = table.Column<bool>(type: "bit", nullable: false, defaultValue: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Acc_T_InvoiceType", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Acc_T_PaymentStatus",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
Description = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
IsActive = table.Column<bool>(type: "bit", nullable: false, defaultValue: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Acc_T_PaymentStatus", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Acc_T_WaybillStatus",
columns: table => new
@ -5103,6 +5213,55 @@ namespace Erp.Platform.Migrations
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "Acc_B_CheckNote",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
BranchId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
CheckNumber = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
BankName = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
BranchName = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
AccountNumber = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
DrawerName = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
PayeeName = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
CurrentAccountId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
IssueDate = table.Column<DateTime>(type: "datetime2", nullable: false),
DueDate = table.Column<DateTime>(type: "datetime2", nullable: false),
Amount = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
Currency = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: false),
StatusId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TypeId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
BankingDate = table.Column<DateTime>(type: "datetime2", nullable: true),
CollectionDate = table.Column<DateTime>(type: "datetime2", nullable: true),
EndorsedTo = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
Notes = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Acc_B_CheckNote", x => x.Id);
table.ForeignKey(
name: "FK_Acc_B_CheckNote_Acc_T_CheckStatus_StatusId",
column: x => x.StatusId,
principalTable: "Acc_T_CheckStatus",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_Acc_B_CheckNote_Acc_T_CheckType_TypeId",
column: x => x.TypeId,
principalTable: "Acc_T_CheckType",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "Acc_B_CurrentAccount",
columns: table => new
@ -5141,31 +5300,92 @@ namespace Erp.Platform.Migrations
});
migrationBuilder.CreateTable(
name: "Waybills",
name: "Acc_B_Invoice",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
BranchId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
WaybillNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
InvoiceNumber = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
InvoiceTypeId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
CurrentAccountId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
InvoiceDate = table.Column<DateTime>(type: "datetime2", nullable: false),
DueDate = table.Column<DateTime>(type: "datetime2", nullable: false),
DeliveryDate = table.Column<DateTime>(type: "datetime2", nullable: true),
Subtotal = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
TaxAmount = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
DiscountAmount = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
TotalAmount = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
PaidAmount = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
RemainingAmount = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
Currency = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: false),
StatusId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
PaymentStatusId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
WaybillId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Notes = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Acc_B_Invoice", x => x.Id);
table.ForeignKey(
name: "FK_Acc_B_Invoice_Acc_B_CurrentAccount_CurrentAccountId",
column: x => x.CurrentAccountId,
principalTable: "Acc_B_CurrentAccount",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_Acc_B_Invoice_Acc_T_InvoiceStatus_StatusId",
column: x => x.StatusId,
principalTable: "Acc_T_InvoiceStatus",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_Acc_B_Invoice_Acc_T_InvoiceType_InvoiceTypeId",
column: x => x.InvoiceTypeId,
principalTable: "Acc_T_InvoiceType",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_Acc_B_Invoice_Acc_T_PaymentStatus_PaymentStatusId",
column: x => x.PaymentStatusId,
principalTable: "Acc_T_PaymentStatus",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "Acc_B_Waybill",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
BranchId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
WaybillNumber = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
WaybillTypeId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
CurrentAccountId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
WaybillDate = table.Column<DateTime>(type: "datetime2", nullable: false),
DeliveryDate = table.Column<DateTime>(type: "datetime2", nullable: true),
Subtotal = table.Column<double>(type: "float", nullable: false),
TaxAmount = table.Column<double>(type: "float", nullable: false),
DiscountAmount = table.Column<double>(type: "float", nullable: false),
TotalAmount = table.Column<double>(type: "float", nullable: false),
Currency = table.Column<string>(type: "nvarchar(max)", nullable: true),
Subtotal = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
TaxAmount = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
DiscountAmount = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
TotalAmount = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
Currency = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: false),
WaybillStatusId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
IsInvoiced = table.Column<bool>(type: "bit", nullable: false),
IsInvoiced = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
InvoiceId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeliveryAddress = table.Column<string>(type: "nvarchar(max)", nullable: true),
ReceiverName = table.Column<string>(type: "nvarchar(max)", nullable: true),
ReceiverPhone = table.Column<string>(type: "nvarchar(max)", nullable: true),
CarrierCompany = table.Column<string>(type: "nvarchar(max)", nullable: true),
TrackingNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
Notes = table.Column<string>(type: "nvarchar(max)", nullable: true),
DeliveryAddress = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
ReceiverName = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
ReceiverPhone = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
CarrierCompany = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
TrackingNumber = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
Notes = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
@ -5176,46 +5396,45 @@ namespace Erp.Platform.Migrations
},
constraints: table =>
{
table.PrimaryKey("PK_Waybills", x => x.Id);
table.PrimaryKey("PK_Acc_B_Waybill", x => x.Id);
table.ForeignKey(
name: "FK_Waybills_Acc_B_CurrentAccount_CurrentAccountId",
name: "FK_Acc_B_Waybill_Acc_B_CurrentAccount_CurrentAccountId",
column: x => x.CurrentAccountId,
principalTable: "Acc_B_CurrentAccount",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_Waybills_Acc_T_WaybillStatus_WaybillStatusId",
name: "FK_Acc_B_Waybill_Acc_T_WaybillStatus_WaybillStatusId",
column: x => x.WaybillStatusId,
principalTable: "Acc_T_WaybillStatus",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_Waybills_Acc_T_WaybillType_WaybillTypeId",
name: "FK_Acc_B_Waybill_Acc_T_WaybillType_WaybillTypeId",
column: x => x.WaybillTypeId,
principalTable: "Acc_T_WaybillType",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "WaybillItems",
name: "Acc_B_InvoiceItem",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
BranchId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
WaybillId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
MaterialId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Description = table.Column<string>(type: "nvarchar(max)", nullable: true),
Quantity = table.Column<double>(type: "float", nullable: false),
Unit = table.Column<string>(type: "nvarchar(max)", nullable: true),
UnitPrice = table.Column<double>(type: "float", nullable: false),
LineTotal = table.Column<double>(type: "float", nullable: false),
DiscountRate = table.Column<double>(type: "float", nullable: false),
DiscountAmount = table.Column<double>(type: "float", nullable: false),
TaxRate = table.Column<double>(type: "float", nullable: false),
TaxAmount = table.Column<double>(type: "float", nullable: false),
NetAmount = table.Column<double>(type: "float", nullable: false),
InvoiceId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
MaterialId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Uom = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
Description = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: false),
Quantity = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
UnitPrice = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
LineTotal = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
DiscountRate = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
DiscountAmount = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
TaxRate = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
TaxAmount = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
NetAmount = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
@ -5226,18 +5445,62 @@ namespace Erp.Platform.Migrations
},
constraints: table =>
{
table.PrimaryKey("PK_WaybillItems", x => x.Id);
table.PrimaryKey("PK_Acc_B_InvoiceItem", x => x.Id);
table.ForeignKey(
name: "FK_WaybillItems_Scp_T_Material_MaterialId",
name: "FK_Acc_B_InvoiceItem_Acc_B_Invoice_InvoiceId",
column: x => x.InvoiceId,
principalTable: "Acc_B_Invoice",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_Acc_B_InvoiceItem_Scp_T_Material_MaterialId",
column: x => x.MaterialId,
principalTable: "Scp_T_Material",
principalColumn: "Id");
table.ForeignKey(
name: "FK_WaybillItems_Waybills_WaybillId",
column: x => x.WaybillId,
principalTable: "Waybills",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "Acc_B_WaybillItem",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
WaybillId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
MaterialId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Uom = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
Description = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: false),
Quantity = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
UnitPrice = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
LineTotal = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
DiscountRate = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
DiscountAmount = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
TaxRate = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
TaxAmount = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
NetAmount = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Acc_B_WaybillItem", x => x.Id);
table.ForeignKey(
name: "FK_Acc_B_WaybillItem_Acc_B_Waybill_WaybillId",
column: x => x.WaybillId,
principalTable: "Acc_B_Waybill",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_Acc_B_WaybillItem_Scp_T_Material_MaterialId",
column: x => x.MaterialId,
principalTable: "Scp_T_Material",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
@ -8190,6 +8453,21 @@ namespace Erp.Platform.Migrations
table: "Acc_B_BankAccount",
column: "BankId");
migrationBuilder.CreateIndex(
name: "IX_Acc_B_CheckNote_CurrentAccountId",
table: "Acc_B_CheckNote",
column: "CurrentAccountId");
migrationBuilder.CreateIndex(
name: "IX_Acc_B_CheckNote_StatusId",
table: "Acc_B_CheckNote",
column: "StatusId");
migrationBuilder.CreateIndex(
name: "IX_Acc_B_CheckNote_TypeId",
table: "Acc_B_CheckNote",
column: "TypeId");
migrationBuilder.CreateIndex(
name: "IX_Acc_B_CurrentAccount_PartnerId",
table: "Acc_B_CurrentAccount",
@ -8200,6 +8478,61 @@ namespace Erp.Platform.Migrations
table: "Acc_B_CurrentAccount",
column: "PaymentTermId");
migrationBuilder.CreateIndex(
name: "IX_Acc_B_Invoice_CurrentAccountId",
table: "Acc_B_Invoice",
column: "CurrentAccountId");
migrationBuilder.CreateIndex(
name: "IX_Acc_B_Invoice_InvoiceTypeId",
table: "Acc_B_Invoice",
column: "InvoiceTypeId");
migrationBuilder.CreateIndex(
name: "IX_Acc_B_Invoice_PaymentStatusId",
table: "Acc_B_Invoice",
column: "PaymentStatusId");
migrationBuilder.CreateIndex(
name: "IX_Acc_B_Invoice_StatusId",
table: "Acc_B_Invoice",
column: "StatusId");
migrationBuilder.CreateIndex(
name: "IX_Acc_B_InvoiceItem_InvoiceId",
table: "Acc_B_InvoiceItem",
column: "InvoiceId");
migrationBuilder.CreateIndex(
name: "IX_Acc_B_InvoiceItem_MaterialId",
table: "Acc_B_InvoiceItem",
column: "MaterialId");
migrationBuilder.CreateIndex(
name: "IX_Acc_B_Waybill_CurrentAccountId",
table: "Acc_B_Waybill",
column: "CurrentAccountId");
migrationBuilder.CreateIndex(
name: "IX_Acc_B_Waybill_WaybillStatusId",
table: "Acc_B_Waybill",
column: "WaybillStatusId");
migrationBuilder.CreateIndex(
name: "IX_Acc_B_Waybill_WaybillTypeId",
table: "Acc_B_Waybill",
column: "WaybillTypeId");
migrationBuilder.CreateIndex(
name: "IX_Acc_B_WaybillItem_MaterialId",
table: "Acc_B_WaybillItem",
column: "MaterialId");
migrationBuilder.CreateIndex(
name: "IX_Acc_B_WaybillItem_WaybillId",
table: "Acc_B_WaybillItem",
column: "WaybillId");
migrationBuilder.CreateIndex(
name: "IX_Adm_T_BlogCategory_Slug",
table: "Adm_T_BlogCategory",
@ -9488,30 +9821,13 @@ namespace Erp.Platform.Migrations
table: "Str_T_Zone",
column: "ZoneTypeId");
migrationBuilder.CreateIndex(
name: "IX_WaybillItems_MaterialId",
table: "WaybillItems",
column: "MaterialId");
migrationBuilder.CreateIndex(
name: "IX_WaybillItems_WaybillId",
table: "WaybillItems",
column: "WaybillId");
migrationBuilder.CreateIndex(
name: "IX_Waybills_CurrentAccountId",
table: "Waybills",
column: "CurrentAccountId");
migrationBuilder.CreateIndex(
name: "IX_Waybills_WaybillStatusId",
table: "Waybills",
column: "WaybillStatusId");
migrationBuilder.CreateIndex(
name: "IX_Waybills_WaybillTypeId",
table: "Waybills",
column: "WaybillTypeId");
migrationBuilder.AddForeignKey(
name: "FK_Acc_B_CheckNote_Acc_B_CurrentAccount_CurrentAccountId",
table: "Acc_B_CheckNote",
column: "CurrentAccountId",
principalTable: "Acc_B_CurrentAccount",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_Acc_B_CurrentAccount_Adm_T_Partner_PartnerId",
@ -9703,6 +10019,15 @@ namespace Erp.Platform.Migrations
migrationBuilder.DropTable(
name: "Acc_B_Cash");
migrationBuilder.DropTable(
name: "Acc_B_CheckNote");
migrationBuilder.DropTable(
name: "Acc_B_InvoiceItem");
migrationBuilder.DropTable(
name: "Acc_B_WaybillItem");
migrationBuilder.DropTable(
name: "Adm_T_About");
@ -10060,9 +10385,6 @@ namespace Erp.Platform.Migrations
migrationBuilder.DropTable(
name: "Str_T_PutawayCondition");
migrationBuilder.DropTable(
name: "WaybillItems");
migrationBuilder.DropTable(
name: "AbpEntityChanges");
@ -10078,6 +10400,18 @@ namespace Erp.Platform.Migrations
migrationBuilder.DropTable(
name: "AbpUsers");
migrationBuilder.DropTable(
name: "Acc_T_CheckStatus");
migrationBuilder.DropTable(
name: "Acc_T_CheckType");
migrationBuilder.DropTable(
name: "Acc_B_Invoice");
migrationBuilder.DropTable(
name: "Acc_B_Waybill");
migrationBuilder.DropTable(
name: "Adm_T_BlogCategory");
@ -10196,10 +10530,25 @@ namespace Erp.Platform.Migrations
name: "Str_T_Putaway");
migrationBuilder.DropTable(
name: "Waybills");
name: "AbpAuditLogs");
migrationBuilder.DropTable(
name: "AbpAuditLogs");
name: "Acc_T_InvoiceStatus");
migrationBuilder.DropTable(
name: "Acc_T_InvoiceType");
migrationBuilder.DropTable(
name: "Acc_T_PaymentStatus");
migrationBuilder.DropTable(
name: "Acc_B_CurrentAccount");
migrationBuilder.DropTable(
name: "Acc_T_WaybillStatus");
migrationBuilder.DropTable(
name: "Acc_T_WaybillType");
migrationBuilder.DropTable(
name: "Crd_B_RegistrationType");
@ -10279,15 +10628,6 @@ namespace Erp.Platform.Migrations
migrationBuilder.DropTable(
name: "Str_T_ReferenceType");
migrationBuilder.DropTable(
name: "Acc_B_CurrentAccount");
migrationBuilder.DropTable(
name: "Acc_T_WaybillStatus");
migrationBuilder.DropTable(
name: "Acc_T_WaybillType");
migrationBuilder.DropTable(
name: "Sas_T_Branch");

View file

@ -6732,5 +6732,120 @@
"description": "Malzeme iadeleri için kullanılan irsaliye türü",
"isActive": true
}
]
],
"InvoiceTypes": [
{
"name": "Satış",
"description": "Satış faturası türü",
"isActive": true
},
{
"name": "Satın Alma",
"description": "Satın alma faturası türü",
"isActive": true
},
{
"name": "İade",
"description": "İade faturası türü",
"isActive": true
},
{
"name": "Proforma",
"description": "Proforma faturası türü",
"isActive": true
}
],
"InvoiceStatuses": [
{
"name": "Taslak",
"description": "Faturanın taslak aşamasında olduğunu ifade eder",
"isActive": true
},
{
"name": "Onaylandı",
"description": "Faturanın onaylandığını ifade eder",
"isActive": true
},
{
"name": "Gönderildi",
"description": "Faturanın gönderildiğini ifade eder",
"isActive": true
},
{
"name": "Ödendi",
"description": "Faturanın ödendiğini ifade eder",
"isActive": true
},
{
"name": "İptal Edildi",
"description": "Faturanın iptal edildiğini ifade eder",
"isActive": true
}
],
"PaymentStatuses": [
{
"name": "Ödenmemiş",
"description": "Faturanın ödenmemiş olduğunu ifade eder",
"isActive": true
},
{
"name": "Kısmen Ödenmiş",
"description": "Faturanın kısmen ödendiğini ifade eder",
"isActive": true
},
{
"name": "Tamamen Ödenmiş",
"description": "Faturanın tamamen ödendiğini ifade eder",
"isActive": true
},
{
"name": "Vadesi Geçmiş",
"description": "Faturanın gecikmiş olduğunu ifade eder",
"isActive": true
}
],
"CheckStatuses": [
{
"name": "Cüzdanda",
"description": "Çek henüz bankaya verilmemiştir",
"isActive": true
},
{
"name": "Hesaba Yatırıldı",
"description": "Çek bankaya yatırılmıştır",
"isActive": true
},
{
"name": "Tahsil Edildi",
"description": "Çek tahsil edilmiştir",
"isActive": true
},
{
"name": "İade Oldu",
"description": "Çek iade olmuştur",
"isActive": true
},
{
"name": "Ciro Edildi",
"description": "Çek ciro edilmiştir",
"isActive": true
},
{
"name": "İptal Edildi",
"description": "Çek iptal edilmiştir",
"isActive": true
}
],
"CheckTypes": [
{
"name": "Alınan",
"description": "Alınan çekler",
"isActive": true
},
{
"name": "Verilen",
"description": "Verilen çekler",
"isActive": true
}
]
}

View file

@ -14,7 +14,7 @@ using System.Linq;
using System.Collections.Generic;
using Volo.Abp.Identity;
using Volo.Abp.Timing;
using System.Security.Cryptography.Xml;
using Volo.Abp;
namespace Erp.Platform.Data.Seeds;
@ -149,6 +149,11 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
private readonly IRepository<MovementItem, Guid> _movementItemRepository;
private readonly IRepository<WaybillStatus, Guid> _waybillStatusRepository;
private readonly IRepository<WaybillType, Guid> _waybillTypeRepository;
private readonly IRepository<InvoiceType, Guid> _invoiceTypeRepository;
private readonly IRepository<InvoiceStatus, Guid> _invoiceStatusRepository;
private readonly IRepository<PaymentStatus, Guid> _paymentStatusRepository;
private readonly IRepository<CheckStatus, Guid> _checkStatusRepository;
private readonly IRepository<CheckType, Guid> _checkTypeRepository;
public TenantDataSeeder(
IClock clock,
@ -279,7 +284,12 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
IRepository<Movement, Guid> movementRepository,
IRepository<MovementItem, Guid> movementItemRepository,
IRepository<WaybillStatus, Guid> waybillStatusRepository,
IRepository<WaybillType, Guid> waybillTypeRepository
IRepository<WaybillType, Guid> waybillTypeRepository,
IRepository<InvoiceType, Guid> invoiceTypeRepository,
IRepository<InvoiceStatus, Guid> invoiceStatusRepository,
IRepository<PaymentStatus, Guid> paymentStatusRepository,
IRepository<CheckStatus, Guid> checkStatusRepository,
IRepository<CheckType, Guid> checkTypeRepository
)
{
_clock = clock;
@ -412,6 +422,11 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
_movementItemRepository = movementItemRepository;
_waybillStatusRepository = waybillStatusRepository;
_waybillTypeRepository = waybillTypeRepository;
_invoiceTypeRepository = invoiceTypeRepository;
_invoiceStatusRepository = invoiceStatusRepository;
_paymentStatusRepository = paymentStatusRepository;
_checkStatusRepository = checkStatusRepository;
_checkTypeRepository = checkTypeRepository;
}
private static IConfigurationRoot BuildConfiguration()
@ -2878,6 +2893,76 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
IsActive = item.IsActive
}, autoSave: true);
}
foreach (var item in items.InvoiceTypes)
{
var exists = await _invoiceTypeRepository.AnyAsync(x => x.Name == item.Name);
if (exists)
continue;
await _invoiceTypeRepository.InsertAsync(new InvoiceType
{
Name = item.Name,
Description = item.Description,
IsActive = item.IsActive
}, autoSave: true);
}
foreach (var item in items.InvoiceStatuses)
{
var exists = await _invoiceStatusRepository.AnyAsync(x => x.Name == item.Name);
if (exists)
continue;
await _invoiceStatusRepository.InsertAsync(new InvoiceStatus
{
Name = item.Name,
Description = item.Description,
IsActive = item.IsActive
}, autoSave: true);
}
foreach (var item in items.PaymentStatuses)
{
var exists = await _paymentStatusRepository.AnyAsync(x => x.Name == item.Name);
if (exists)
continue;
await _paymentStatusRepository.InsertAsync(new PaymentStatus
{
Name = item.Name,
Description = item.Description,
IsActive = item.IsActive
}, autoSave: true);
}
foreach (var item in items.CheckStatuses)
{
var exists = await _checkStatusRepository.AnyAsync(x => x.Name == item.Name);
if (exists)
continue;
await _checkStatusRepository.InsertAsync(new CheckStatus
{
Name = item.Name,
Description = item.Description,
IsActive = item.IsActive
}, autoSave: true);
}
foreach (var item in items.CheckTypes)
{
var exists = await _checkTypeRepository.AnyAsync(x => x.Name == item.Name);
if (exists)
continue;
await _checkTypeRepository.InsertAsync(new CheckType
{
Name = item.Name,
Description = item.Description,
IsActive = item.IsActive
}, autoSave: true);
}
}
}

View file

@ -151,6 +151,46 @@ public class TenantSeederDto
//Accounting
public List<WaybillTypeSeedDto> WaybillTypes { get; set; }
public List<WaybillStatusSeedDto> WaybillStatuses { get; set; }
public List<InvoiceTypeSeedDto> InvoiceTypes { get; set; }
public List<InvoiceStatusSeedDto> InvoiceStatuses { get; set; }
public List<PaymentStatusSeedDto> PaymentStatuses { get; set; }
public List<CheckStatusSeedDto> CheckStatuses { get; set; }
public List<CheckTypeSeedDto> CheckTypes { get; set; }
}
public class CheckTypeSeedDto
{
public string Name { get; set; }
public string Description { get; set; }
public bool IsActive { get; set; }
}
public class CheckStatusSeedDto
{
public string Name { get; set; }
public string Description { get; set; }
public bool IsActive { get; set; }
}
public class PaymentStatusSeedDto
{
public string Name { get; set; }
public string Description { get; set; }
public bool IsActive { get; set; }
}
public class InvoiceStatusSeedDto
{
public string Name { get; set; }
public string Description { get; set; }
public bool IsActive { get; set; }
}
public class InvoiceTypeSeedDto
{
public string Name { get; set; }
public string Description { get; set; }
public bool IsActive { get; set; }
}
public class WaybillTypeSeedDto