diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/PurchaseReturnNoteController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/PurchaseReturnNoteController.cs index 988c531e5..fea073acd 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/PurchaseReturnNoteController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/PurchaseReturnNoteController.cs @@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Mvc; using Volo.Abp; using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.Users; using Win_in.Sfs.Label.Application.Contracts; using Win_in.Sfs.Label.Domain; using Win_in.Sfs.Shared.Domain.Shared; @@ -39,8 +40,8 @@ public class PurchaseReturnNoteController : AbpController public PurchaseReturnNoteController(IPurchaseReturnNoteAppService noteAppService, IInventoryLabelAppService labelAppService, IBalanceAppService balanceAppService, - IPurchaseOrderAppService purchaseOrderAppService - ) + IPurchaseOrderAppService purchaseOrderAppService + ) { _noteAppService = noteAppService; this._labelAppService = labelAppService; @@ -70,7 +71,6 @@ public class PurchaseReturnNoteController : AbpController // await this.SetDetailPoNumberAsync(input.Details); var noteCreateInputs = await BuildNoteCreateInputsAsync(input, EnumPurchaseReturnType.BeforePuton).ConfigureAwait(false); - foreach (var noteCreateInput in noteCreateInputs) { await _noteAppService.CreateAsync(noteCreateInput).ConfigureAwait(false); @@ -141,7 +141,6 @@ public class PurchaseReturnNoteController : AbpController createInputs.Add(returnNoteEditInput); } - return createInputs; } private async Task SetDetailByPoAsync(string poNumber, PurchaseReturnNoteDetailInput createInputDetail) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/PurchaseReturnNotes/PurchaseReturnNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/PurchaseReturnNotes/PurchaseReturnNoteAppService.cs index 56ffc0a53..e6cebdd88 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/PurchaseReturnNotes/PurchaseReturnNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/PurchaseReturnNotes/PurchaseReturnNoteAppService.cs @@ -15,7 +15,7 @@ using System.Linq.Expressions; using System.Threading; using Volo.Abp.Application.Dtos; - +using Volo.Abp.Users; using Win_in.Sfs.FileStorage.Application.Contracts; using Win_in.Sfs.Shared.Application.Contracts; using Win_in.Sfs.Shared.Domain; @@ -31,12 +31,17 @@ public class PurchaseReturnNoteAppService : SfsStoreWithDetailsAppServiceBase CreateAsync(PurchaseReturnNoteEditInput input) { var entity = ObjectMapper.Map(input); + if (entity.Worker.IsNullOrEmpty() && _currentUser != null) + { + entity.Worker = _currentUser.UserName; + } await _purchaseReturnNoteManager.CreateAsync(entity).ConfigureAwait(false); var dto = ObjectMapper.Map(entity);