Multiple pr item approval
This commit is contained in:
parent
efd7017476
commit
33b839741f
@ -18,10 +18,10 @@ namespace CPRNIMS.Domain.Contracts.PR
|
|||||||
Task<List<ForReceiving>> GetForReceiving(PRDto PRDto);
|
Task<List<ForReceiving>> GetForReceiving(PRDto PRDto);
|
||||||
Task<List<Dashboard>> GetDashBoard(PRDto PRDto);
|
Task<List<Dashboard>> GetDashBoard(PRDto PRDto);
|
||||||
Task<List<ItemApproval>> GetMyPR(PRDto PRDto);
|
Task<List<ItemApproval>> GetMyPR(PRDto PRDto);
|
||||||
Task<List<PRList>> GetAllPR(PRDto PRDto);
|
Task<List<Infrastructure.Entities.Purchasing.PRList>> GetAllPR(PRDto PRDto);
|
||||||
Task<List<Infrastructure.Entities.Canvass.PRList>> GetPRListByPRNo(PRDto PRDto);
|
Task<List<Infrastructure.Entities.Canvass.PRList>> GetPRListByPRNo(PRDto PRDto);
|
||||||
Task<List<NotifUserKey>> GetNotifUserKey(PRDto PRDto);
|
Task<List<NotifUserKey>> GetNotifUserKey(PRDto PRDto);
|
||||||
Task<List<PRDetails>> GetPRDetailByPRNo(PRDto PRDto);
|
Task<List<PRItemList>> GetPRDetailByPRNo(PRDto PRDto);
|
||||||
Task<List<PRTracking>> GetPRStatusById(PRDto PRDto);
|
Task<List<PRTracking>> GetPRStatusById(PRDto PRDto);
|
||||||
Task<List<RRReport>> GetDetailedPRTracking(PRDto PRDto);
|
Task<List<RRReport>> GetDetailedPRTracking(PRDto PRDto);
|
||||||
Task<List<AlternativeOffer>> GetSupplierAlternativeOffer(PRDto PRDto);
|
Task<List<AlternativeOffer>> GetSupplierAlternativeOffer(PRDto PRDto);
|
||||||
|
|||||||
@ -25,7 +25,7 @@ namespace CPRNIMS.Domain.Services.PR
|
|||||||
_dbContext = dbContext;
|
_dbContext = dbContext;
|
||||||
}
|
}
|
||||||
#region Get
|
#region Get
|
||||||
public async Task<List<PRList>> GetAllPR(PRDto PRDto)
|
public async Task<List<Infrastructure.Entities.Purchasing.PRList>> GetAllPR(PRDto PRDto)
|
||||||
{
|
{
|
||||||
var allItems = await _dbContext.PRLists
|
var allItems = await _dbContext.PRLists
|
||||||
.FromSqlRaw($"EXEC GetAllPR @UserId,@IsArchived",
|
.FromSqlRaw($"EXEC GetAllPR @UserId,@IsArchived",
|
||||||
@ -33,7 +33,7 @@ namespace CPRNIMS.Domain.Services.PR
|
|||||||
new SqlParameter("@IsArchived", PRDto.IsArchived))
|
new SqlParameter("@IsArchived", PRDto.IsArchived))
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
return allItems ?? new List<PRList>();
|
return allItems ?? new List<Infrastructure.Entities.Purchasing.PRList>();
|
||||||
}
|
}
|
||||||
public async Task<List<PRDto>> GetApproverName(PRDto PRDto)
|
public async Task<List<PRDto>> GetApproverName(PRDto PRDto)
|
||||||
{
|
{
|
||||||
@ -109,15 +109,15 @@ namespace CPRNIMS.Domain.Services.PR
|
|||||||
|
|
||||||
return allItems ?? new List<NotifUserKey>();
|
return allItems ?? new List<NotifUserKey>();
|
||||||
}
|
}
|
||||||
public async Task<List<PRDetails>> GetPRDetailByPRNo(PRDto PRDto)
|
public async Task<List<PRItemList>> GetPRDetailByPRNo(PRDto PRDto)
|
||||||
{
|
{
|
||||||
var allItems = await _dbContext.PRDetails
|
var allItems = await _dbContext.PRItemLists
|
||||||
.FromSqlRaw($"EXEC GetPRDetailByPRNo @UserId, @PRNo",
|
.FromSqlRaw($"EXEC GetPRDetailByPRNo @UserId, @PRNo",
|
||||||
new SqlParameter("@UserId", PRDto.UserId),
|
new SqlParameter("@UserId", PRDto.UserId),
|
||||||
new SqlParameter("@PRNo", PRDto.PRNo))
|
new SqlParameter("@PRNo", PRDto.PRNo))
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
return allItems ?? new List<PRDetails>();
|
return allItems ?? new List<PRItemList>();
|
||||||
}
|
}
|
||||||
public async Task<List<PRTracking>> GetPRStatusById(PRDto PRDto)
|
public async Task<List<PRTracking>> GetPRStatusById(PRDto PRDto)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -36,5 +36,6 @@ namespace CPRNIMS.Domain.UIContracts.PR
|
|||||||
Task<PRVM> PutAlternativeOffer(User user, PRVM viewModel);
|
Task<PRVM> PutAlternativeOffer(User user, PRVM viewModel);
|
||||||
Task<PRVM> PutSupplierAlterOffer(User user, PRVM viewModel);
|
Task<PRVM> PutSupplierAlterOffer(User user, PRVM viewModel);
|
||||||
Task<PRVM> PRItemRemoval(User user, PRVM viewModel);
|
Task<PRVM> PRItemRemoval(User user, PRVM viewModel);
|
||||||
|
Task<PRVM> ApprovedSelectedPRItem(User user, PRVM viewModel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -248,6 +248,11 @@ namespace CPRNIMS.Domain.UIServices.PR
|
|||||||
return await SendPostApiRequest(user, viewModel,
|
return await SendPostApiRequest(user, viewModel,
|
||||||
_configuration["LLI:NonInvent:PRMgmt:PRItemRemoval"]);
|
_configuration["LLI:NonInvent:PRMgmt:PRItemRemoval"]);
|
||||||
}
|
}
|
||||||
|
public async Task<PRVM> ApprovedSelectedPRItem(User user, PRVM viewModel)
|
||||||
|
{
|
||||||
|
return await SendPostApiRequest(user, viewModel,
|
||||||
|
_configuration["LLI:NonInvent:PRMgmt:ApprovedSelectedPRItem"]);
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -46,6 +46,7 @@ namespace CPRNIMS.Infrastructure.Database
|
|||||||
public virtual DbSet<Approved> Approved { get; set; }
|
public virtual DbSet<Approved> Approved { get; set; }
|
||||||
public virtual DbSet<SMTPCredential> SMTPCredentials { get; set; }
|
public virtual DbSet<SMTPCredential> SMTPCredentials { get; set; }
|
||||||
public virtual DbSet<PRDetails> PRDetails { get; set; }
|
public virtual DbSet<PRDetails> PRDetails { get; set; }
|
||||||
|
public virtual DbSet<PRItemList> PRItemLists { get; set; }
|
||||||
public virtual DbSet<NotificationById> NotificationByIds { get; set; }
|
public virtual DbSet<NotificationById> NotificationByIds { get; set; }
|
||||||
public virtual DbSet<AlternativeOffer> AlternativeOffers { get; set; }
|
public virtual DbSet<AlternativeOffer> AlternativeOffers { get; set; }
|
||||||
public virtual DbSet<AlternativeOfferDetails> AlternativeOfferDetails { get; set; }
|
public virtual DbSet<AlternativeOfferDetails> AlternativeOfferDetails { get; set; }
|
||||||
|
|||||||
14
CPRNIMS.Infrastructure/Dto/PR/PRList.cs
Normal file
14
CPRNIMS.Infrastructure/Dto/PR/PRList.cs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace CPRNIMS.Infrastructure.Dto.PR
|
||||||
|
{
|
||||||
|
public class PRList
|
||||||
|
{
|
||||||
|
public List<long>? PRDetailsId { get; set; }
|
||||||
|
public List<long>? ItemNo { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
41
CPRNIMS.Infrastructure/Entities/Purchasing/PRItemList.cs
Normal file
41
CPRNIMS.Infrastructure/Entities/Purchasing/PRItemList.cs
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
using CPRNIMS.Infrastructure.Entities.Common;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace CPRNIMS.Infrastructure.Entities.Purchasing
|
||||||
|
{
|
||||||
|
public class PRItemList : CommonProperties
|
||||||
|
{
|
||||||
|
[Key]
|
||||||
|
public long PRDetailsId { get; set; }
|
||||||
|
public long ItemCodeId { get; set; }
|
||||||
|
public short ItemClassId { get; set; }
|
||||||
|
public string? Department { get; set; }
|
||||||
|
public string? ItemCategoryName { get; set; }
|
||||||
|
public string? UserId { get; set; }
|
||||||
|
public string? ItemName { get; set; }
|
||||||
|
public decimal TotalAmount { get; set; }
|
||||||
|
public string? ItemDescription { get; set; }
|
||||||
|
public short Status { get; set; }
|
||||||
|
public string? StatusName { get; set; }
|
||||||
|
public bool IsActive { get; set; }
|
||||||
|
public long ItemNo { get; set; }
|
||||||
|
public string? ItemLocalName { get; set; }
|
||||||
|
public decimal Qty { get; set; }
|
||||||
|
public string? NewPRNo { get; set; }
|
||||||
|
public string? ItemClassName { get; set; }
|
||||||
|
public string? UOMName { get; set; }
|
||||||
|
public string? ItemColorName { get; set; }
|
||||||
|
public string? ItemAttachPath { get; set; }
|
||||||
|
public long PRNo { get; set; }
|
||||||
|
public string? Remarks { get; set; }
|
||||||
|
public DateTime DateNeeded { get; set; }
|
||||||
|
public bool Queue { get; set; }
|
||||||
|
public string? AttestedBy { get; set; }
|
||||||
|
public string? ApprovedBy { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,4 +1,5 @@
|
|||||||
using CPRNIMS.Infrastructure.Entities.Common;
|
using CPRNIMS.Infrastructure.Dto.PR;
|
||||||
|
using CPRNIMS.Infrastructure.Entities.Common;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@ -123,5 +124,6 @@ namespace CPRNIMS.Infrastructure.ViewModel.PR
|
|||||||
public int AlternativeOfferId { get; set; }
|
public int AlternativeOfferId { get; set; }
|
||||||
public string? AggreDescription { get; set; }
|
public string? AggreDescription { get; set; }
|
||||||
public ItemReceivingList? ItemList { get; set; }
|
public ItemReceivingList? ItemList { get; set; }
|
||||||
|
public PRList? PRList { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,18 +28,7 @@ namespace CPRNIMS.WebApi.Controllers.Inventory
|
|||||||
[HttpPost("GetInventoryByUserId")]
|
[HttpPost("GetInventoryByUserId")]
|
||||||
public async Task<IActionResult> GetInventoryByUserId(InventoryDto itemCodeDto)
|
public async Task<IActionResult> GetInventoryByUserId(InventoryDto itemCodeDto)
|
||||||
{
|
{
|
||||||
try
|
return Ok(await _inventory.GetInventoryByUserId(itemCodeDto));
|
||||||
{
|
|
||||||
var allPR = await _inventory.GetInventoryByUserId(itemCodeDto);
|
|
||||||
|
|
||||||
return Ok(allPR);
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
var message = ex.InnerException?.ToString() ?? ex.Message.ToString();
|
|
||||||
await PostErrorMessage(message + "GetInventoryByUserId", "WebApi");
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
[HttpPost("GetRequestedItemByUserId")]
|
[HttpPost("GetRequestedItemByUserId")]
|
||||||
public async Task<IActionResult> GetRequestedItemByUserId(InventoryDto itemCodeDto)
|
public async Task<IActionResult> GetRequestedItemByUserId(InventoryDto itemCodeDto)
|
||||||
|
|||||||
@ -28,6 +28,38 @@ namespace CPRNIMS.WebApi.Controllers.PR
|
|||||||
_pRequest = pRequest;
|
_pRequest = pRequest;
|
||||||
}
|
}
|
||||||
#region POST PUT
|
#region POST PUT
|
||||||
|
[HttpPost("ApprovedSelectedPRItem")]
|
||||||
|
public async Task<IActionResult> ApprovedSelectedPRItem([FromBody] PRVM PRDto)
|
||||||
|
{
|
||||||
|
return await ExecuteWithErrorHandling(async () =>
|
||||||
|
{
|
||||||
|
var results = new List<object>();
|
||||||
|
|
||||||
|
if (PRDto.PRList?.PRDetailsId?.Count > 0)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < PRDto.PRList.PRDetailsId.Count; i++)
|
||||||
|
{
|
||||||
|
var dto = new PRDto
|
||||||
|
{
|
||||||
|
PRDetailsId = PRDto.PRList.PRDetailsId[i],
|
||||||
|
ItemNo = PRDto.PRList.ItemNo[i],
|
||||||
|
UserId = PRDto.UserId,
|
||||||
|
Status = 1
|
||||||
|
};
|
||||||
|
|
||||||
|
var result = await _pRequest.PostPRApproveReject(dto);
|
||||||
|
results.Add(new { PONo = dto.PONo, Result = result });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return new
|
||||||
|
{
|
||||||
|
ProcessedCount = results.Count,
|
||||||
|
Results = results
|
||||||
|
};
|
||||||
|
},
|
||||||
|
nameof(ApprovedSelectedPRItem), true);
|
||||||
|
}
|
||||||
[HttpPost("PostPutDeniedItem")]
|
[HttpPost("PostPutDeniedItem")]
|
||||||
public async Task<IActionResult> PostPutDeniedItem([FromBody] PRVM viewModel)
|
public async Task<IActionResult> PostPutDeniedItem([FromBody] PRVM viewModel)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -79,18 +79,10 @@ namespace CPRNIMS.WebApps.Controllers.Inventory
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
public async Task<IActionResult> GetInventoryByUserId(InventoryVM viewModels)
|
public async Task<IActionResult> GetInventoryByUserId(InventoryVM viewModels)
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
response = await _inventory.GetInventoryByUserId(GetUser(), viewModels);
|
response = await _inventory.GetInventoryByUserId(GetUser(), viewModels);
|
||||||
return GetResponse(response);
|
return GetResponse(response);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
var message = ex.InnerException?.ToString() ?? ex.Message.ToString();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public async Task<IActionResult> GetRequestedItemByUserId(InventoryVM viewModels)
|
public async Task<IActionResult> GetRequestedItemByUserId(InventoryVM viewModels)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
using CPRNIMS.Domain.UIContracts.PR;
|
using CPRNIMS.Domain.UIContracts.PR;
|
||||||
|
using CPRNIMS.Infrastructure.Dto.PR;
|
||||||
using CPRNIMS.Infrastructure.Helper;
|
using CPRNIMS.Infrastructure.Helper;
|
||||||
using CPRNIMS.Infrastructure.ViewModel.PR;
|
using CPRNIMS.Infrastructure.ViewModel.PR;
|
||||||
using CPRNIMS.WebApps.Controllers.Base;
|
using CPRNIMS.WebApps.Controllers.Base;
|
||||||
@ -97,8 +98,38 @@ namespace CPRNIMS.WebApps.Controllers.PR
|
|||||||
|
|
||||||
return GetResponse(response);
|
return GetResponse(response);
|
||||||
}
|
}
|
||||||
|
private PRList MapToPRItemList(IEnumerable<PRList> prList)
|
||||||
|
{
|
||||||
|
if (prList == null || !prList.Any())
|
||||||
|
{
|
||||||
|
return new PRList
|
||||||
|
{
|
||||||
|
PRDetailsId = new List<long>(),
|
||||||
|
ItemNo = new List<long>(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return new PRList
|
||||||
|
{
|
||||||
|
PRDetailsId = prList.SelectMany(ic => ic.PRDetailsId).ToList(),
|
||||||
|
ItemNo = prList.SelectMany(ic => ic.ItemNo).ToList()
|
||||||
|
};
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region POST PUT
|
#region POST PUT
|
||||||
|
public async Task<IActionResult> ApprovedSelectedPRItem(PRVM viewModel,
|
||||||
|
List<PRList> PRList)
|
||||||
|
{
|
||||||
|
viewModel.PRList = MapToPRItemList(PRList);
|
||||||
|
|
||||||
|
var postPutItem = await _pRequest.ApprovedSelectedPRItem(GetUser(), viewModel);
|
||||||
|
|
||||||
|
if (postPutItem.messCode != 0)
|
||||||
|
{
|
||||||
|
return Json(new { success = true });
|
||||||
|
}
|
||||||
|
return Json(new { success = false, Response = postPutItem.Message });
|
||||||
|
}
|
||||||
public async Task<IActionResult> PostPutDeniedItem(PRVM viewModel, List<ItemReceivingList> ItemList)
|
public async Task<IActionResult> PostPutDeniedItem(PRVM viewModel, List<ItemReceivingList> ItemList)
|
||||||
{
|
{
|
||||||
if (ItemList.Count > 0)
|
if (ItemList.Count > 0)
|
||||||
|
|||||||
@ -77,6 +77,6 @@
|
|||||||
<link href="~/css/pr/TrackingV2.css" rel="stylesheet" />
|
<link href="~/css/pr/TrackingV2.css" rel="stylesheet" />
|
||||||
<link href="~/css/pr/buttonstyle.css" rel="stylesheet" />
|
<link href="~/css/pr/buttonstyle.css" rel="stylesheet" />
|
||||||
@await Html.PartialAsync("PagesView/PR/_PRTracking")
|
@await Html.PartialAsync("PagesView/PR/_PRTracking")
|
||||||
<script src="~/JsFunctions/PR/PRV5.js"></script>
|
<script src="~/JsFunctions/PR/PRV6.js"></script>
|
||||||
@await Html.PartialAsync("PagesView/PR/_PRScripts")
|
@await Html.PartialAsync("PagesView/PR/_PRScripts")
|
||||||
</body>
|
</body>
|
||||||
@ -1,16 +1,19 @@
|
|||||||
<div id="overlay" class="overlay" style="display: none;">
|
<div id="overlay" class="overlay" style="display: none;">
|
||||||
<div id="loader" class="loader"></div>
|
<div id="loader" class="loader"></div>
|
||||||
</div>
|
</div>
|
||||||
<script src="~/jsfunctions/pr/PRColumnV5.js"></script>
|
<link href="~/css/common/rowhighlighter.css" rel="stylesheet" />
|
||||||
<script src="~/jsfunctions/pr/PRViewV3.js"></script>
|
<script src="~/jsfunctions/pr/PRColumnV6.js"></script>
|
||||||
<script src="~/jsfunctions/pr/PRPutPostV8.js"></script>
|
<script src="~/jsfunctions/pr/PRViewV4.js"></script>
|
||||||
|
<script src="~/jsfunctions/pr/PRPutPostV9.js"></script>
|
||||||
<script src="~/jsfunctions/pr/PRButtonv2.js"></script>
|
<script src="~/jsfunctions/pr/PRButtonv2.js"></script>
|
||||||
<script src="~/jsfunctions/pr/PRVarV3.js"></script>
|
<script src="~/jsfunctions/pr/PRVarV3.js"></script>
|
||||||
<script src="~/jsfunctions/pr/Configv3.js"></script>
|
<script src="~/jsfunctions/pr/Configv4.js"></script>
|
||||||
<script src="~/jsfunctions/pr/populatedropdown.js"></script>
|
<script src="~/jsfunctions/pr/populatedropdown.js"></script>
|
||||||
<script src="~/jsfunctions/pr/prRowCallbackV3.js"></script>
|
<script src="~/jsfunctions/pr/prRowCallbackV3.js"></script>
|
||||||
<script src="~/jsfunctions/utilities/columnstyle.js"></script>
|
<script src="~/jsfunctions/utilities/columnstyle.js"></script>
|
||||||
<script src="~/jsfunctions/utilities/utilsV3.js"></script>
|
|
||||||
<script src="~/jsfunctions/utilities/stylesv3.js"></script>
|
|
||||||
<script src="~/jsfunctions/tracking/tracking.js"></script>
|
<script src="~/jsfunctions/tracking/tracking.js"></script>
|
||||||
|
|
||||||
|
<script src="~/jsfunctions/utilities/NewStyle.js"></script>
|
||||||
|
<script src="~/jsfunctions/utilities/utilsV3.js"></script>
|
||||||
|
<script src="~/jsfunctions/utilities/StylesV3.js"></script>
|
||||||
<script src="~/jsfunctions/utilities/searchengine.js"></script>
|
<script src="~/jsfunctions/utilities/searchengine.js"></script>
|
||||||
|
|||||||
@ -188,7 +188,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- Modal viewPRItemDetails -->
|
<!-- Modal viewPRItemDetails -->
|
||||||
<div class="modal fade custom-modal-backdrop" id="viewPRItemDetails"
|
<div class="modal fade custom-modal-backdrop" id="viewPRItemDetails"
|
||||||
tabindex="-1" aria-labelledby="ModalLabel" aria-hidden="true" data-bs-backdrop="static">
|
tabindex="-1" aria-labelledby="ModalLabel" aria-hidden="true" data-bs-backdrop="static">
|
||||||
<div class="modal-dialog modal-xl">
|
<div class="modal-dialog modal-xl">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
@ -383,25 +383,34 @@ tabindex="-1" aria-labelledby="ModalLabel" aria-hidden="true" data-bs-backdrop="
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<label for="totalSelected" style="font-size:medium;">Total Selected : </label>
|
||||||
|
<label id="totalSelected"
|
||||||
|
style="margin-bottom:20px; width:50px; font-weight:bold; color:red;"></label>
|
||||||
|
<br />
|
||||||
<table id="PRdataTable"
|
<table id="PRdataTable"
|
||||||
class="row-border" style="width: 100%;">
|
class="row-border" style="width: 100%;">
|
||||||
<colgroup>
|
<colgroup>
|
||||||
|
<col style="width:4%;text-align:left;" />
|
||||||
<col style="width:8%" />
|
<col style="width:8%" />
|
||||||
<col style ="width:30%" />
|
<col style="width:28%" />
|
||||||
<col style="width:34%" />
|
<col style="width:32%" />
|
||||||
<col style="width:8%" />
|
<col style="width:8%" />
|
||||||
<col style="width:8%" />
|
<col style="width:8%" />
|
||||||
<col style="width:12%" />
|
<col style="width:12%" />
|
||||||
</colgroup>
|
</colgroup>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th >ItemNo</th>
|
<th style="text-align:left;width:4%;">
|
||||||
<th >ItemName</th>
|
All
|
||||||
|
<input id="selectAllCheckboxItem" type="checkbox"
|
||||||
|
class="selectAllCheckboxItem" />
|
||||||
|
</th>
|
||||||
|
<th>ItemNo</th>
|
||||||
|
<th>ItemName</th>
|
||||||
<th>Specification</th>
|
<th>Specification</th>
|
||||||
<th >Qty</th>
|
<th>Qty</th>
|
||||||
<th>Status</th>
|
<th>Status</th>
|
||||||
<th >Action</th>
|
<th>Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -412,6 +421,10 @@ tabindex="-1" aria-labelledby="ModalLabel" aria-hidden="true" data-bs-backdrop="
|
|||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-primary" onclick="resetIsApproval()" data-bs-dismiss="modal">Back</button>
|
<button type="button" class="btn btn-primary" onclick="resetIsApproval()" data-bs-dismiss="modal">Back</button>
|
||||||
<button type="button" id="btnPrintPR" onclick="printPRItem();" class="btn btn-warning">Print</button>
|
<button type="button" id="btnPrintPR" onclick="printPRItem();" class="btn btn-warning">Print</button>
|
||||||
|
<button id="btnSubmitItem" type="button"
|
||||||
|
class="btn btn-success" onclick="approvedSelectedPRItem();">
|
||||||
|
Submit
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -19,7 +19,7 @@
|
|||||||
"GetUserRights": "api/Account/GetUserRights/",
|
"GetUserRights": "api/Account/GetUserRights/",
|
||||||
"UpdateUser": "api/Account/UpdateUser/",
|
"UpdateUser": "api/Account/UpdateUser/",
|
||||||
"GetUserById": "api/Account/GetUserById/",
|
"GetUserById": "api/Account/GetUserById/",
|
||||||
"GetUserByEmail": "api/Account/GetUserByEmail/",
|
"GetUserByEmail": "api/Anon/GetUserByEmail/",
|
||||||
"GetLandingPageByUserId": "api/Account/GetLandingPageByUserId/",
|
"GetLandingPageByUserId": "api/Account/GetLandingPageByUserId/",
|
||||||
"GetDepartment": "api/Account/GetDepartment/",
|
"GetDepartment": "api/Account/GetDepartment/",
|
||||||
"Claims": "api/Account/GetUserRolesClaims/",
|
"Claims": "api/Account/GetUserRolesClaims/",
|
||||||
@ -27,8 +27,8 @@
|
|||||||
"RegisterAdmin": "api/Account/login/",
|
"RegisterAdmin": "api/Account/login/",
|
||||||
"RegisterUser": "/api/Account/register/",
|
"RegisterUser": "/api/Account/register/",
|
||||||
"CreateUpdateRole": "/api/Account/CreateUpdateRole/",
|
"CreateUpdateRole": "/api/Account/CreateUpdateRole/",
|
||||||
"ChangePassword": "api/Account/ChangePassword/",
|
"ChangePassword": "api/Anon/ChangePassword/",
|
||||||
"ValidateOTP": "api/Account/ValidateOTP/",
|
"ValidateOTP": "api/Anon/ValidateOTP/",
|
||||||
"PutPostUserAccess": "api/Account/PutPostUserAccess/"
|
"PutPostUserAccess": "api/Account/PutPostUserAccess/"
|
||||||
},
|
},
|
||||||
"LLI": {
|
"LLI": {
|
||||||
@ -58,6 +58,7 @@
|
|||||||
"PutItemDetail": "api/PRMgmt/PutItemDetail/",
|
"PutItemDetail": "api/PRMgmt/PutItemDetail/",
|
||||||
"PutSupplierAlterOffer": "api/PRMgmt/PutSupplierAlterOffer/",
|
"PutSupplierAlterOffer": "api/PRMgmt/PutSupplierAlterOffer/",
|
||||||
"PRItemRemoval": "api/PRMgmt/PRItemRemoval/",
|
"PRItemRemoval": "api/PRMgmt/PRItemRemoval/",
|
||||||
|
"ApprovedSelectedPRItem": "api/PRMgmt/ApprovedSelectedPRItem/",
|
||||||
"GetAllPR": "api/PRMgmt/GetAllPR/",
|
"GetAllPR": "api/PRMgmt/GetAllPR/",
|
||||||
"GetPRArchived": "api/PRMgmt/GetPRArchived/",
|
"GetPRArchived": "api/PRMgmt/GetPRArchived/",
|
||||||
"GetMyPR": "api/PRMgmt/GetMyPR/",
|
"GetMyPR": "api/PRMgmt/GetMyPR/",
|
||||||
|
|||||||
@ -9,5 +9,6 @@
|
|||||||
PutSupplierAlterOffer: '/PRMgmt/PutSupplierAlterOffer',
|
PutSupplierAlterOffer: '/PRMgmt/PutSupplierAlterOffer',
|
||||||
PRItemRemoval: '/PRMgmt/PRItemRemoval',
|
PRItemRemoval: '/PRMgmt/PRItemRemoval',
|
||||||
PutItemDetail: '/PRMgmt/PutItemDetail',
|
PutItemDetail: '/PRMgmt/PutItemDetail',
|
||||||
|
ApprovedSelectedPRItem: '/PRMgmt/ApprovedSelectedPRItem',
|
||||||
PostPRApproveReject: '/PRMgmt/PostPRApproveReject',
|
PostPRApproveReject: '/PRMgmt/PostPRApproveReject',
|
||||||
};
|
};
|
||||||
@ -163,6 +163,15 @@ var colRRFinance = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
var colItemList = [
|
var colItemList = [
|
||||||
|
{
|
||||||
|
data: 'prDetailsId',
|
||||||
|
title: '<input type="checkbox" class="select-all-item-checkbox" />',
|
||||||
|
render: function () {
|
||||||
|
return '<input type="checkbox" class="select-item-checkbox" style="text-align:center;"/>';
|
||||||
|
},
|
||||||
|
orderable: false,
|
||||||
|
searchable: false
|
||||||
|
},
|
||||||
{ data: 'itemNo' },
|
{ data: 'itemNo' },
|
||||||
{ data: 'itemName' },
|
{ data: 'itemName' },
|
||||||
{ data: 'itemDescription' },
|
{ data: 'itemDescription' },
|
||||||
@ -1,4 +1,68 @@
|
|||||||
function prItemRemoval(data) {
|
function approvedSelectedPRItem() {
|
||||||
|
const loader = $('#overlay, #loader').css('z-index', 1070);
|
||||||
|
|
||||||
|
const selectedItems = Object.values(selectedProductsMap);
|
||||||
|
if (selectedItems.length === 0) {
|
||||||
|
showToast('warning', 'Please select items first!', 'Approval failed', 4000);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const PRList = selectedItems.map(item => {
|
||||||
|
return {
|
||||||
|
prNo: item.prNo,
|
||||||
|
prDetailsId: item.prDetailsId,
|
||||||
|
itemNo: item.itemNo
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
let message = PRList.length > 1
|
||||||
|
? 'Are you sure you want to approve these selected items? This action cannot be undone.'
|
||||||
|
: 'Are you sure you want to approve this selected item? This action cannot be undone.';
|
||||||
|
|
||||||
|
showConfirmation({
|
||||||
|
title: 'Multiple P.R. Item Approval',
|
||||||
|
message: message,
|
||||||
|
type: 'warning',
|
||||||
|
confirmText: 'Yes, Approve',
|
||||||
|
cancelText: 'No'
|
||||||
|
}).then((confirmed) => {
|
||||||
|
if (confirmed) {
|
||||||
|
$.ajax({
|
||||||
|
url: endpoint.ApprovedSelectedPRItem,
|
||||||
|
type: 'POST',
|
||||||
|
data: { PRList },
|
||||||
|
...beforeComplete(loader),
|
||||||
|
success: function (response) {
|
||||||
|
if (response.success) {
|
||||||
|
|
||||||
|
getApproverName(PRList[0].prDetailsId);
|
||||||
|
|
||||||
|
PRList.forEach(item => {
|
||||||
|
delete selectedProductsMap[item.prDetailsId];
|
||||||
|
});
|
||||||
|
|
||||||
|
const approvedIds = new Set(PRList.map(x => x.prDetailsId));
|
||||||
|
prDataTable.rows(function (idx, data) {
|
||||||
|
return approvedIds.has(data.prDetailsId);
|
||||||
|
}).remove().draw(false);
|
||||||
|
|
||||||
|
clearTableSelection('#PRdataTable', selectedProductsMap, () => {
|
||||||
|
totalSelectedLabel.text(0);
|
||||||
|
}, 'selected-row', '.select-all-item-checkbox');
|
||||||
|
|
||||||
|
hideButtonApproval(true);
|
||||||
|
$('#addRemarksUpdate').modal('hide');
|
||||||
|
showToast('success', 'Item successfully approved!', 'Success', 4000);
|
||||||
|
} else {
|
||||||
|
showToast('error', response.response, 'Approval failed', 4000);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: errorHandler
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function prItemRemoval(data) {
|
||||||
loader = $('#overlay, #loader').css('z-index', 1070);
|
loader = $('#overlay, #loader').css('z-index', 1070);
|
||||||
const remarksInput = document.getElementById('remove-remarks');
|
const remarksInput = document.getElementById('remove-remarks');
|
||||||
remarksInput.addEventListener('input', removeErrorClass);
|
remarksInput.addEventListener('input', removeErrorClass);
|
||||||
@ -45,29 +45,6 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function getApproverName(prDetailsId) {
|
|
||||||
PRDetailsId = prDetailsId;
|
|
||||||
$.ajax({
|
|
||||||
url: '/PRMgmt/GetApproverName',
|
|
||||||
type: 'POST',
|
|
||||||
data: { PRDetailsId },
|
|
||||||
success: function (data) {
|
|
||||||
if (data && data.data && data.data.length > 0) {
|
|
||||||
var item = data.data[0];
|
|
||||||
|
|
||||||
const attestedBy = document.getElementById('label-pr-attestedBy');
|
|
||||||
const approveBy = document.getElementById('label-pr-approvedBy');
|
|
||||||
if (attestedBy) {
|
|
||||||
attestedBy.innerHTML = item.attestedBy;
|
|
||||||
}
|
|
||||||
if (approveBy) {
|
|
||||||
approveBy.innerHTML = item.approvedBy;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
error: errorHandler
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
loader = $('#overlay, #loader');
|
loader = $('#overlay, #loader');
|
||||||
@ -1,4 +1,27 @@
|
|||||||
function printPRItem() {
|
function getApproverName(prDetailsId) {
|
||||||
|
PRDetailsId = prDetailsId;
|
||||||
|
$.ajax({
|
||||||
|
url: '/PRMgmt/GetApproverName',
|
||||||
|
type: 'POST',
|
||||||
|
data: { PRDetailsId },
|
||||||
|
success: function (data) {
|
||||||
|
if (data && data.data && data.data.length > 0) {
|
||||||
|
var item = data.data[0];
|
||||||
|
|
||||||
|
const attestedBy = document.getElementById('label-pr-attestedBy');
|
||||||
|
const approveBy = document.getElementById('label-pr-approvedBy');
|
||||||
|
if (attestedBy) {
|
||||||
|
attestedBy.innerHTML = item.attestedBy;
|
||||||
|
}
|
||||||
|
if (approveBy) {
|
||||||
|
approveBy.innerHTML = item.approvedBy;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: errorHandler
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function printPRItem() {
|
||||||
const iframe = document.createElement('iframe');
|
const iframe = document.createElement('iframe');
|
||||||
iframe.style.position = 'fixed';
|
iframe.style.position = 'fixed';
|
||||||
iframe.style.right = '0';
|
iframe.style.right = '0';
|
||||||
@ -542,7 +565,7 @@ function enableDisableInput(isDenied, dynamicBtn) {
|
|||||||
let buttonUpdate = document.getElementById('btnUpdateItem');
|
let buttonUpdate = document.getElementById('btnUpdateItem');
|
||||||
let btnHold = document.getElementById('btnHold');
|
let btnHold = document.getElementById('btnHold');
|
||||||
let btnApprove = document.getElementById('btnApprove');
|
let btnApprove = document.getElementById('btnApprove');
|
||||||
console.log('isDenied', isDenied);
|
|
||||||
if (['Approver1', 'Approver2', 'CnvssAppver'].includes(UserRights)) {
|
if (['Approver1', 'Approver2', 'CnvssAppver'].includes(UserRights)) {
|
||||||
if (UserRights !== 'CnvssAppver') {
|
if (UserRights !== 'CnvssAppver') {
|
||||||
btnApprove.style.display = 'block';
|
btnApprove.style.display = 'block';
|
||||||
@ -594,9 +617,18 @@ function viewPRDetails(data) {
|
|||||||
|
|
||||||
$('#viewPRDetails').modal('show');
|
$('#viewPRDetails').modal('show');
|
||||||
$('#viewPRDetails').css('z-index', 1050);
|
$('#viewPRDetails').css('z-index', 1050);
|
||||||
tableElement = $('#PRdataTable');
|
|
||||||
|
|
||||||
|
tableName = '#PRdataTable';
|
||||||
|
|
||||||
|
totalSelectedLabel = $('#totalSelected');
|
||||||
|
|
||||||
|
clearTableSelection(tableName, selectedProductsMap, () => {
|
||||||
|
totalSelectedLabel.text(0);
|
||||||
|
}, 'selected-row', '.select-all-item-checkbox');
|
||||||
|
|
||||||
|
tableElement = $(tableName);
|
||||||
tableDestroy(tableElement);
|
tableDestroy(tableElement);
|
||||||
|
|
||||||
var PRNo = data.prNo;
|
var PRNo = data.prNo;
|
||||||
document.getElementById('label-pr-prNo').innerHTML = data.prNo;
|
document.getElementById('label-pr-prNo').innerHTML = data.prNo;
|
||||||
document.getElementById('label-prby').innerHTML = data.createdBy;
|
document.getElementById('label-prby').innerHTML = data.createdBy;
|
||||||
@ -606,6 +638,8 @@ function viewPRDetails(data) {
|
|||||||
document.getElementById('label-pr-approvedBy').innerHTML = data.approvedBy;
|
document.getElementById('label-pr-approvedBy').innerHTML = data.approvedBy;
|
||||||
|
|
||||||
document.getElementById('label-pr-dateNeeded').innerHTML = formatDate(data.dateNeeded);
|
document.getElementById('label-pr-dateNeeded').innerHTML = formatDate(data.dateNeeded);
|
||||||
|
|
||||||
|
|
||||||
prDataTable = tableElement.DataTable({
|
prDataTable = tableElement.DataTable({
|
||||||
ajax: $.extend({
|
ajax: $.extend({
|
||||||
url: '/PRMgmt/GetPRDetailByPRNo',
|
url: '/PRMgmt/GetPRDetailByPRNo',
|
||||||
@ -616,7 +650,21 @@ function viewPRDetails(data) {
|
|||||||
language: {
|
language: {
|
||||||
emptyTable: "No record available"
|
emptyTable: "No record available"
|
||||||
},
|
},
|
||||||
initComplete: initCompleteCallback(),
|
initComplete: function () {
|
||||||
|
initializeTableSelection({
|
||||||
|
tableName: tableName,
|
||||||
|
dataTable: prDataTable,
|
||||||
|
selectedItemsMap: selectedProductsMap,
|
||||||
|
idKey: 'prDetailsId',
|
||||||
|
idKey2: 'itemNo',
|
||||||
|
checkboxClass: '.select-item-checkbox',
|
||||||
|
selectAllClass: '.select-all-item-checkbox',
|
||||||
|
selectedRowClass: 'selected-row',
|
||||||
|
updateCountCallback: function () {
|
||||||
|
totalSelectedLabel.text(getSelectedCount(selectedProductsMap));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
columns: colItemList,
|
columns: colItemList,
|
||||||
// responsive: true,
|
// responsive: true,
|
||||||
rowCallback: rowStatusColorCallback,
|
rowCallback: rowStatusColorCallback,
|
||||||
Loading…
Reference in New Issue
Block a user