diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MakeCanSettlementService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MakeCanSettlementService.cs index 52839e8b..872eefb0 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MakeCanSettlementService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MakeCanSettlementService.cs @@ -133,32 +133,39 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs itm2.SetGroupNum(billNum); billDetails.Add(itm2); } + + var test = details.Sum(p => p.Price * p.Qty); + + var count = details.Count; + details = new List(); - sum = 0; + sum = itm1.Qty * itm1.Price; } - var _detailEntity = new BBAC_CAN_SA_DETAIL( - guid: GuidGenerator.Create(), - keyCode: itm1.KeyCode, - version: itm1.Version, - billNum: string.Empty, - settleBillNum: itm1.SettleBillNum, - lU: itm1.LU, - pN: itm1.PN, - site: itm1.Site, - qty: itm1.Qty, - price: itm1.Price, - category: itm1.BusinessType, - isReturn: itm1.IsReturn, - settleDate: itm1.SettleDate, - groupNum: itm1.GroupNum, - invGroupNum: string.Empty, - contactid: itm1.ContractDocID, - invbillnum: string.Empty, - partcode: itm1.PartCode - ); - _detailEntity.RealPartCode = itm1.RealPartCode; - details.Add(_detailEntity); - + + var _detailEntity = new BBAC_CAN_SA_DETAIL( + guid: GuidGenerator.Create(), + keyCode: itm1.KeyCode, + version: itm1.Version, + billNum: string.Empty, + settleBillNum: itm1.SettleBillNum, + lU: itm1.LU, + pN: itm1.PN, + site: itm1.Site, + qty: itm1.Qty, + price: itm1.Price, + category: itm1.BusinessType, + isReturn: itm1.IsReturn, + settleDate: itm1.SettleDate, + groupNum: itm1.GroupNum, + invGroupNum: string.Empty, + contactid: itm1.ContractDocID, + invbillnum: string.Empty, + partcode: itm1.PartCode + ); + _detailEntity.RealPartCode = itm1.RealPartCode; + details.Add(_detailEntity); + + } var billNum1 = OrderNumberGenerator.GenerateOrderNumber("N"); var bbac_sa1 = new BBAC_CAN_SA(); @@ -271,7 +278,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs List details = new List(); foreach (var itm1 in ls) { - + sum += (itm1.Qty * itm1.Price); + if (sum > 10000000) { var billNum = OrderNumberGenerator.GenerateOrderNumber("N"); @@ -291,11 +299,14 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs itm2.SetGroupNum(billNum); billDetails.Add(itm2); } + + var test = details.Sum(p => p.Price * p.Qty); + details = new List(); - sum = 0; - + sum = itm1.Qty * itm1.Price; + } - sum += (itm1.Qty * itm1.Price); + var _detailEntity = new BBAC_CAN_SA_DETAIL( guid: GuidGenerator.Create(), keyCode: itm1.KeyCode, @@ -527,7 +538,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs billDetails.Add(itm2); } details = new List(); - sum = 0; + sum = itm1.Qty * itm1.Price; } var _detailEntity = new HBPO_CAN_SA_DETAIL( guid: GuidGenerator.Create(), diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_NOT_SA_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_NOT_SA_MNG.cs index f1dd6127..a34b0408 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_NOT_SA_MNG.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_NOT_SA_MNG.cs @@ -367,7 +367,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers billDetails.Add(itm2); } details = new List(); - sum = 0; + sum = (itm1.Qty * itm1.Price); } } var billNum1 = OrderNumberGenerator.GenerateOrderNumber("N");