SalesOrders Seeder düzenlemesi
This commit is contained in:
parent
4a1eb264b1
commit
1c5ff7bdd5
20 changed files with 2172 additions and 32 deletions
|
|
@ -9985,12 +9985,24 @@
|
||||||
"tr": "Aktiviteler",
|
"tr": "Aktiviteler",
|
||||||
"en": "Activities"
|
"en": "Activities"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"resourceName": "Platform",
|
||||||
|
"key": "App.Crm.SalesOrderStatus",
|
||||||
|
"tr": "Satış Siparişleri Durumları",
|
||||||
|
"en": "Sales Order Statuses"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"resourceName": "Platform",
|
"resourceName": "Platform",
|
||||||
"key": "App.Crm.SalesOrder",
|
"key": "App.Crm.SalesOrder",
|
||||||
"tr": "Satış Siparişleri",
|
"tr": "Satış Siparişleri",
|
||||||
"en": "Sales Orders"
|
"en": "Sales Orders"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"resourceName": "Platform",
|
||||||
|
"key": "App.Crm.SalesOrderItem",
|
||||||
|
"tr": "Satış Siparişi Ürünleri",
|
||||||
|
"en": "Sales Order Items"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"resourceName": "Platform",
|
"resourceName": "Platform",
|
||||||
"key": "App.Mrp.OperationCategory",
|
"key": "App.Mrp.OperationCategory",
|
||||||
|
|
|
||||||
|
|
@ -2280,5 +2280,777 @@ public class ListFormSeeder_Crm : IDataSeedContributor, ITransientDependency
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Sales Order Status
|
||||||
|
listFormName = AppCodes.Crm.SalesOrderStatus;
|
||||||
|
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.SalesOrderStatus)),
|
||||||
|
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.SalesOrderStatus)),
|
||||||
|
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
|
||||||
|
PagerOptionJson = DefaultPagerOptionJson,
|
||||||
|
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 300, true, true, true, true, false),
|
||||||
|
InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson,
|
||||||
|
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>()
|
||||||
|
{
|
||||||
|
new() {
|
||||||
|
Order=1, ColCount=1, ColSpan=1, ItemType="group", Items =[
|
||||||
|
new EditingFormItemDto { Order = 1, DataField="Name", ColSpan = 1, IsRequired =true, EditorType2 = EditorTypes.dxTextBox },
|
||||||
|
new EditingFormItemDto { Order = 2, DataField="Description", ColSpan = 1, EditorType2 = EditorTypes.dxTextArea },
|
||||||
|
new EditingFormItemDto { Order = 3, DataField="IsActive", ColSpan = 1, EditorType2 = EditorTypes.dxCheckBox },
|
||||||
|
]}
|
||||||
|
}),
|
||||||
|
FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] {
|
||||||
|
new() { FieldName = "IsActive", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value }
|
||||||
|
}),
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
#region Sales Order 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,
|
||||||
|
SortIndex = 0,
|
||||||
|
ValidationRuleJson = DefaultValidationRuleRequiredJson,
|
||||||
|
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||||
|
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
|
||||||
|
PivotSettingsJson = DefaultPivotSettingsJson
|
||||||
|
},
|
||||||
|
new() {
|
||||||
|
ListFormCode = listForm.ListFormCode,
|
||||||
|
CultureName = LanguageCodes.En,
|
||||||
|
SourceDbType = DbType.String,
|
||||||
|
FieldName = "Name",
|
||||||
|
Width = 300,
|
||||||
|
ListOrderNo = 2,
|
||||||
|
Visible = true,
|
||||||
|
IsActive = true,
|
||||||
|
IsDeleted = false,
|
||||||
|
AllowSearch = true,
|
||||||
|
ValidationRuleJson = DefaultValidationRuleRequiredJson,
|
||||||
|
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||||
|
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
|
||||||
|
PivotSettingsJson = DefaultPivotSettingsJson
|
||||||
|
},
|
||||||
|
new() {
|
||||||
|
ListFormCode = listForm.ListFormCode,
|
||||||
|
CultureName = LanguageCodes.En,
|
||||||
|
SourceDbType = DbType.String,
|
||||||
|
FieldName = "Description",
|
||||||
|
Width = 500,
|
||||||
|
ListOrderNo = 3,
|
||||||
|
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 = 4,
|
||||||
|
Visible = true,
|
||||||
|
IsActive = true,
|
||||||
|
IsDeleted = false,
|
||||||
|
AllowSearch = true,
|
||||||
|
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||||
|
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
|
||||||
|
PivotSettingsJson = DefaultPivotSettingsJson
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Sales Order
|
||||||
|
listFormName = AppCodes.Crm.SalesOrder;
|
||||||
|
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.SalesOrder)),
|
||||||
|
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.SalesOrder)),
|
||||||
|
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
|
||||||
|
PagerOptionJson = DefaultPagerOptionJson,
|
||||||
|
EditingOptionJson = DefaultEditingOptionJson(listFormName, 800, 400, true, true, true, true, false),
|
||||||
|
InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson,
|
||||||
|
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>()
|
||||||
|
{
|
||||||
|
new() {
|
||||||
|
Order=1, ColCount=2, ColSpan=1, ItemType="group", Items =[
|
||||||
|
new EditingFormItemDto { Order = 1, DataField="OrderNumber", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox, EditorOptions = EditorOptionValues.Disabled },
|
||||||
|
new EditingFormItemDto { Order = 2, DataField="OrderDate", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxDateBox, EditorOptions = EditorOptionValues.DateFormat },
|
||||||
|
new EditingFormItemDto { Order = 3, DataField="CustomerId", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox },
|
||||||
|
new EditingFormItemDto { Order = 4, DataField="RequestedDeliveryDate", ColSpan = 1, EditorType2 = EditorTypes.dxDateBox, EditorOptions = EditorOptionValues.DateFormat },
|
||||||
|
new EditingFormItemDto { Order = 5, DataField="ConfirmedDeliveryDate", ColSpan = 1, EditorType2 = EditorTypes.dxDateBox, EditorOptions = EditorOptionValues.DateFormat },
|
||||||
|
new EditingFormItemDto { Order = 6, DataField="Status", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox },
|
||||||
|
new EditingFormItemDto { Order = 7, DataField="Currency", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox },
|
||||||
|
new EditingFormItemDto { Order = 8, DataField="PaymentTermId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox },
|
||||||
|
new EditingFormItemDto { Order = 9, DataField="DeliveryTermId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox },
|
||||||
|
new EditingFormItemDto { Order = 10, DataField="ExchangeRate", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox, EditorOptions = EditorOptionValues.NumberStandartFormat },
|
||||||
|
new EditingFormItemDto { Order = 11, DataField="DiscountRate", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox, EditorOptions = EditorOptionValues.NumberStandartFormat },
|
||||||
|
new EditingFormItemDto { Order = 12, DataField="TaxRate", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox, EditorOptions = EditorOptionValues.NumberStandartFormat },
|
||||||
|
new EditingFormItemDto { Order = 13, DataField="SpecialInstructions", ColSpan = 2, EditorType2 = EditorTypes.dxTextArea },
|
||||||
|
new EditingFormItemDto { Order = 14, DataField="Notes", ColSpan = 2, EditorType2 = EditorTypes.dxTextArea },
|
||||||
|
]}
|
||||||
|
}),
|
||||||
|
FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] {
|
||||||
|
new() { FieldName = "OrderNumber", FieldDbType = DbType.String, Value = "@AUTONUMBER", CustomValueType = FieldCustomValueTypeEnum.CustomKey },
|
||||||
|
new() { FieldName = "OrderDate", FieldDbType = DbType.Date, Value = "@DATE", CustomValueType = FieldCustomValueTypeEnum.CustomKey },
|
||||||
|
new() { FieldName = "Status", FieldDbType = DbType.String, Value = "Taslak", CustomValueType = FieldCustomValueTypeEnum.Value },
|
||||||
|
new() { FieldName = "Currency", FieldDbType = DbType.String, Value = "TRY", CustomValueType = FieldCustomValueTypeEnum.Value },
|
||||||
|
new() { FieldName = "DiscountRate", FieldDbType = DbType.Decimal, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value },
|
||||||
|
new() { FieldName = "ExchangeRate", FieldDbType = DbType.Decimal, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value },
|
||||||
|
new() { FieldName = "TaxRate", FieldDbType = DbType.Decimal, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value },
|
||||||
|
}),
|
||||||
|
CommandColumnJson = JsonSerializer.Serialize(new CommandColumnDto[] {
|
||||||
|
new() {
|
||||||
|
Hint = "Manage",
|
||||||
|
Text ="Manage",
|
||||||
|
UrlTarget="_blank",
|
||||||
|
AuthName = listFormName,
|
||||||
|
Url=$"/admin/form/{SeederUtils.GetDefaultFormCodes(listFormName)}/@Id",
|
||||||
|
IsVisible = true,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
}, autoSave: true
|
||||||
|
);
|
||||||
|
|
||||||
|
#region Sales Order 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,
|
||||||
|
SortIndex = 0,
|
||||||
|
ValidationRuleJson = DefaultValidationRuleRequiredJson,
|
||||||
|
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||||
|
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
|
||||||
|
PivotSettingsJson = DefaultPivotSettingsJson
|
||||||
|
},
|
||||||
|
new() {
|
||||||
|
ListFormCode = listForm.ListFormCode,
|
||||||
|
CultureName = LanguageCodes.En,
|
||||||
|
SourceDbType = DbType.String,
|
||||||
|
FieldName = "OrderNumber",
|
||||||
|
Width = 100,
|
||||||
|
ListOrderNo = 2,
|
||||||
|
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.Guid,
|
||||||
|
FieldName = "CustomerId",
|
||||||
|
Width = 200,
|
||||||
|
ListOrderNo = 3,
|
||||||
|
Visible = true,
|
||||||
|
IsActive = true,
|
||||||
|
IsDeleted = false,
|
||||||
|
AllowSearch = true,
|
||||||
|
LookupJson = JsonSerializer.Serialize(new LookupDto
|
||||||
|
{
|
||||||
|
DataSourceType = UiLookupDataSourceTypeEnum.Query,
|
||||||
|
DisplayExpr = "Name",
|
||||||
|
ValueExpr = "Key",
|
||||||
|
LookupQuery = LookupQueryValues.CustomerValues
|
||||||
|
}),
|
||||||
|
ValidationRuleJson = DefaultValidationRuleRequiredJson,
|
||||||
|
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||||
|
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
|
||||||
|
PivotSettingsJson = DefaultPivotSettingsJson
|
||||||
|
},
|
||||||
|
new() {
|
||||||
|
ListFormCode = listForm.ListFormCode,
|
||||||
|
CultureName = LanguageCodes.En,
|
||||||
|
SourceDbType = DbType.Date,
|
||||||
|
FieldName = "OrderDate",
|
||||||
|
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.Date,
|
||||||
|
FieldName = "RequestedDeliveryDate",
|
||||||
|
Width = 100,
|
||||||
|
ListOrderNo = 5,
|
||||||
|
Visible = true,
|
||||||
|
IsActive = true,
|
||||||
|
IsDeleted = false,
|
||||||
|
AllowSearch = true,
|
||||||
|
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||||
|
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
|
||||||
|
PivotSettingsJson = DefaultPivotSettingsJson
|
||||||
|
},
|
||||||
|
new() {
|
||||||
|
ListFormCode = listForm.ListFormCode,
|
||||||
|
CultureName = LanguageCodes.En,
|
||||||
|
SourceDbType = DbType.Date,
|
||||||
|
FieldName = "ConfirmedDeliveryDate",
|
||||||
|
Width = 100,
|
||||||
|
ListOrderNo = 6,
|
||||||
|
Visible = true,
|
||||||
|
IsActive = true,
|
||||||
|
IsDeleted = false,
|
||||||
|
AllowSearch = true,
|
||||||
|
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||||
|
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
|
||||||
|
PivotSettingsJson = DefaultPivotSettingsJson
|
||||||
|
},
|
||||||
|
new() {
|
||||||
|
ListFormCode = listForm.ListFormCode,
|
||||||
|
CultureName = LanguageCodes.En,
|
||||||
|
SourceDbType = DbType.String,
|
||||||
|
FieldName = "Status",
|
||||||
|
Width = 100,
|
||||||
|
ListOrderNo = 7,
|
||||||
|
Visible = true,
|
||||||
|
IsActive = true,
|
||||||
|
IsDeleted = false,
|
||||||
|
AllowSearch = true,
|
||||||
|
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.SalesOrderStatus), "Name", "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 = 8,
|
||||||
|
Visible = true,
|
||||||
|
IsActive = true,
|
||||||
|
IsDeleted = false,
|
||||||
|
AllowSearch = true,
|
||||||
|
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Currency), "Code", "Name"),
|
||||||
|
ValidationRuleJson = DefaultValidationRuleRequiredJson,
|
||||||
|
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||||
|
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
|
||||||
|
PivotSettingsJson = DefaultPivotSettingsJson
|
||||||
|
},
|
||||||
|
new() {
|
||||||
|
ListFormCode = listForm.ListFormCode,
|
||||||
|
CultureName = LanguageCodes.En,
|
||||||
|
SourceDbType = DbType.Guid,
|
||||||
|
FieldName = "PaymentTermId",
|
||||||
|
Width = 150,
|
||||||
|
ListOrderNo = 9,
|
||||||
|
Visible = true,
|
||||||
|
IsActive = true,
|
||||||
|
IsDeleted = false,
|
||||||
|
AllowSearch = true,
|
||||||
|
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.PaymentTerm), "Id", "Name"),
|
||||||
|
ValidationRuleJson = DefaultValidationRuleRequiredJson,
|
||||||
|
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||||
|
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
|
||||||
|
PivotSettingsJson = DefaultPivotSettingsJson
|
||||||
|
},
|
||||||
|
new() {
|
||||||
|
ListFormCode = listForm.ListFormCode,
|
||||||
|
CultureName = LanguageCodes.En,
|
||||||
|
SourceDbType = DbType.Guid,
|
||||||
|
FieldName = "DeliveryTermId",
|
||||||
|
Width = 150,
|
||||||
|
ListOrderNo = 10,
|
||||||
|
Visible = true,
|
||||||
|
IsActive = true,
|
||||||
|
IsDeleted = false,
|
||||||
|
AllowSearch = true,
|
||||||
|
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.DeliveryTerm), "Id", "Name"),
|
||||||
|
ValidationRuleJson = DefaultValidationRuleRequiredJson,
|
||||||
|
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||||
|
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
|
||||||
|
PivotSettingsJson = DefaultPivotSettingsJson
|
||||||
|
},
|
||||||
|
new() {
|
||||||
|
ListFormCode = listForm.ListFormCode,
|
||||||
|
CultureName = LanguageCodes.En,
|
||||||
|
SourceDbType = DbType.Decimal,
|
||||||
|
FieldName = "ExchangeRate",
|
||||||
|
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.Decimal,
|
||||||
|
FieldName = "DiscountRate",
|
||||||
|
Format = "fixedPoint",
|
||||||
|
Alignment = "right",
|
||||||
|
Width = 100,
|
||||||
|
ListOrderNo = 12,
|
||||||
|
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 = 13,
|
||||||
|
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 = "SpecialInstructions",
|
||||||
|
Width = 300,
|
||||||
|
ListOrderNo = 14,
|
||||||
|
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 = "Notes",
|
||||||
|
Width = 300,
|
||||||
|
ListOrderNo = 15,
|
||||||
|
Visible = true,
|
||||||
|
IsActive = true,
|
||||||
|
IsDeleted = false,
|
||||||
|
AllowSearch = true,
|
||||||
|
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||||
|
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
|
||||||
|
PivotSettingsJson = DefaultPivotSettingsJson
|
||||||
|
},
|
||||||
|
], autoSave: true);
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Sales Order Item
|
||||||
|
listFormName = AppCodes.Crm.SalesOrderItem;
|
||||||
|
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.SalesOrderItem)),
|
||||||
|
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.SalesOrderItem)),
|
||||||
|
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
|
||||||
|
PagerOptionJson = DefaultPagerOptionJson,
|
||||||
|
EditingOptionJson = DefaultEditingOptionJson(listFormName, 800, 400, true, true, true, true, false),
|
||||||
|
InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson,
|
||||||
|
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>()
|
||||||
|
{
|
||||||
|
new() {
|
||||||
|
Order=1, ColCount=2, ColSpan=1, ItemType="group", Items =[
|
||||||
|
new EditingFormItemDto { Order = 1, DataField="MaterialId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox },
|
||||||
|
new EditingFormItemDto { Order = 2, DataField="Quantity", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox, EditorOptions = EditorOptionValues.NumberStandartFormat },
|
||||||
|
new EditingFormItemDto { Order = 3, DataField="UnitPrice", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox, EditorOptions = EditorOptionValues.NumberStandartFormat },
|
||||||
|
new EditingFormItemDto { Order = 4, DataField="TotalAmount", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox, EditorOptions = EditorOptionValues.NumberStandartFormat },
|
||||||
|
new EditingFormItemDto { Order = 5, DataField="Uom", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox },
|
||||||
|
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="Status", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox },
|
||||||
|
new EditingFormItemDto { Order = 11, DataField="Description", ColSpan = 2, EditorType2 = EditorTypes.dxTextArea },
|
||||||
|
new EditingFormItemDto { Order = 12, DataField="Notes", ColSpan = 2, EditorType2 = EditorTypes.dxTextArea },
|
||||||
|
]}
|
||||||
|
}),
|
||||||
|
FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] {
|
||||||
|
new() { FieldName = "Quantity", FieldDbType = DbType.Decimal, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value },
|
||||||
|
new() { FieldName = "UnitPrice", FieldDbType = DbType.Decimal, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value },
|
||||||
|
new() { FieldName = "TotalAmount", FieldDbType = DbType.Decimal, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value },
|
||||||
|
new() { FieldName = "Uom", FieldDbType = DbType.String, Value = "Adet", 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 = "Status", FieldDbType = DbType.String, Value = "Taslak", CustomValueType = FieldCustomValueTypeEnum.Value }
|
||||||
|
}),
|
||||||
|
}, autoSave: true
|
||||||
|
);
|
||||||
|
|
||||||
|
#region Sales Order 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,
|
||||||
|
SortIndex = 0,
|
||||||
|
ValidationRuleJson = DefaultValidationRuleRequiredJson,
|
||||||
|
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||||
|
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
|
||||||
|
PivotSettingsJson = DefaultPivotSettingsJson
|
||||||
|
},
|
||||||
|
new() {
|
||||||
|
ListFormCode = listForm.ListFormCode,
|
||||||
|
CultureName = LanguageCodes.En,
|
||||||
|
SourceDbType = DbType.Guid,
|
||||||
|
FieldName = "MaterialId",
|
||||||
|
Width = 150,
|
||||||
|
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.Decimal,
|
||||||
|
FieldName = "Quantity",
|
||||||
|
Format = "fixedPoint",
|
||||||
|
Alignment = "right",
|
||||||
|
Width = 100,
|
||||||
|
ListOrderNo = 3,
|
||||||
|
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 = "UnitPrice",
|
||||||
|
Format = "fixedPoint",
|
||||||
|
Alignment = "right",
|
||||||
|
Width = 100,
|
||||||
|
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.Decimal,
|
||||||
|
FieldName = "TotalAmount",
|
||||||
|
Format = "fixedPoint",
|
||||||
|
Alignment = "right",
|
||||||
|
Width = 100,
|
||||||
|
ListOrderNo = 5,
|
||||||
|
Visible = true,
|
||||||
|
IsActive = true,
|
||||||
|
IsDeleted = false,
|
||||||
|
AllowSearch = true,
|
||||||
|
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||||
|
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
|
||||||
|
PivotSettingsJson = DefaultPivotSettingsJson
|
||||||
|
},
|
||||||
|
new() {
|
||||||
|
ListFormCode = listForm.ListFormCode,
|
||||||
|
CultureName = LanguageCodes.En,
|
||||||
|
SourceDbType = DbType.String,
|
||||||
|
FieldName = "Uom",
|
||||||
|
Width = 150,
|
||||||
|
ListOrderNo = 6,
|
||||||
|
Visible = true,
|
||||||
|
IsActive = true,
|
||||||
|
IsDeleted = false,
|
||||||
|
AllowSearch = true,
|
||||||
|
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Uom), "Name", "Name"),
|
||||||
|
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.String,
|
||||||
|
FieldName = "Status",
|
||||||
|
Width = 100,
|
||||||
|
ListOrderNo = 11,
|
||||||
|
Visible = true,
|
||||||
|
IsActive = true,
|
||||||
|
IsDeleted = false,
|
||||||
|
AllowSearch = true,
|
||||||
|
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.SalesOrderStatus), "Name", "Name"),
|
||||||
|
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||||
|
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
|
||||||
|
PivotSettingsJson = DefaultPivotSettingsJson
|
||||||
|
},
|
||||||
|
new() {
|
||||||
|
ListFormCode = listForm.ListFormCode,
|
||||||
|
CultureName = LanguageCodes.En,
|
||||||
|
SourceDbType = DbType.String,
|
||||||
|
FieldName = "Description",
|
||||||
|
Width = 300,
|
||||||
|
ListOrderNo = 12,
|
||||||
|
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 = "Notes",
|
||||||
|
Width = 300,
|
||||||
|
ListOrderNo = 13,
|
||||||
|
Visible = true,
|
||||||
|
IsActive = true,
|
||||||
|
IsDeleted = false,
|
||||||
|
AllowSearch = true,
|
||||||
|
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||||
|
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
|
||||||
|
PivotSettingsJson = DefaultPivotSettingsJson
|
||||||
|
},
|
||||||
|
], autoSave: true);
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
// Sales Order ve Sales Order Item arasında Sub Forms ilişkisinin kurulması
|
||||||
|
await utils.CloneFormLayoutAsync(
|
||||||
|
AppCodes.Crm.SalesOrder,
|
||||||
|
JsonSerializer.Serialize(new List<dynamic>() {
|
||||||
|
new {
|
||||||
|
TabType = ListFormTabTypeEnum.List,
|
||||||
|
TabTitle = AppCodes.Crm.SalesOrderItem,
|
||||||
|
Code = AppCodes.Crm.SalesOrderItem,
|
||||||
|
Relation = new List<dynamic>() {
|
||||||
|
new {
|
||||||
|
ParentFieldName = "Id",
|
||||||
|
DbType = DbType.Guid,
|
||||||
|
ChildFieldName = "SalesOrderId"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2238,11 +2238,21 @@
|
||||||
"RequiredPermissionName": "App.Crm.Activity",
|
"RequiredPermissionName": "App.Crm.Activity",
|
||||||
"IsDisabled": false
|
"IsDisabled": false
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"ParentCode": "App.Crm",
|
||||||
|
"Code": "App.Crm.SalesOrderStatus",
|
||||||
|
"DisplayName": "App.Crm.SalesOrderStatus",
|
||||||
|
"Order": 8,
|
||||||
|
"Url": "/admin/list/App.Crm.SalesOrderStatus",
|
||||||
|
"Icon": "FcWorkflow",
|
||||||
|
"RequiredPermissionName": "App.Crm.SalesOrderStatus",
|
||||||
|
"IsDisabled": false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"ParentCode": "App.Crm",
|
"ParentCode": "App.Crm",
|
||||||
"Code": "App.Crm.SalesOrder",
|
"Code": "App.Crm.SalesOrder",
|
||||||
"DisplayName": "App.Crm.SalesOrder",
|
"DisplayName": "App.Crm.SalesOrder",
|
||||||
"Order": 8,
|
"Order": 9,
|
||||||
"Url": "/admin/list/App.Crm.SalesOrder",
|
"Url": "/admin/list/App.Crm.SalesOrder",
|
||||||
"Icon": "FcShop",
|
"Icon": "FcShop",
|
||||||
"RequiredPermissionName": "App.Crm.SalesOrder",
|
"RequiredPermissionName": "App.Crm.SalesOrder",
|
||||||
|
|
|
||||||
|
|
@ -11793,6 +11793,70 @@
|
||||||
"MultiTenancySide": 3,
|
"MultiTenancySide": 3,
|
||||||
"MenuGroup": "Erp"
|
"MenuGroup": "Erp"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"GroupName": "App.Crm",
|
||||||
|
"Name": "App.Crm.SalesOrderStatus",
|
||||||
|
"ParentName": null,
|
||||||
|
"DisplayName": "App.Crm.SalesOrderStatus",
|
||||||
|
"IsEnabled": true,
|
||||||
|
"MultiTenancySide": 3,
|
||||||
|
"MenuGroup": "Erp"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"GroupName": "App.Crm",
|
||||||
|
"Name": "App.Crm.SalesOrderStatus.Create",
|
||||||
|
"ParentName": "App.Crm.SalesOrderStatus",
|
||||||
|
"DisplayName": "Create",
|
||||||
|
"IsEnabled": true,
|
||||||
|
"MultiTenancySide": 3,
|
||||||
|
"MenuGroup": "Erp"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"GroupName": "App.Crm",
|
||||||
|
"Name": "App.Crm.SalesOrderStatus.Update",
|
||||||
|
"ParentName": "App.Crm.SalesOrderStatus",
|
||||||
|
"DisplayName": "Update",
|
||||||
|
"IsEnabled": true,
|
||||||
|
"MultiTenancySide": 3,
|
||||||
|
"MenuGroup": "Erp"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"GroupName": "App.Crm",
|
||||||
|
"Name": "App.Crm.SalesOrderStatus.Delete",
|
||||||
|
"ParentName": "App.Crm.SalesOrderStatus",
|
||||||
|
"DisplayName": "Delete",
|
||||||
|
"IsEnabled": true,
|
||||||
|
"MultiTenancySide": 3,
|
||||||
|
"MenuGroup": "Erp"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"GroupName": "App.Crm",
|
||||||
|
"Name": "App.Crm.SalesOrderStatus.Export",
|
||||||
|
"ParentName": "App.Crm.SalesOrderStatus",
|
||||||
|
"DisplayName": "Export",
|
||||||
|
"IsEnabled": true,
|
||||||
|
"MultiTenancySide": 3,
|
||||||
|
"MenuGroup": "Erp"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"GroupName": "App.Crm",
|
||||||
|
"Name": "App.Crm.SalesOrderStatus.Import",
|
||||||
|
"ParentName": "App.Crm.SalesOrderStatus",
|
||||||
|
"DisplayName": "Import",
|
||||||
|
"IsEnabled": true,
|
||||||
|
"MultiTenancySide": 3,
|
||||||
|
"MenuGroup": "Erp"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"GroupName": "App.Crm",
|
||||||
|
"Name": "App.Crm.SalesOrderStatus.Note",
|
||||||
|
"ParentName": "App.Crm.SalesOrderStatus",
|
||||||
|
"DisplayName": "Note",
|
||||||
|
"IsEnabled": true,
|
||||||
|
"MultiTenancySide": 3,
|
||||||
|
"MenuGroup": "Erp"
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"GroupName": "App.Crm",
|
"GroupName": "App.Crm",
|
||||||
"Name": "App.Crm.SalesOrder",
|
"Name": "App.Crm.SalesOrder",
|
||||||
|
|
@ -11856,6 +11920,71 @@
|
||||||
"MultiTenancySide": 3,
|
"MultiTenancySide": 3,
|
||||||
"MenuGroup": "Erp"
|
"MenuGroup": "Erp"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"GroupName": "App.Crm",
|
||||||
|
"Name": "App.Crm.SalesOrderItem",
|
||||||
|
"ParentName": null,
|
||||||
|
"DisplayName": "App.Crm.SalesOrderItem",
|
||||||
|
"IsEnabled": true,
|
||||||
|
"MultiTenancySide": 3,
|
||||||
|
"MenuGroup": "Erp"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"GroupName": "App.Crm",
|
||||||
|
"Name": "App.Crm.SalesOrderItem.Create",
|
||||||
|
"ParentName": "App.Crm.SalesOrderItem",
|
||||||
|
"DisplayName": "Create",
|
||||||
|
"IsEnabled": true,
|
||||||
|
"MultiTenancySide": 3,
|
||||||
|
"MenuGroup": "Erp"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"GroupName": "App.Crm",
|
||||||
|
"Name": "App.Crm.SalesOrderItem.Update",
|
||||||
|
"ParentName": "App.Crm.SalesOrderItem",
|
||||||
|
"DisplayName": "Update",
|
||||||
|
"IsEnabled": true,
|
||||||
|
"MultiTenancySide": 3,
|
||||||
|
"MenuGroup": "Erp"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"GroupName": "App.Crm",
|
||||||
|
"Name": "App.Crm.SalesOrderItem.Delete",
|
||||||
|
"ParentName": "App.Crm.SalesOrderItem",
|
||||||
|
"DisplayName": "Delete",
|
||||||
|
"IsEnabled": true,
|
||||||
|
"MultiTenancySide": 3,
|
||||||
|
"MenuGroup": "Erp"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"GroupName": "App.Crm",
|
||||||
|
"Name": "App.Crm.SalesOrderItem.Export",
|
||||||
|
"ParentName": "App.Crm.SalesOrderItem",
|
||||||
|
"DisplayName": "Export",
|
||||||
|
"IsEnabled": true,
|
||||||
|
"MultiTenancySide": 3,
|
||||||
|
"MenuGroup": "Erp"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"GroupName": "App.Crm",
|
||||||
|
"Name": "App.Crm.SalesOrderItem.Import",
|
||||||
|
"ParentName": "App.Crm.SalesOrderItem",
|
||||||
|
"DisplayName": "Import",
|
||||||
|
"IsEnabled": true,
|
||||||
|
"MultiTenancySide": 3,
|
||||||
|
"MenuGroup": "Erp"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"GroupName": "App.Crm",
|
||||||
|
"Name": "App.Crm.SalesOrderItem.Note",
|
||||||
|
"ParentName": "App.Crm.SalesOrderItem",
|
||||||
|
"DisplayName": "Note",
|
||||||
|
"IsEnabled": true,
|
||||||
|
"MultiTenancySide": 3,
|
||||||
|
"MenuGroup": "Erp"
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"GroupName": "App.Mrp",
|
"GroupName": "App.Mrp",
|
||||||
"Name": "App.Mrp.OperationCategory",
|
"Name": "App.Mrp.OperationCategory",
|
||||||
|
|
|
||||||
|
|
@ -208,5 +208,8 @@ public enum TableNameEnum
|
||||||
DeliveryTerm,
|
DeliveryTerm,
|
||||||
OrderStatus,
|
OrderStatus,
|
||||||
PurchaseOrder,
|
PurchaseOrder,
|
||||||
PurchaseOrderItem
|
PurchaseOrderItem,
|
||||||
|
SalesOrderStatus,
|
||||||
|
SalesOrder,
|
||||||
|
SalesOrderItem
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -191,6 +191,9 @@ public static class TableNameResolver
|
||||||
{ nameof(TableNameEnum.Opportunity), (TablePrefix.TenantByName, MenuPrefix.Crm) },
|
{ nameof(TableNameEnum.Opportunity), (TablePrefix.TenantByName, MenuPrefix.Crm) },
|
||||||
{ nameof(TableNameEnum.Activity), (TablePrefix.TenantByName, MenuPrefix.Crm) },
|
{ nameof(TableNameEnum.Activity), (TablePrefix.TenantByName, MenuPrefix.Crm) },
|
||||||
{ nameof(TableNameEnum.Competitor), (TablePrefix.TenantByName, MenuPrefix.Crm) },
|
{ nameof(TableNameEnum.Competitor), (TablePrefix.TenantByName, MenuPrefix.Crm) },
|
||||||
|
{ nameof(TableNameEnum.SalesOrderStatus), (TablePrefix.TenantByName, MenuPrefix.Crm) },
|
||||||
|
{ nameof(TableNameEnum.SalesOrder), (TablePrefix.TenantByName, MenuPrefix.Crm) },
|
||||||
|
{ nameof(TableNameEnum.SalesOrderItem), (TablePrefix.TenantByName, MenuPrefix.Crm) },
|
||||||
|
|
||||||
// 🔹 MAINTENANCE
|
// 🔹 MAINTENANCE
|
||||||
{ nameof(TableNameEnum.WorkcenterType), (TablePrefix.TenantByName, MenuPrefix.Maintenance) },
|
{ nameof(TableNameEnum.WorkcenterType), (TablePrefix.TenantByName, MenuPrefix.Maintenance) },
|
||||||
|
|
|
||||||
|
|
@ -508,7 +508,9 @@ public static class SeedConsts
|
||||||
public const string OpportunityActivity = Default + ".OpportunityActivity";
|
public const string OpportunityActivity = Default + ".OpportunityActivity";
|
||||||
public const string OpportunityCompetitor = Default + ".OpportunityCompetitor";
|
public const string OpportunityCompetitor = Default + ".OpportunityCompetitor";
|
||||||
public const string Activity = Default + ".Activity";
|
public const string Activity = Default + ".Activity";
|
||||||
public const string Orders = Default + ".Orders";
|
public const string SalesOrderStatus = Default + ".SalesOrderStatus";
|
||||||
|
public const string SalesOrder = Default + ".SalesOrder";
|
||||||
|
public const string SalesOrderItem = Default + ".SalesOrderItem";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class SupplyChain
|
public static class SupplyChain
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
// Domain/Entities/CrmSalesOrder.cs
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Volo.Abp.Domain.Entities.Auditing;
|
||||||
|
using Volo.Abp.MultiTenancy;
|
||||||
|
|
||||||
|
namespace Erp.Platform.Entities;
|
||||||
|
|
||||||
|
public class SalesOrder : FullAuditedEntity<Guid>, IMultiTenant
|
||||||
|
{
|
||||||
|
public Guid? TenantId { get; set; }
|
||||||
|
|
||||||
|
public string OrderNumber { get; set; }
|
||||||
|
public Guid CustomerId { get; set; }
|
||||||
|
public Partner Customer { get; set; }
|
||||||
|
|
||||||
|
public DateTime OrderDate { get; set; }
|
||||||
|
public DateTime RequestedDeliveryDate { get; set; }
|
||||||
|
public DateTime? ConfirmedDeliveryDate { get; set; }
|
||||||
|
|
||||||
|
public string Status { 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 PaymentTermId { get; set; }
|
||||||
|
public PaymentTerm PaymentTerm { get; set; }
|
||||||
|
|
||||||
|
public Guid DeliveryTermId { get; set; }
|
||||||
|
public DeliveryTerm DeliveryTerm { get; set; }
|
||||||
|
|
||||||
|
public decimal ExchangeRate { get; set; }
|
||||||
|
public decimal DiscountRate { get; set; }
|
||||||
|
public decimal TaxRate { get; set; }
|
||||||
|
|
||||||
|
public string SpecialInstructions { get; set; }
|
||||||
|
public string Notes { get; set; }
|
||||||
|
|
||||||
|
public ICollection<SalesOrderItem> Items { get; set; }
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
// Domain/Entities/CrmSalesOrderItem.cs
|
||||||
|
using System;
|
||||||
|
using Volo.Abp.Domain.Entities.Auditing;
|
||||||
|
using Volo.Abp.MultiTenancy;
|
||||||
|
|
||||||
|
namespace Erp.Platform.Entities;
|
||||||
|
|
||||||
|
public class SalesOrderItem : FullAuditedEntity<Guid>, IMultiTenant
|
||||||
|
{
|
||||||
|
public Guid? TenantId { get; set; }
|
||||||
|
|
||||||
|
public Guid SalesOrderId { get; set; }
|
||||||
|
public SalesOrder SalesOrder { get; set; }
|
||||||
|
|
||||||
|
public Guid MaterialId { get; set; }
|
||||||
|
public Material Material { get; set; }
|
||||||
|
|
||||||
|
public decimal Quantity { get; set; }
|
||||||
|
public decimal DeliveredQuantity { get; set; } //Sadece listede
|
||||||
|
|
||||||
|
public decimal UnitPrice { get; set; }
|
||||||
|
public decimal TotalAmount { get; set; }
|
||||||
|
|
||||||
|
public string Uom { get; set; }
|
||||||
|
|
||||||
|
public decimal DiscountRate { get; set; }
|
||||||
|
public decimal DiscountAmount { get; set; }
|
||||||
|
|
||||||
|
public decimal TaxRate { get; set; }
|
||||||
|
public decimal TaxAmount { get; set; }
|
||||||
|
|
||||||
|
public string Description { get; set; }
|
||||||
|
public string Notes { get; set; }
|
||||||
|
public string Status { get; set; }
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Volo.Abp.Domain.Entities.Auditing;
|
||||||
|
using Volo.Abp.MultiTenancy;
|
||||||
|
|
||||||
|
namespace Erp.Platform.Entities;
|
||||||
|
|
||||||
|
public class SalesOrderStatus : 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<SalesOrder> SalesOrders { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -15,4 +15,5 @@ public class DeliveryTerm : FullAuditedEntity<Guid>, IMultiTenant
|
||||||
public bool IsActive { get; set; }
|
public bool IsActive { get; set; }
|
||||||
|
|
||||||
public ICollection<Quotation> Quotations { get; set; }
|
public ICollection<Quotation> Quotations { get; set; }
|
||||||
|
public ICollection<SalesOrder> SalesOrders { get; set; }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,9 +27,14 @@ public class Material : FullAuditedEntity<Guid>, IMultiTenant
|
||||||
|
|
||||||
// Relations
|
// Relations
|
||||||
public List<Uom> AlternativeUoms { get; set; }
|
public List<Uom> AlternativeUoms { get; set; }
|
||||||
public List<MaterialSpecification> Specifications { get; set; }
|
|
||||||
public List<Partner> Suppliers { get; set; }
|
public List<Partner> Suppliers { get; set; }
|
||||||
public List<Bom> Boms { get; set; }
|
public List<Bom> Boms { get; set; }
|
||||||
public List<BomComponent> BomComponents { get; set; }
|
public List<BomComponent> BomComponents { get; set; }
|
||||||
|
public List<MaterialSpecification> Specifications { get; set; }
|
||||||
|
public List<WorkorderMaterial> WorkorderMaterials { get; set; }
|
||||||
|
public List<RequestItem> RequestItems { get; set; }
|
||||||
|
public List<QuotationItem> QuotationItems { get; set; }
|
||||||
|
public List<PurchaseOrderItem> PurchaseOrderItems { get; set; }
|
||||||
|
public List<SalesOrderItem> SalesOrderItems { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ public class PaymentTerm : FullAuditedEntity<Guid>, IMultiTenant
|
||||||
|
|
||||||
public ICollection<Quotation> Quotations { get; set; }
|
public ICollection<Quotation> Quotations { get; set; }
|
||||||
public ICollection<PurchaseOrder> PurchaseOrders { get; set; }
|
public ICollection<PurchaseOrder> PurchaseOrders { get; set; }
|
||||||
|
public ICollection<SalesOrder> SalesOrders { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -222,6 +222,7 @@ public class PlatformDbContext :
|
||||||
public DbSet<QuotationItem> QuotationItems { get; set; }
|
public DbSet<QuotationItem> QuotationItems { get; set; }
|
||||||
public DbSet<OrderStatus> OrderStatuses { get; set; }
|
public DbSet<OrderStatus> OrderStatuses { get; set; }
|
||||||
public DbSet<PurchaseOrder> PurchaseOrders { get; set; }
|
public DbSet<PurchaseOrder> PurchaseOrders { get; set; }
|
||||||
|
public DbSet<PurchaseOrderItem> PurchaseOrderItems { get; set; }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Crm
|
#region Crm
|
||||||
|
|
@ -229,6 +230,9 @@ public class PlatformDbContext :
|
||||||
public DbSet<Opportunity> Opportunities { get; set; }
|
public DbSet<Opportunity> Opportunities { get; set; }
|
||||||
public DbSet<Entities.Activity> Actions { get; set; }
|
public DbSet<Entities.Activity> Actions { get; set; }
|
||||||
public DbSet<Competitor> Competitors { get; set; }
|
public DbSet<Competitor> Competitors { get; set; }
|
||||||
|
public DbSet<SalesOrder> SalesOrders { get; set; }
|
||||||
|
public DbSet<SalesOrderItem> SalesOrderItems { get; set; }
|
||||||
|
public DbSet<SalesOrderStatus> SalesOrderStatuses { get; set; }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Accounting
|
#region Accounting
|
||||||
|
|
@ -2756,6 +2760,11 @@ public class PlatformDbContext :
|
||||||
b.Property(x => x.Specification).HasMaxLength(500);
|
b.Property(x => x.Specification).HasMaxLength(500);
|
||||||
b.Property(x => x.Justification).HasMaxLength(500);
|
b.Property(x => x.Justification).HasMaxLength(500);
|
||||||
|
|
||||||
|
b.HasOne(x => x.Material)
|
||||||
|
.WithMany(x => x.RequestItems)
|
||||||
|
.HasForeignKey(x => x.MaterialId)
|
||||||
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
|
||||||
b.HasOne(x => x.Request)
|
b.HasOne(x => x.Request)
|
||||||
.WithMany(x => x.Items)
|
.WithMany(x => x.Items)
|
||||||
.HasForeignKey(x => x.RequestId)
|
.HasForeignKey(x => x.RequestId)
|
||||||
|
|
@ -3521,6 +3530,11 @@ public class PlatformDbContext :
|
||||||
b.Property(x => x.LeadTime).HasDefaultValue(0);
|
b.Property(x => x.LeadTime).HasDefaultValue(0);
|
||||||
b.Property(x => x.Description).HasMaxLength(500);
|
b.Property(x => x.Description).HasMaxLength(500);
|
||||||
|
|
||||||
|
b.HasOne(x => x.Material)
|
||||||
|
.WithMany(x => x.QuotationItems)
|
||||||
|
.HasForeignKey(x => x.MaterialId)
|
||||||
|
.OnDelete(DeleteBehavior.Restrict);
|
||||||
|
|
||||||
b.HasOne(x => x.Quotation)
|
b.HasOne(x => x.Quotation)
|
||||||
.WithMany(x => x.Items)
|
.WithMany(x => x.Items)
|
||||||
.HasForeignKey(x => x.QuotationId)
|
.HasForeignKey(x => x.QuotationId)
|
||||||
|
|
@ -3557,6 +3571,11 @@ public class PlatformDbContext :
|
||||||
b.Property(x => x.UnitCost).HasPrecision(18, 2);
|
b.Property(x => x.UnitCost).HasPrecision(18, 2);
|
||||||
b.Property(x => x.TotalCost).HasPrecision(18, 2);
|
b.Property(x => x.TotalCost).HasPrecision(18, 2);
|
||||||
|
|
||||||
|
b.HasOne(x => x.Material)
|
||||||
|
.WithMany(x => x.WorkorderMaterials)
|
||||||
|
.HasForeignKey(x => x.MaterialId)
|
||||||
|
.OnDelete(DeleteBehavior.Restrict);
|
||||||
|
|
||||||
b.HasOne(x => x.Workorder)
|
b.HasOne(x => x.Workorder)
|
||||||
.WithMany(x => x.Materials)
|
.WithMany(x => x.Materials)
|
||||||
.HasForeignKey(x => x.WorkorderId)
|
.HasForeignKey(x => x.WorkorderId)
|
||||||
|
|
@ -3601,7 +3620,7 @@ public class PlatformDbContext :
|
||||||
b.Property(x => x.Status).IsRequired().HasMaxLength(64);
|
b.Property(x => x.Status).IsRequired().HasMaxLength(64);
|
||||||
b.Property(x => x.Currency).IsRequired().HasMaxLength(8);
|
b.Property(x => x.Currency).IsRequired().HasMaxLength(8);
|
||||||
|
|
||||||
b.Property(x => x.ExchangeRate).HasPrecision(18, 2).HasDefaultValue(1);
|
b.Property(x => x.ExchangeRate).HasPrecision(18, 2).HasDefaultValue(0);
|
||||||
b.Property(x => x.Subtotal).HasPrecision(18, 2).HasDefaultValue(0);
|
b.Property(x => x.Subtotal).HasPrecision(18, 2).HasDefaultValue(0);
|
||||||
b.Property(x => x.TaxAmount).HasPrecision(18, 2).HasDefaultValue(0);
|
b.Property(x => x.TaxAmount).HasPrecision(18, 2).HasDefaultValue(0);
|
||||||
b.Property(x => x.TotalAmount).HasPrecision(18, 2).HasDefaultValue(0);
|
b.Property(x => x.TotalAmount).HasPrecision(18, 2).HasDefaultValue(0);
|
||||||
|
|
@ -3640,7 +3659,7 @@ public class PlatformDbContext :
|
||||||
b.Property(x => x.PurchaseOrderId).IsRequired();
|
b.Property(x => x.PurchaseOrderId).IsRequired();
|
||||||
b.Property(x => x.MaterialId).IsRequired();
|
b.Property(x => x.MaterialId).IsRequired();
|
||||||
b.Property(x => x.UnitPrice).HasPrecision(18, 2).HasDefaultValue(0);
|
b.Property(x => x.UnitPrice).HasPrecision(18, 2).HasDefaultValue(0);
|
||||||
b.Property(x => x.Quantity).HasPrecision(18, 2).HasDefaultValue(1);
|
b.Property(x => x.Quantity).HasPrecision(18, 2).HasDefaultValue(0);
|
||||||
b.Property(x => x.Uom).IsRequired().HasMaxLength(64);
|
b.Property(x => x.Uom).IsRequired().HasMaxLength(64);
|
||||||
b.Property(x => x.TotalPrice).HasPrecision(18, 2).HasDefaultValue(0);
|
b.Property(x => x.TotalPrice).HasPrecision(18, 2).HasDefaultValue(0);
|
||||||
|
|
||||||
|
|
@ -3650,10 +3669,90 @@ public class PlatformDbContext :
|
||||||
|
|
||||||
b.Property(x => x.Description).HasMaxLength(1000);
|
b.Property(x => x.Description).HasMaxLength(1000);
|
||||||
|
|
||||||
|
b.HasOne(x => x.Material)
|
||||||
|
.WithMany(x => x.PurchaseOrderItems)
|
||||||
|
.HasForeignKey(x => x.MaterialId)
|
||||||
|
.OnDelete(DeleteBehavior.Restrict);
|
||||||
|
|
||||||
b.HasOne(x => x.PurchaseOrder)
|
b.HasOne(x => x.PurchaseOrder)
|
||||||
.WithMany(x => x.PurchaseOrders)
|
.WithMany(x => x.PurchaseOrders)
|
||||||
.HasForeignKey(x => x.PurchaseOrderId)
|
.HasForeignKey(x => x.PurchaseOrderId)
|
||||||
.OnDelete(DeleteBehavior.Restrict);
|
.OnDelete(DeleteBehavior.Restrict);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
builder.Entity<SalesOrderStatus>(b =>
|
||||||
|
{
|
||||||
|
b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.SalesOrderStatus)), 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<SalesOrder>(b =>
|
||||||
|
{
|
||||||
|
b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.SalesOrder)), Prefix.DbSchema);
|
||||||
|
b.ConfigureByConvention();
|
||||||
|
|
||||||
|
b.Property(x => x.OrderNumber).IsRequired().HasMaxLength(50);
|
||||||
|
b.Property(x => x.CustomerId).IsRequired();
|
||||||
|
b.Property(x => x.OrderDate).IsRequired();
|
||||||
|
b.Property(x => x.RequestedDeliveryDate).IsRequired();
|
||||||
|
b.Property(x => x.Status).IsRequired().HasMaxLength(64);
|
||||||
|
b.Property(x => x.Currency).IsRequired().HasMaxLength(8);
|
||||||
|
b.Property(x => x.PaymentTermId).IsRequired();
|
||||||
|
b.Property(x => x.DeliveryTermId).IsRequired();
|
||||||
|
b.Property(x => x.Subtotal).HasPrecision(18, 2).HasDefaultValue(0);
|
||||||
|
b.Property(x => x.TaxAmount).HasPrecision(18, 2).HasDefaultValue(0);
|
||||||
|
b.Property(x => x.TotalAmount).HasPrecision(18, 2).HasDefaultValue(0);
|
||||||
|
b.Property(x => x.DiscountAmount).HasPrecision(18, 2).HasDefaultValue(0);
|
||||||
|
b.Property(x => x.Notes).HasMaxLength(1000);
|
||||||
|
b.Property(x => x.SpecialInstructions).HasMaxLength(1000);
|
||||||
|
b.Property(x => x.ExchangeRate).HasPrecision(18, 2).HasDefaultValue(0);
|
||||||
|
b.Property(x => x.DiscountRate).HasPrecision(18, 2).HasDefaultValue(0);
|
||||||
|
b.Property(x => x.TaxRate).HasPrecision(18, 2).HasDefaultValue(0);
|
||||||
|
|
||||||
|
b.HasOne(x => x.DeliveryTerm)
|
||||||
|
.WithMany(x => x.SalesOrders)
|
||||||
|
.HasForeignKey(x => x.DeliveryTermId)
|
||||||
|
.OnDelete(DeleteBehavior.Restrict);
|
||||||
|
|
||||||
|
b.HasOne(x => x.PaymentTerm)
|
||||||
|
.WithMany(x => x.SalesOrders)
|
||||||
|
.HasForeignKey(x => x.PaymentTermId)
|
||||||
|
.OnDelete(DeleteBehavior.Restrict);
|
||||||
|
});
|
||||||
|
|
||||||
|
builder.Entity<SalesOrderItem>(b =>
|
||||||
|
{
|
||||||
|
b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.SalesOrderItem)), Prefix.DbSchema);
|
||||||
|
b.ConfigureByConvention();
|
||||||
|
|
||||||
|
b.Property(x => x.SalesOrderId).IsRequired();
|
||||||
|
b.Property(x => x.MaterialId).IsRequired();
|
||||||
|
b.Property(x => x.Description).HasMaxLength(1000);
|
||||||
|
b.Property(x => x.Quantity).HasPrecision(18, 2).HasDefaultValue(0);
|
||||||
|
b.Property(x => x.DeliveredQuantity).HasPrecision(18, 2).HasDefaultValue(0);
|
||||||
|
b.Property(x => x.UnitPrice).HasPrecision(18, 2).HasDefaultValue(0);
|
||||||
|
b.Property(x => x.TotalAmount).HasPrecision(18, 2).HasDefaultValue(0);
|
||||||
|
b.Property(x => x.Uom).IsRequired().HasMaxLength(64);
|
||||||
|
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.Notes).HasMaxLength(1000);
|
||||||
|
b.Property(x => x.Status).HasMaxLength(64);
|
||||||
|
|
||||||
|
b.HasOne(x => x.Material)
|
||||||
|
.WithMany(x => x.SalesOrderItems)
|
||||||
|
.HasForeignKey(x => x.MaterialId)
|
||||||
|
.OnDelete(DeleteBehavior.Restrict);
|
||||||
|
|
||||||
|
b.HasOne(x => x.SalesOrder)
|
||||||
|
.WithMany(x => x.Items)
|
||||||
|
.HasForeignKey(x => x.SalesOrderId)
|
||||||
|
.OnDelete(DeleteBehavior.Restrict);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore;
|
||||||
namespace Erp.Platform.Migrations
|
namespace Erp.Platform.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(PlatformDbContext))]
|
[DbContext(typeof(PlatformDbContext))]
|
||||||
[Migration("20251204121428_Initial")]
|
[Migration("20251204142238_Initial")]
|
||||||
partial class Initial
|
partial class Initial
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|
@ -10236,7 +10236,7 @@ namespace Erp.Platform.Migrations
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasPrecision(18, 2)
|
.HasPrecision(18, 2)
|
||||||
.HasColumnType("decimal(18,2)")
|
.HasColumnType("decimal(18,2)")
|
||||||
.HasDefaultValue(1m);
|
.HasDefaultValue(0m);
|
||||||
|
|
||||||
b.Property<bool>("IsDeleted")
|
b.Property<bool>("IsDeleted")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
|
|
@ -10375,7 +10375,7 @@ namespace Erp.Platform.Migrations
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasPrecision(18, 2)
|
.HasPrecision(18, 2)
|
||||||
.HasColumnType("decimal(18,2)")
|
.HasColumnType("decimal(18,2)")
|
||||||
.HasDefaultValue(1m);
|
.HasDefaultValue(0m);
|
||||||
|
|
||||||
b.Property<decimal>("ReceivedQuantity")
|
b.Property<decimal>("ReceivedQuantity")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
|
|
@ -11924,6 +11924,321 @@ namespace Erp.Platform.Migrations
|
||||||
b.ToTable("Sas_H_Route", (string)null);
|
b.ToTable("Sas_H_Route", (string)null);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Erp.Platform.Entities.SalesOrder", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("ConfirmedDeliveryDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreationTime")
|
||||||
|
.HasColumnType("datetime2")
|
||||||
|
.HasColumnName("CreationTime");
|
||||||
|
|
||||||
|
b.Property<Guid?>("CreatorId")
|
||||||
|
.HasColumnType("uniqueidentifier")
|
||||||
|
.HasColumnName("CreatorId");
|
||||||
|
|
||||||
|
b.Property<string>("Currency")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(8)
|
||||||
|
.HasColumnType("nvarchar(8)");
|
||||||
|
|
||||||
|
b.Property<Guid>("CustomerId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<Guid?>("DeleterId")
|
||||||
|
.HasColumnType("uniqueidentifier")
|
||||||
|
.HasColumnName("DeleterId");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("DeletionTime")
|
||||||
|
.HasColumnType("datetime2")
|
||||||
|
.HasColumnName("DeletionTime");
|
||||||
|
|
||||||
|
b.Property<Guid>("DeliveryTermId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<decimal>("DiscountAmount")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasPrecision(18, 2)
|
||||||
|
.HasColumnType("decimal(18,2)")
|
||||||
|
.HasDefaultValue(0m);
|
||||||
|
|
||||||
|
b.Property<decimal>("DiscountRate")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasPrecision(18, 2)
|
||||||
|
.HasColumnType("decimal(18,2)")
|
||||||
|
.HasDefaultValue(0m);
|
||||||
|
|
||||||
|
b.Property<decimal>("ExchangeRate")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasPrecision(18, 2)
|
||||||
|
.HasColumnType("decimal(18,2)")
|
||||||
|
.HasDefaultValue(0m);
|
||||||
|
|
||||||
|
b.Property<bool>("IsDeleted")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("bit")
|
||||||
|
.HasDefaultValue(false)
|
||||||
|
.HasColumnName("IsDeleted");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastModificationTime")
|
||||||
|
.HasColumnType("datetime2")
|
||||||
|
.HasColumnName("LastModificationTime");
|
||||||
|
|
||||||
|
b.Property<Guid?>("LastModifierId")
|
||||||
|
.HasColumnType("uniqueidentifier")
|
||||||
|
.HasColumnName("LastModifierId");
|
||||||
|
|
||||||
|
b.Property<string>("Notes")
|
||||||
|
.HasMaxLength(1000)
|
||||||
|
.HasColumnType("nvarchar(1000)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("OrderDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<string>("OrderNumber")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("nvarchar(50)");
|
||||||
|
|
||||||
|
b.Property<Guid>("PaymentTermId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<DateTime>("RequestedDeliveryDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<Guid?>("SalesOrderStatusId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<string>("SpecialInstructions")
|
||||||
|
.HasMaxLength(1000)
|
||||||
|
.HasColumnType("nvarchar(1000)");
|
||||||
|
|
||||||
|
b.Property<string>("Status")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(64)
|
||||||
|
.HasColumnType("nvarchar(64)");
|
||||||
|
|
||||||
|
b.Property<decimal>("Subtotal")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasPrecision(18, 2)
|
||||||
|
.HasColumnType("decimal(18,2)")
|
||||||
|
.HasDefaultValue(0m);
|
||||||
|
|
||||||
|
b.Property<decimal>("TaxAmount")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasPrecision(18, 2)
|
||||||
|
.HasColumnType("decimal(18,2)")
|
||||||
|
.HasDefaultValue(0m);
|
||||||
|
|
||||||
|
b.Property<decimal>("TaxRate")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasPrecision(18, 2)
|
||||||
|
.HasColumnType("decimal(18,2)")
|
||||||
|
.HasDefaultValue(0m);
|
||||||
|
|
||||||
|
b.Property<Guid?>("TenantId")
|
||||||
|
.HasColumnType("uniqueidentifier")
|
||||||
|
.HasColumnName("TenantId");
|
||||||
|
|
||||||
|
b.Property<decimal>("TotalAmount")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasPrecision(18, 2)
|
||||||
|
.HasColumnType("decimal(18,2)")
|
||||||
|
.HasDefaultValue(0m);
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("CustomerId");
|
||||||
|
|
||||||
|
b.HasIndex("DeliveryTermId");
|
||||||
|
|
||||||
|
b.HasIndex("PaymentTermId");
|
||||||
|
|
||||||
|
b.HasIndex("SalesOrderStatusId");
|
||||||
|
|
||||||
|
b.ToTable("Crm_T_SalesOrder", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Erp.Platform.Entities.SalesOrderItem", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreationTime")
|
||||||
|
.HasColumnType("datetime2")
|
||||||
|
.HasColumnName("CreationTime");
|
||||||
|
|
||||||
|
b.Property<Guid?>("CreatorId")
|
||||||
|
.HasColumnType("uniqueidentifier")
|
||||||
|
.HasColumnName("CreatorId");
|
||||||
|
|
||||||
|
b.Property<Guid?>("DeleterId")
|
||||||
|
.HasColumnType("uniqueidentifier")
|
||||||
|
.HasColumnName("DeleterId");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("DeletionTime")
|
||||||
|
.HasColumnType("datetime2")
|
||||||
|
.HasColumnName("DeletionTime");
|
||||||
|
|
||||||
|
b.Property<decimal>("DeliveredQuantity")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasPrecision(18, 2)
|
||||||
|
.HasColumnType("decimal(18,2)")
|
||||||
|
.HasDefaultValue(0m);
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.HasMaxLength(1000)
|
||||||
|
.HasColumnType("nvarchar(1000)");
|
||||||
|
|
||||||
|
b.Property<decimal>("DiscountAmount")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasPrecision(18, 2)
|
||||||
|
.HasColumnType("decimal(18,2)")
|
||||||
|
.HasDefaultValue(0m);
|
||||||
|
|
||||||
|
b.Property<decimal>("DiscountRate")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasPrecision(18, 2)
|
||||||
|
.HasColumnType("decimal(18,2)")
|
||||||
|
.HasDefaultValue(0m);
|
||||||
|
|
||||||
|
b.Property<bool>("IsDeleted")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("bit")
|
||||||
|
.HasDefaultValue(false)
|
||||||
|
.HasColumnName("IsDeleted");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastModificationTime")
|
||||||
|
.HasColumnType("datetime2")
|
||||||
|
.HasColumnName("LastModificationTime");
|
||||||
|
|
||||||
|
b.Property<Guid?>("LastModifierId")
|
||||||
|
.HasColumnType("uniqueidentifier")
|
||||||
|
.HasColumnName("LastModifierId");
|
||||||
|
|
||||||
|
b.Property<Guid>("MaterialId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<string>("Notes")
|
||||||
|
.HasMaxLength(1000)
|
||||||
|
.HasColumnType("nvarchar(1000)");
|
||||||
|
|
||||||
|
b.Property<decimal>("Quantity")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasPrecision(18, 2)
|
||||||
|
.HasColumnType("decimal(18,2)")
|
||||||
|
.HasDefaultValue(0m);
|
||||||
|
|
||||||
|
b.Property<Guid>("SalesOrderId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<string>("Status")
|
||||||
|
.HasMaxLength(64)
|
||||||
|
.HasColumnType("nvarchar(64)");
|
||||||
|
|
||||||
|
b.Property<decimal>("TaxAmount")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasPrecision(18, 2)
|
||||||
|
.HasColumnType("decimal(18,2)")
|
||||||
|
.HasDefaultValue(0m);
|
||||||
|
|
||||||
|
b.Property<decimal>("TaxRate")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasPrecision(18, 2)
|
||||||
|
.HasColumnType("decimal(18,2)")
|
||||||
|
.HasDefaultValue(0m);
|
||||||
|
|
||||||
|
b.Property<Guid?>("TenantId")
|
||||||
|
.HasColumnType("uniqueidentifier")
|
||||||
|
.HasColumnName("TenantId");
|
||||||
|
|
||||||
|
b.Property<decimal>("TotalAmount")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasPrecision(18, 2)
|
||||||
|
.HasColumnType("decimal(18,2)")
|
||||||
|
.HasDefaultValue(0m);
|
||||||
|
|
||||||
|
b.Property<decimal>("UnitPrice")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasPrecision(18, 2)
|
||||||
|
.HasColumnType("decimal(18,2)")
|
||||||
|
.HasDefaultValue(0m);
|
||||||
|
|
||||||
|
b.Property<string>("Uom")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(64)
|
||||||
|
.HasColumnType("nvarchar(64)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("MaterialId");
|
||||||
|
|
||||||
|
b.HasIndex("SalesOrderId");
|
||||||
|
|
||||||
|
b.ToTable("Crm_T_SalesOrderItem", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Erp.Platform.Entities.SalesOrderStatus", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreationTime")
|
||||||
|
.HasColumnType("datetime2")
|
||||||
|
.HasColumnName("CreationTime");
|
||||||
|
|
||||||
|
b.Property<Guid?>("CreatorId")
|
||||||
|
.HasColumnType("uniqueidentifier")
|
||||||
|
.HasColumnName("CreatorId");
|
||||||
|
|
||||||
|
b.Property<Guid?>("DeleterId")
|
||||||
|
.HasColumnType("uniqueidentifier")
|
||||||
|
.HasColumnName("DeleterId");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("DeletionTime")
|
||||||
|
.HasColumnType("datetime2")
|
||||||
|
.HasColumnName("DeletionTime");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.HasMaxLength(500)
|
||||||
|
.HasColumnType("nvarchar(500)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("bit")
|
||||||
|
.HasDefaultValue(true);
|
||||||
|
|
||||||
|
b.Property<bool>("IsDeleted")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("bit")
|
||||||
|
.HasDefaultValue(false)
|
||||||
|
.HasColumnName("IsDeleted");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastModificationTime")
|
||||||
|
.HasColumnType("datetime2")
|
||||||
|
.HasColumnName("LastModificationTime");
|
||||||
|
|
||||||
|
b.Property<Guid?>("LastModifierId")
|
||||||
|
.HasColumnType("uniqueidentifier")
|
||||||
|
.HasColumnName("LastModifierId");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("nvarchar(50)");
|
||||||
|
|
||||||
|
b.Property<Guid?>("TenantId")
|
||||||
|
.HasColumnType("uniqueidentifier")
|
||||||
|
.HasColumnName("TenantId");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Crm_T_SalesOrderStatus", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Erp.Platform.Entities.SalesRejectionReason", b =>
|
modelBuilder.Entity("Erp.Platform.Entities.SalesRejectionReason", b =>
|
||||||
{
|
{
|
||||||
b.Property<Guid>("Id")
|
b.Property<Guid>("Id")
|
||||||
|
|
@ -18581,9 +18896,9 @@ namespace Erp.Platform.Migrations
|
||||||
modelBuilder.Entity("Erp.Platform.Entities.PurchaseOrderItem", b =>
|
modelBuilder.Entity("Erp.Platform.Entities.PurchaseOrderItem", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Erp.Platform.Entities.Material", "Material")
|
b.HasOne("Erp.Platform.Entities.Material", "Material")
|
||||||
.WithMany()
|
.WithMany("PurchaseOrderItems")
|
||||||
.HasForeignKey("MaterialId")
|
.HasForeignKey("MaterialId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("Erp.Platform.Entities.PurchaseOrder", "PurchaseOrder")
|
b.HasOne("Erp.Platform.Entities.PurchaseOrder", "PurchaseOrder")
|
||||||
|
|
@ -18687,9 +19002,9 @@ namespace Erp.Platform.Migrations
|
||||||
modelBuilder.Entity("Erp.Platform.Entities.QuotationItem", b =>
|
modelBuilder.Entity("Erp.Platform.Entities.QuotationItem", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Erp.Platform.Entities.Material", "Material")
|
b.HasOne("Erp.Platform.Entities.Material", "Material")
|
||||||
.WithMany()
|
.WithMany("QuotationItems")
|
||||||
.HasForeignKey("MaterialId")
|
.HasForeignKey("MaterialId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("Erp.Platform.Entities.Quotation", "Quotation")
|
b.HasOne("Erp.Platform.Entities.Quotation", "Quotation")
|
||||||
|
|
@ -18793,7 +19108,7 @@ namespace Erp.Platform.Migrations
|
||||||
modelBuilder.Entity("Erp.Platform.Entities.RequestItem", b =>
|
modelBuilder.Entity("Erp.Platform.Entities.RequestItem", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Erp.Platform.Entities.Material", "Material")
|
b.HasOne("Erp.Platform.Entities.Material", "Material")
|
||||||
.WithMany()
|
.WithMany("RequestItems")
|
||||||
.HasForeignKey("MaterialId")
|
.HasForeignKey("MaterialId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
@ -18820,6 +19135,56 @@ namespace Erp.Platform.Migrations
|
||||||
b.Navigation("Employee");
|
b.Navigation("Employee");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Erp.Platform.Entities.SalesOrder", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Erp.Platform.Entities.Partner", "Customer")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("CustomerId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("Erp.Platform.Entities.DeliveryTerm", "DeliveryTerm")
|
||||||
|
.WithMany("SalesOrders")
|
||||||
|
.HasForeignKey("DeliveryTermId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("Erp.Platform.Entities.PaymentTerm", "PaymentTerm")
|
||||||
|
.WithMany("SalesOrders")
|
||||||
|
.HasForeignKey("PaymentTermId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("Erp.Platform.Entities.SalesOrderStatus", null)
|
||||||
|
.WithMany("SalesOrders")
|
||||||
|
.HasForeignKey("SalesOrderStatusId");
|
||||||
|
|
||||||
|
b.Navigation("Customer");
|
||||||
|
|
||||||
|
b.Navigation("DeliveryTerm");
|
||||||
|
|
||||||
|
b.Navigation("PaymentTerm");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Erp.Platform.Entities.SalesOrderItem", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Erp.Platform.Entities.Material", "Material")
|
||||||
|
.WithMany("SalesOrderItems")
|
||||||
|
.HasForeignKey("MaterialId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("Erp.Platform.Entities.SalesOrder", "SalesOrder")
|
||||||
|
.WithMany("Items")
|
||||||
|
.HasForeignKey("SalesOrderId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Material");
|
||||||
|
|
||||||
|
b.Navigation("SalesOrder");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Erp.Platform.Entities.Schedule", b =>
|
modelBuilder.Entity("Erp.Platform.Entities.Schedule", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Erp.Platform.Entities.Branch", "Branch")
|
b.HasOne("Erp.Platform.Entities.Branch", "Branch")
|
||||||
|
|
@ -19131,9 +19496,9 @@ namespace Erp.Platform.Migrations
|
||||||
modelBuilder.Entity("Erp.Platform.Entities.WorkorderMaterial", b =>
|
modelBuilder.Entity("Erp.Platform.Entities.WorkorderMaterial", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Erp.Platform.Entities.Material", "Material")
|
b.HasOne("Erp.Platform.Entities.Material", "Material")
|
||||||
.WithMany()
|
.WithMany("WorkorderMaterials")
|
||||||
.HasForeignKey("MaterialId")
|
.HasForeignKey("MaterialId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("Erp.Platform.Entities.Workorder", "Workorder")
|
b.HasOne("Erp.Platform.Entities.Workorder", "Workorder")
|
||||||
|
|
@ -19469,6 +19834,8 @@ namespace Erp.Platform.Migrations
|
||||||
modelBuilder.Entity("Erp.Platform.Entities.DeliveryTerm", b =>
|
modelBuilder.Entity("Erp.Platform.Entities.DeliveryTerm", b =>
|
||||||
{
|
{
|
||||||
b.Navigation("Quotations");
|
b.Navigation("Quotations");
|
||||||
|
|
||||||
|
b.Navigation("SalesOrders");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Erp.Platform.Entities.Department", b =>
|
modelBuilder.Entity("Erp.Platform.Entities.Department", b =>
|
||||||
|
|
@ -19550,9 +19917,19 @@ namespace Erp.Platform.Migrations
|
||||||
|
|
||||||
b.Navigation("Boms");
|
b.Navigation("Boms");
|
||||||
|
|
||||||
|
b.Navigation("PurchaseOrderItems");
|
||||||
|
|
||||||
|
b.Navigation("QuotationItems");
|
||||||
|
|
||||||
|
b.Navigation("RequestItems");
|
||||||
|
|
||||||
|
b.Navigation("SalesOrderItems");
|
||||||
|
|
||||||
b.Navigation("Specifications");
|
b.Navigation("Specifications");
|
||||||
|
|
||||||
b.Navigation("Suppliers");
|
b.Navigation("Suppliers");
|
||||||
|
|
||||||
|
b.Navigation("WorkorderMaterials");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Erp.Platform.Entities.MaterialGroup", b =>
|
modelBuilder.Entity("Erp.Platform.Entities.MaterialGroup", b =>
|
||||||
|
|
@ -19617,6 +19994,8 @@ namespace Erp.Platform.Migrations
|
||||||
b.Navigation("PurchaseOrders");
|
b.Navigation("PurchaseOrders");
|
||||||
|
|
||||||
b.Navigation("Quotations");
|
b.Navigation("Quotations");
|
||||||
|
|
||||||
|
b.Navigation("SalesOrders");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Erp.Platform.Entities.Payroll", b =>
|
modelBuilder.Entity("Erp.Platform.Entities.Payroll", b =>
|
||||||
|
|
@ -19722,6 +20101,16 @@ namespace Erp.Platform.Migrations
|
||||||
b.Navigation("ProjectRisks");
|
b.Navigation("ProjectRisks");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Erp.Platform.Entities.SalesOrder", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Items");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Erp.Platform.Entities.SalesOrderStatus", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("SalesOrders");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Erp.Platform.Entities.Schedule", b =>
|
modelBuilder.Entity("Erp.Platform.Entities.Schedule", b =>
|
||||||
{
|
{
|
||||||
b.Navigation("Lessons");
|
b.Navigation("Lessons");
|
||||||
|
|
@ -1172,6 +1172,28 @@ namespace Erp.Platform.Migrations
|
||||||
table.PrimaryKey("PK_Crm_T_LossReason", x => x.Id);
|
table.PrimaryKey("PK_Crm_T_LossReason", x => x.Id);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "Crm_T_SalesOrderStatus",
|
||||||
|
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_Crm_T_SalesOrderStatus", x => x.Id);
|
||||||
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
name: "Hr_T_Badge",
|
name: "Hr_T_Badge",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
|
|
@ -5109,6 +5131,112 @@ namespace Erp.Platform.Migrations
|
||||||
onDelete: ReferentialAction.Restrict);
|
onDelete: ReferentialAction.Restrict);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "Crm_T_SalesOrder",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
|
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||||
|
OrderNumber = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
|
||||||
|
CustomerId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
|
OrderDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||||
|
RequestedDeliveryDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||||
|
ConfirmedDeliveryDate = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||||
|
Status = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
|
||||||
|
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(8)", maxLength: 8, nullable: false),
|
||||||
|
PaymentTermId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
|
DeliveryTermId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
|
ExchangeRate = 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),
|
||||||
|
TaxRate = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
|
||||||
|
SpecialInstructions = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true),
|
||||||
|
Notes = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true),
|
||||||
|
SalesOrderStatusId = table.Column<Guid>(type: "uniqueidentifier", 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_Crm_T_SalesOrder", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_Crm_T_SalesOrder_Adm_T_Partner_CustomerId",
|
||||||
|
column: x => x.CustomerId,
|
||||||
|
principalTable: "Adm_T_Partner",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_Crm_T_SalesOrder_Crm_T_SalesOrderStatus_SalesOrderStatusId",
|
||||||
|
column: x => x.SalesOrderStatusId,
|
||||||
|
principalTable: "Crm_T_SalesOrderStatus",
|
||||||
|
principalColumn: "Id");
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_Crm_T_SalesOrder_Scp_T_DeliveryTerm_DeliveryTermId",
|
||||||
|
column: x => x.DeliveryTermId,
|
||||||
|
principalTable: "Scp_T_DeliveryTerm",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_Crm_T_SalesOrder_Scp_T_PaymentTerm_PaymentTermId",
|
||||||
|
column: x => x.PaymentTermId,
|
||||||
|
principalTable: "Scp_T_PaymentTerm",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "Crm_T_SalesOrderItem",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
|
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||||
|
SalesOrderId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
|
MaterialId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
|
Quantity = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
|
||||||
|
DeliveredQuantity = 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),
|
||||||
|
TotalAmount = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
|
||||||
|
Uom = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
|
||||||
|
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),
|
||||||
|
Description = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true),
|
||||||
|
Notes = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true),
|
||||||
|
Status = table.Column<string>(type: "nvarchar(64)", maxLength: 64, 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_Crm_T_SalesOrderItem", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_Crm_T_SalesOrderItem_Crm_T_SalesOrder_SalesOrderId",
|
||||||
|
column: x => x.SalesOrderId,
|
||||||
|
principalTable: "Crm_T_SalesOrder",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_Crm_T_SalesOrderItem_Scp_T_Material_MaterialId",
|
||||||
|
column: x => x.MaterialId,
|
||||||
|
principalTable: "Scp_T_Material",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
name: "Crm_T_Activity",
|
name: "Crm_T_Activity",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
|
|
@ -6751,7 +6879,7 @@ namespace Erp.Platform.Migrations
|
||||||
column: x => x.MaterialId,
|
column: x => x.MaterialId,
|
||||||
principalTable: "Scp_T_Material",
|
principalTable: "Scp_T_Material",
|
||||||
principalColumn: "Id",
|
principalColumn: "Id",
|
||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Restrict);
|
||||||
table.ForeignKey(
|
table.ForeignKey(
|
||||||
name: "FK_Scp_T_QuotationItem_Scp_T_Quotation_QuotationId",
|
name: "FK_Scp_T_QuotationItem_Scp_T_Quotation_QuotationId",
|
||||||
column: x => x.QuotationId,
|
column: x => x.QuotationId,
|
||||||
|
|
@ -6776,7 +6904,7 @@ namespace Erp.Platform.Migrations
|
||||||
RequestId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
RequestId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||||
QuotationId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
QuotationId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||||
Currency = table.Column<string>(type: "nvarchar(8)", maxLength: 8, nullable: false),
|
Currency = table.Column<string>(type: "nvarchar(8)", maxLength: 8, nullable: false),
|
||||||
ExchangeRate = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 1m),
|
ExchangeRate = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
|
||||||
Subtotal = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
|
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),
|
TaxAmount = 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),
|
TotalAmount = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
|
||||||
|
|
@ -6964,7 +7092,7 @@ namespace Erp.Platform.Migrations
|
||||||
column: x => x.MaterialId,
|
column: x => x.MaterialId,
|
||||||
principalTable: "Scp_T_Material",
|
principalTable: "Scp_T_Material",
|
||||||
principalColumn: "Id",
|
principalColumn: "Id",
|
||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Restrict);
|
||||||
});
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
|
|
@ -7004,7 +7132,7 @@ namespace Erp.Platform.Migrations
|
||||||
PurchaseOrderId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
PurchaseOrderId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
MaterialId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
MaterialId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
UnitPrice = 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),
|
||||||
Quantity = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 1m),
|
Quantity = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
|
||||||
Uom = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
|
Uom = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
|
||||||
TotalPrice = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
|
TotalPrice = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
|
||||||
ReceivedQuantity = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
|
ReceivedQuantity = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
|
||||||
|
|
@ -7027,7 +7155,7 @@ namespace Erp.Platform.Migrations
|
||||||
column: x => x.MaterialId,
|
column: x => x.MaterialId,
|
||||||
principalTable: "Scp_T_Material",
|
principalTable: "Scp_T_Material",
|
||||||
principalColumn: "Id",
|
principalColumn: "Id",
|
||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Restrict);
|
||||||
table.ForeignKey(
|
table.ForeignKey(
|
||||||
name: "FK_Scp_T_PurchaseOrderItem_Scp_T_PurchaseOrder_PurchaseOrderId",
|
name: "FK_Scp_T_PurchaseOrderItem_Scp_T_PurchaseOrder_PurchaseOrderId",
|
||||||
column: x => x.PurchaseOrderId,
|
column: x => x.PurchaseOrderId,
|
||||||
|
|
@ -7882,6 +8010,36 @@ namespace Erp.Platform.Migrations
|
||||||
table: "Crm_T_Opportunity",
|
table: "Crm_T_Opportunity",
|
||||||
column: "SourceId");
|
column: "SourceId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Crm_T_SalesOrder_CustomerId",
|
||||||
|
table: "Crm_T_SalesOrder",
|
||||||
|
column: "CustomerId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Crm_T_SalesOrder_DeliveryTermId",
|
||||||
|
table: "Crm_T_SalesOrder",
|
||||||
|
column: "DeliveryTermId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Crm_T_SalesOrder_PaymentTermId",
|
||||||
|
table: "Crm_T_SalesOrder",
|
||||||
|
column: "PaymentTermId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Crm_T_SalesOrder_SalesOrderStatusId",
|
||||||
|
table: "Crm_T_SalesOrder",
|
||||||
|
column: "SalesOrderStatusId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Crm_T_SalesOrderItem_MaterialId",
|
||||||
|
table: "Crm_T_SalesOrderItem",
|
||||||
|
column: "MaterialId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Crm_T_SalesOrderItem_SalesOrderId",
|
||||||
|
table: "Crm_T_SalesOrderItem",
|
||||||
|
column: "SalesOrderId");
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "IX_Hr_T_CostCenter_DepartmentId",
|
name: "IX_Hr_T_CostCenter_DepartmentId",
|
||||||
table: "Hr_T_CostCenter",
|
table: "Hr_T_CostCenter",
|
||||||
|
|
@ -9064,6 +9222,9 @@ namespace Erp.Platform.Migrations
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "Crm_T_Competitor");
|
name: "Crm_T_Competitor");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "Crm_T_SalesOrderItem");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "Hr_T_Expense");
|
name: "Hr_T_Expense");
|
||||||
|
|
||||||
|
|
@ -9331,6 +9492,9 @@ namespace Erp.Platform.Migrations
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "Crm_T_Opportunity");
|
name: "Crm_T_Opportunity");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "Crm_T_SalesOrder");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "Hr_T_Payroll");
|
name: "Hr_T_Payroll");
|
||||||
|
|
||||||
|
|
@ -9436,6 +9600,9 @@ namespace Erp.Platform.Migrations
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "Prt_T_Source");
|
name: "Prt_T_Source");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "Crm_T_SalesOrderStatus");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "Hr_T_Survey");
|
name: "Hr_T_Survey");
|
||||||
|
|
||||||
|
|
@ -10233,7 +10233,7 @@ namespace Erp.Platform.Migrations
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasPrecision(18, 2)
|
.HasPrecision(18, 2)
|
||||||
.HasColumnType("decimal(18,2)")
|
.HasColumnType("decimal(18,2)")
|
||||||
.HasDefaultValue(1m);
|
.HasDefaultValue(0m);
|
||||||
|
|
||||||
b.Property<bool>("IsDeleted")
|
b.Property<bool>("IsDeleted")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
|
|
@ -10372,7 +10372,7 @@ namespace Erp.Platform.Migrations
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasPrecision(18, 2)
|
.HasPrecision(18, 2)
|
||||||
.HasColumnType("decimal(18,2)")
|
.HasColumnType("decimal(18,2)")
|
||||||
.HasDefaultValue(1m);
|
.HasDefaultValue(0m);
|
||||||
|
|
||||||
b.Property<decimal>("ReceivedQuantity")
|
b.Property<decimal>("ReceivedQuantity")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
|
|
@ -11921,6 +11921,321 @@ namespace Erp.Platform.Migrations
|
||||||
b.ToTable("Sas_H_Route", (string)null);
|
b.ToTable("Sas_H_Route", (string)null);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Erp.Platform.Entities.SalesOrder", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("ConfirmedDeliveryDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreationTime")
|
||||||
|
.HasColumnType("datetime2")
|
||||||
|
.HasColumnName("CreationTime");
|
||||||
|
|
||||||
|
b.Property<Guid?>("CreatorId")
|
||||||
|
.HasColumnType("uniqueidentifier")
|
||||||
|
.HasColumnName("CreatorId");
|
||||||
|
|
||||||
|
b.Property<string>("Currency")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(8)
|
||||||
|
.HasColumnType("nvarchar(8)");
|
||||||
|
|
||||||
|
b.Property<Guid>("CustomerId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<Guid?>("DeleterId")
|
||||||
|
.HasColumnType("uniqueidentifier")
|
||||||
|
.HasColumnName("DeleterId");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("DeletionTime")
|
||||||
|
.HasColumnType("datetime2")
|
||||||
|
.HasColumnName("DeletionTime");
|
||||||
|
|
||||||
|
b.Property<Guid>("DeliveryTermId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<decimal>("DiscountAmount")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasPrecision(18, 2)
|
||||||
|
.HasColumnType("decimal(18,2)")
|
||||||
|
.HasDefaultValue(0m);
|
||||||
|
|
||||||
|
b.Property<decimal>("DiscountRate")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasPrecision(18, 2)
|
||||||
|
.HasColumnType("decimal(18,2)")
|
||||||
|
.HasDefaultValue(0m);
|
||||||
|
|
||||||
|
b.Property<decimal>("ExchangeRate")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasPrecision(18, 2)
|
||||||
|
.HasColumnType("decimal(18,2)")
|
||||||
|
.HasDefaultValue(0m);
|
||||||
|
|
||||||
|
b.Property<bool>("IsDeleted")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("bit")
|
||||||
|
.HasDefaultValue(false)
|
||||||
|
.HasColumnName("IsDeleted");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastModificationTime")
|
||||||
|
.HasColumnType("datetime2")
|
||||||
|
.HasColumnName("LastModificationTime");
|
||||||
|
|
||||||
|
b.Property<Guid?>("LastModifierId")
|
||||||
|
.HasColumnType("uniqueidentifier")
|
||||||
|
.HasColumnName("LastModifierId");
|
||||||
|
|
||||||
|
b.Property<string>("Notes")
|
||||||
|
.HasMaxLength(1000)
|
||||||
|
.HasColumnType("nvarchar(1000)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("OrderDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<string>("OrderNumber")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("nvarchar(50)");
|
||||||
|
|
||||||
|
b.Property<Guid>("PaymentTermId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<DateTime>("RequestedDeliveryDate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<Guid?>("SalesOrderStatusId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<string>("SpecialInstructions")
|
||||||
|
.HasMaxLength(1000)
|
||||||
|
.HasColumnType("nvarchar(1000)");
|
||||||
|
|
||||||
|
b.Property<string>("Status")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(64)
|
||||||
|
.HasColumnType("nvarchar(64)");
|
||||||
|
|
||||||
|
b.Property<decimal>("Subtotal")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasPrecision(18, 2)
|
||||||
|
.HasColumnType("decimal(18,2)")
|
||||||
|
.HasDefaultValue(0m);
|
||||||
|
|
||||||
|
b.Property<decimal>("TaxAmount")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasPrecision(18, 2)
|
||||||
|
.HasColumnType("decimal(18,2)")
|
||||||
|
.HasDefaultValue(0m);
|
||||||
|
|
||||||
|
b.Property<decimal>("TaxRate")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasPrecision(18, 2)
|
||||||
|
.HasColumnType("decimal(18,2)")
|
||||||
|
.HasDefaultValue(0m);
|
||||||
|
|
||||||
|
b.Property<Guid?>("TenantId")
|
||||||
|
.HasColumnType("uniqueidentifier")
|
||||||
|
.HasColumnName("TenantId");
|
||||||
|
|
||||||
|
b.Property<decimal>("TotalAmount")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasPrecision(18, 2)
|
||||||
|
.HasColumnType("decimal(18,2)")
|
||||||
|
.HasDefaultValue(0m);
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("CustomerId");
|
||||||
|
|
||||||
|
b.HasIndex("DeliveryTermId");
|
||||||
|
|
||||||
|
b.HasIndex("PaymentTermId");
|
||||||
|
|
||||||
|
b.HasIndex("SalesOrderStatusId");
|
||||||
|
|
||||||
|
b.ToTable("Crm_T_SalesOrder", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Erp.Platform.Entities.SalesOrderItem", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreationTime")
|
||||||
|
.HasColumnType("datetime2")
|
||||||
|
.HasColumnName("CreationTime");
|
||||||
|
|
||||||
|
b.Property<Guid?>("CreatorId")
|
||||||
|
.HasColumnType("uniqueidentifier")
|
||||||
|
.HasColumnName("CreatorId");
|
||||||
|
|
||||||
|
b.Property<Guid?>("DeleterId")
|
||||||
|
.HasColumnType("uniqueidentifier")
|
||||||
|
.HasColumnName("DeleterId");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("DeletionTime")
|
||||||
|
.HasColumnType("datetime2")
|
||||||
|
.HasColumnName("DeletionTime");
|
||||||
|
|
||||||
|
b.Property<decimal>("DeliveredQuantity")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasPrecision(18, 2)
|
||||||
|
.HasColumnType("decimal(18,2)")
|
||||||
|
.HasDefaultValue(0m);
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.HasMaxLength(1000)
|
||||||
|
.HasColumnType("nvarchar(1000)");
|
||||||
|
|
||||||
|
b.Property<decimal>("DiscountAmount")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasPrecision(18, 2)
|
||||||
|
.HasColumnType("decimal(18,2)")
|
||||||
|
.HasDefaultValue(0m);
|
||||||
|
|
||||||
|
b.Property<decimal>("DiscountRate")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasPrecision(18, 2)
|
||||||
|
.HasColumnType("decimal(18,2)")
|
||||||
|
.HasDefaultValue(0m);
|
||||||
|
|
||||||
|
b.Property<bool>("IsDeleted")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("bit")
|
||||||
|
.HasDefaultValue(false)
|
||||||
|
.HasColumnName("IsDeleted");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastModificationTime")
|
||||||
|
.HasColumnType("datetime2")
|
||||||
|
.HasColumnName("LastModificationTime");
|
||||||
|
|
||||||
|
b.Property<Guid?>("LastModifierId")
|
||||||
|
.HasColumnType("uniqueidentifier")
|
||||||
|
.HasColumnName("LastModifierId");
|
||||||
|
|
||||||
|
b.Property<Guid>("MaterialId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<string>("Notes")
|
||||||
|
.HasMaxLength(1000)
|
||||||
|
.HasColumnType("nvarchar(1000)");
|
||||||
|
|
||||||
|
b.Property<decimal>("Quantity")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasPrecision(18, 2)
|
||||||
|
.HasColumnType("decimal(18,2)")
|
||||||
|
.HasDefaultValue(0m);
|
||||||
|
|
||||||
|
b.Property<Guid>("SalesOrderId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<string>("Status")
|
||||||
|
.HasMaxLength(64)
|
||||||
|
.HasColumnType("nvarchar(64)");
|
||||||
|
|
||||||
|
b.Property<decimal>("TaxAmount")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasPrecision(18, 2)
|
||||||
|
.HasColumnType("decimal(18,2)")
|
||||||
|
.HasDefaultValue(0m);
|
||||||
|
|
||||||
|
b.Property<decimal>("TaxRate")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasPrecision(18, 2)
|
||||||
|
.HasColumnType("decimal(18,2)")
|
||||||
|
.HasDefaultValue(0m);
|
||||||
|
|
||||||
|
b.Property<Guid?>("TenantId")
|
||||||
|
.HasColumnType("uniqueidentifier")
|
||||||
|
.HasColumnName("TenantId");
|
||||||
|
|
||||||
|
b.Property<decimal>("TotalAmount")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasPrecision(18, 2)
|
||||||
|
.HasColumnType("decimal(18,2)")
|
||||||
|
.HasDefaultValue(0m);
|
||||||
|
|
||||||
|
b.Property<decimal>("UnitPrice")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasPrecision(18, 2)
|
||||||
|
.HasColumnType("decimal(18,2)")
|
||||||
|
.HasDefaultValue(0m);
|
||||||
|
|
||||||
|
b.Property<string>("Uom")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(64)
|
||||||
|
.HasColumnType("nvarchar(64)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("MaterialId");
|
||||||
|
|
||||||
|
b.HasIndex("SalesOrderId");
|
||||||
|
|
||||||
|
b.ToTable("Crm_T_SalesOrderItem", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Erp.Platform.Entities.SalesOrderStatus", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreationTime")
|
||||||
|
.HasColumnType("datetime2")
|
||||||
|
.HasColumnName("CreationTime");
|
||||||
|
|
||||||
|
b.Property<Guid?>("CreatorId")
|
||||||
|
.HasColumnType("uniqueidentifier")
|
||||||
|
.HasColumnName("CreatorId");
|
||||||
|
|
||||||
|
b.Property<Guid?>("DeleterId")
|
||||||
|
.HasColumnType("uniqueidentifier")
|
||||||
|
.HasColumnName("DeleterId");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("DeletionTime")
|
||||||
|
.HasColumnType("datetime2")
|
||||||
|
.HasColumnName("DeletionTime");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.HasMaxLength(500)
|
||||||
|
.HasColumnType("nvarchar(500)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("bit")
|
||||||
|
.HasDefaultValue(true);
|
||||||
|
|
||||||
|
b.Property<bool>("IsDeleted")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("bit")
|
||||||
|
.HasDefaultValue(false)
|
||||||
|
.HasColumnName("IsDeleted");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastModificationTime")
|
||||||
|
.HasColumnType("datetime2")
|
||||||
|
.HasColumnName("LastModificationTime");
|
||||||
|
|
||||||
|
b.Property<Guid?>("LastModifierId")
|
||||||
|
.HasColumnType("uniqueidentifier")
|
||||||
|
.HasColumnName("LastModifierId");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("nvarchar(50)");
|
||||||
|
|
||||||
|
b.Property<Guid?>("TenantId")
|
||||||
|
.HasColumnType("uniqueidentifier")
|
||||||
|
.HasColumnName("TenantId");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Crm_T_SalesOrderStatus", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Erp.Platform.Entities.SalesRejectionReason", b =>
|
modelBuilder.Entity("Erp.Platform.Entities.SalesRejectionReason", b =>
|
||||||
{
|
{
|
||||||
b.Property<Guid>("Id")
|
b.Property<Guid>("Id")
|
||||||
|
|
@ -18578,9 +18893,9 @@ namespace Erp.Platform.Migrations
|
||||||
modelBuilder.Entity("Erp.Platform.Entities.PurchaseOrderItem", b =>
|
modelBuilder.Entity("Erp.Platform.Entities.PurchaseOrderItem", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Erp.Platform.Entities.Material", "Material")
|
b.HasOne("Erp.Platform.Entities.Material", "Material")
|
||||||
.WithMany()
|
.WithMany("PurchaseOrderItems")
|
||||||
.HasForeignKey("MaterialId")
|
.HasForeignKey("MaterialId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("Erp.Platform.Entities.PurchaseOrder", "PurchaseOrder")
|
b.HasOne("Erp.Platform.Entities.PurchaseOrder", "PurchaseOrder")
|
||||||
|
|
@ -18684,9 +18999,9 @@ namespace Erp.Platform.Migrations
|
||||||
modelBuilder.Entity("Erp.Platform.Entities.QuotationItem", b =>
|
modelBuilder.Entity("Erp.Platform.Entities.QuotationItem", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Erp.Platform.Entities.Material", "Material")
|
b.HasOne("Erp.Platform.Entities.Material", "Material")
|
||||||
.WithMany()
|
.WithMany("QuotationItems")
|
||||||
.HasForeignKey("MaterialId")
|
.HasForeignKey("MaterialId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("Erp.Platform.Entities.Quotation", "Quotation")
|
b.HasOne("Erp.Platform.Entities.Quotation", "Quotation")
|
||||||
|
|
@ -18790,7 +19105,7 @@ namespace Erp.Platform.Migrations
|
||||||
modelBuilder.Entity("Erp.Platform.Entities.RequestItem", b =>
|
modelBuilder.Entity("Erp.Platform.Entities.RequestItem", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Erp.Platform.Entities.Material", "Material")
|
b.HasOne("Erp.Platform.Entities.Material", "Material")
|
||||||
.WithMany()
|
.WithMany("RequestItems")
|
||||||
.HasForeignKey("MaterialId")
|
.HasForeignKey("MaterialId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
@ -18817,6 +19132,56 @@ namespace Erp.Platform.Migrations
|
||||||
b.Navigation("Employee");
|
b.Navigation("Employee");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Erp.Platform.Entities.SalesOrder", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Erp.Platform.Entities.Partner", "Customer")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("CustomerId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("Erp.Platform.Entities.DeliveryTerm", "DeliveryTerm")
|
||||||
|
.WithMany("SalesOrders")
|
||||||
|
.HasForeignKey("DeliveryTermId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("Erp.Platform.Entities.PaymentTerm", "PaymentTerm")
|
||||||
|
.WithMany("SalesOrders")
|
||||||
|
.HasForeignKey("PaymentTermId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("Erp.Platform.Entities.SalesOrderStatus", null)
|
||||||
|
.WithMany("SalesOrders")
|
||||||
|
.HasForeignKey("SalesOrderStatusId");
|
||||||
|
|
||||||
|
b.Navigation("Customer");
|
||||||
|
|
||||||
|
b.Navigation("DeliveryTerm");
|
||||||
|
|
||||||
|
b.Navigation("PaymentTerm");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Erp.Platform.Entities.SalesOrderItem", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Erp.Platform.Entities.Material", "Material")
|
||||||
|
.WithMany("SalesOrderItems")
|
||||||
|
.HasForeignKey("MaterialId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("Erp.Platform.Entities.SalesOrder", "SalesOrder")
|
||||||
|
.WithMany("Items")
|
||||||
|
.HasForeignKey("SalesOrderId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Material");
|
||||||
|
|
||||||
|
b.Navigation("SalesOrder");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Erp.Platform.Entities.Schedule", b =>
|
modelBuilder.Entity("Erp.Platform.Entities.Schedule", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Erp.Platform.Entities.Branch", "Branch")
|
b.HasOne("Erp.Platform.Entities.Branch", "Branch")
|
||||||
|
|
@ -19128,9 +19493,9 @@ namespace Erp.Platform.Migrations
|
||||||
modelBuilder.Entity("Erp.Platform.Entities.WorkorderMaterial", b =>
|
modelBuilder.Entity("Erp.Platform.Entities.WorkorderMaterial", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Erp.Platform.Entities.Material", "Material")
|
b.HasOne("Erp.Platform.Entities.Material", "Material")
|
||||||
.WithMany()
|
.WithMany("WorkorderMaterials")
|
||||||
.HasForeignKey("MaterialId")
|
.HasForeignKey("MaterialId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("Erp.Platform.Entities.Workorder", "Workorder")
|
b.HasOne("Erp.Platform.Entities.Workorder", "Workorder")
|
||||||
|
|
@ -19466,6 +19831,8 @@ namespace Erp.Platform.Migrations
|
||||||
modelBuilder.Entity("Erp.Platform.Entities.DeliveryTerm", b =>
|
modelBuilder.Entity("Erp.Platform.Entities.DeliveryTerm", b =>
|
||||||
{
|
{
|
||||||
b.Navigation("Quotations");
|
b.Navigation("Quotations");
|
||||||
|
|
||||||
|
b.Navigation("SalesOrders");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Erp.Platform.Entities.Department", b =>
|
modelBuilder.Entity("Erp.Platform.Entities.Department", b =>
|
||||||
|
|
@ -19547,9 +19914,19 @@ namespace Erp.Platform.Migrations
|
||||||
|
|
||||||
b.Navigation("Boms");
|
b.Navigation("Boms");
|
||||||
|
|
||||||
|
b.Navigation("PurchaseOrderItems");
|
||||||
|
|
||||||
|
b.Navigation("QuotationItems");
|
||||||
|
|
||||||
|
b.Navigation("RequestItems");
|
||||||
|
|
||||||
|
b.Navigation("SalesOrderItems");
|
||||||
|
|
||||||
b.Navigation("Specifications");
|
b.Navigation("Specifications");
|
||||||
|
|
||||||
b.Navigation("Suppliers");
|
b.Navigation("Suppliers");
|
||||||
|
|
||||||
|
b.Navigation("WorkorderMaterials");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Erp.Platform.Entities.MaterialGroup", b =>
|
modelBuilder.Entity("Erp.Platform.Entities.MaterialGroup", b =>
|
||||||
|
|
@ -19614,6 +19991,8 @@ namespace Erp.Platform.Migrations
|
||||||
b.Navigation("PurchaseOrders");
|
b.Navigation("PurchaseOrders");
|
||||||
|
|
||||||
b.Navigation("Quotations");
|
b.Navigation("Quotations");
|
||||||
|
|
||||||
|
b.Navigation("SalesOrders");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Erp.Platform.Entities.Payroll", b =>
|
modelBuilder.Entity("Erp.Platform.Entities.Payroll", b =>
|
||||||
|
|
@ -19719,6 +20098,16 @@ namespace Erp.Platform.Migrations
|
||||||
b.Navigation("ProjectRisks");
|
b.Navigation("ProjectRisks");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Erp.Platform.Entities.SalesOrder", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Items");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Erp.Platform.Entities.SalesOrderStatus", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("SalesOrders");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Erp.Platform.Entities.Schedule", b =>
|
modelBuilder.Entity("Erp.Platform.Entities.Schedule", b =>
|
||||||
{
|
{
|
||||||
b.Navigation("Lessons");
|
b.Navigation("Lessons");
|
||||||
|
|
|
||||||
|
|
@ -6411,5 +6411,42 @@
|
||||||
"description": "Teklifin iptal edildiğini ifade eder",
|
"description": "Teklifin iptal edildiğini ifade eder",
|
||||||
"isActive": true
|
"isActive": true
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
"SalesOrderStatuses": [
|
||||||
|
{
|
||||||
|
"name": "Taslak",
|
||||||
|
"description": "Satış siparişlerin taslak aşamasında olduğunu ifade eder",
|
||||||
|
"isActive": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Onaylandı",
|
||||||
|
"description": "Satış siparişlerin onaylandığını ifade eder",
|
||||||
|
"isActive": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Üretimde",
|
||||||
|
"description": "Satış siparişlerin üretimde olduğunu ifade eder",
|
||||||
|
"isActive": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Hazır",
|
||||||
|
"description": "Satış siparişlerin hazır olduğunu ifade eder",
|
||||||
|
"isActive": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Gönderildi",
|
||||||
|
"description": "Satış siparişlerin gönderildiğini ifade eder",
|
||||||
|
"isActive": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Teslim Edildi",
|
||||||
|
"description": "Satış siparişlerin teslim edildiğini ifade eder",
|
||||||
|
"isActive": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "İptal Edildi",
|
||||||
|
"description": "Satış siparişlerin iptal edildiğini ifade eder",
|
||||||
|
"isActive": true
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -140,6 +140,7 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
|
||||||
private readonly IRepository<DeliveryTerm, Guid> _deliveryTermRepository;
|
private readonly IRepository<DeliveryTerm, Guid> _deliveryTermRepository;
|
||||||
private readonly IRepository<QuotationStatus, Guid> _quotationStatusRepository;
|
private readonly IRepository<QuotationStatus, Guid> _quotationStatusRepository;
|
||||||
private readonly IRepository<OrderStatus, Guid> _orderStatusRepository;
|
private readonly IRepository<OrderStatus, Guid> _orderStatusRepository;
|
||||||
|
private readonly IRepository<SalesOrderStatus, Guid> _salesOrderStatusRepository;
|
||||||
|
|
||||||
public TenantDataSeeder(
|
public TenantDataSeeder(
|
||||||
IClock clock,
|
IClock clock,
|
||||||
|
|
@ -262,7 +263,8 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
|
||||||
IRepository<ProjectTask, Guid> projectTaskRepository,
|
IRepository<ProjectTask, Guid> projectTaskRepository,
|
||||||
IRepository<DeliveryTerm, Guid> deliveryTermRepository,
|
IRepository<DeliveryTerm, Guid> deliveryTermRepository,
|
||||||
IRepository<QuotationStatus, Guid> quotationStatusRepository,
|
IRepository<QuotationStatus, Guid> quotationStatusRepository,
|
||||||
IRepository<OrderStatus, Guid> orderStatusRepository
|
IRepository<OrderStatus, Guid> orderStatusRepository,
|
||||||
|
IRepository<SalesOrderStatus, Guid> salesOrderStatusRepository
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
_clock = clock;
|
_clock = clock;
|
||||||
|
|
@ -387,6 +389,7 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
|
||||||
_deliveryTermRepository = deliveryTermRepository;
|
_deliveryTermRepository = deliveryTermRepository;
|
||||||
_quotationStatusRepository = quotationStatusRepository;
|
_quotationStatusRepository = quotationStatusRepository;
|
||||||
_orderStatusRepository = orderStatusRepository;
|
_orderStatusRepository = orderStatusRepository;
|
||||||
|
_salesOrderStatusRepository = salesOrderStatusRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static IConfigurationRoot BuildConfiguration()
|
private static IConfigurationRoot BuildConfiguration()
|
||||||
|
|
@ -2701,6 +2704,20 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
|
||||||
IsActive = item.IsActive
|
IsActive = item.IsActive
|
||||||
}, autoSave: true);
|
}, autoSave: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (var item in items.SalesOrderStatuses)
|
||||||
|
{
|
||||||
|
var exists = await _salesOrderStatusRepository.AnyAsync(x => x.Name == item.Name);
|
||||||
|
if (exists)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
await _salesOrderStatusRepository.InsertAsync(new SalesOrderStatus
|
||||||
|
{
|
||||||
|
Name = item.Name,
|
||||||
|
Description = item.Description,
|
||||||
|
IsActive = item.IsActive
|
||||||
|
}, autoSave: true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -100,6 +100,7 @@ public class TenantSeederDto
|
||||||
public List<CustomerSegmentSeedDto> CustomerSegments { get; set; }
|
public List<CustomerSegmentSeedDto> CustomerSegments { get; set; }
|
||||||
public List<LossReasonSeedDto> LossReasons { get; set; }
|
public List<LossReasonSeedDto> LossReasons { get; set; }
|
||||||
public List<OrganizationUnitSeedDto> OrganizationUnits { get; set; }
|
public List<OrganizationUnitSeedDto> OrganizationUnits { get; set; }
|
||||||
|
public List<SalesOrderStatusSeedDto> SalesOrderStatuses { get; set; }
|
||||||
|
|
||||||
//Maintenance
|
//Maintenance
|
||||||
public List<WorkcenterTypeSeedDto> WorkcenterTypes { get; set; }
|
public List<WorkcenterTypeSeedDto> WorkcenterTypes { get; set; }
|
||||||
|
|
@ -143,6 +144,13 @@ public class TenantSeederDto
|
||||||
public List<ProjectTaskDailySeedDto> ProjectTaskDailies { get; set; }
|
public List<ProjectTaskDailySeedDto> ProjectTaskDailies { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class SalesOrderStatusSeedDto
|
||||||
|
{
|
||||||
|
public string Name { get; set; }
|
||||||
|
public string Description { get; set; }
|
||||||
|
public bool IsActive { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
public class OrderStatusSeedDto
|
public class OrderStatusSeedDto
|
||||||
{
|
{
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue