From 7889ffab7e274f6a4bee6300458e1136b47605e4 Mon Sep 17 00:00:00 2001 From: paulcortez Date: Mon, 29 May 2023 23:44:47 +0800 Subject: [PATCH] Fix Model No Field Fix Model No Field and added new remarks field --- Connected Services/ItemServices/Reference.cs | 8 +++++ .../InventoryCorrection.razor | 36 ++++++++----------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Connected Services/ItemServices/Reference.cs b/Connected Services/ItemServices/Reference.cs index f199f48..4bb2c82 100644 --- a/Connected Services/ItemServices/Reference.cs +++ b/Connected Services/ItemServices/Reference.cs @@ -330,6 +330,9 @@ namespace ItemServices [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IItemService/GetItemListByModelnoStartsWith", ReplyAction="http://tempuri.org/IItemService/GetItemListByModelnoStartsWithResponse")] System.Threading.Tasks.Task GetItemListByModelnoStartsWithAsync(string modelno); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IItemService/GetItemListByModelnoStartsWithAndLimit", ReplyAction="http://tempuri.org/IItemService/GetItemListByModelnoStartsWithAndLimitResponse")] + System.Threading.Tasks.Task GetItemListByModelnoStartsWithAndLimitAsync(string modelno, int limit); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IItemService/GetItemListByDescription", ReplyAction="http://tempuri.org/IItemService/GetItemListByDescriptionResponse")] System.Threading.Tasks.Task GetItemListByDescriptionAsync(string description); @@ -616,6 +619,11 @@ namespace ItemServices return base.Channel.GetItemListByModelnoStartsWithAsync(modelno); } + public System.Threading.Tasks.Task GetItemListByModelnoStartsWithAndLimitAsync(string modelno, int limit) + { + return base.Channel.GetItemListByModelnoStartsWithAndLimitAsync(modelno, limit); + } + public System.Threading.Tasks.Task GetItemListByDescriptionAsync(string description) { return base.Channel.GetItemListByDescriptionAsync(description); diff --git a/Pages/BranchMaintenance/InventoryCorrection.razor b/Pages/BranchMaintenance/InventoryCorrection.razor index 8d6efaa..b847b67 100644 --- a/Pages/BranchMaintenance/InventoryCorrection.razor +++ b/Pages/BranchMaintenance/InventoryCorrection.razor @@ -16,7 +16,7 @@ - + Get Record @@ -36,12 +36,18 @@ - + @branchItemLedger.itemcode - + @branchItemLedger.remarks + + @newRemarks + + + Remarks above is the existing value of remarks on particular item while New Remarks is the remarks that will be added to Remarks after changes had been saved. + Edit the details below @@ -81,7 +87,7 @@ else @code { BranchServices.branch[]? branchList; - string? selectedBranch, selectedModelNo; + string? selectedBranch, modelNo, newRemarks; BranchItemLedgerServices.branchitemledger? branchItemLedger = null; bool disableStatusGetRecord = false, disableStatusSave = true; @@ -105,20 +111,6 @@ else return branchList.Where(c => c.brCode.Contains(value, StringComparison.InvariantCultureIgnoreCase)).Select(c=>c.brCode); } - async Task> SearchModelNo(string value) - { - ItemServices.items[] itemList; - - if (string.IsNullOrEmpty(value) || value.Length < 2) - { - itemList = await itemServiceClient.GetTopDataAsync(10); - return itemList.Select(c => c.modelno); - } - - itemList = await itemServiceClient.GetItemListByModelnoStartsWithAsync(value); - return itemList.Select(c => c.modelno); - } - async Task GetRecord() { if(string.IsNullOrEmpty(selectedBranch)) @@ -132,7 +124,7 @@ else return; } - if (string.IsNullOrEmpty(selectedModelNo)) + if (string.IsNullOrEmpty(modelNo)) { var dialogParam = new DialogParameters(); dialogParam.Add("ContentText", "No model number. Please enter in the Model Number field"); @@ -146,7 +138,8 @@ else disableStatusGetRecord = true; disableStatusSave = true; - branchItemLedger = await branchItemLedgerServiceClient.GetRemoteDataByBrCodeModelnoAsync(selectedBranch, selectedModelNo); + branchItemLedger = await branchItemLedgerServiceClient.GetRemoteDataByBrCodeModelnoAsync(selectedBranch, modelNo); + newRemarks = $"Manually edit by {userService?.CurrentUser?.fullName}. {DateTime.Now:MM/dd/yyyy hh:mm:sstt}"; disableStatusGetRecord = false; disableStatusSave = false; @@ -160,8 +153,7 @@ else disableStatusGetRecord = true; disableStatusSave = true; - branchItemLedger.remarks = $"|Manually edit by {userService?.CurrentUser?.fullName}. {DateTime.Now:MM/dd/yyyy} [{branchItemLedger.beginningqty} {branchItemLedger.inqty} {branchItemLedger.outqty} {branchItemLedger.sales} {branchItemLedger.adjustment} {branchItemLedger.endingqty}]"; - + branchItemLedger.remarks = $"|Manually edit by {userService?.CurrentUser?.fullName}. {DateTime.Now:MM/dd/yyyy hh:mm:sstt} [{branchItemLedger.beginningqty} {branchItemLedger.inqty} {branchItemLedger.outqty} {branchItemLedger.sales} {branchItemLedger.adjustment} {branchItemLedger.endingqty}]"; int result = await branchItemLedgerServiceClient.UpdateRemoteBranchItemLedgerAsync(branchItemLedger); if(result > 0)