Browse Source

sku订单公式调整

AddValidOverTime
shanji 2 years ago
parent
commit
18de1194b4
  1. 20
      BBWY.Server.Business/Order/OrderBusiness.cs
  2. 5
      BBWY.Server.Business/PurchaseOrder/PurchaseOrderBusiness.cs
  3. 2
      BBWY.Server.Business/Sync/OrderSyncBusiness.cs

20
BBWY.Server.Business/Order/OrderBusiness.cs

@ -592,7 +592,8 @@ namespace BBWY.Server.Business
SkuAmount = purchaseOrder.SingleSkuAmount * deductionQuantity, SkuAmount = purchaseOrder.SingleSkuAmount * deductionQuantity,
StorageAmount = purchaseOrder.SingleStorageAmount * deductionQuantity StorageAmount = purchaseOrder.SingleStorageAmount * deductionQuantity
}; };
orderCostDetail.SkuGrossProfit = orderSku.Price.Value * deductionQuantity - avgPreferential - (orderCostDetail.TotalCost + orderCostDetail.DeliveryExpressFreight) - orderSku.Price.Value * deductionQuantity * autoCalculationCostRequest.PlatformCommissionRatio; //orderCostDetail.SkuGrossProfit = orderSku.Price.Value * deductionQuantity - avgPreferential - (orderCostDetail.TotalCost + orderCostDetail.DeliveryExpressFreight) - orderSku.Price.Value * deductionQuantity * autoCalculationCostRequest.PlatformCommissionRatio;
orderCostDetail.SkuGrossProfit = (orderSku.ShouldPay ?? 0M) - orderCostDetail.TotalCost - orderCostDetail.DeliveryExpressFreight;
insertOrderCostDetailList.Add(orderCostDetail); insertOrderCostDetailList.Add(orderCostDetail);
} }
} }
@ -660,7 +661,8 @@ namespace BBWY.Server.Business
{ {
osku.SkuId, osku.SkuId,
osku.Price, osku.Price,
osku.ItemTotal osku.ItemTotal,
osku.ShouldPay
}); });
var avgPreferential = dbOrder.PreferentialAmount / orderSkuList.Count(); var avgPreferential = dbOrder.PreferentialAmount / orderSkuList.Count();
@ -682,9 +684,10 @@ namespace BBWY.Server.Business
var osku = orderSkuList.FirstOrDefault(o => o.SkuId == orderCostDetail.SkuId); var osku = orderSkuList.FirstOrDefault(o => o.SkuId == orderCostDetail.SkuId);
if (osku != null) if (osku != null)
{ {
orderCostDetail.SkuGrossProfit = osku.Price.Value * orderCostDetail.DeductionQuantity - avgPreferential - //orderCostDetail.SkuGrossProfit = osku.Price.Value * orderCostDetail.DeductionQuantity - avgPreferential -
(orderCostDetail.TotalCost + orderCostDetail.DeliveryExpressFreight) - // (orderCostDetail.TotalCost + orderCostDetail.DeliveryExpressFreight) -
osku.Price.Value * orderCostDetail.DeductionQuantity * manualCalculationCostRequest.PlatformCommissionRatio; // osku.Price.Value * orderCostDetail.DeductionQuantity * manualCalculationCostRequest.PlatformCommissionRatio;
orderCostDetail.SkuGrossProfit = (osku.ShouldPay ?? 0M) - orderCostDetail.TotalCost - orderCostDetail.DeliveryExpressFreight;
} }
} }
@ -940,9 +943,10 @@ namespace BBWY.Server.Business
var dbOrderSku = dbOrderSkuList.FirstOrDefault(dbosku => dbosku.SkuId == relationOrderSku.SkuId); var dbOrderSku = dbOrderSkuList.FirstOrDefault(dbosku => dbosku.SkuId == relationOrderSku.SkuId);
if (dbOrderSku != null) if (dbOrderSku != null)
{ {
orderCostDetail.SkuGrossProfit = dbOrderSku.Price.Value * orderCostDetail.DeductionQuantity - avgPreferential - //orderCostDetail.SkuGrossProfit = dbOrderSku.Price.Value * orderCostDetail.DeductionQuantity - avgPreferential -
(orderCostDetail.TotalCost + orderCostDetail.DeliveryExpressFreight) - // (orderCostDetail.TotalCost + orderCostDetail.DeliveryExpressFreight) -
dbOrderSku.Price.Value * orderCostDetail.DeductionQuantity * relationPurchaseOrderRequestV2.PlatformCommissionRatio; // dbOrderSku.Price.Value * orderCostDetail.DeductionQuantity * relationPurchaseOrderRequestV2.PlatformCommissionRatio;
orderCostDetail.SkuGrossProfit = (dbOrderSku.ShouldPay ?? 0M) - orderCostDetail.TotalCost - orderCostDetail.DeliveryExpressFreight;
} }
#endregion #endregion
} }

5
BBWY.Server.Business/PurchaseOrder/PurchaseOrderBusiness.cs

@ -263,7 +263,10 @@ namespace BBWY.Server.Business
//UnitCost = purchaseOrder.UnitCost, //UnitCost = purchaseOrder.UnitCost,
//TotalCost = currentOrderSkuProductAmount + currentOrderSkuFreightAmount//purchaseOrder.UnitCost * orderSku.ItemTotal.Value //TotalCost = currentOrderSkuProductAmount + currentOrderSkuFreightAmount//purchaseOrder.UnitCost * orderSku.ItemTotal.Value
}; };
orderCostDetail.SkuGrossProfit = orderSku.Price.Value * orderCostDetail.DeductionQuantity - avgPreferential - (orderCostDetail.TotalCost + orderCostDetail.DeliveryExpressFreight) - orderSku.Price.Value * orderCostDetail.DeductionQuantity * createOnlinePurchaseOrderRequest.PlatformCommissionRatio; //orderCostDetail.SkuGrossProfit = orderSku.Price.Value * orderCostDetail.DeductionQuantity - avgPreferential - (orderCostDetail.TotalCost + orderCostDetail.DeliveryExpressFreight) - orderSku.Price.Value * orderCostDetail.DeductionQuantity * createOnlinePurchaseOrderRequest.PlatformCommissionRatio;
orderCostDetail.SkuGrossProfit = (orderSku.ShouldPay ?? 0M) - orderCostDetail.TotalCost - orderCostDetail.DeliveryExpressFreight;
insertOrderCostDetails.Add(orderCostDetail); insertOrderCostDetails.Add(orderCostDetail);
#endregion #endregion
} }

2
BBWY.Server.Business/Sync/OrderSyncBusiness.cs

@ -788,7 +788,7 @@ namespace BBWY.Server.Business
//orderCostDetail.SkuGrossProfit = itemPrice * deductionQuantity - avgPreferential - //orderCostDetail.SkuGrossProfit = itemPrice * deductionQuantity - avgPreferential -
// (orderCostDetail.TotalCost + orderCostDetail.DeliveryExpressFreight) - // (orderCostDetail.TotalCost + orderCostDetail.DeliveryExpressFreight) -
// itemPrice * deductionQuantity * platformCommissionRatio; // itemPrice * deductionQuantity * platformCommissionRatio;
orderCostDetail.SkuGrossProfit = skuShouldPay ?? 0M - (orderCostDetail.TotalCost + orderCostDetail.DeliveryExpressFreight); orderCostDetail.SkuGrossProfit = (skuShouldPay ?? 0M) - orderCostDetail.TotalCost - orderCostDetail.DeliveryExpressFreight;
insertOrderCostDetailList.Add(orderCostDetail); insertOrderCostDetailList.Add(orderCostDetail);
} }
} }

Loading…
Cancel
Save