Public Order entity ve ListForm Seederlar
This commit is contained in:
parent
7770227b4c
commit
e45885f569
14 changed files with 169 additions and 155 deletions
|
|
@ -15,9 +15,8 @@ public class OrderDto : EntityDto<Guid>
|
||||||
public decimal Commission { get; set; }
|
public decimal Commission { get; set; }
|
||||||
public decimal Total { get; set; }
|
public decimal Total { get; set; }
|
||||||
|
|
||||||
public string PaymentMethod { get; set; }
|
public Guid PaymentMethodId { get; set; }
|
||||||
public int? Installments { get; set; }
|
public int? Installment { get; set; }
|
||||||
public string? InstallmentName { get; set; }
|
|
||||||
|
|
||||||
public Dictionary<string, object> PaymentData { get; set; }
|
public Dictionary<string, object> PaymentData { get; set; }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -247,9 +247,8 @@ public class PublicAppService : PlatformAppService
|
||||||
Subtotal = input.Subtotal,
|
Subtotal = input.Subtotal,
|
||||||
Commission = input.Commission,
|
Commission = input.Commission,
|
||||||
Total = input.Total,
|
Total = input.Total,
|
||||||
PaymentMethod = input.PaymentMethod,
|
PaymentMethodId = input.PaymentMethodId,
|
||||||
Installments = input.Installments,
|
Installment = input.Installment,
|
||||||
InstallmentName = input.InstallmentName,
|
|
||||||
PaymentDataJson = JsonSerializer.Serialize(input.PaymentData),
|
PaymentDataJson = JsonSerializer.Serialize(input.PaymentData),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -273,7 +272,7 @@ public class PublicAppService : PlatformAppService
|
||||||
{
|
{
|
||||||
Id = entity.Id,
|
Id = entity.Id,
|
||||||
Total = entity.Total,
|
Total = entity.Total,
|
||||||
PaymentMethod = entity.PaymentMethod
|
PaymentMethodId = entity.PaymentMethodId
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -155,6 +155,20 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
$"(\"{SelectCommandByTableName("ClassType", Prefix.DbTableDefinition)}\".\"BranchId\" = @param0 OR @param0 IS NULL) " +
|
$"(\"{SelectCommandByTableName("ClassType", Prefix.DbTableDefinition)}\".\"BranchId\" = @param0 OR @param0 IS NULL) " +
|
||||||
$"ORDER BY \"{SelectCommandByTableName("ClassType", Prefix.DbTableDefinition)}\".\"Name\";";
|
$"ORDER BY \"{SelectCommandByTableName("ClassType", Prefix.DbTableDefinition)}\".\"Name\";";
|
||||||
|
|
||||||
|
var lookupQueryPaymentMethodValues =
|
||||||
|
$"SELECT " +
|
||||||
|
$"\"{SelectCommandByTableName("PaymentMethod", Prefix.DbTableWeb)}\".\"Id\" AS \"Key\", " +
|
||||||
|
$"\"{SelectCommandByTableName("PaymentMethod", Prefix.DbTableWeb)}\".\"Name\" AS \"Name\" " +
|
||||||
|
$"FROM \"{SelectCommandByTableName("PaymentMethod", Prefix.DbTableWeb)}\" " +
|
||||||
|
$"ORDER BY \"{SelectCommandByTableName("PaymentMethod", Prefix.DbTableWeb)}\".\"Name\";";
|
||||||
|
|
||||||
|
var lookupQueryInstallmentValues =
|
||||||
|
$"SELECT " +
|
||||||
|
$"\"{SelectCommandByTableName("InstallmentOption", Prefix.DbTableWeb)}\".\"Installment\" AS \"Key\", " +
|
||||||
|
$"\"{SelectCommandByTableName("InstallmentOption", Prefix.DbTableWeb)}\".\"Name\" AS \"Name\" " +
|
||||||
|
$"FROM \"{SelectCommandByTableName("InstallmentOption", Prefix.DbTableWeb)}\" " +
|
||||||
|
$"ORDER BY \"{SelectCommandByTableName("InstallmentOption", Prefix.DbTableWeb)}\".\"Installment\";";
|
||||||
|
|
||||||
var htmlEditorOptions = "{\"toolbar\": {\"multiline\": true, \"items\": [{\"name\": \"undo\"},{\"name\": \"redo\"},{\"name\": \"separator\"},{\"name\": \"size\",\"acceptedValues\": [\"8pt\",\"10pt\",\"12pt\",\"14pt\",\"18pt\",\"24pt\",\"36pt\"],\"options\": {\"inputAttr\": {\"aria-label\": \"Font size\"}}},{\"name\": \"font\",\"acceptedValues\": [\"Arial\",\"Courier New\",\"Georgia\",\"Impact\",\"Lucida Console\",\"Tahoma\",\"Times New Roman\",\"Verdana\"],\"options\": {\"inputAttr\": {\"aria-label\": \"Font family\"}}},{\"name\": \"separator\"},{\"name\": \"bold\"},{\"name\": \"italic\"},{\"name\": \"strike\"},{\"name\": \"underline\"},{\"name\": \"separator\"},{\"name\": \"alignLeft\"},{\"name\": \"alignCenter\"},{\"name\": \"alignRight\"},{\"name\": \"alignJustify\"},{\"name\": \"separator\"},{\"name\": \"orderedList\"},{\"name\": \"bulletList\"},{\"name\": \"separator\"},{\"name\": \"header\",\"acceptedValues\": [false,1,2,3,4,5],\"options\": {\"inputAttr\": {\"aria-label\": \"Font family\"}}},{\"name\": \"separator\"},{\"name\": \"color\"},{\"name\": \"background\"},{\"name\": \"separator\"},{\"name\": \"link\"},{\"name\": \"image\"},{\"name\": \"separator\"},{\"name\": \"clear\"},{\"name\": \"codeBlock\"},{\"name\": \"blockquote\"},{\"name\": \"separator\"},{\"name\": \"insertTable\"},{\"name\": \"deleteTable\"},{\"name\": \"insertRowAbove\"},{\"name\": \"insertRowBelow\"},{\"name\": \"deleteRow\"},{\"name\": \"insertColumnLeft\"},{\"name\": \"insertColumnRight\"},{\"name\": \"deleteColumn\"}]}}";
|
var htmlEditorOptions = "{\"toolbar\": {\"multiline\": true, \"items\": [{\"name\": \"undo\"},{\"name\": \"redo\"},{\"name\": \"separator\"},{\"name\": \"size\",\"acceptedValues\": [\"8pt\",\"10pt\",\"12pt\",\"14pt\",\"18pt\",\"24pt\",\"36pt\"],\"options\": {\"inputAttr\": {\"aria-label\": \"Font size\"}}},{\"name\": \"font\",\"acceptedValues\": [\"Arial\",\"Courier New\",\"Georgia\",\"Impact\",\"Lucida Console\",\"Tahoma\",\"Times New Roman\",\"Verdana\"],\"options\": {\"inputAttr\": {\"aria-label\": \"Font family\"}}},{\"name\": \"separator\"},{\"name\": \"bold\"},{\"name\": \"italic\"},{\"name\": \"strike\"},{\"name\": \"underline\"},{\"name\": \"separator\"},{\"name\": \"alignLeft\"},{\"name\": \"alignCenter\"},{\"name\": \"alignRight\"},{\"name\": \"alignJustify\"},{\"name\": \"separator\"},{\"name\": \"orderedList\"},{\"name\": \"bulletList\"},{\"name\": \"separator\"},{\"name\": \"header\",\"acceptedValues\": [false,1,2,3,4,5],\"options\": {\"inputAttr\": {\"aria-label\": \"Font family\"}}},{\"name\": \"separator\"},{\"name\": \"color\"},{\"name\": \"background\"},{\"name\": \"separator\"},{\"name\": \"link\"},{\"name\": \"image\"},{\"name\": \"separator\"},{\"name\": \"clear\"},{\"name\": \"codeBlock\"},{\"name\": \"blockquote\"},{\"name\": \"separator\"},{\"name\": \"insertTable\"},{\"name\": \"deleteTable\"},{\"name\": \"insertRowAbove\"},{\"name\": \"insertRowBelow\"},{\"name\": \"deleteRow\"},{\"name\": \"insertColumnLeft\"},{\"name\": \"insertColumnRight\"},{\"name\": \"deleteColumn\"}]}}";
|
||||||
var showClearButton = "{ \"showClearButton\" : true }";
|
var showClearButton = "{ \"showClearButton\" : true }";
|
||||||
|
|
||||||
|
|
@ -12149,10 +12163,9 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
ItemType = "group",
|
ItemType = "group",
|
||||||
Items =
|
Items =
|
||||||
[
|
[
|
||||||
new EditingFormItemDto { Order = 1, DataField = "Id", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
||||||
new EditingFormItemDto { Order = 2, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
new EditingFormItemDto { Order = 2, DataField = "Commission", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox },
|
||||||
new EditingFormItemDto { Order = 3, DataField = "Commission", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox },
|
new EditingFormItemDto { Order = 3, DataField = "Logo", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
||||||
new EditingFormItemDto { Order = 4, DataField = "Logo", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
|
@ -12525,7 +12538,7 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
Name = AppCodes.Orders.PurchaseOrders,
|
Name = AppCodes.Orders.PurchaseOrders,
|
||||||
Title = AppCodes.Orders.PurchaseOrders,
|
Title = AppCodes.Orders.PurchaseOrders,
|
||||||
DataSourceCode = SeedConsts.DataSources.DefaultCode,
|
DataSourceCode = SeedConsts.DataSources.DefaultCode,
|
||||||
IsTenant = true,
|
IsTenant = false,
|
||||||
IsBranch = false,
|
IsBranch = false,
|
||||||
IsOrganizationUnit = false,
|
IsOrganizationUnit = false,
|
||||||
Description = AppCodes.Orders.PurchaseOrders,
|
Description = AppCodes.Orders.PurchaseOrders,
|
||||||
|
|
@ -12593,8 +12606,8 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
Popup = new GridEditingPopupDto
|
Popup = new GridEditingPopupDto
|
||||||
{
|
{
|
||||||
Title = "Purchase Order Form",
|
Title = "Purchase Order Form",
|
||||||
Width = 500,
|
Width = 1000,
|
||||||
Height = 800
|
Height = 500
|
||||||
},
|
},
|
||||||
AllowDeleting = true,
|
AllowDeleting = true,
|
||||||
AllowAdding = true,
|
AllowAdding = true,
|
||||||
|
|
@ -12606,32 +12619,31 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
new()
|
new()
|
||||||
{
|
{
|
||||||
Order = 1,
|
Order = 1,
|
||||||
ColCount = 1,
|
ColCount = 2,
|
||||||
ColSpan = 2,
|
ColSpan = 2,
|
||||||
ItemType = "group",
|
ItemType = "group",
|
||||||
Items =
|
Items =
|
||||||
[
|
[
|
||||||
new EditingFormItemDto { Order = 1, DataField = "OrganizationName", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
new EditingFormItemDto { Order = 1, DataField = "OrganizationName", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
||||||
new EditingFormItemDto { Order = 2, DataField = "Founder", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
new EditingFormItemDto { Order = 2, DataField = "Founder", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
||||||
new EditingFormItemDto { Order = 3, DataField = "VknTckn", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox },
|
new EditingFormItemDto { Order = 3, DataField = "VknTckn", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox },
|
||||||
new EditingFormItemDto { Order = 4, DataField = "TaxOffice", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
new EditingFormItemDto { Order = 4, DataField = "TaxOffice", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
||||||
new EditingFormItemDto { Order = 5, DataField = "Address", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
new EditingFormItemDto { Order = 7, DataField = "Country", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
||||||
new EditingFormItemDto { Order = 6, DataField = "Address2", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
new EditingFormItemDto { Order = 8, DataField = "City", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
||||||
new EditingFormItemDto { Order = 7, DataField = "Country", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
new EditingFormItemDto { Order = 9, DataField = "District", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
||||||
new EditingFormItemDto { Order = 8, DataField = "City", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
new EditingFormItemDto { Order = 5, DataField = "Address", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
||||||
new EditingFormItemDto { Order = 9, DataField = "District", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
new EditingFormItemDto { Order = 6, DataField = "Address2", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox },
|
||||||
new EditingFormItemDto { Order = 10, DataField = "PostalCode", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
new EditingFormItemDto { Order = 10, DataField = "PostalCode", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
||||||
new EditingFormItemDto { Order = 11, DataField = "Phone", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox },
|
new EditingFormItemDto { Order = 11, DataField = "Phone", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox },
|
||||||
new EditingFormItemDto { Order = 12, DataField = "Mobile", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox },
|
new EditingFormItemDto { Order = 12, DataField = "Mobile", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox },
|
||||||
new EditingFormItemDto { Order = 13, DataField = "Fax", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox },
|
new EditingFormItemDto { Order = 13, DataField = "Fax", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox },
|
||||||
new EditingFormItemDto { Order = 14, DataField = "Email", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
new EditingFormItemDto { Order = 14, DataField = "Email", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
||||||
new EditingFormItemDto { Order = 15, DataField = "Website", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
new EditingFormItemDto { Order = 15, DataField = "Website", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
||||||
new EditingFormItemDto { Order = 16, DataField = "Subtotal", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox },
|
new EditingFormItemDto { Order = 16, DataField = "Subtotal", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox },
|
||||||
new EditingFormItemDto { Order = 17, DataField = "Commission", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox },
|
new EditingFormItemDto { Order = 17, DataField = "Commission", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox },
|
||||||
new EditingFormItemDto { Order = 18, DataField = "Total", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox },
|
new EditingFormItemDto { Order = 18, DataField = "Total", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox },
|
||||||
new EditingFormItemDto { Order = 19, DataField = "PaymentMethod", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
new EditingFormItemDto { Order = 19, DataField = "PaymentMethodId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
||||||
new EditingFormItemDto { Order = 20, DataField = "Installments", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox },
|
new EditingFormItemDto { Order = 20, DataField = "Installment", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
||||||
new EditingFormItemDto { Order = 21, DataField = "InstallmentName", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
|
@ -12694,7 +12706,7 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
CultureName = LanguageCodes.En,
|
CultureName = LanguageCodes.En,
|
||||||
SourceDbType = DbType.String,
|
SourceDbType = DbType.String,
|
||||||
FieldName = "OrganizationName",
|
FieldName = "OrganizationName",
|
||||||
Width = 300,
|
Width = 200,
|
||||||
ListOrderNo = 2,
|
ListOrderNo = 2,
|
||||||
Visible = true,
|
Visible = true,
|
||||||
IsActive = true,
|
IsActive = true,
|
||||||
|
|
@ -12840,6 +12852,14 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
IsActive = true,
|
IsActive = true,
|
||||||
IsDeleted = false,
|
IsDeleted = false,
|
||||||
AllowSearch = true,
|
AllowSearch = true,
|
||||||
|
LookupJson = JsonSerializer.Serialize(new LookupDto
|
||||||
|
{
|
||||||
|
DataSourceType = UiLookupDataSourceTypeEnum.Query,
|
||||||
|
DisplayExpr = "Name",
|
||||||
|
ValueExpr = "Key",
|
||||||
|
LookupQuery = lookupQueryCountryValues,
|
||||||
|
CascadeEmptyFields = "City,District"
|
||||||
|
}),
|
||||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||||
{
|
{
|
||||||
C = AppCodes.Orders.PurchaseOrders + ".Create",
|
C = AppCodes.Orders.PurchaseOrders + ".Create",
|
||||||
|
|
@ -12862,6 +12882,17 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
IsActive = true,
|
IsActive = true,
|
||||||
IsDeleted = false,
|
IsDeleted = false,
|
||||||
AllowSearch = true,
|
AllowSearch = true,
|
||||||
|
LookupJson = JsonSerializer.Serialize(new LookupDto
|
||||||
|
{
|
||||||
|
DataSourceType = UiLookupDataSourceTypeEnum.Query,
|
||||||
|
DisplayExpr = "Name",
|
||||||
|
ValueExpr = "Key",
|
||||||
|
LookupQuery = lookupQueryCityValues,
|
||||||
|
CascadeRelationField = "Country",
|
||||||
|
CascadeFilterOperator="=",
|
||||||
|
CascadeParentFields = "Country",
|
||||||
|
CascadeEmptyFields = "District"
|
||||||
|
}),
|
||||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||||
{
|
{
|
||||||
C = AppCodes.Orders.PurchaseOrders + ".Create",
|
C = AppCodes.Orders.PurchaseOrders + ".Create",
|
||||||
|
|
@ -12884,6 +12915,16 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
IsActive = true,
|
IsActive = true,
|
||||||
IsDeleted = false,
|
IsDeleted = false,
|
||||||
AllowSearch = true,
|
AllowSearch = true,
|
||||||
|
LookupJson = JsonSerializer.Serialize(new LookupDto
|
||||||
|
{
|
||||||
|
DataSourceType = UiLookupDataSourceTypeEnum.Query,
|
||||||
|
DisplayExpr = "Name",
|
||||||
|
ValueExpr = "Key",
|
||||||
|
LookupQuery = lookupQueryDistrictValues,
|
||||||
|
CascadeRelationField = "City",
|
||||||
|
CascadeFilterOperator="=",
|
||||||
|
CascadeParentFields = "Country,City",
|
||||||
|
}),
|
||||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||||
{
|
{
|
||||||
C = AppCodes.Orders.PurchaseOrders + ".Create",
|
C = AppCodes.Orders.PurchaseOrders + ".Create",
|
||||||
|
|
@ -13052,14 +13093,21 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
{
|
{
|
||||||
ListFormCode = listFormPurchaseOrder.ListFormCode,
|
ListFormCode = listFormPurchaseOrder.ListFormCode,
|
||||||
CultureName = LanguageCodes.En,
|
CultureName = LanguageCodes.En,
|
||||||
SourceDbType = DbType.String,
|
SourceDbType = DbType.Guid,
|
||||||
FieldName = "PaymentMethod",
|
FieldName = "PaymentMethodId",
|
||||||
Width = 100,
|
Width = 100,
|
||||||
ListOrderNo = 18,
|
ListOrderNo = 18,
|
||||||
Visible = true,
|
Visible = true,
|
||||||
IsActive = true,
|
IsActive = true,
|
||||||
IsDeleted = false,
|
IsDeleted = false,
|
||||||
AllowSearch = true,
|
AllowSearch = true,
|
||||||
|
LookupJson = JsonSerializer.Serialize(new LookupDto
|
||||||
|
{
|
||||||
|
DataSourceType = UiLookupDataSourceTypeEnum.Query,
|
||||||
|
DisplayExpr = "Name",
|
||||||
|
ValueExpr = "Key",
|
||||||
|
LookupQuery = lookupQueryPaymentMethodValues
|
||||||
|
}),
|
||||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||||
{
|
{
|
||||||
C = AppCodes.Orders.PurchaseOrders + ".Create",
|
C = AppCodes.Orders.PurchaseOrders + ".Create",
|
||||||
|
|
@ -13075,13 +13123,20 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
ListFormCode = listFormPurchaseOrder.ListFormCode,
|
ListFormCode = listFormPurchaseOrder.ListFormCode,
|
||||||
CultureName = LanguageCodes.En,
|
CultureName = LanguageCodes.En,
|
||||||
SourceDbType = DbType.Int32,
|
SourceDbType = DbType.Int32,
|
||||||
FieldName = "Installments",
|
FieldName = "Installment",
|
||||||
Width = 100,
|
Width = 100,
|
||||||
ListOrderNo = 19,
|
ListOrderNo = 19,
|
||||||
Visible = true,
|
Visible = true,
|
||||||
IsActive = true,
|
IsActive = true,
|
||||||
IsDeleted = false,
|
IsDeleted = false,
|
||||||
AllowSearch = true,
|
AllowSearch = true,
|
||||||
|
LookupJson = JsonSerializer.Serialize(new LookupDto
|
||||||
|
{
|
||||||
|
DataSourceType = UiLookupDataSourceTypeEnum.Query,
|
||||||
|
DisplayExpr = "Name",
|
||||||
|
ValueExpr = "Key",
|
||||||
|
LookupQuery = lookupQueryInstallmentValues
|
||||||
|
}),
|
||||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||||
{
|
{
|
||||||
C = AppCodes.Orders.PurchaseOrders + ".Create",
|
C = AppCodes.Orders.PurchaseOrders + ".Create",
|
||||||
|
|
@ -13091,29 +13146,7 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
I = true,
|
I = true,
|
||||||
Deny = false
|
Deny = false
|
||||||
})
|
})
|
||||||
},
|
}
|
||||||
new()
|
|
||||||
{
|
|
||||||
ListFormCode = listFormPurchaseOrder.ListFormCode,
|
|
||||||
CultureName = LanguageCodes.En,
|
|
||||||
SourceDbType = DbType.String,
|
|
||||||
FieldName = "InstallmentName",
|
|
||||||
Width = 100,
|
|
||||||
ListOrderNo = 20,
|
|
||||||
Visible = true,
|
|
||||||
IsActive = true,
|
|
||||||
IsDeleted = false,
|
|
||||||
AllowSearch = true,
|
|
||||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
|
||||||
{
|
|
||||||
C = AppCodes.Orders.PurchaseOrders + ".Create",
|
|
||||||
R = AppCodes.Orders.PurchaseOrders,
|
|
||||||
U = AppCodes.Orders.PurchaseOrders + ".Update",
|
|
||||||
E = true,
|
|
||||||
I = true,
|
|
||||||
Deny = false
|
|
||||||
})
|
|
||||||
},
|
|
||||||
]);
|
]);
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
@ -13542,7 +13575,7 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
Popup = new GridEditingPopupDto
|
Popup = new GridEditingPopupDto
|
||||||
{
|
{
|
||||||
Title = "Blog Post Form",
|
Title = "Blog Post Form",
|
||||||
Width = 600,
|
Width = 1000,
|
||||||
Height = 600
|
Height = 600
|
||||||
},
|
},
|
||||||
AllowDeleting = true,
|
AllowDeleting = true,
|
||||||
|
|
|
||||||
|
|
@ -589,28 +589,28 @@ public class PlatformTenantDataSeeder : IDataSeedContributor, ITransientDependen
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var item in items.NotificationRules)
|
// foreach (var item in items.NotificationRules)
|
||||||
{
|
// {
|
||||||
var exists = await _notificationRuleRepository.AnyAsync(x =>
|
// var exists = await _notificationRuleRepository.AnyAsync(x =>
|
||||||
x.NotificationType == item.NotificationType &&
|
// x.NotificationType == item.NotificationType &&
|
||||||
x.RecipientType == item.RecipientType &&
|
// x.RecipientType == item.RecipientType &&
|
||||||
x.RecipientId == item.RecipientId &&
|
// x.RecipientId == item.RecipientId &&
|
||||||
x.Channel == item.Channel);
|
// x.Channel == item.Channel);
|
||||||
|
|
||||||
if (!exists)
|
// if (!exists)
|
||||||
{
|
// {
|
||||||
await _notificationRuleRepository.InsertAsync(new NotificationRule
|
// await _notificationRuleRepository.InsertAsync(new NotificationRule
|
||||||
{
|
// {
|
||||||
NotificationType = item.NotificationType,
|
// NotificationType = item.NotificationType,
|
||||||
RecipientType = item.RecipientType,
|
// RecipientType = item.RecipientType,
|
||||||
RecipientId = item.RecipientId,
|
// RecipientId = item.RecipientId,
|
||||||
Channel = item.Channel,
|
// Channel = item.Channel,
|
||||||
IsActive = item.IsActive,
|
// IsActive = item.IsActive,
|
||||||
IsFixed = item.IsFixed,
|
// IsFixed = item.IsFixed,
|
||||||
IsCustomized = item.IsCustomized
|
// IsCustomized = item.IsCustomized
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
foreach (var item in items.Menus)
|
foreach (var item in items.Menus)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,8 @@ public class Order : FullAuditedEntity<Guid>, IMultiTenant
|
||||||
public decimal Commission { get; set; }
|
public decimal Commission { get; set; }
|
||||||
public decimal Total { get; set; }
|
public decimal Total { get; set; }
|
||||||
|
|
||||||
public string PaymentMethod { get; set; }
|
public Guid PaymentMethodId { get; set; }
|
||||||
public int? Installments { get; set; }
|
public int? Installment { get; set; }
|
||||||
public string? InstallmentName { get; set; }
|
|
||||||
|
|
||||||
public string PaymentDataJson { get; set; } // JSON olarak saklanacak
|
public string PaymentDataJson { get; set; } // JSON olarak saklanacak
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1395,8 +1395,6 @@ public class PlatformDbContext :
|
||||||
b.Property(o => o.Commission).IsRequired().HasPrecision(18, 2);
|
b.Property(o => o.Commission).IsRequired().HasPrecision(18, 2);
|
||||||
b.Property(o => o.Total).IsRequired().HasPrecision(18, 2);
|
b.Property(o => o.Total).IsRequired().HasPrecision(18, 2);
|
||||||
|
|
||||||
b.Property(o => o.PaymentMethod).IsRequired().HasMaxLength(64);
|
|
||||||
b.Property(o => o.InstallmentName).HasMaxLength(128);
|
|
||||||
b.Property(o => o.PaymentDataJson).HasMaxLength(4000);
|
b.Property(o => o.PaymentDataJson).HasMaxLength(4000);
|
||||||
|
|
||||||
b.HasMany(o => o.Items)
|
b.HasMany(o => o.Items)
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore;
|
||||||
namespace Kurs.Platform.Migrations
|
namespace Kurs.Platform.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(PlatformDbContext))]
|
[DbContext(typeof(PlatformDbContext))]
|
||||||
[Migration("20251008104142_Initial")]
|
[Migration("20251008124621_Initial")]
|
||||||
partial class Initial
|
partial class Initial
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|
@ -4625,11 +4625,7 @@ namespace Kurs.Platform.Migrations
|
||||||
.HasMaxLength(128)
|
.HasMaxLength(128)
|
||||||
.HasColumnType("nvarchar(128)");
|
.HasColumnType("nvarchar(128)");
|
||||||
|
|
||||||
b.Property<string>("InstallmentName")
|
b.Property<int?>("Installment")
|
||||||
.HasMaxLength(128)
|
|
||||||
.HasColumnType("nvarchar(128)");
|
|
||||||
|
|
||||||
b.Property<int?>("Installments")
|
|
||||||
.HasColumnType("int");
|
.HasColumnType("int");
|
||||||
|
|
||||||
b.Property<bool>("IsDeleted")
|
b.Property<bool>("IsDeleted")
|
||||||
|
|
@ -4657,10 +4653,8 @@ namespace Kurs.Platform.Migrations
|
||||||
.HasMaxLength(4000)
|
.HasMaxLength(4000)
|
||||||
.HasColumnType("nvarchar(4000)");
|
.HasColumnType("nvarchar(4000)");
|
||||||
|
|
||||||
b.Property<string>("PaymentMethod")
|
b.Property<Guid>("PaymentMethodId")
|
||||||
.IsRequired()
|
.HasColumnType("uniqueidentifier");
|
||||||
.HasMaxLength(64)
|
|
||||||
.HasColumnType("nvarchar(64)");
|
|
||||||
|
|
||||||
b.Property<long>("Phone")
|
b.Property<long>("Phone")
|
||||||
.HasColumnType("bigint");
|
.HasColumnType("bigint");
|
||||||
|
|
@ -1932,9 +1932,8 @@ namespace Kurs.Platform.Migrations
|
||||||
Subtotal = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false),
|
Subtotal = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false),
|
||||||
Commission = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false),
|
Commission = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false),
|
||||||
Total = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false),
|
Total = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false),
|
||||||
PaymentMethod = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
|
PaymentMethodId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
Installments = table.Column<int>(type: "int", nullable: true),
|
Installment = table.Column<int>(type: "int", nullable: true),
|
||||||
InstallmentName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
|
|
||||||
PaymentDataJson = table.Column<string>(type: "nvarchar(4000)", maxLength: 4000, nullable: true),
|
PaymentDataJson = table.Column<string>(type: "nvarchar(4000)", maxLength: 4000, nullable: true),
|
||||||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||||
|
|
@ -4622,11 +4622,7 @@ namespace Kurs.Platform.Migrations
|
||||||
.HasMaxLength(128)
|
.HasMaxLength(128)
|
||||||
.HasColumnType("nvarchar(128)");
|
.HasColumnType("nvarchar(128)");
|
||||||
|
|
||||||
b.Property<string>("InstallmentName")
|
b.Property<int?>("Installment")
|
||||||
.HasMaxLength(128)
|
|
||||||
.HasColumnType("nvarchar(128)");
|
|
||||||
|
|
||||||
b.Property<int?>("Installments")
|
|
||||||
.HasColumnType("int");
|
.HasColumnType("int");
|
||||||
|
|
||||||
b.Property<bool>("IsDeleted")
|
b.Property<bool>("IsDeleted")
|
||||||
|
|
@ -4654,10 +4650,8 @@ namespace Kurs.Platform.Migrations
|
||||||
.HasMaxLength(4000)
|
.HasMaxLength(4000)
|
||||||
.HasColumnType("nvarchar(4000)");
|
.HasColumnType("nvarchar(4000)");
|
||||||
|
|
||||||
b.Property<string>("PaymentMethod")
|
b.Property<Guid>("PaymentMethodId")
|
||||||
.IsRequired()
|
.HasColumnType("uniqueidentifier");
|
||||||
.HasMaxLength(64)
|
|
||||||
.HasColumnType("nvarchar(64)");
|
|
||||||
|
|
||||||
b.Property<long>("Phone")
|
b.Property<long>("Phone")
|
||||||
.HasColumnType("bigint");
|
.HasColumnType("bigint");
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,8 @@ export const PaymentForm: React.FC<PaymentFormProps> = ({
|
||||||
onComplete,
|
onComplete,
|
||||||
cartState,
|
cartState,
|
||||||
}) => {
|
}) => {
|
||||||
const [selectedPaymentMethod, setSelectedPaymentMethod] = useState<string>('credit-card')
|
const defaultPaymentMethod = 'Kredi Kartı'
|
||||||
|
const [selectedPaymentMethod, setSelectedPaymentMethod] = useState<string>(defaultPaymentMethod)
|
||||||
const [selectedInstallment, setSelectedInstallment] = useState<InstallmentOptionDto>()
|
const [selectedInstallment, setSelectedInstallment] = useState<InstallmentOptionDto>()
|
||||||
const [paymentData, setPaymentData] = useState({
|
const [paymentData, setPaymentData] = useState({
|
||||||
cardNumber: '',
|
cardNumber: '',
|
||||||
|
|
@ -65,7 +66,7 @@ export const PaymentForm: React.FC<PaymentFormProps> = ({
|
||||||
const paymentResponse = await orderService.getPaymentMethodList()
|
const paymentResponse = await orderService.getPaymentMethodList()
|
||||||
setPaymentMethods(paymentResponse.data)
|
setPaymentMethods(paymentResponse.data)
|
||||||
if (paymentResponse.data.length > 0) {
|
if (paymentResponse.data.length > 0) {
|
||||||
setSelectedPaymentMethod(paymentResponse.data[1].id)
|
setSelectedPaymentMethod(paymentResponse.data[1].name)
|
||||||
}
|
}
|
||||||
|
|
||||||
const installmentResponse = await orderService.getInstallmentOptionList()
|
const installmentResponse = await orderService.getInstallmentOptionList()
|
||||||
|
|
@ -80,10 +81,10 @@ export const PaymentForm: React.FC<PaymentFormProps> = ({
|
||||||
fetchData()
|
fetchData()
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
const selectedMethod = paymentMethods.find((m) => m.id === selectedPaymentMethod)
|
const selectedMethod = paymentMethods.find((m) => m.name === selectedPaymentMethod)
|
||||||
|
|
||||||
let commission = 0
|
let commission = 0
|
||||||
if (selectedPaymentMethod === 'credit-card' && selectedInstallment) {
|
if (selectedPaymentMethod === defaultPaymentMethod && selectedInstallment) {
|
||||||
commission = cartState.total * selectedInstallment.commission
|
commission = cartState.total * selectedInstallment.commission
|
||||||
} else if (selectedMethod) {
|
} else if (selectedMethod) {
|
||||||
commission = cartState.total * selectedMethod.commission
|
commission = cartState.total * selectedMethod.commission
|
||||||
|
|
@ -102,10 +103,11 @@ export const PaymentForm: React.FC<PaymentFormProps> = ({
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
onComplete({
|
onComplete({
|
||||||
...paymentData,
|
...paymentData,
|
||||||
paymentMethod: selectedMethod?.name ?? '',
|
paymentMethodId: selectedMethod?.id,
|
||||||
installments: selectedPaymentMethod === 'credit-card' ? (selectedInstallment?.id ?? 1) : 1,
|
installment:
|
||||||
installmentName:
|
selectedPaymentMethod === defaultPaymentMethod
|
||||||
selectedPaymentMethod === 'credit-card' ? (selectedInstallment?.name ?? '') : 'Tek Ödeme',
|
? (selectedInstallment?.installment ?? 1)
|
||||||
|
: 1,
|
||||||
commission,
|
commission,
|
||||||
total: finalTotal,
|
total: finalTotal,
|
||||||
})
|
})
|
||||||
|
|
@ -260,24 +262,26 @@ export const PaymentForm: React.FC<PaymentFormProps> = ({
|
||||||
<label
|
<label
|
||||||
key={method.id}
|
key={method.id}
|
||||||
className={`flex items-center p-3 border-2 rounded-lg cursor-pointer transition-all ${
|
className={`flex items-center p-3 border-2 rounded-lg cursor-pointer transition-all ${
|
||||||
selectedPaymentMethod === method.id
|
selectedPaymentMethod === method.name
|
||||||
? 'border-blue-500 bg-blue-50'
|
? 'border-blue-500 bg-blue-50'
|
||||||
: 'border-gray-200 hover:border-gray-300'
|
: 'border-gray-200 hover:border-gray-300'
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<input
|
<input
|
||||||
type="radio"
|
type="radio"
|
||||||
name="paymentMethod"
|
name="paymentMethodId"
|
||||||
value={method.id}
|
value={method.name}
|
||||||
checked={selectedPaymentMethod === method.id}
|
checked={selectedPaymentMethod === method.name}
|
||||||
onChange={(e) => setSelectedPaymentMethod(e.target.value)}
|
onChange={(e) => {
|
||||||
|
setSelectedPaymentMethod(e.target.value)
|
||||||
|
}}
|
||||||
className="sr-only"
|
className="sr-only"
|
||||||
/>
|
/>
|
||||||
<span className="text-2xl mr-3">{method.logo}</span>
|
<span className="text-2xl mr-3">{method.logo}</span>
|
||||||
<div>
|
<div>
|
||||||
<div className="font-medium text-gray-900">{method.name}</div>
|
<div className="font-medium text-gray-900">{method.name}</div>
|
||||||
<div className="text-sm text-gray-600">
|
<div className="text-sm text-gray-600">
|
||||||
{method.id === 'credit-card'
|
{method.name === defaultPaymentMethod
|
||||||
? translate('::Public.payment.method.installmentsAvailable')
|
? translate('::Public.payment.method.installmentsAvailable')
|
||||||
: translate('::Public.payment.method.noCommission')}
|
: translate('::Public.payment.method.noCommission')}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -288,7 +292,7 @@ export const PaymentForm: React.FC<PaymentFormProps> = ({
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Taksit Seçenekleri */}
|
{/* Taksit Seçenekleri */}
|
||||||
{selectedPaymentMethod === 'credit-card' && (
|
{selectedPaymentMethod === defaultPaymentMethod && (
|
||||||
<div className="bg-white rounded-xl shadow border p-4">
|
<div className="bg-white rounded-xl shadow border p-4">
|
||||||
<h3 className="text-md font-medium text-gray-800 mb-2">
|
<h3 className="text-md font-medium text-gray-800 mb-2">
|
||||||
{translate('::Public.payment.installments.title')}
|
{translate('::Public.payment.installments.title')}
|
||||||
|
|
@ -298,7 +302,7 @@ export const PaymentForm: React.FC<PaymentFormProps> = ({
|
||||||
<label
|
<label
|
||||||
key={option.id}
|
key={option.id}
|
||||||
className={`flex flex-col items-center justify-center h-full p-4 border-2 rounded-xl cursor-pointer transition-all text-xs md:text-sm text-center select-none ${
|
className={`flex flex-col items-center justify-center h-full p-4 border-2 rounded-xl cursor-pointer transition-all text-xs md:text-sm text-center select-none ${
|
||||||
selectedInstallment?.id === option.id
|
selectedInstallment?.installment === option.installment
|
||||||
? 'border-blue-500 bg-blue-50 shadow-md scale-105'
|
? 'border-blue-500 bg-blue-50 shadow-md scale-105'
|
||||||
: 'border-gray-200 hover:border-blue-200'
|
: 'border-gray-200 hover:border-blue-200'
|
||||||
}`}
|
}`}
|
||||||
|
|
@ -306,8 +310,8 @@ export const PaymentForm: React.FC<PaymentFormProps> = ({
|
||||||
<input
|
<input
|
||||||
type="radio"
|
type="radio"
|
||||||
name="installment"
|
name="installment"
|
||||||
value={option.id}
|
value={option.installment}
|
||||||
checked={selectedInstallment?.id === option.id}
|
checked={selectedInstallment?.installment === option.installment}
|
||||||
onChange={() => setSelectedInstallment(option)}
|
onChange={() => setSelectedInstallment(option)}
|
||||||
className="sr-only"
|
className="sr-only"
|
||||||
/>
|
/>
|
||||||
|
|
@ -319,13 +323,14 @@ export const PaymentForm: React.FC<PaymentFormProps> = ({
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="text-blue-700 font-bold mb-1">
|
<div className="text-blue-700 font-bold mb-1">
|
||||||
{option.id > 1
|
{option.installment > 1
|
||||||
? `${option.id} ${translate('::Public.payment.installments.monthly')}`
|
? `${option.installment} ${translate('::Public.payment.installments.monthly')}`
|
||||||
: translate('::Public.payment.installments.single')}
|
: translate('::Public.payment.installments.single')}
|
||||||
</div>
|
</div>
|
||||||
<div className="font-extrabold text-lg text-gray-900 mt-1">
|
<div className="font-extrabold text-lg text-gray-900 mt-1">
|
||||||
{formatPrice(
|
{formatPrice(
|
||||||
(cartState.total + cartState.total * option.commission) / option.id,
|
(cartState.total + cartState.total * option.commission) /
|
||||||
|
option.installment,
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</label>
|
</label>
|
||||||
|
|
@ -338,7 +343,7 @@ export const PaymentForm: React.FC<PaymentFormProps> = ({
|
||||||
{/* 3. Sütun: Kart Bilgileri + Sipariş Özeti ve Butonlar */}
|
{/* 3. Sütun: Kart Bilgileri + Sipariş Özeti ve Butonlar */}
|
||||||
<div className="w-full lg:w-1/3 flex flex-col gap-6">
|
<div className="w-full lg:w-1/3 flex flex-col gap-6">
|
||||||
{/* Kart Bilgileri */}
|
{/* Kart Bilgileri */}
|
||||||
{selectedPaymentMethod !== 'bank-transfer' && (
|
{selectedPaymentMethod !== defaultPaymentMethod && (
|
||||||
<div className="bg-white rounded-xl shadow border p-6 space-y-3">
|
<div className="bg-white rounded-xl shadow border p-6 space-y-3">
|
||||||
<h3 className="text-md font-medium text-gray-800 mb-3">
|
<h3 className="text-md font-medium text-gray-800 mb-3">
|
||||||
{translate('::Public.payment.card.title')}
|
{translate('::Public.payment.card.title')}
|
||||||
|
|
@ -419,14 +424,14 @@ export const PaymentForm: React.FC<PaymentFormProps> = ({
|
||||||
<span>{translate('::Public.payment.summary.commission')}</span>
|
<span>{translate('::Public.payment.summary.commission')}</span>
|
||||||
<span>{formatPrice(commission)}</span>
|
<span>{formatPrice(commission)}</span>
|
||||||
</div>
|
</div>
|
||||||
{selectedPaymentMethod === 'credit-card' &&
|
{selectedPaymentMethod === defaultPaymentMethod &&
|
||||||
selectedInstallment?.id &&
|
selectedInstallment?.installment &&
|
||||||
selectedInstallment.id > 1 && (
|
selectedInstallment.installment > 1 && (
|
||||||
<div className="flex justify-between text-blue-600">
|
<div className="flex justify-between text-blue-600">
|
||||||
<span>{translate('::Public.payment.summary.monthlyInstallment')}: </span>
|
<span>{translate('::Public.payment.summary.monthlyInstallment')}: </span>
|
||||||
<span>
|
<span>
|
||||||
{formatPrice(finalTotal / selectedInstallment.id)} x{' '}
|
{formatPrice(finalTotal / selectedInstallment.installment)} x{' '}
|
||||||
{selectedInstallment.id}
|
{selectedInstallment.installment}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { CustomTenantDto } from "../config/models"
|
import { CustomTenantDto } from '../config/models'
|
||||||
|
|
||||||
export type BillingCycle = 'monthly' | 'yearly'
|
export type BillingCycle = 'monthly' | 'yearly'
|
||||||
|
|
||||||
|
|
@ -52,6 +52,7 @@ export interface PaymentMethodDto {
|
||||||
|
|
||||||
export interface InstallmentOptionDto {
|
export interface InstallmentOptionDto {
|
||||||
id: number
|
id: number
|
||||||
|
installment: number
|
||||||
name: string
|
name: string
|
||||||
commission: number
|
commission: number
|
||||||
}
|
}
|
||||||
|
|
@ -62,8 +63,7 @@ export interface OrderDto {
|
||||||
subtotal: number
|
subtotal: number
|
||||||
commission: number
|
commission: number
|
||||||
total: number
|
total: number
|
||||||
paymentMethod: string
|
paymentMethodId: string
|
||||||
installments?: number
|
installment: number
|
||||||
installmentName?: string
|
|
||||||
paymentData: Record<string, unknown>
|
paymentData: Record<string, unknown>
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,9 +47,8 @@ export class OrderService {
|
||||||
subtotal: orderData.subtotal,
|
subtotal: orderData.subtotal,
|
||||||
commission: orderData.commission,
|
commission: orderData.commission,
|
||||||
total: orderData.total,
|
total: orderData.total,
|
||||||
paymentMethod: orderData.paymentMethod,
|
paymentMethodId: orderData.paymentMethodId,
|
||||||
installments: orderData.installments,
|
installment: orderData.installment,
|
||||||
installmentName: orderData.installmentName,
|
|
||||||
paymentData: orderData.paymentData,
|
paymentData: orderData.paymentData,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -96,9 +96,6 @@ const SalesOrderForm: React.FC = () => {
|
||||||
if (existingOrder) {
|
if (existingOrder) {
|
||||||
setFormData(existingOrder)
|
setFormData(existingOrder)
|
||||||
}
|
}
|
||||||
// Load existing sales order data
|
|
||||||
// This would typically come from an API call
|
|
||||||
console.log('Loading sales order:', id)
|
|
||||||
}
|
}
|
||||||
}, [id, isEdit])
|
}, [id, isEdit])
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -71,16 +71,14 @@ const Payment: React.FC = () => {
|
||||||
subtotal: cartState.total,
|
subtotal: cartState.total,
|
||||||
commission: paymentData.commission,
|
commission: paymentData.commission,
|
||||||
total: paymentData.total,
|
total: paymentData.total,
|
||||||
paymentMethod: paymentData.paymentMethod,
|
paymentMethodId: paymentData.paymentMethodId,
|
||||||
installments: paymentData.installments,
|
installment: paymentData.installment,
|
||||||
installmentName: paymentData.installmentName,
|
|
||||||
paymentData: {
|
paymentData: {
|
||||||
cardNumber: paymentData.cardNumber
|
cardNumber: paymentData.cardNumber
|
||||||
? `****${(paymentData.cardNumber as string).slice(-4)}`
|
? `****${(paymentData.cardNumber as string).slice(-4)}`
|
||||||
: null,
|
: null,
|
||||||
cardName: paymentData.cardName,
|
cardName: paymentData.cardName,
|
||||||
installments: paymentData.installments,
|
installment: paymentData.installment,
|
||||||
installmentName: paymentData.installmentName,
|
|
||||||
},
|
},
|
||||||
} as OrderDto
|
} as OrderDto
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue