diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/FawtygAutoMapperProfile.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/FawtygAutoMapperProfile.cs index 5cdb32ef2..e526956e1 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/FawtygAutoMapperProfile.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/FawtygAutoMapperProfile.cs @@ -60,7 +60,6 @@ public class FawtygAutoMapperProfile : Profile .Ignore(x => x.Details) .Ignore(x => x.ExtraProperties) .Ignore(x => x.Status) - .Ignore(x => x.RpNumber) .Ignore(x => x.DockCode) .Ignore(x => x.Remark) @@ -69,6 +68,7 @@ public class FawtygAutoMapperProfile : Profile ; CreateMap() + .ForMember(x => x.RecommendErpCode, y => y.MapFrom(d => d.LocationErpCode)) .Ignore(x => x.ItemName) .Ignore(x => x.ItemDesc1) .Ignore(x => x.ItemDesc2) diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/DictConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/DictConverter.cs index 0499c7eae..b1db11002 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/DictConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/DictConverter.cs @@ -46,7 +46,7 @@ public class DictConverter : IIncomingConverter var materialRequestList = await BuildIncomingToWmsOfDictRequestAsync(incomingFromExternalList).ConfigureAwait(false); await _incomingToWmsManager.CreateBulkAsync(materialRequestList).ConfigureAwait(false); //归档 - await _incomingFromExternalManager.ArchiveBulkAsync(incomingFromExternalList).ConfigureAwait(false); + await _incomingFromExternalManager.ArchiveManyAsync(incomingFromExternalList).ConfigureAwait(false); } private async Task> BuildIncomingToWmsOfDictRequestAsync(List incomingDataList) diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsWorker.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsWorker.cs index 9fc4f4695..907622f56 100644 --- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsWorker.cs +++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsWorker.cs @@ -88,7 +88,7 @@ public class IncomingToWmsWorker : AsyncPeriodicBackgroundWorkerBase await incomingToWms.HandleItemsAsync(workerContext).ConfigureAwait(false); break; case EnumIncomingDataType.Location: - await incomingToWms.HandleErpLocationsAsync(workerContext).ConfigureAwait(false); + await incomingToWms.HandleErpLocationsAsync(workerContext).ConfigureAwait(false); break; case EnumIncomingDataType.Bom: await incomingToWms.HandleBomsAsync(workerContext).ConfigureAwait(false); diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/ItemBasic/ItemBasicExchangeDto.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/ItemBasic/ItemBasicExchangeDto.cs index 4183180f5..f2bf0a16c 100644 --- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/ItemBasic/ItemBasicExchangeDto.cs +++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/ItemBasic/ItemBasicExchangeDto.cs @@ -68,6 +68,12 @@ public class ItemBasicExchangeDto [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] public string AbcClass { get; set; } + /// + /// 管理类型 + /// + [Display(Name = "管理类型")] + public EnumItemManageType ManageType { get; set; } = EnumItemManageType.Batch; + public override bool Equals(object obj) { if (obj is ItemBasicExchangeDto) diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/ItemBasics/Inputs/ItemBasicImportInput.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/ItemBasics/Inputs/ItemBasicImportInput.cs index 02db0e15a..3a847cf3d 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/ItemBasics/Inputs/ItemBasicImportInput.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/ItemBasics/Inputs/ItemBasicImportInput.cs @@ -79,10 +79,10 @@ public class ItemBasicImportInput : SfsBaseDataImportInputBase /// 类型 /// [Display(Name = "类型")] - [ValueMapping("成品", "成品")] - [ValueMapping("原料", "原料")] - [ValueMapping("物料", "物料")] - [ValueMapping("半成品", "半成品")] + [ValueMapping("10C01", "10C01")] + [ValueMapping("10C02", "10C02")] + [ValueMapping("10C03", "10C03")] + [ValueMapping("10C04", "10C04")] public string Type { get; set; } /// diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Locations/LocationAutoMapperProfile.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Locations/LocationAutoMapperProfile.cs index 5bbeca507..492e50342 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Locations/LocationAutoMapperProfile.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Locations/LocationAutoMapperProfile.cs @@ -17,22 +17,22 @@ public partial class BasedataApplicationAutoMapperProfile : Profile .Ignore(x => x.TenantId) .Ignore(x => x.ExtraProperties) .Ignore(x => x.ConcurrencyStamp) - .Ignore(x => x.EnableMixItem) - .Ignore(x => x.EnableMixLot) - .Ignore(x => x.EnableMixStatus) - .Ignore(x => x.EnableNegative) - .Ignore(x => x.EnableKeepZero) - .Ignore(x => x.EnableOpportunityCount) - .Ignore(x => x.EnablePick) - .Ignore(x => x.EnableOverPick) - .Ignore(x => x.EnableWholeStore) - .Ignore(x => x.EnableBreakStore) - .Ignore(x => x.EnableShip) - .Ignore(x => x.EnableReceive) - .Ignore(x => x.EnableReturnToSupplier) - .Ignore(x => x.EnableReturnFromCustomer) - .Ignore(x => x.EnableSplitPallet) - .Ignore(x => x.EnableSplitBox) + //.Ignore(x => x.EnableMixItem) + //.Ignore(x => x.EnableMixLot) + //.Ignore(x => x.EnableMixStatus) + //.Ignore(x => x.EnableNegative) + //.Ignore(x => x.EnableKeepZero) + //.Ignore(x => x.EnableOpportunityCount) + //.Ignore(x => x.EnablePick) + //.Ignore(x => x.EnableOverPick) + //.Ignore(x => x.EnableWholeStore) + //.Ignore(x => x.EnableBreakStore) + //.Ignore(x => x.EnableShip) + //.Ignore(x => x.EnableReceive) + //.Ignore(x => x.EnableReturnToSupplier) + //.Ignore(x => x.EnableReturnFromCustomer) + //.Ignore(x => x.EnableSplitPallet) + //.Ignore(x => x.EnableSplitBox) ; diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/SupplierTimeWindows/SupplierTimeWindowAutoMapperProfile.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/SupplierTimeWindows/SupplierTimeWindowAutoMapperProfile.cs index 8886ae52e..23e93166e 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/SupplierTimeWindows/SupplierTimeWindowAutoMapperProfile.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/SupplierTimeWindows/SupplierTimeWindowAutoMapperProfile.cs @@ -17,11 +17,10 @@ public partial class BasedataApplicationAutoMapperProfile : Profile .Ignore(x => x.TenantId) .Ignore(x => x.ExtraProperties) .Ignore(x => x.ConcurrencyStamp) - .Ignore(x => x.SupplierName) ; CreateMap() - .Ignore(x => x.ReportStatus) + .Ignore(x => x.ReportStatus) .Ignore(x => x.ReportReason); } } diff --git a/be/Modules/Shared/src/Win_in.Sfs.Shared.Application/SfsCrudWithDetailsAppServiceBase.cs b/be/Modules/Shared/src/Win_in.Sfs.Shared.Application/SfsCrudWithDetailsAppServiceBase.cs index fd6654cd6..64a9ac7db 100644 --- a/be/Modules/Shared/src/Win_in.Sfs.Shared.Application/SfsCrudWithDetailsAppServiceBase.cs +++ b/be/Modules/Shared/src/Win_in.Sfs.Shared.Application/SfsCrudWithDetailsAppServiceBase.cs @@ -772,8 +772,11 @@ public abstract class SfsCrudWithDetailsAppServiceBase p.Name == "Worker"); - first.SetValue(first, CurrentUser.GetUserName()); + if (entity.GetProps().Any(p => p.Name == "Worker")) + { + var first = entity.GetProps().First(p => p.Name == "Worker"); + first.SetValue(first, CurrentUser.GetUserName()); + } } var hasEntity = entity != null; diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/PurchaseReceiptRequests/IPurchaseReceiptRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/PurchaseReceiptRequests/IPurchaseReceiptRequestAppService.cs index 07a28912f..8cb796843 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/PurchaseReceiptRequests/IPurchaseReceiptRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/PurchaseReceiptRequests/IPurchaseReceiptRequestAppService.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using System.Threading.Tasks; using Win_in.Sfs.Shared.Application.Contracts; +using Win_in.Sfs.Shared.Domain.Shared; namespace Win_in.Sfs.Wms.Store.Application.Contracts; @@ -29,4 +30,13 @@ public interface IPurchaseReceiptRequestAppService /// Task GetDetailByItemAndPackingAsync(string itemCode, string packingCode); + + /// + /// 修改请求状态 + /// + /// + /// + /// + Task UpdatePurchaseReceiptRequestAsync(string number, + EnumRequestStatus enumRequestStatus); } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReceiptRequests/PurchaseReceiptRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReceiptRequests/PurchaseReceiptRequestAppService.cs index ded767df5..59210677d 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReceiptRequests/PurchaseReceiptRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReceiptRequests/PurchaseReceiptRequestAppService.cs @@ -4,9 +4,11 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Volo.Abp.ObjectMapping; using Volo.Abp.Uow; using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Label.Application.Contracts; +using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Domain; using Win_in.Sfs.Wms.Store.Domain.Shared; @@ -120,6 +122,22 @@ public class PurchaseReceiptRequestAppService : return ObjectMapper.Map, List>(entity); } + /// + /// 修改请求状态 + /// + /// + /// + /// + [HttpGet("update-request-status")] + public virtual async Task UpdatePurchaseReceiptRequestAsync(string number, + EnumRequestStatus enumRequestStatus) + { + var entity=await _repository.GetAsync(p => p.Number == number).ConfigureAwait(false); + entity.RequestStatus=enumRequestStatus; + entity= await _repository.UpdateAsync(entity).ConfigureAwait(false); + return ObjectMapper.Map(entity); + } + protected override Func GetEntityExpression() { throw new NotImplementedException(); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/InspectJobs/InspectJobManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/InspectJobs/InspectJobManager.cs index 68e6f5e97..dd44a42dc 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/InspectJobs/InspectJobManager.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/InspectJobs/InspectJobManager.cs @@ -148,8 +148,11 @@ public class InspectJobManager : SfsJobManagerBase }); var goodqty = jobEntity.Details.Where(p => - p.DetailInspectStatus == EnumDetailInspectStatus.DefaultOK || - p.DetailInspectStatus == EnumDetailInspectStatus.OK).Sum(p => p.GoodQty); + (p.DetailInspectStatus == EnumDetailInspectStatus.DefaultOK || + p.DetailInspectStatus == EnumDetailInspectStatus.OK) + && p.ItemCode == input.ItemCode + && p.Lot == input.Lot) + .Sum(p => p.GoodQty); //获取 汇总详情 var summaryDetailEntity = jobEntity.SummaryDetails.Find(p => p.Id == summaryDetailId); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ProductReceiptNotes/ProductReceiptNoteManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ProductReceiptNotes/ProductReceiptNoteManager.cs index 5b6caa107..855f7519d 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ProductReceiptNotes/ProductReceiptNoteManager.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ProductReceiptNotes/ProductReceiptNoteManager.cs @@ -42,7 +42,7 @@ public class ProductReceiptNoteManager : SfsStoreManagerBase CreateAsync(ProductReceiptNote productReceiptNote) { - if (string.IsNullOrEmpty(productReceiptNote.ProductionPlanNumber) == false) + if (string.IsNullOrEmpty(productReceiptNote.ProductionPlanNumber) == false) { //更新生产计划 var productionPlan = await _productionPlanRepository.FindAsync(c => c.Number == productReceiptNote.ProductionPlanNumber, true).ConfigureAwait(false); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Orders/PurchaseOrders/PurchaseOrderManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Orders/PurchaseOrders/PurchaseOrderManager.cs index 721b1c17c..965a025b8 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Orders/PurchaseOrders/PurchaseOrderManager.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Orders/PurchaseOrders/PurchaseOrderManager.cs @@ -54,7 +54,6 @@ public class PurchaseOrderManager : SfsStoreManagerBase eventData) @@ -30,7 +40,7 @@ public class ProductReceiptNoteEventHandler { var inboundTransactions = new List(); - inboundTransactions.AddRange(BuildTransactions(productReceiptNote)); + inboundTransactions.AddRange(await BuildTransactions(productReceiptNote)); await TransactionAppService.AddManyAsync(inboundTransactions).ConfigureAwait(false); @@ -51,13 +61,13 @@ public class ProductReceiptNoteEventHandler //如果要做库存事务汇总,可以修改此处 foreach (var productReceiptNote in productReceiptNotes) { - inboundTransactions.AddRange(BuildTransactions(productReceiptNote)); + inboundTransactions.AddRange(await BuildTransactions(productReceiptNote)); } await TransactionAppService.AddManyAsync(inboundTransactions).ConfigureAwait(false); } - private List BuildTransactions(ProductReceiptNote productReceiptNote) + private async Task> BuildTransactions(ProductReceiptNote productReceiptNote) { var transactionCreateInputs = new List(); //构造库存入库创建Input @@ -65,6 +75,21 @@ public class ProductReceiptNoteEventHandler { var transaction = ObjectMapper.Map(detail); + var itemBasicDto= await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); + ; + detail.ItemDesc1 = itemBasicDto.Desc1; + detail.ItemDesc2 = itemBasicDto.Desc2; + detail.ItemName=itemBasicDto.Name; + detail.StdPackQty=itemBasicDto.StdPackQty; + + var erpLocationDtos= await _locationAppService.GetListByTypesAndErpCodeAsync(new List { EnumLocationType.WIP }, + detail.LocationErpCode).ConfigureAwait(false); + var erpLocationDto = erpLocationDtos.First(); + detail.LocationArea = erpLocationDto.Code; + detail.LocationGroup = erpLocationDto.LocationGroupCode; + detail.LocationErpCode= erpLocationDto.Code; + detail.LocationCode= erpLocationDto.Code; + transaction.TransType = TransType; transaction.TransInOut = TransInOut; transaction.WarehouseCode = productReceiptNote.WarehouseCode; diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/PurchaseReceiptNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/PurchaseReceiptNoteEventHandler.cs index 719171fa8..4bf33466c 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/PurchaseReceiptNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/PurchaseReceiptNoteEventHandler.cs @@ -30,6 +30,7 @@ public class PurchaseReceiptNoteEventHandler private readonly IPurchaseOrderAppService _purchaseOrderAppService; private readonly IItemQualityAppService _itemQualityAppService; private readonly ISupplierAsnAppService _supplierAsnAppService; + private readonly IPurchaseReceiptRequestAppService _purchaseReceiptRequestAppService; /// /// 收货记录 @@ -41,12 +42,14 @@ public class PurchaseReceiptNoteEventHandler IInspectRequestAppService inspectRequestAppService, IPurchaseOrderAppService purchaseOrderAppService, IItemQualityAppService itemQualityAppService, - ISupplierAsnAppService supplierAsnAppService) + ISupplierAsnAppService supplierAsnAppService, + IPurchaseReceiptRequestAppService purchaseReceiptRequestAppService) { _inspectRequestAppService = inspectRequestAppService; _purchaseOrderAppService = purchaseOrderAppService; _itemQualityAppService = itemQualityAppService; _supplierAsnAppService = supplierAsnAppService; + _purchaseReceiptRequestAppService = purchaseReceiptRequestAppService; } /// @@ -70,6 +73,9 @@ public class PurchaseReceiptNoteEventHandler //更新订单已收货数量 await UpdatePurchaseOrderAsync(entity).ConfigureAwait(false); + //更新收货请求状态 + await UpdatePurchaseReceiptRequest(entity.PurchaseReceiptRequestNumber).ConfigureAwait(false); + //更新发货单状态 await UpdateSupplierAsnAsync(entity.AsnNumber).ConfigureAwait(false); } @@ -108,6 +114,16 @@ public class PurchaseReceiptNoteEventHandler await _supplierAsnAppService.UpdateStatusAsync(asnNumber,EnumSupplierAsnStatus.Received).ConfigureAwait(false); } + /// + /// 更新发货请求状态 + /// + /// + /// + private async Task UpdatePurchaseReceiptRequest(string purchaseReceiptRequestNumber) + { + await _purchaseReceiptRequestAppService.UpdatePurchaseReceiptRequestAsync(purchaseReceiptRequestNumber,EnumRequestStatus.Completed).ConfigureAwait(false); + } + #region 私有 /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/PurchaseReturnNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/PurchaseReturnNoteEventHandler.cs index 0c5f36fa1..d71e51a92 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/PurchaseReturnNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/PurchaseReturnNoteEventHandler.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Threading.Tasks; using Volo.Abp.EventBus; using Volo.Abp.Uow; +using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Label.Application.Contracts; using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Shared.Event; @@ -27,15 +28,18 @@ public class PurchaseReturnNoteEventHandler private readonly IPurchaseReturnRequestAppService _purchaseReturnRequestApp; private readonly IPurchaseOrderAppService _purchaseOrderAppService; private readonly IInventoryLabelAppService _inventoryLabelAppService; + private readonly IItemBasicAppService _itemBasicAppService; public PurchaseReturnNoteEventHandler( IPurchaseReturnRequestAppService purchaseReturnRequestApp , IPurchaseOrderAppService purchaseOrderAppService, - IInventoryLabelAppService inventoryLabelAppService) + IInventoryLabelAppService inventoryLabelAppService, + IItemBasicAppService itemBasicAppService) { _purchaseReturnRequestApp = purchaseReturnRequestApp; _purchaseOrderAppService = purchaseOrderAppService; _inventoryLabelAppService = inventoryLabelAppService; + _itemBasicAppService = itemBasicAppService; } [UnitOfWork] @@ -81,7 +85,7 @@ public class PurchaseReturnNoteEventHandler { var inboundTransactions = new List(); - inboundTransactions.AddRange(BuildTransactions(purchaseReturnNote)); + inboundTransactions.AddRange(await BuildTransactions(purchaseReturnNote).ConfigureAwait(false)); await TransactionAppService.AddManyAsync(inboundTransactions).ConfigureAwait(false); @@ -118,12 +122,13 @@ public class PurchaseReturnNoteEventHandler } */ - private List BuildTransactions(PurchaseReturnNote purchaseReturnNote) + private async Task> BuildTransactions(PurchaseReturnNote purchaseReturnNote) { var transactions = new List(); //构造库存转移记录创建Input foreach (var detail in purchaseReturnNote.Details.Where(detail => detail.Qty != 0)) { + var itemBasicDto= await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); var transaction = ObjectMapper.Map(detail); transaction.TransType = @@ -134,6 +139,7 @@ public class PurchaseReturnNoteEventHandler transaction.Worker = purchaseReturnNote.Worker; transaction.DocNumber = purchaseReturnNote.Number; transaction.JobNumber = purchaseReturnNote.JobNumber; + transaction.ManageType = itemBasicDto.ManageType; //transaction.Status = // detail.Status == EnumInventoryStatus.None // ? InventoryStatus