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