public List <WCFRequisitionDetail> GetConsolidatedRequisitionDetailsforAllocation() { List <string> itemCodes = stationeryService.GetListOfItemCodes(); List <WCFRequisitionDetail> model = new List <WCFRequisitionDetail>(); foreach (String ic in itemCodes) { int fulfilled = 0; int allocated = 0; int requested = 0; WCFRequisitionDetail rd = new WCFRequisitionDetail(); List <WCFRequisitionDetail> list = GetRequisitionDetailsByItemCode(ic).Where(x => x.Status == "Approved and Processing" || x.Status == "Partially fulfilled").ToList(); foreach (WCFRequisitionDetail itemRD in list) { fulfilled += itemRD.FulfilledQty; allocated += itemRD.AllocateQty; requested += itemRD.Qty; rd.StationeryDescription = itemRD.StationeryDescription; } rd.ItemCode = ic; rd.Qty = requested; rd.AllocateQty = allocated; rd.FulfilledQty = fulfilled; if (rd.Qty > rd.FulfilledQty) { model.Add(rd); } } return(model); }
public static Requisition_Detail ConvertFromWCFRequisitionDetail(WCFRequisitionDetail wcf_detail) { Requisition_Detail detail = new Requisition_Detail(); detail.allocatedQty = wcf_detail.AllocateQty; detail.clerkID = wcf_detail.ClerkID; detail.fulfilledQty = wcf_detail.FulfilledQty; detail.itemCode = wcf_detail.ItemCode; detail.nextCollectionDate = wcf_detail.NextCollectionDate; detail.qty = wcf_detail.Qty; detail.remarks = wcf_detail.Remarks; detail.requisitionNo = wcf_detail.RequisitionNo; detail.retrievedDate = wcf_detail.RetrievedDate; return(detail); }
public static WCFRequisitionDetail ConvertToWCFRequisitionDetail(Requisition_Detail detail) { Stationery s = stationeryService.FindStationeryByItemCode(detail.itemCode); WCFRequisitionDetail wcf_detail = new WCFRequisitionDetail(); wcf_detail.RequisitionNo = detail.requisitionNo; wcf_detail.ItemCode = detail.itemCode; wcf_detail.StationeryDescription = s.description; wcf_detail.UOM = s.unitOfMeasure; wcf_detail.Remarks = detail.remarks; wcf_detail.Qty = (detail.qty == null) ? 0 : (int)detail.qty; wcf_detail.FulfilledQty = (detail.fulfilledQty == null) ? 0 : (int)detail.fulfilledQty; wcf_detail.ClerkID = detail.clerkID; wcf_detail.RetrievedDate = detail.retrievedDate; wcf_detail.AllocateQty = (detail.allocatedQty == null) ? 0 : (int)detail.allocatedQty; wcf_detail.NextCollectionDate = detail.nextCollectionDate; wcf_detail.Status = detail.Requisition_Record.status; return(wcf_detail); }
public void UpdateRequisitionDetailAndroid(WCFRequisitionDetail reqDetail) { requisitionRecordService.UpdateDetailsAndroid(reqDetail.ItemCode, reqDetail.RequisitionNo, reqDetail.AllocateQty); }