SalesOrders ve SalesOrderItem düzenlemeleri
This commit is contained in:
parent
8280a681d1
commit
f3a922a5a8
7 changed files with 305 additions and 6 deletions
|
|
@ -172,6 +172,14 @@ public static class LookupQueryValues
|
|||
$"WHERE \"IsDeleted\" = 'false' " +
|
||||
$"ORDER BY \"Name\";";
|
||||
|
||||
public static string ProductValues =
|
||||
$"SELECT " +
|
||||
$"\"Id\" AS \"Key\", " +
|
||||
$"\"Name\" AS \"Name\" " +
|
||||
$"FROM \"{TableNameResolver.GetFullTableName(nameof(TableNameEnum.Product))}\" " +
|
||||
$"WHERE \"IsDeleted\" = 'false' " +
|
||||
$"ORDER BY \"Name\";";
|
||||
|
||||
public static string MenuCodeValues =
|
||||
$"SELECT " +
|
||||
$"\"Code\" AS \"Key\", " +
|
||||
|
|
|
|||
|
|
@ -6072,6 +6072,12 @@
|
|||
"tr": "Satış Siparişleri",
|
||||
"en": "Sales Orders"
|
||||
},
|
||||
{
|
||||
"resourceName": "Platform",
|
||||
"key": "App.Orders.SalesOrderItem",
|
||||
"tr": "Satış Sipariş Kalemleri",
|
||||
"en": "Sales Order Items"
|
||||
},
|
||||
{
|
||||
"resourceName": "Platform",
|
||||
"key": "Public.about.description.closing",
|
||||
|
|
@ -12506,6 +12512,18 @@
|
|||
"en": "Work Hour",
|
||||
"tr": "Çalışma Saati"
|
||||
},
|
||||
{
|
||||
"resourceName": "Platform",
|
||||
"key": "App.Listform.ListformField.ProductId",
|
||||
"en": "Product",
|
||||
"tr": "Ürün"
|
||||
},
|
||||
{
|
||||
"resourceName": "Platform",
|
||||
"key": "App.Listform.ListformField.BillingCycle",
|
||||
"en": "Billing Cycle",
|
||||
"tr": "Fatura Döngüsü"
|
||||
},
|
||||
{
|
||||
"resourceName": "Platform",
|
||||
"key": "App.Listform.ListformField.Abbreviation",
|
||||
|
|
|
|||
|
|
@ -2231,7 +2231,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
|
|||
PermissionJson = DefaultPermissionJson(listFormName),
|
||||
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.UomCategory)),
|
||||
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson(),
|
||||
InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson(DbType.String, "Name"),
|
||||
InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson(),
|
||||
PagerOptionJson = DefaultPagerOptionJson,
|
||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 400, 200, true, true, true, false, false, true),
|
||||
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>
|
||||
|
|
@ -6272,10 +6272,10 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
|
|||
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.Order)),
|
||||
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson(),
|
||||
PagerOptionJson = DefaultPagerOptionJson,
|
||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 1000, 500, true, true, true, true, false),
|
||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 1000, 700, true, true, true, true, false, true),
|
||||
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>
|
||||
{
|
||||
new() { Order=1, ColCount=1, ColSpan=1, ItemType="group", Items =
|
||||
new() { Order=1, ColCount=3, ColSpan=1, ItemType="group", Items =
|
||||
[
|
||||
new EditingFormItemDto { Order = 1, DataField = "OrganizationName", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order = 2, DataField = "Founder", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
||||
|
|
@ -6289,7 +6289,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
|
|||
new EditingFormItemDto { Order = 10, DataField = "PostalCode", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
||||
]
|
||||
},
|
||||
new() { Order=2, ColCount=1, ColSpan=1, ItemType="group", Items =
|
||||
new() { Order=2, ColCount=3, ColSpan=1, ItemType="group", Items =
|
||||
[
|
||||
new EditingFormItemDto { Order = 11, DataField = "PhoneNumber", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox, EditorOptions=EditorOptionValues.PhoneEditorOptions },
|
||||
new EditingFormItemDto { Order = 12, DataField = "MobileNumber", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox, EditorOptions=EditorOptionValues.PhoneEditorOptions },
|
||||
|
|
@ -6310,6 +6310,20 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
|
|||
new() { FieldName = "Country", FieldDbType = DbType.String, Value = "Türkiye", CustomValueType = FieldCustomValueTypeEnum.Value },
|
||||
new() { FieldName = "IsActive", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value },
|
||||
new() { FieldName = "Commission", FieldDbType = DbType.Decimal, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value }
|
||||
}),
|
||||
SubFormsJson = JsonSerializer.Serialize(new List<dynamic>() {
|
||||
new {
|
||||
TabType = ListFormTabTypeEnum.List,
|
||||
TabTitle = AppCodes.Orders.SalesOrderItem,
|
||||
Code = AppCodes.Orders.SalesOrderItem,
|
||||
Relation = new List<dynamic>() {
|
||||
new {
|
||||
ParentFieldName = "Id",
|
||||
DbType = DbType.Guid,
|
||||
ChildFieldName = "OrderId"
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
});
|
||||
|
||||
|
|
@ -6710,12 +6724,214 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
|
|||
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
|
||||
PivotSettingsJson = DefaultPivotSettingsJson,
|
||||
},
|
||||
new()
|
||||
{
|
||||
ListFormCode = listForm.ListFormCode,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.String,
|
||||
FieldName = "PostalCode",
|
||||
CaptionName = "App.Listform.ListformField.PostalCode",
|
||||
Width = 100,
|
||||
ListOrderNo = 21,
|
||||
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 = "Email",
|
||||
CaptionName = "App.Listform.ListformField.Email",
|
||||
Width = 100,
|
||||
ListOrderNo = 22,
|
||||
Visible = true,
|
||||
IsActive = true,
|
||||
IsDeleted = false,
|
||||
AllowSearch = true,
|
||||
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
|
||||
PivotSettingsJson = DefaultPivotSettingsJson,
|
||||
}
|
||||
]);
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Sales Order Item
|
||||
listFormName = AppCodes.Orders.SalesOrderItem;
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
|
||||
{
|
||||
var listForm = await _listFormRepository.InsertAsync(
|
||||
new ListForm()
|
||||
{
|
||||
ListFormType = ListFormTypeEnum.List,
|
||||
PageSize = 10,
|
||||
ExportJson = DefaultExportJson,
|
||||
IsSubForm = true,
|
||||
ShowNote = true,
|
||||
LayoutJson = DefaultLayoutJson(),
|
||||
CultureName = LanguageCodes.En,
|
||||
ListFormCode = listFormName,
|
||||
Name = listFormName,
|
||||
Title = listFormName,
|
||||
DataSourceCode = SeedConsts.DataSources.DefaultCode,
|
||||
IsTenant = false,
|
||||
IsBranch = false,
|
||||
IsOrganizationUnit = false,
|
||||
Description = listFormName,
|
||||
SelectCommandType = SelectCommandTypeEnum.Table,
|
||||
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.OrderItem)),
|
||||
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.Uom)),
|
||||
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson(),
|
||||
InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson(),
|
||||
PagerOptionJson = DefaultPagerOptionJson,
|
||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 600, 450, true, true, true, false, false),
|
||||
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>() {
|
||||
new() {
|
||||
Order=1, ColCount=1, ColSpan=1, ItemType="group", Items=[
|
||||
new EditingFormItemDto { Order = 1, DataField = "ProductId", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
|
||||
new EditingFormItemDto { Order = 2, DataField = "BillingCycle", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
|
||||
new EditingFormItemDto { Order = 3, DataField = "Quantity", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxNumberBox },
|
||||
new EditingFormItemDto { Order = 4, DataField = "TotalPrice", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxNumberBox },
|
||||
]}
|
||||
}),
|
||||
}, autoSave: true
|
||||
);
|
||||
|
||||
#region Sales Order Item Fields
|
||||
await _listFormFieldRepository.InsertManyAsync([
|
||||
new ListFormField
|
||||
{
|
||||
ListFormCode = listForm.ListFormCode,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.Guid,
|
||||
FieldName = "Id",
|
||||
CaptionName = "App.Listform.ListformField.Id",
|
||||
Width = 100,
|
||||
ListOrderNo = 1,
|
||||
Visible = false,
|
||||
IsActive = true,
|
||||
IsDeleted = false,
|
||||
SortIndex = 0,
|
||||
ValidationRuleJson = DefaultValidationRuleRequiredJson,
|
||||
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
|
||||
PivotSettingsJson = DefaultPivotSettingsJson
|
||||
},
|
||||
new ListFormField
|
||||
{
|
||||
ListFormCode = listForm.ListFormCode,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.Guid,
|
||||
FieldName = "ProductId",
|
||||
CaptionName = "App.Listform.ListformField.ProductId",
|
||||
Width = 500,
|
||||
ListOrderNo = 2,
|
||||
Visible = true,
|
||||
IsActive = true,
|
||||
IsDeleted = false,
|
||||
AllowSearch = true,
|
||||
LookupJson = JsonSerializer.Serialize(new LookupDto {
|
||||
DataSourceType = UiLookupDataSourceTypeEnum.Query,
|
||||
DisplayExpr = "name",
|
||||
ValueExpr = "key",
|
||||
LookupQuery = LookupQueryValues.ProductValues,
|
||||
}),
|
||||
ValidationRuleJson = DefaultValidationRuleRequiredJson,
|
||||
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
|
||||
PivotSettingsJson = DefaultPivotSettingsJson
|
||||
},
|
||||
new ListFormField
|
||||
{
|
||||
ListFormCode = listForm.ListFormCode,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.String,
|
||||
FieldName = "BillingCycle",
|
||||
CaptionName = "App.Listform.ListformField.BillingCycle",
|
||||
Width = 200,
|
||||
ListOrderNo = 3,
|
||||
Visible = true,
|
||||
IsActive = true,
|
||||
IsDeleted = false,
|
||||
AllowSearch = true,
|
||||
LookupJson = JsonSerializer.Serialize(new LookupDto {
|
||||
DataSourceType = UiLookupDataSourceTypeEnum.StaticData,
|
||||
DisplayExpr = "name",
|
||||
ValueExpr = "key",
|
||||
LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] {
|
||||
new () { Key="yearly", Name="Yearly" },
|
||||
new () { Key="monthly", Name="Monthly" },
|
||||
}),
|
||||
}),
|
||||
ValidationRuleJson = DefaultValidationRuleRequiredJson,
|
||||
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
|
||||
PivotSettingsJson = DefaultPivotSettingsJson
|
||||
},
|
||||
new ListFormField
|
||||
{
|
||||
ListFormCode = listForm.ListFormCode,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.Int32,
|
||||
FieldName = "Quantity",
|
||||
CaptionName = "App.Listform.ListformField.Quantity",
|
||||
Alignment = "right",
|
||||
Width = 150,
|
||||
ListOrderNo = 4,
|
||||
Visible = true,
|
||||
IsActive = true,
|
||||
IsDeleted = false,
|
||||
AllowSearch = true,
|
||||
ValidationRuleJson = DefaultValidationRuleRequiredJson,
|
||||
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
|
||||
PivotSettingsJson = DefaultPivotSettingsJson,
|
||||
EditorOptions=EditorOptionValues.NumberStandartFormat()
|
||||
},
|
||||
new ListFormField
|
||||
{
|
||||
ListFormCode = listForm.ListFormCode,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.Decimal,
|
||||
FieldName = "TotalPrice",
|
||||
CaptionName = "App.Listform.ListformField.TotalPrice",
|
||||
Alignment = "right",
|
||||
Width = 150,
|
||||
ListOrderNo = 5,
|
||||
Visible = true,
|
||||
IsActive = true,
|
||||
IsDeleted = false,
|
||||
AllowSearch = true,
|
||||
ValidationRuleJson = DefaultValidationRuleRequiredJson,
|
||||
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
|
||||
PivotSettingsJson = DefaultPivotSettingsJson,
|
||||
EditorOptions=EditorOptionValues.NumberStandartFormat()
|
||||
},
|
||||
], autoSave: true);
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region BlogCategory
|
||||
listFormName = AppCodes.BlogManagement.BlogCategory;
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
|
||||
|
|
|
|||
|
|
@ -1603,6 +1603,61 @@
|
|||
"MultiTenancySide": 2,
|
||||
"MenuGroup": "Erp|Kurs"
|
||||
},
|
||||
|
||||
{
|
||||
"GroupName": "App.Saas",
|
||||
"Name": "App.Orders.SalesOrderItem",
|
||||
"ParentName": null,
|
||||
"DisplayName": "App.Orders.SalesOrderItem",
|
||||
"IsEnabled": true,
|
||||
"MultiTenancySide": 2,
|
||||
"MenuGroup": "Erp|Kurs"
|
||||
},
|
||||
{
|
||||
"GroupName": "App.Saas",
|
||||
"Name": "App.Orders.SalesOrderItem.Create",
|
||||
"ParentName": "App.Orders.SalesOrderItem",
|
||||
"DisplayName": "Create",
|
||||
"IsEnabled": true,
|
||||
"MultiTenancySide": 2,
|
||||
"MenuGroup": "Erp|Kurs"
|
||||
},
|
||||
{
|
||||
"GroupName": "App.Saas",
|
||||
"Name": "App.Orders.SalesOrderItem.Delete",
|
||||
"ParentName": "App.Orders.SalesOrderItem",
|
||||
"DisplayName": "Delete",
|
||||
"IsEnabled": true,
|
||||
"MultiTenancySide": 2,
|
||||
"MenuGroup": "Erp|Kurs"
|
||||
},
|
||||
{
|
||||
"GroupName": "App.Saas",
|
||||
"Name": "App.Orders.SalesOrderItem.Export",
|
||||
"ParentName": "App.Orders.SalesOrderItem",
|
||||
"DisplayName": "Export",
|
||||
"IsEnabled": true,
|
||||
"MultiTenancySide": 2,
|
||||
"MenuGroup": "Erp|Kurs"
|
||||
},
|
||||
{
|
||||
"GroupName": "App.Saas",
|
||||
"Name": "App.Orders.SalesOrderItem.Import",
|
||||
"ParentName": "App.Orders.SalesOrderItem",
|
||||
"DisplayName": "Import",
|
||||
"IsEnabled": true,
|
||||
"MultiTenancySide": 2,
|
||||
"MenuGroup": "Erp|Kurs"
|
||||
},
|
||||
{
|
||||
"GroupName": "App.Saas",
|
||||
"Name": "App.Orders.SalesOrderItem.Update",
|
||||
"ParentName": "App.Orders.SalesOrderItem",
|
||||
"DisplayName": "Update",
|
||||
"IsEnabled": true,
|
||||
"MultiTenancySide": 2,
|
||||
"MenuGroup": "Erp|Kurs"
|
||||
},
|
||||
{
|
||||
"GroupName": "App.Saas",
|
||||
"Name": "App.BlogManagement.Category",
|
||||
|
|
|
|||
|
|
@ -401,6 +401,7 @@ public static class PlatformConsts
|
|||
public const string PaymentMethods = Default + ".PaymentMethods";
|
||||
public const string InstallmentOptions = Default + ".InstallmentOptions";
|
||||
public const string SalesOrders = Default + ".SalesOrders";
|
||||
public const string SalesOrderItem = Default + ".SalesOrderItem";
|
||||
}
|
||||
public static class BlogManagement
|
||||
{
|
||||
|
|
|
|||
|
|
@ -393,6 +393,7 @@ public static class SeedConsts
|
|||
public const string PaymentMethods = Default + ".PaymentMethods";
|
||||
public const string InstallmentOptions = Default + ".InstallmentOptions";
|
||||
public const string SalesOrders = Default + ".SalesOrders";
|
||||
public const string SalesOrderItem = Default + ".SalesOrderItem";
|
||||
}
|
||||
public static class BlogManagement
|
||||
{
|
||||
|
|
|
|||
|
|
@ -343,7 +343,7 @@ export const PaymentForm: React.FC<PaymentFormProps> = ({
|
|||
{/* 3. Sütun: Kart Bilgileri + Sipariş Özeti ve Butonlar */}
|
||||
<div className="w-full lg:w-1/3 flex flex-col gap-6">
|
||||
{/* Kart Bilgileri */}
|
||||
{selectedPaymentMethod !== defaultPaymentMethod && (
|
||||
{selectedPaymentMethod === defaultPaymentMethod && (
|
||||
<div className="bg-white rounded-xl shadow border p-6 space-y-3">
|
||||
<h3 className="text-md font-medium text-gray-800 mb-3">
|
||||
{translate('::Public.payment.card.title')}
|
||||
|
|
@ -398,7 +398,7 @@ export const PaymentForm: React.FC<PaymentFormProps> = ({
|
|||
{cartState.items.map((item, index) => (
|
||||
<div key={`${item.product.id}-${index}`} className="flex justify-between text-sm">
|
||||
<div>
|
||||
<div className="font-medium">{item.product.name}</div>
|
||||
<div className="font-medium">{translate('::' + item.product.name)}</div>
|
||||
<div className="text-gray-500">
|
||||
{item.quantity}x -{' '}
|
||||
{item.billingCycle === 'monthly'
|
||||
|
|
|
|||
Loading…
Reference in a new issue