fixes
This commit is contained in:
parent
11b151a9ec
commit
b00bd0508d
|
|
@ -347,23 +347,23 @@
|
||||||
};
|
};
|
||||||
gridModel.ColumnCollection.Add(new ColumnProperty(nameof(OrderModelExtended.IsMeasurable))
|
gridModel.ColumnCollection.Add(new ColumnProperty(nameof(OrderModelExtended.IsMeasurable))
|
||||||
{
|
{
|
||||||
Title = T("Admin.Orders.Fields.IsMeasurable").Text,
|
Title = T($"FruitBank.{nameof(OrderModelExtended.IsMeasurable)}?").Text,
|
||||||
Width = "100",
|
Width = "80",
|
||||||
Render = new RenderCustom("renderColumnIsMeasurable"),
|
Render = new RenderCustom("renderColumnIsMeasurable"),
|
||||||
ClassName = NopColumnClassDefaults.CenterAll
|
ClassName = NopColumnClassDefaults.CenterAll
|
||||||
});
|
});
|
||||||
|
|
||||||
gridModel.ColumnCollection.Add(new ColumnProperty(nameof(OrderModelExtended.IsMeasured))
|
gridModel.ColumnCollection.Add(new ColumnProperty(nameof(OrderModelExtended.IsMeasured))
|
||||||
{
|
{
|
||||||
Title = T("Admin.Orders.Fields.IsMeasured").Text,
|
Title = T($"FruitBank.{nameof(OrderModelExtended.IsMeasured)}?").Text,
|
||||||
Width = "100",
|
Width = "80",
|
||||||
Render = new RenderCustom("renderColumnIsMeasurable"),
|
Render = new RenderCustom("renderColumnIsMeasurable"),
|
||||||
ClassName = NopColumnClassDefaults.CenterAll
|
ClassName = NopColumnClassDefaults.CenterAll
|
||||||
});
|
});
|
||||||
|
|
||||||
gridModel.ColumnCollection.Add(new ColumnProperty(nameof(IOrderDto.DateOfReceipt))
|
gridModel.ColumnCollection.Add(new ColumnProperty(nameof(IOrderDto.DateOfReceipt))
|
||||||
{
|
{
|
||||||
Title = T("Admin.Orders.Fields.PickupDate").Text,
|
Title = T($"FruitBank.{nameof(IOrderDto.DateOfReceipt)}").Text,
|
||||||
Width = "100",
|
Width = "100",
|
||||||
Render = new RenderCustom("renderColumnPickupDateAndTime"),
|
Render = new RenderCustom("renderColumnPickupDateAndTime"),
|
||||||
ClassName = NopColumnClassDefaults.CenterAll
|
ClassName = NopColumnClassDefaults.CenterAll
|
||||||
|
|
@ -382,7 +382,7 @@
|
||||||
gridModel.ColumnCollection.Add(new ColumnProperty(nameof(OrderModel.PaymentStatus))
|
gridModel.ColumnCollection.Add(new ColumnProperty(nameof(OrderModel.PaymentStatus))
|
||||||
{
|
{
|
||||||
Title = T("Admin.Orders.Fields.PaymentStatus").Text,
|
Title = T("Admin.Orders.Fields.PaymentStatus").Text,
|
||||||
Width = "150"
|
Width = "130"
|
||||||
});
|
});
|
||||||
//a vendor does not have access to this functionality
|
//a vendor does not have access to this functionality
|
||||||
if (!Model.IsLoggedInAsVendor)
|
if (!Model.IsLoggedInAsVendor)
|
||||||
|
|
@ -390,12 +390,13 @@
|
||||||
gridModel.ColumnCollection.Add(new ColumnProperty(nameof(OrderModel.ShippingStatus))
|
gridModel.ColumnCollection.Add(new ColumnProperty(nameof(OrderModel.ShippingStatus))
|
||||||
{
|
{
|
||||||
Title = T("Admin.Orders.Fields.ShippingStatus").Text,
|
Title = T("Admin.Orders.Fields.ShippingStatus").Text,
|
||||||
Width = "150"
|
Width = "130"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
gridModel.ColumnCollection.Add(new ColumnProperty(nameof(OrderModelExtended.CustomerCompany))
|
gridModel.ColumnCollection.Add(new ColumnProperty(nameof(OrderModelExtended.CustomerCompany))
|
||||||
{
|
{
|
||||||
Title = T("Admin.Orders.Fields.Customer").Text,
|
Title = T("Admin.Orders.Fields.Customer").Text,
|
||||||
|
Width = "150"
|
||||||
//Render = new RenderCustom("renderColumnCustomer")
|
//Render = new RenderCustom("renderColumnCustomer")
|
||||||
});
|
});
|
||||||
gridModel.ColumnCollection.Add(new ColumnProperty(nameof(OrderModel.StoreName))
|
gridModel.ColumnCollection.Add(new ColumnProperty(nameof(OrderModel.StoreName))
|
||||||
|
|
@ -407,7 +408,7 @@
|
||||||
gridModel.ColumnCollection.Add(new ColumnProperty(nameof(OrderModel.CreatedOn))
|
gridModel.ColumnCollection.Add(new ColumnProperty(nameof(OrderModel.CreatedOn))
|
||||||
{
|
{
|
||||||
Title = T("Admin.Orders.Fields.CreatedOn").Text,
|
Title = T("Admin.Orders.Fields.CreatedOn").Text,
|
||||||
Width = "120",
|
Width = "100",
|
||||||
Render = new RenderDate()
|
Render = new RenderDate()
|
||||||
});
|
});
|
||||||
//a vendor does not have access to this functionality
|
//a vendor does not have access to this functionality
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ public class FruitBankEventConsumer :
|
||||||
IConsumer<EntityInsertedEvent<OrderItem>>,
|
IConsumer<EntityInsertedEvent<OrderItem>>,
|
||||||
IConsumer<EntityUpdatedEvent<OrderItem>>
|
IConsumer<EntityUpdatedEvent<OrderItem>>
|
||||||
{
|
{
|
||||||
private CustomPriceCalculationService _customPriceCalculationService;
|
private readonly CustomPriceCalculationService _customPriceCalculationService;
|
||||||
|
|
||||||
private readonly FruitBankDbContext _ctx;
|
private readonly FruitBankDbContext _ctx;
|
||||||
private readonly FruitBankAttributeService _fruitBankAttributeService;
|
private readonly FruitBankAttributeService _fruitBankAttributeService;
|
||||||
|
|
@ -44,7 +44,6 @@ public class FruitBankEventConsumer :
|
||||||
_customPriceCalculationService = customPriceCalculationService as CustomPriceCalculationService;
|
_customPriceCalculationService = customPriceCalculationService as CustomPriceCalculationService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public override async Task HandleEventAsync(EntityUpdatedEvent<Product> eventMessage)
|
public override async Task HandleEventAsync(EntityUpdatedEvent<Product> eventMessage)
|
||||||
{
|
{
|
||||||
var product = await CheckAndUpdateProductManageInventoryMethodToManageStock(eventMessage.Entity);
|
var product = await CheckAndUpdateProductManageInventoryMethodToManageStock(eventMessage.Entity);
|
||||||
|
|
@ -83,7 +82,6 @@ public class FruitBankEventConsumer :
|
||||||
/// <param name="product"></param>
|
/// <param name="product"></param>
|
||||||
/// <returns>IsMeasureable</returns>
|
/// <returns>IsMeasureable</returns>
|
||||||
/// <exception cref="Exception"></exception>
|
/// <exception cref="Exception"></exception>
|
||||||
|
|
||||||
private async Task<(bool IsMeasurableChanged, bool? IsMeasurable)> SaveProductCustomAttributesAsync(Product product)
|
private async Task<(bool IsMeasurableChanged, bool? IsMeasurable)> SaveProductCustomAttributesAsync(Product product)
|
||||||
{
|
{
|
||||||
if (product == null) return (false, null);
|
if (product == null) return (false, null);
|
||||||
|
|
|
||||||
|
|
@ -74,6 +74,12 @@ public class CustomPriceCalculationService : PriceCalculationService
|
||||||
return await CheckAndUpdateOrderItemFinalPricesAsync(orderItem, orderItemDto);
|
return await CheckAndUpdateOrderItemFinalPricesAsync(orderItem, orderItemDto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="orderItem"></param>
|
||||||
|
/// <param name="orderItemDto"></param>
|
||||||
|
/// <returns>true if has changes</returns>
|
||||||
public async Task<bool> CheckAndUpdateOrderItemFinalPricesAsync(OrderItem orderItem, OrderItemDto orderItemDto)
|
public async Task<bool> CheckAndUpdateOrderItemFinalPricesAsync(OrderItem orderItem, OrderItemDto orderItemDto)
|
||||||
{
|
{
|
||||||
_logger.Info($"CustomPriceCalculationService->CheckAndUpdateOrderItemFinalPricesAsync; orderItem.Id: {orderItem.Id}");
|
_logger.Info($"CustomPriceCalculationService->CheckAndUpdateOrderItemFinalPricesAsync; orderItem.Id: {orderItem.Id}");
|
||||||
|
|
@ -94,7 +100,12 @@ public class CustomPriceCalculationService : PriceCalculationService
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task CheckAndUpdateOrderTotalPrice(Order order)
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="order"></param>
|
||||||
|
/// <returns>true if has changes</returns>
|
||||||
|
public async Task<bool> CheckAndUpdateOrderTotalPrice(Order order)
|
||||||
{
|
{
|
||||||
var prevOrderTotal = order.OrderTotal;
|
var prevOrderTotal = order.OrderTotal;
|
||||||
var orderItemDtos = await _dbContext.OrderItemDtos.GetAllByOrderId(order.Id).ToListAsync();
|
var orderItemDtos = await _dbContext.OrderItemDtos.GetAllByOrderId(order.Id).ToListAsync();
|
||||||
|
|
@ -107,7 +118,7 @@ public class CustomPriceCalculationService : PriceCalculationService
|
||||||
order.OrderTotal += itemDto.PriceInclTax;
|
order.OrderTotal += itemDto.PriceInclTax;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (order.OrderTotal == prevOrderTotal) return;
|
if (order.OrderTotal == prevOrderTotal) return false;
|
||||||
|
|
||||||
_logger.Error($"HandleEventAsync->CheckAndUpdateOrderItemFinalPrices; order.OrderTotal({order.OrderTotal}) == prevOrderTotal({prevOrderTotal})");
|
_logger.Error($"HandleEventAsync->CheckAndUpdateOrderItemFinalPrices; order.OrderTotal({order.OrderTotal}) == prevOrderTotal({prevOrderTotal})");
|
||||||
|
|
||||||
|
|
@ -117,6 +128,7 @@ public class CustomPriceCalculationService : PriceCalculationService
|
||||||
order.OrderSubTotalDiscountExclTax = order.OrderTotal;
|
order.OrderSubTotalDiscountExclTax = order.OrderTotal;
|
||||||
|
|
||||||
await _dbContext.Orders.UpdateAsync(order);
|
await _dbContext.Orders.UpdateAsync(order);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//public override async Task<(decimal priceWithoutDiscounts, decimal finalPrice, decimal appliedDiscountAmount, List<Discount> appliedDiscounts)> GetFinalPriceAsync(
|
//public override async Task<(decimal priceWithoutDiscounts, decimal finalPrice, decimal appliedDiscountAmount, List<Discount> appliedDiscounts)> GetFinalPriceAsync(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue