diff --git a/BBWY.Server.Business/Order/OrderBusiness.cs b/BBWY.Server.Business/Order/OrderBusiness.cs index a7232797..db1c0b62 100644 --- a/BBWY.Server.Business/Order/OrderBusiness.cs +++ b/BBWY.Server.Business/Order/OrderBusiness.cs @@ -1021,14 +1021,15 @@ namespace BBWY.Server.Business if (orderCost != null) { orderCost.PlatformCommissionRatio = relationPurchaseOrderRequestV2.PlatformCommissionRatio; - orderCost.PlatformCommissionAmount = dbOrder.OrderSellerPrice * relationPurchaseOrderRequestV2.PlatformCommissionRatio; + //orderCost.PlatformCommissionAmount = dbOrder.OrderSellerPrice * relationPurchaseOrderRequestV2.PlatformCommissionRatio; orderCost.DeliveryExpressFreight = totalDeliveryFreight; orderCost.PurchaseAmount = totalPurchaseAmount; - orderCost.Profit = dbOrder.OrderSellerPrice + - dbOrder.FreightPrice - - orderCost.PurchaseAmount - - orderCost.DeliveryExpressFreight - - orderCost.PlatformCommissionAmount; + orderCost.CalculationOrderProfitAndCost(dbOrder, null); + //orderCost.Profit = dbOrder.OrderSellerPrice + + // dbOrder.FreightPrice - + // orderCost.PurchaseAmount - + // orderCost.DeliveryExpressFreight - + // orderCost.PlatformCommissionAmount; orderCost.IsEstimateCost = false; orderCost.IsManualEdited = true; updateOrderCost = fsql.Update().SetSource(orderCost).IgnoreColumns(oc => new @@ -1053,16 +1054,15 @@ namespace BBWY.Server.Business SDCommissionAmount = 0, SDOrderAmount = 0, PurchaseAmount = totalPurchaseAmount, - PlatformCommissionAmount = dbOrder.OrderSellerPrice * relationPurchaseOrderRequestV2.PlatformCommissionRatio, PreferentialAmount = preferentialAmount, IsManualEdited = true }; - - orderCost.Profit = dbOrder.OrderSellerPrice + - dbOrder.FreightPrice - - orderCost.PurchaseAmount - - orderCost.DeliveryExpressFreight - - orderCost.PlatformCommissionAmount; + orderCost.CalculationOrderProfitAndCost(dbOrder, null); + //orderCost.Profit = dbOrder.OrderSellerPrice + + // dbOrder.FreightPrice - + // orderCost.PurchaseAmount - + // orderCost.DeliveryExpressFreight - + // orderCost.PlatformCommissionAmount; insertOrderCost = fsql.Insert(orderCost); } #endregion