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,
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);
}
}
@ -660,7 +661,8 @@ namespace BBWY.Server.Business
{
osku.SkuId,
osku.Price,
osku.ItemTotal
osku.ItemTotal,
osku.ShouldPay
});
var avgPreferential = dbOrder.PreferentialAmount / orderSkuList.Count();
@ -682,9 +684,10 @@ namespace BBWY.Server.Business
var osku = orderSkuList.FirstOrDefault(o => o.SkuId == orderCostDetail.SkuId);
if (osku != null)
{
orderCostDetail.SkuGrossProfit = osku.Price.Value * orderCostDetail.DeductionQuantity - avgPreferential -
(orderCostDetail.TotalCost + orderCostDetail.DeliveryExpressFreight) -
osku.Price.Value * orderCostDetail.DeductionQuantity * manualCalculationCostRequest.PlatformCommissionRatio;
//orderCostDetail.SkuGrossProfit = osku.Price.Value * orderCostDetail.DeductionQuantity - avgPreferential -
// (orderCostDetail.TotalCost + orderCostDetail.DeliveryExpressFreight) -
// 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);
if (dbOrderSku != null)
{
orderCostDetail.SkuGrossProfit = dbOrderSku.Price.Value * orderCostDetail.DeductionQuantity - avgPreferential -
(orderCostDetail.TotalCost + orderCostDetail.DeliveryExpressFreight) -
dbOrderSku.Price.Value * orderCostDetail.DeductionQuantity * relationPurchaseOrderRequestV2.PlatformCommissionRatio;
//orderCostDetail.SkuGrossProfit = dbOrderSku.Price.Value * orderCostDetail.DeductionQuantity - avgPreferential -
// (orderCostDetail.TotalCost + orderCostDetail.DeliveryExpressFreight) -
// dbOrderSku.Price.Value * orderCostDetail.DeductionQuantity * relationPurchaseOrderRequestV2.PlatformCommissionRatio;
orderCostDetail.SkuGrossProfit = (dbOrderSku.ShouldPay ?? 0M) - orderCostDetail.TotalCost - orderCostDetail.DeliveryExpressFreight;
}
#endregion
}

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

@ -263,7 +263,10 @@ namespace BBWY.Server.Business
//UnitCost = purchaseOrder.UnitCost,
//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);
#endregion
}

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

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

Loading…
Cancel
Save