Commit ba73be59 authored by liudong1993's avatar liudong1993

报价单 收支明细

parent 6f42368a
......@@ -292,6 +292,10 @@ namespace Edu.Model.Entity.Finance
/// 23 电商erp已发货退货退款 2020-09-15 ld
/// 24 电商erp未发货退款(制单就原路退款) 2020-09-15 ld
/// 25 和平甲鹤 已复制单据
/// 26 教育教师奖金单据
/// 27 教育教师绩效单据 2020-12-18 ld
/// 28 教育退课单据 2020-12-23 ld
/// 29 教育报价单-订单 2021-03-15 ld
/// </summary>
public int? OtherType { get => otherType; set => otherType = value; }
......
......@@ -91,6 +91,14 @@ namespace Edu.Repository.Finance
{
where += string.Format(" AND A." + nameof(RB_Finance.FinanceType) + " ={0}", model.FinanceType);
}
if (model.OtherType > 0)
{
where += string.Format(" AND A." + nameof(RB_Finance.OtherType) + " ={0}", model.OtherType);
}
if (model.ReFinanceId > 0)
{
where += string.Format(" AND A." + nameof(RB_Finance.ReFinanceId) + " ={0}", model.ReFinanceId);
}
if (model.Status > 0)
{
where += string.Format(" AND A." + nameof(RB_Finance.Status) + " ={0}", (int)model.Status);
......
......@@ -574,5 +574,56 @@ namespace Edu.WebApi.Controllers.Finance
return "";
}
}
#region 获取报价单单据列表
/// <summary>
/// 获取报价单收支明细
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public ApiResult GetOfferOrderBalanceSheet()
{
int OfferId = base.ParmJObj.GetInt("OfferId", 0);
if (OfferId <= 0)
{
return ApiResult.Failed("班级Id不存在");
}
RB_Finance_Extend model = new RB_Finance_Extend() { OtherType = 29, ReFinanceId = OfferId, OrderSource = OrderResourceEnum.Education, RB_Group_Id = base.UserInfo.Group_Id, FinanceType = 2, IsSelectNormal = 1 };
var financeList = financeModule.GetFinanceInfoList(model);
var recultFiniceList = financeList.Select(x => new
{
x.FrID,
x.Type,
x.TCID,
x.OrderID,
x.Money,
x.PayMoney,
AirTotalMoney = x.AirTotalMoney ?? 0,
AirTotalPayMoney = x.AirTotalPayMoney ?? 0,
CostTypeList = x.CostTypeList.Distinct().ToList(),
x.OrderSource,
AuditList = x.AuditList.Select(t => new { t.AuditEmId, t.AuditEmName, AuditDate = t.AuditDate.HasValue ? t.AuditDate.Value.ToString("yyyy/MM/dd") : "" }),
StatusStr = EnumHelper.ToName(x.Status.Value),
x.RB_CreateByName,
CreateDate = x.CreateDate.Value.ToString("yyyy-MM-dd"),
TradeDate = x.TradeDate.HasValue ? x.TradeDate.Value.ToString("yyyy-MM-dd") : "",
TradeWayList = x.BankList?.Select(y => new { y.AccountType, y.Alias, y.BankNo, TypeName = EnumHelper.ToName(y.Type), y.CurrencyName, y.OriginalMoney, y.Money, y.Rate })
});
var resultData = new
{
IncomeList = recultFiniceList.Where(t => t.Type == WFTempLateClassEnum.IN),//学费收入
ExpendList = recultFiniceList.Where(t => t.Type == WFTempLateClassEnum.OUT),//其他支出
IncomeReceive = recultFiniceList.Where(t => t.Type == WFTempLateClassEnum.IN).Sum(x => x.Money),
IncomeActual = recultFiniceList.Where(t => t.Type == WFTempLateClassEnum.IN).Sum(x => x.PayMoney),
ExpendReceive = recultFiniceList.Where(t => t.Type == WFTempLateClassEnum.OUT).Sum(x => x.Money),
ExpendActual = recultFiniceList.Where(t => t.Type == WFTempLateClassEnum.OUT).Sum(x => x.PayMoney)
};
return ApiResult.Success("", resultData);
}
#endregion
}
}
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