diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs index 780451e4..90702998 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs @@ -159,9 +159,6 @@ namespace Win.Sfs.SettleAccount.Bases var sdtos = ObjectMapper.Map, List>(s); if (invs.FirstOrDefault().BusinessType == EnumBusinessType.JisBBAC) { - - - var A = await _wRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount); var AMap = ObjectMapper.Map, List>(A); var wquery = from itm in AMap @@ -199,7 +196,7 @@ namespace Win.Sfs.SettleAccount.Bases join itm1 in invs on itm.InvbillNum equals itm1.InvbillNum join itm2 in materialList on itm.LU equals itm2.SettleMaterialCode into temp from tm in temp.DefaultIfEmpty() - select + select new INVOICE_WAIT_DETAIL_BJ_DTO() { PartDesc = tm == null ? string.Empty : itm.PartDesc, @@ -228,7 +225,7 @@ namespace Win.Sfs.SettleAccount.Bases join itm1 in invs on itm.InvbillNum equals itm1.InvbillNum join itm2 in materialList on itm.LU equals itm2.SettleMaterialCode into temp from tm in temp.DefaultIfEmpty() - select + select new INVOICE_WAIT_DETAIL_DTO() { PartDesc = tm == null ? string.Empty : itm.PartDesc, @@ -291,7 +288,6 @@ namespace Win.Sfs.SettleAccount.Bases KeyCode = itm.KeyCode, Price = itm.Price }; - entity.INVOICE_NOT_SETTLE = notquery.ToList(); entity.INVOICE_MAP_GROUP = mquery.ToList(); entity.ADJ_DETAIL = adjQuery.ToList(); @@ -345,7 +341,6 @@ namespace Win.Sfs.SettleAccount.Bases bool issuc= await _invMng.Reject(p_invGroupNum); if (issuc == true) { - return new JsonResult(new { Code = 200, Message = "退回成功" }); } @@ -425,7 +420,6 @@ namespace Win.Sfs.SettleAccount.Bases protected virtual async Task GetInvoiceGroupByInvBillNum(string p_invbillNum) { List filters = new List(); - filters.Add(new FilterCondition("InvBillNum", p_invbillNum, EnumFilterAction.Equal, EnumFilterLogic.And)); var ls = await _repository.GetListByFilterAsync(filters); if (ls != null && ls.Count() > 0) 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 1274ca6c..fa051e96 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 @@ -392,9 +392,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { throw new UserFriendlyException($"选择发票:{invbillnum}状态在财务审核后可以报废重开,之前请退回重开!", "400"); } - var bbaclist = await _bbacMng.GetContainsAsync(inv.InvbillNum);//结算分组对应结算零件 - //var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 + //var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 if (adjlist != null && adjlist.Count() > 0) { foreach (var itm in adjlist) @@ -557,7 +556,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var entitys = bbaclist;//合并库存调整单和就发票可结算明细数据 var gNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); var priceList = _priceRepository.ToList();//价格单 - var dto1s = ObjectMapper.Map, List>(entitys); var q = from d in dto1s join p in priceList on d.LU equals p.LU @@ -617,7 +615,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { var entities = await ReissueSecInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum); var ls = ObjectMapper.Map, List>(entities); - var invlist = ls.Select(p => p.InvbillNum).Distinct(); foreach (var itm in invlist) { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs index de8aabdc..0ce20c2f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs @@ -14,6 +14,7 @@ using System; using System.Collections; using System.Collections.Generic; using System.Linq; +using System.Runtime.InteropServices; using System.Security.Policy; using System.Text; using System.Text.Json; @@ -1237,6 +1238,24 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers groupList.AddRange(group1); } + string site = dtos.FirstOrDefault().Site; + string clientCode = string.Empty; + + switch (clientCode) + { + case "1040": + clientCode = "C001"; + break; + case "1046": + clientCode = "C171"; + break; + default: + clientCode = "C004"; + break; + + } + + var invbill = new INVOICE_GRP (guid: GuidGenerator.Create(), realnvBillNum: string.Empty, @@ -1248,16 +1267,18 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers invGroupNum: p_InvGroupNum, state: SettleBillState.已开票, invoiceBillState: InvoiceBillState.正常, - tax: 0, + tax: 0.13m, parent: p_parentInvBillNum, preTaxDiff: 0, taxDiff: 0, clientCode: string.Empty, realAmt: readAmt - - ); + invbill.ClientCode = clientCode; + + + invbill.Site = dtos.FirstOrDefault().Site; invlist.Add(invbill); } @@ -1479,13 +1500,33 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers invGroupNum: p_InvGroupNum, state: SettleBillState.已开票, invoiceBillState: InvoiceBillState.正常, - tax: 0, + tax: 0.13m, parent: string.Empty, preTaxDiff: 0, taxDiff: 0, clientCode: string.Empty, realAmt: realAmt + ); + string site = dtos.FirstOrDefault().Site; + string clientCode = string.Empty; + + switch(clientCode) + { + case "1040": + clientCode = "C001"; + break; + case "1046": + clientCode = "C171"; + break; + default: + clientCode = "C004"; + break; + + } + + + invbill.ClientCode = clientCode; invbill.Site= dtos.FirstOrDefault().Site; invbill.CreationTime = DateTime.Now; invlist.Add(invbill); @@ -1748,7 +1789,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers invGroupNum: p_InvGroupNum, state: SettleBillState.已开票, invoiceBillState: InvoiceBillState.正常, - tax: 0, + tax: 0.13m, parent: p_parentInvBillNum, preTaxDiff:0, taxDiff:0, @@ -1965,6 +2006,25 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers notDetialList.AddRange(innotls); } } + string site = dtos.FirstOrDefault().Site; + string clientCode = string.Empty; + + switch (clientCode) + { + case "1040": + clientCode = "C001"; + break; + case "1046": + clientCode = "C171"; + break; + default: + clientCode = "C004"; + break; + + } + + + var invbill = new INVOICE_GRP (guid: GuidGenerator.Create(), realnvBillNum: string.Empty, @@ -1976,7 +2036,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers invGroupNum: p_InvGroupNum, state: SettleBillState.已开票, invoiceBillState: InvoiceBillState.正常, - tax: 0, + tax: 0.13m, parent: string.Empty, preTaxDiff: 0, taxDiff: 0, @@ -1984,6 +2044,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers realAmt: realAmt ); invbill.Site = dtos.FirstOrDefault().Site; + invbill.ClientCode = clientCode; invbill.CreationTime = DateTime.Now; invlist.Add(invbill); } @@ -2309,7 +2370,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers invGroupNum: p_InvGroupNum, state: SettleBillState.已开票, invoiceBillState: InvoiceBillState.正常, - tax: 0, + tax: 0.13m, parent: string.Empty, preTaxDiff: 0, taxDiff: 0, @@ -2317,6 +2378,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers realAmt: 0 ); invbill.CreationTime = DateTime.Now; + invbill.ClientCode = "C001"; invlist.Add(invbill); } await _repository.DbContext.BulkInsertAsync(invlist);