Commit f84a7e29 authored by 吴春's avatar 吴春

提交代码

parent 8f82e169
......@@ -78,6 +78,8 @@ namespace Mall.Model.Entity.User
get;
set;
}
/// <summary>
/// 退款费用
/// </summary>
......@@ -98,6 +100,16 @@ namespace Mall.Model.Entity.User
/// 运杂费用id
/// </summary>
public int? ExpensesCostTypeId { get; set; }
/// <summary>
/// 保险成本费用
/// </summary>
public int? InsuranceCostTypeId
{
get;
set;
}
/// <summary>
/// RemitCostTypeId
/// </summary>
......
......@@ -113,5 +113,9 @@ namespace Mall.Model.Entity.Finance
set;
}
/// <summary>
/// 保险成本价格
/// </summary>
public decimal? InsuranceCostMoney { get; set; }
}
}
......@@ -216,6 +216,11 @@ namespace Mall.Model.Entity.Product
/// </summary>
public int FreightFinanceId { get; set; }
/// <summary>
/// 保险成本单据id
/// </summary>
public int InsuranceFinanceId { get; set; }
/// <summary>
/// 积分赠送
/// </summary>
......
......@@ -159,7 +159,7 @@ namespace Mall.Model.Extend.Product
/// <summary>
/// 1-商品,2-运费
/// 1-商品,2-运费,3-保险
/// </summary>
public int FinanceType { get; set; }
#endregion
......@@ -192,10 +192,16 @@ namespace Mall.Model.Extend.Product
/// <summary>
/// 是否查询所有,0-全部,1-成本,2-运费
/// 是否查询所有,0-全部,1-成本,2-运费,3-保险成本
/// </summary>
public int IsSelectAll { get; set; }
/// <summary>
/// 订单分类 0正常订单 1司导订单
/// </summary>
public int OrderClassify { get; set; }
/// <summary>
/// 规格key(出库的规格),没有修改为
/// </summary>
......
......@@ -196,6 +196,10 @@ where {where} order by o.CreateDate desc";
{
where += $@" and o.{nameof(RB_Goods_Order.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.OrderClassify > -1)
{
where += $@" and o.{nameof(RB_Goods_Order.OrderClassify)}={dmodel.OrderClassify}";
}
if (dmodel.OrderType > 0)
{
......
......@@ -298,9 +298,6 @@ namespace Mall.WebApi.Controllers.User
{
if (orderGoodsItem.CostMoney > 0 && orderGoodsItem.CostFinanceId <= 0)
{
//var newOrderGoods = new RB_Goods_OrderDetail_Extend();
//newOrderGoods = orderGoodsItem;
//newOrderGoods.FinanceType = 1;
var newOrderGoods = new RB_Goods_OrderDetail_Extend
{
FinanceType = 1,
......@@ -311,7 +308,8 @@ namespace Mall.WebApi.Controllers.User
OrderNo = orderGoodsItem.OrderNo,
Id = orderGoodsItem.Id,
CostMoney = orderGoodsItem.CostMoney,
FreightCostMoney = orderGoodsItem.FreightCostMoney
FreightCostMoney = orderGoodsItem.FreightCostMoney,
InsuranceCostMoney = orderGoodsItem.InsuranceCostMoney
};
OrderDetailPaid += ((orderGoodsItem.CostMoney ?? 0) * (orderGoodsItem.Number ?? 0));
result.Add(newOrderGoods);
......@@ -319,11 +317,9 @@ namespace Mall.WebApi.Controllers.User
}
if (demodel.IsSelectAll == 0 || demodel.IsSelectAll == 2)
{
if (orderGoodsItem.FreightCostMoney.HasValue && orderGoodsItem.FreightCostMoney.Value > 0 && orderGoodsItem.FreightFinanceId <= 0)
{
//var newOrderGoods = new RB_Goods_OrderDetail_Extend();
//newOrderGoods = orderGoodsItem;
//newOrderGoods.FinanceType = 2;
var newOrderGoods = new RB_Goods_OrderDetail_Extend
{
FinanceType = 2,
......@@ -334,12 +330,38 @@ namespace Mall.WebApi.Controllers.User
OrderNo = orderGoodsItem.OrderNo,
Id = orderGoodsItem.Id,
CostMoney = orderGoodsItem.CostMoney,
FreightCostMoney = orderGoodsItem.FreightCostMoney
FreightCostMoney = orderGoodsItem.FreightCostMoney,
InsuranceCostMoney = orderGoodsItem.InsuranceCostMoney
};
OrderDetailPaid += (orderGoodsItem.FreightCostMoney ?? 0);
result.Add(newOrderGoods);
}
}
if (demodel.IsSelectAll == 0 || demodel.IsSelectAll == 3)
{
if (orderGoodsItem.InsuranceCostMoney.HasValue && orderGoodsItem.InsuranceCostMoney.Value > 0 && orderGoodsItem.InsuranceFinanceId <= 0)
{
var newOrderGoods = new RB_Goods_OrderDetail_Extend
{
FinanceType = 3,
Final_Price = orderGoodsItem.Final_Price,
Number = 1,
FreightMoney = orderGoodsItem.FreightMoney,
GoodsName = orderGoodsItem.GoodsName,
OrderNo = orderGoodsItem.OrderNo,
Id = orderGoodsItem.Id,
CostMoney = orderGoodsItem.CostMoney,
FreightCostMoney = orderGoodsItem.FreightCostMoney,
InsuranceCostMoney = orderGoodsItem.InsuranceCostMoney
};
OrderDetailPaid += ((orderGoodsItem.InsuranceCostMoney ?? 0) * (orderGoodsItem.Number ?? 0));
result.Add(newOrderGoods);
}
}
RB_Finance_RecordDetail_Extend financeRecordDetail = new RB_Finance_RecordDetail_Extend
{
......@@ -358,6 +380,7 @@ namespace Mall.WebApi.Controllers.User
Unit_Price = orderGoodsItem.CostMoney,
Number = orderGoodsItem.Number,
OrderDetailPaid = OrderDetailPaid,
InsuranceCostMoney = ((orderGoodsItem.InsuranceCostMoney ?? 0) * (orderGoodsItem.Number ?? 0)),
};
record.RecordDetailList.Add(financeRecordDetail);
......@@ -370,17 +393,25 @@ namespace Mall.WebApi.Controllers.User
ECList = ECList.Distinct().ToList();
var detailList = result.Select(x => new
{
CostTypeId = x.FinanceType == 1 ? financeConfigurineModel.CBCostTypeId : financeConfigurineModel.ExpensesCostTypeId,
Number = x.FinanceType == 1 ? x.Number : 1,
OriginalMoney = x.FinanceType == 1 ? ((x.CostMoney ?? 0) * (x.Number ?? 0)) : x.FreightCostMoney,
UnitPrice = x.FinanceType == 1 ? ((x.CostMoney ?? 0)) : x.FreightCostMoney,
CostTypeId = x.FinanceType == 1 ? financeConfigurineModel.CBCostTypeId : (x.FinanceType == 2 ? financeConfigurineModel.ExpensesCostTypeId : financeConfigurineModel.InsuranceCostTypeId),
// CostTypeId = x.FinanceType == 1 ? financeConfigurineModel.CBCostTypeId : financeConfigurineModel.ExpensesCostTypeId,
Number = (x.FinanceType == 1 || x.FinanceType == 3) ? x.Number : 1,
OriginalMoney = x.FinanceType == 1 ? ((x.CostMoney ?? 0) * (x.Number ?? 0)) : (x.FinanceType == 2 ? x.FreightCostMoney : ((x.InsuranceCostMoney ?? 0) * (x.Number ?? 0))),
UnitPrice = x.FinanceType == 1 ? ((x.CostMoney ?? 0)) : (x.FinanceType == 2 ? x.FreightCostMoney : (x.InsuranceCostMoney ?? 0)),
Remark = x.GoodsName + x.Specification + x.OrderNo
});
decimal totalMonry = 0;
if (demodel.IsSelectAll == 0)
{
totalMonry = (result.Where(x => x.FinanceType == 1).Sum(x => ((x.CostMoney ?? 0) * (x.Number ?? 0)))) + (result.Where(x => x.FinanceType == 2).Sum(x => x.FreightCostMoney ?? 0));
if (demodel.OrderClassify == 0)
{
totalMonry = (result.Where(x => x.FinanceType == 1).Sum(x => ((x.CostMoney ?? 0) * (x.Number ?? 0)))) + (result.Where(x => x.FinanceType == 2).Sum(x => x.FreightCostMoney ?? 0));
}
else
{
totalMonry = (result.Where(x => x.FinanceType == 1).Sum(x => ((x.CostMoney ?? 0) * (x.Number ?? 0)))) + (result.Where(x => x.FinanceType == 3).Sum(x => ((x.InsuranceCostMoney ?? 0) * (x.Number ?? 0))));
}
}
else if (demodel.IsSelectAll == 1)
{
......@@ -390,10 +421,14 @@ namespace Mall.WebApi.Controllers.User
{
totalMonry = result.Where(x => x.FinanceType == 2).Sum(x => (x.FreightCostMoney ?? 0));
}
else if (demodel.IsSelectAll == 3)
{
totalMonry = result.Where(x => x.FinanceType == 2).Sum(x => ((x.InsuranceCostMoney ?? 0) * (x.Number ?? 0)));
}
var financeObj = new
{
CreateBy = demodel.FinanceCreateBy == 0 ? Config.ExpendDirector : demodel.FinanceCreateBy.ToString(),
IsPublic = demodel.IsPublic,// supplierModel.ClientBankAccount.AccountType, //financeConfigurineModel.AccountType,
IsPublic = demodel.IsPublic,
ClientType = supplierModel.ClientBankAccount.Type,
ClientID = supplierModel.BankAccountId,
CurrencyId = financeConfigurineModel.CurrencyId,
......
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