diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs index a5a73071..1274ca6c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs @@ -393,7 +393,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ throw new UserFriendlyException($"选择发票:{invbillnum}状态在财务审核后可以报废重开,之前请退回重开!", "400"); } - var bbaclist = await _bbacMng.GetContainsAsync(inv.InvbillNum, "400");//结算分组对应结算零件 + var bbaclist = await _bbacMng.GetContainsAsync(inv.InvbillNum);//结算分组对应结算零件 //var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 if (adjlist != null && adjlist.Count() > 0) { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs index 8abb4418..49cdd0f5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs @@ -117,8 +117,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ invbillnum: string.Empty, partcode: itm.PartCode, pobillnum:string.Empty - - )); } } @@ -126,8 +124,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var gNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); //var groupNumList = entitys.Select(p => new { p.GroupNum).Distinct().ToList(); //var notList = _notRepository.Where(p => gNumList.Contains(p.GroupNum)).ToList();//不能结算 - - List priceList = new List(); if (inv.BusinessType == EnumBusinessType.BeiJian) { @@ -327,14 +323,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ /// public virtual async Task ReissueInvoiceListExt(List p_list) { - - var result = await _adjservice.CheckImport(p_list); if (result != "OK") { return new JsonResult(new { Code = 400, Message = "请下载错误模版", fileName = result }); } - var first = p_list.FirstOrDefault(); var invbillnum = first.InvBillNum; var invBilllist = new List(); @@ -344,7 +337,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { throw new UserFriendlyException($"调整表无数据!", "400"); } - //var mappingList = await GetMapGroupAsync(invbillnum);//发票对应结算分组 //if (mappingList != null && mappingList.Count() > 0) //{ @@ -439,9 +431,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ if (invbillnum.Substring(0, 3) == "INV")//一次开票重开 { var entities = await ReissueFirstInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum); - ls = ObjectMapper.Map, List>(entities); - var invlist = ls.Select(p => p.InvbillNum).Distinct(); foreach (var itm in invlist) { @@ -497,7 +487,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ // throw new UserFriendlyException($"不存发票号:{invbillnum}对应的结算分组号"); //} return new JsonResult(new { Code = 200, Message = "生成成功", Data = invBilllist }); - } @@ -505,14 +494,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ [UnitOfWork(false)] public virtual async Task ReissueInvoiceList(List p_list) { - - var result = await _adjservice.CheckImport(p_list); if (result != "OK") { return new JsonResult(new { Code = 400, Message = "请下载错误模版", fileName = result }); } - var first = p_list.FirstOrDefault(); var invbillnum = first.InvBillNum; var invBilllist = new List(); @@ -522,16 +508,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { throw new UserFriendlyException($"调整表无数据!", "400"); } - //var mappingList = await GetMapGroupAsync(invbillnum);//发票对应结算分组 //if (mappingList != null && mappingList.Count() > 0) //{ var version = int.Parse(DateTime.Now.ToString("yyyymm")); //var gList = mappingList.Select(p => p.SettleGroupNum).ToList();//获取发票所有结算分组 var inv = await GetInvoiceGroupByInvBillNum(invbillnum); - var settle = await _pubMng.GetMainAsync(inv.InvGroupNum); - if (settle == null) { throw new UserFriendlyException($"选择发票:{invbillnum}对应的可结算单不在请检查!", "400"); @@ -565,11 +548,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ qty: itm.Qty, price: itm.Price, businessType: itm.BusinessType, - settleDate: itm.SettleDate, groupNum: itm.GroupNum, invGroupNum: itm.InvGroupNum, - invbillnum: string.Empty, partcode: itm.PartCode, pobillnum: string.Empty @@ -617,55 +598,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ if (invbillnum.Substring(0, 3) == "INV")//一次开票重开 { var entities = await ReissueFirstInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum); - ls = ObjectMapper.Map, List>(entities); - invBilllist.AddRange(ls.ToList()); - - //var invlist = ls.Select(p => p.InvbillNum).Distinct(); - //foreach (var itm in invlist) - //{ - // var invBill = new INVOICE_REPEAT_DTO(); - // var invls = ls.Where(p => p.InvbillNum == itm).ToList(); - // var entitylist = entities.Where(p => p.InvbillNum == itm).ToList(); - // var tax = inv.Tax;//税率 - // var amt = entitylist.Sum(p => p.Amt);//税前 - // var taxamt = amt + Math.Round(amt * tax, 2);//税后 - // var realamt = Math.Round(amt * tax, 2);//税额 - // invBill.Amt = amt; - // invBill.TaxAmt = taxamt; - // invBill.Tax = tax; - // invBill.BusinessType = inv.BusinessType; - // invBill.DETAIL = invls; - // invBill.RealAmt = realamt; - // invBilllist.Add(invBill); - //} } else//二次开票 { var entities = await ReissueSecInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum); ls = ObjectMapper.Map, List>(entities); - //var invlist = ls.Select(p => p.InvbillNum).Distinct(); - //foreach (var itm in invlist) - //{ - // var invBill = new INVOICE_REPEAT_DTO(); - // var invls = ls.Where(p => p.InvbillNum == itm).ToList(); - // var entitylist = entities.Where(p => p.InvbillNum == itm).ToList(); - // var tax = inv.Tax;//税率 - // var amt = entitylist.Sum(p => p.Amt);//税前 - // var taxamt = amt + Math.Round(amt * tax, 2);//税后 - // var realamt = Math.Round(amt * tax, 2);//税额 - // invBill.Amt = amt; - // invBill.TaxAmt = taxamt; - // invBill.Tax = tax; - // invBill.BusinessType = inv.BusinessType; - // invBill.DETAIL = invls; - // invBill.RealAmt = realamt; - // invBilllist.Add(invBill); - //} invBilllist.AddRange(ls.ToList()); - } } }