|
|
@ -519,6 +519,7 @@ namespace BBWY.Server.Business |
|
|
|
SkuAmount = purchaseOrder.SingleSkuAmount * deductionQuantity, |
|
|
|
StorageAmount = purchaseOrder.SingleStorageAmount * deductionQuantity |
|
|
|
}; |
|
|
|
orderCostDetail.SkuGrossProfit = orderSku.Price.Value * deductionQuantity - (orderCostDetail.TotalCost + orderCostDetail.DeliveryExpressFreight); |
|
|
|
insertOrderCostDetailList.Add(orderCostDetail); |
|
|
|
} |
|
|
|
} |
|
|
@ -593,6 +594,12 @@ namespace BBWY.Server.Business |
|
|
|
IUpdate<OrderCost> updateOrderCost = null; |
|
|
|
IInsert<OrderCost> insertOrderCost = null; |
|
|
|
List<OrderCostDetail> insertOrderCostDetailList = new List<OrderCostDetail>(); |
|
|
|
var orderSkuList = fsql.Select<OrderSku>().Where(osku => osku.OrderId == manualCalculationCostRequest.OrderId).ToList(osku => new |
|
|
|
{ |
|
|
|
osku.SkuId, |
|
|
|
osku.Price, |
|
|
|
osku.ItemTotal |
|
|
|
}); |
|
|
|
var dbAfterSaleOrderList = fsql.Select<AfterSaleOrder>().Where(aso => aso.OrderId == manualCalculationCostRequest.OrderId).ToList(); |
|
|
|
|
|
|
|
if (manualCalculationCostRequest.IsSetStorageType) |
|
|
@ -605,6 +612,13 @@ namespace BBWY.Server.Business |
|
|
|
orderCostDetail.CreateTime = DateTime.Now; |
|
|
|
orderCostDetail.OrderId = manualCalculationCostRequest.OrderId; |
|
|
|
orderCostDetail.PurchaseOrderPKId = 0; |
|
|
|
|
|
|
|
var osku = orderSkuList.FirstOrDefault(o => o.SkuId == orderCostDetail.SkuId); |
|
|
|
if (osku != null) |
|
|
|
{ |
|
|
|
orderCostDetail.SkuGrossProfit = osku.Price.Value * orderCostDetail.DeductionQuantity - |
|
|
|
(orderCostDetail.TotalCost + orderCostDetail.DeliveryExpressFreight); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
var totalPurchaseCost = insertOrderCostDetailList.Sum(ocd => ocd.TotalCost); |
|
|
|