修复统计 总销售额的错误计算bug
This commit is contained in:
1 parent
d5d235c0b0
commit
342a66f940
1 file changed
+5
-5
@@ -112,20 +112,20 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Services
|
||||
var valid = list.Where(IsValidOrder).ToList();
|
||||
var refunded = list.Where(IsRefunded).ToList();
|
||||
|
||||
decimal salesAmount = list.Sum(r => (decimal)(r.OrderPrice)) / 100m;
|
||||
decimal salesAmount = valid.Sum(r => (decimal)(r.OrderPrice)) / 100m;//有效订单总金额
|
||||
decimal profit = valid.Concat(refunded).Sum(r => (decimal)(r.Profit)) / 100m;
|
||||
decimal refundAmount = refunded.Sum(r => (decimal)(r.OrderPrice)) / 100m;
|
||||
decimal platformFeeTotal = valid.Sum(r => (decimal)(r.PredictCommissionFee)) / 100m;
|
||||
decimal commission = valid.Sum(r => (decimal)(r.CommissionAmount)) / 100m;
|
||||
decimal purchaseAmount = valid.Sum(r => (decimal)(r.OutAmount)) / 100m;
|
||||
decimal buyerPaymentAmount = list.Sum(r => (decimal)(r.OutAmount)) / 100m; //买手号付款金额(采购金额)
|
||||
decimal buyerPaymentAmount = valid.Sum(r => (decimal)(r.OutAmount)) / 100m; //买手号付款金额(采购金额)
|
||||
decimal buyerRefundAmount = refunded.Sum(r => (decimal)(r.OutAmount)) / 100m; //买手号退款金额(采购退款金额)
|
||||
decimal buyerRefundSuccessedAmount = refunded.Where(IsBuyerRefundSuccessful).Sum(r => (decimal)(r.BuyerRefundAmount)) / 100m; //买手号退款成功金额
|
||||
|
||||
int validOrderCount = valid.Select(r => r.OrderId).Distinct().Count();
|
||||
|
||||
// 总订单数(退款率分母)= 已付款订单 + 已退款订单,不含未付款的 10/250
|
||||
int totalOrderCount = list.Where(r => IsPaidOrder(r) || IsRefunded(r)).Select(r => r.OrderId).Distinct().Count();
|
||||
int totalOrderCount = list.Count();
|
||||
int refundOrderCount = refunded.Select(r => r.OrderId).Distinct().Count();
|
||||
|
||||
return new ShopRevenueSummary
|
||||
@@ -205,7 +205,7 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Services
|
||||
int orderCount = valid.Select(r => r.OrderId).Distinct().Count();
|
||||
decimal profit = valid.Concat(refunded).Sum(r => (decimal)(r.Profit)) / 100m; //与 GetSummary 一致:有效+退款订单利润
|
||||
decimal purchaseAmount = valid.Sum(r => (decimal)(r.OutAmount)) / 100m; //与 GetSummary 一致:买手付款金额(采购金额)
|
||||
decimal buyerPaymentAmount = list.Sum(r => (decimal)(r.OutAmount)) / 100m; //买手号付款金额(采购金额)
|
||||
decimal buyerPaymentAmount = valid.Sum(r => (decimal)(r.OutAmount)) / 100m; //买手号付款金额(采购金额)
|
||||
return new ShopStatisticsItem
|
||||
{
|
||||
ShopName = string.IsNullOrEmpty(g.Key) ? "未知店铺" : g.Key,
|
||||
@@ -242,7 +242,7 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Services
|
||||
decimal profit = valid.Concat(refunded).Sum(r => (decimal)(r.Profit)) / 100m; //与 GetSummary 一致:有效+退款订单利润
|
||||
decimal purchaseAmount = valid.Sum(r => (decimal)(r.OutAmount)) / 100m; //与 GetSummary 一致:买手付款金额(采购金额)
|
||||
int orderCount = valid.Select(r => r.OrderId).Distinct().Count();
|
||||
decimal buyerPaymentAmount = list.Sum(r => (decimal)(r.OutAmount)) / 100m; //买手号付款金额(采购金额)
|
||||
decimal buyerPaymentAmount = valid.Sum(r => (decimal)(r.OutAmount)) / 100m; //买手号付款金额(采购金额)
|
||||
|
||||
return new ShopPeriodStatisticsItem
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user