Commit f483b225 authored by 吴春's avatar 吴春

代付修改

parent cc4caebd
......@@ -90,9 +90,25 @@ namespace Mall.Module.Product
}
model.DetailList = dlist;
if (model.MallBaseId == 19)
{
//620 20元的运费以及其他费用,商品总价600,2个商品,1-全款,1-订金60%;300*(1-(60/100))=120;
//620-120-0=500
decimal payIncome = (model.Income.Value) - (model?.PayIncome ?? 0);//实际应付金额-已支付金额
if ((model?.PayIncome ?? 0) == 0)//支付定金金额
{
decimal depositMoney = Math.Round(dlist.Where(x => x.DepositRatio > 0).Sum(x => (1 - (x.DepositRatio / 100)) * (x.Final_Price ?? 0)), 2);
payIncome = payIncome - depositMoney;//最终应付金额-定金-退款
}
model.GoodsDepositMoney = Math.Round(dlist.Where(x => x.DepositRatio > 0).Sum(x => ((x.DepositRatio / 100)) * (x.Final_Price ?? 0)), 2);
model.ResultPayMoney = payIncome;
}
else
{
model.ResultPayMoney = model.Income ?? 0;
}
//地址
model.DistrictAddress = ((model.Province.HasValue && model.Province.Value > 0) ? (destinationRepository.GetEntity(model.Province)?.Name ?? "") : "") + " " + ((model.City.HasValue && model.City.Value > 0) ? (destinationRepository.GetEntity(model.City)?.Name ?? ""):"") + " " + ((model.District.HasValue && model.District.Value > 0) ? (destinationRepository.GetEntity(model.District)?.Name ?? ""):"");
model.DistrictAddress = ((model.Province.HasValue && model.Province.Value > 0) ? (destinationRepository.GetEntity(model.Province)?.Name ?? "") : "") + " " + ((model.City.HasValue && model.City.Value > 0) ? (destinationRepository.GetEntity(model.City)?.Name ?? "") : "") + " " + ((model.District.HasValue && model.District.Value > 0) ? (destinationRepository.GetEntity(model.District)?.Name ?? "") : "");
model.IsCanApplyForAfterSale = 2;
......@@ -107,6 +123,9 @@ namespace Mall.Module.Product
umodel.Name,
umodel.Photo
},
PayIncome = model.PayIncome ?? 0,
model.ResultPayMoney,
model.GoodsDepositMoney,
OrderStatusName = model.OrderStatus.GetEnumName(),
CreateDate = model.CreateDate.HasValue ? model.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
CancelTime = model.CancelTime.HasValue ? model.CancelTime.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment