public virtual ActionResult InboundShipmentDetail(ShipmentSkuFilterModel filters, bool exportExcel = false)
        {
            int nMaxRowsToShow = 2000;
            var shipmentLists  = GetInboundShipmentDetailModels(filters, nMaxRowsToShow);
            var model          = new IntransitShipmentSkuListViewModel
            {
                Filters = filters
            };

            model.ShipmentLists = shipmentLists;
            //model.TotalShipmentRows = shipmentLists.Select(m => m.Shipments[0].TotalShipmentCount).FirstOrDefault();

            model.MaxRowsToShow = shipmentLists.Select(m => m.Shipments).Distinct().Count();

            model.SewingPlantList = (from item in _service.GetSewingPlantList()
                                     select new SelectListItem
            {
                Text = string.Format("{0}:{1}", item.SewingPlantCode, item.PlantName),
                Value = item.SewingPlantCode
            }).ToArray();

            if (exportExcel)
            {
                var result = new ExcelResult("Shipment_SKU_Detail");
                result.AddWorkSheet(model.TransferShipmentList, "Transfers", "List of Building Transfer Shipment");
                result.AddWorkSheet(model.UnknownShipmentList, "Unknown", "List of Unknown Shipment");
                result.AddWorkSheet(model.VendorShipmentList, "Vendors", "List of Vendor Shipment");
                return(result);
            }
            return(View(Views.IntransitShipmentSkuList, model));
        }
Exemple #2
0
        public virtual ActionResult SkuLocationExcel(string id)
        {
            if (string.IsNullOrWhiteSpace(id))
            {
                throw new ArgumentNullException("id");
            }
            var loc = _repos.Value.GetSkuLocation2(id);

            if (loc == null)
            {
                throw new NotImplementedException("What should we do here?");
            }
            var allSku = loc.SkusAtLocation.Select(p => new SkuLocationSkuModel
            {
                //Upc = p.Upc,
                Style     = p.Style,
                Color     = p.Color,
                Dimension = p.Dimension,
                SkuSize   = p.SkuSize,
                Pieces    = p.Pieces,
                //IsAssigned = loc.AssignedSkuId == p.SkuId
            }).ToList();
            var allPallets          = _repos.Value.GetPalletsOfSkuLocation(id).Select(p => new SkuLocationPalletModel(p)).ToArray();
            var assignUnassignAudit = _repos.Value.GetLocAssignUnassignAudit(id).Select(p => new LocationAuditModel(p)).ToArray();
            var inventoryAudit      = _repos.Value.GetLocationsInventoryAudit(id).Select(p => new LocationAuditModel(p)).ToArray();

            var result = new ExcelResult("SkuLocation_" + id);

            result.AddWorkSheet(allSku, "Inventory", "List on content on location " + id);
            result.AddWorkSheet(allPallets, "Pallets", "List of Pallets on location " + id);
            result.AddWorkSheet(assignUnassignAudit, "Assignment Audit", "SKU assignment audot of location " + id);
            result.AddWorkSheet(inventoryAudit, "Inventory Audit", "Inventory Audit of location" + id);
            return(result);
        }
Exemple #3
0
        public virtual ActionResult PickslipExcel(long id)
        {
            var result = new ExcelResult("Pickslip_" + id);

            result.AddWorkSheet(_repos.Value.GetBoxes(id, GlobalConstants.MAX_EXCEL_ROWS).Select(p => new BoxHeadlineModel(p)).ToList(), "Boxes", "List of boxes of Pickslip " + id);
            result.AddWorkSheet(_repos.Value.GetPickslipSku(id).Select(p => new PickslipSkuModel(p)).ToArray(), "SKUs", "List of SKUs in Pickslip " + id);
            return(result);
        }
Exemple #4
0
        public virtual ActionResult SkuExcel(int id)
        {
            var result = new ExcelResult("SKU_" + id);

            var items = _repos.Value.GetSkuInventoryByArea(id);
            var query = from row in items
                        select new SkuInventoryModel(row);

            result.AddWorkSheet(query.ToArray(), "Inventory", "Inventory of SKU " + id + " per Area/Vwh");
            result.AddWorkSheet(_repos.Value.GetRecentOrders(id, GlobalConstants.MAX_EXCEL_ROWS).Select(p => new RecentPoModel(p)).ToArray(),
                                "Recent PO", "Active POs of SKU " + id);
            return(result);
        }
Exemple #5
0
        public virtual ActionResult BoxExcel(string id)
        {
            if (string.IsNullOrWhiteSpace(id))
            {
                throw new ArgumentNullException("id");
            }
            var result = new ExcelResult("Box_" + id);

            result.AddWorkSheet(_repos.Value.GetBoxSku(id, null).Select(p => new BoxSkuModel(p)).ToArray(),
                                "SKU", "List of SKU in Box " + id);

            result.AddWorkSheet(_repos.Value.GetBoxProcesssHistory(id).Select(p => new BoxAuditModel(p)).ToArray(),
                                "Audit", "Audit of Box " + id);
            return(result);
        }
        public virtual ActionResult CartonLocationExcel(string id)
        {
            if (string.IsNullOrWhiteSpace(id))
            {
                throw new ArgumentNullException("id");
            }
            //var palletCartons = _repos.Value.GetCartonsOfLocationOnPallet(id).Select(p => new CartonLocationPalletModel
            //{
            //    CartonCount = p.CartonCount,
            //    DistinctSKUs = p.DistinctSKUs,
            //    PalletId = p.PalletId,
            //    SKUQuantity = p.SKUQuantity
            //}).ToArray();

            var nonPalletCartons = _repos.Value.GetCartonsAtLocation(id).Take(GlobalConstants.MAX_EXCEL_ROWS).Select(p => new CartonAtLocationModel
            {
                CartonId = p.CartonId,
                //DistinctSKUs = p.DistinctSKUs,
                SKUQuantity = p.SKUQuantity
            }).ToArray();
            var result = new ExcelResult("CartonLocation_" + id);

            //result.AddWorkSheet(palletCartons, "Pallets on Location", "List on Pallets on Location " + id);
            result.AddWorkSheet(nonPalletCartons, "Cartons on Location", "List of Non Pallet Cartons on location " + id);
            return(result);
        }
        public virtual ActionResult IntransitShipmentListExcel(ShipmentListFilterModel filters)
        {
            string heading;

            switch (filters.Source)
            {
            case null:
                heading = "All Shipments";
                break;

            case ShipmentSourceType.Vendor:
                heading = "Vendor Shipments";
                break;

            case ShipmentSourceType.Transfer:
                heading = "Transfer Shipments";
                break;

            default:
                throw new NotImplementedException();
            }
            var list = GetShipmentModels(filters, Helpers.GlobalConstants.MAX_EXCEL_ROWS);

            var result = new ExcelResult("Inbound Shipment Summary");

            //TODO: include filters in heading
            result.AddWorkSheet(list, "Shipments", heading);
            return(result);
        }
Exemple #8
0
        public virtual ActionResult PoImportedExcel(string id, string pk1)
        {
            var result = new ExcelResult("PO_" + id);

            result.AddWorkSheet(_repos.Value.GetInOrderBucketPickslipsOfPo(id, pk1).Select(p => new PickslipHeadlineModel(p)).ToList(), "Pickslips", "List of Pickslips in PO " + id);
            return(result);
        }
        public virtual ActionResult IntransitShipmentExcel(string id)
        {
            if (string.IsNullOrWhiteSpace(id))
            {
                throw new ArgumentNullException("id");
            }
            var shipmentSku = _service.GetInboundShipmentInfo(id).Select(p => new ShipmentSkuModel
            {
                Style                       = p.Style,
                Color                       = p.Color,
                Dimension                   = p.Dimension,
                SkuSize                     = p.SkuSize,
                ReceivedPieces              = p.ReceivedPieces,
                ExpectedPieces              = p.ExpectedPieces,
                UnderReceviedPieces         = p.UnderReceviedPieces,
                OverReceviedPieces          = p.OverReceviedPieces,
                ExpectedCartonCount         = p.ExpectedCartonCount,
                ReceivedCartonCount         = p.ReceivedCartonCount,
                UnderReceviedCartonCount    = p.UnderReceviedCartonCount,
                OverReceviedCartonCount     = p.OverReceviedCartonCount,
                MinMergedToBuddyShipment    = p.MinMergedToBuddyShipment,
                MaxMergedToBuddyShipment    = p.MaxMergedToBuddyShipment,
                MinMergedInBuddyShipment    = p.MinMergedInBuddyShipment,
                MaxMergedInBuddyShipment    = p.MaxMergedInBuddyShipment,
                CountMergedToBuddyShipment  = p.CountMergedToBuddyShipment,
                CountMergedInBuddyShipment  = p.CountMergedInBuddyShipment,
                CtnsReceivedInOtherShipment = p.CtnsReceivedInOtherShipment,
                PcsReceivedInOtherShipment  = p.PcsReceivedInOtherShipment
            }).OrderByDescending(m => m.ExpectedPieces - m.ReceivedPieces).ToList();

            var result = new ExcelResult("IntransitShipment_" + id);

            result.AddWorkSheet(shipmentSku, "SKU", "List of SKU in shipment " + id);
            return(result);
        }
Exemple #10
0
        public virtual ActionResult PickslipImportedExcel(long id)
        {
            var result = new ExcelResult("Pickslip_" + id);

            result.AddWorkSheet(_repos.Value.GetSkuOfImportedPickslip(id).Select(p => new PickslipSkuModel(p)).ToArray(), "SKUs", "List od SKUs in Pickslip " + id);
            return(result);
        }
Exemple #11
0
        public virtual ActionResult OutboundShipmentExcel(string id)
        {
            var result = new ExcelResult("OutboundShipment_" + id);

            result.AddWorkSheet(_repos.Value.GetDetailsOfOutboundShipment(id, null).Select(p => new ParentShipmentContentModel(p)).ToArray(), "Shipment Details", "Details of Shipment " + id);
            return(result);
        }
Exemple #12
0
        public virtual ActionResult PoExcel(string id, string pk1, int?pk2)
        {
            var result = new ExcelResult("PO_" + id);

            result.AddWorkSheet(_repos.Value.GetPickslips(id, pk1, pk2, GlobalConstants.MAX_EXCEL_ROWS).Select(p => new PickslipHeadlineModel(p)).ToList(), "Pickslips", "List of Pickslips in PO " + id);
            return(result);
        }
        public virtual ActionResult CartonAreaExcel(string id)
        {
            if (string.IsNullOrWhiteSpace(id))
            {
                throw new ArgumentNullException("id");
            }
            var areaInventory = _repos.Value.GetCartonAreaInventory(id).Select(p => new CartonAreaInventoryModel(p)).ToArray();
            var result        = new ExcelResult("CartonArea_" + id);

            result.AddWorkSheet(areaInventory, "Inventory", "Inventory in Area " + id);
            return(result);
        }
        public virtual ActionResult ReturnExcel(string id)
        {
            if (string.IsNullOrWhiteSpace(id))
            {
                throw new ArgumentNullException("id");
            }
            var returnRecipts = _repos.Value.GetReturnInfo(id, GlobalConstants.MAX_EXCEL_ROWS).Select(p => new ReturnReceiptModel(p)).ToArray();
            var result        = new ExcelResult("Return_Receipts " + id);

            result.AddWorkSheet(returnRecipts, "Return Receipt", "List of Return Receipt " + id);
            return(result);
        }
        public virtual ActionResult CustomerExcel(string id)
        {
            if (string.IsNullOrWhiteSpace(id))
            {
                throw new ArgumentNullException("id");
            }
            var orders = _repos.Value.GetRecentOrders(id, GlobalConstants.MAX_EXCEL_ROWS).Select(p => new RecentPoModel(p)).ToArray();
            var result = new ExcelResult("Customer_" + id);

            result.AddWorkSheet(orders, "Recent PO", "Active POs of Customer " + id);
            return(result);
        }
        public virtual ActionResult CartonPalletExcel(string id)
        {
            if (string.IsNullOrWhiteSpace(id))
            {
                throw new ArgumentNullException("id");
            }
            var allCartons = _repos.Value.GetCartonsOfPallet(id).Select(p => new CartonHeadlineModel(p)).ToList();
            var result     = new ExcelResult("CartonPallet_" + id);

            result.AddWorkSheet(allCartons, "Cartons", "List of Cartons on Pallet " + id);
            return(result);
        }
        public virtual ActionResult CartonExcel(string id)
        {
            if (string.IsNullOrWhiteSpace(id))
            {
                throw new ArgumentNullException("id");
            }
            var result      = new ExcelResult("Carton_" + id);
            var processList = _repos.Value.GetCartonHistory(id).Select(p => new CartonProcessModel(p)).ToArray();

            result.AddWorkSheet(processList, "Carton History", "History of Carton " + id);
            return(result);
        }
Exemple #18
0
        public virtual ActionResult MasterBolExcel(string id)
        {
            if (string.IsNullOrWhiteSpace(id))
            {
                throw new ArgumentNullException("id");
            }
            var ShipmentList = _repos.Value.GetMasterBolShipments(id).Select(p => new MasterBolShipmentModel(p)).ToList();
            var result       = new ExcelResult("MasterBOL_" + id);

            result.AddWorkSheet(ShipmentList, "Master BOL Shipment List", "Shipment in Master BOL " + id);
            return(result);
        }
Exemple #19
0
        public virtual ActionResult BoxPalletExcel(string id)
        {
            if (string.IsNullOrWhiteSpace(id))
            {
                throw new ArgumentNullException("id");
            }
            var result = new ExcelResult("BoxPallet_" + id);
            var boxes  = _repos.Value.GetBoxesOfPallet(id, GlobalConstants.MAX_EXCEL_ROWS);

            result.AddWorkSheet(boxes.Select(p => new BoxHeadlineModel(p)).ToList(), "Boxes", "List of Boxes on Pallet " + id);
            var allSku = _repos.Value.GetBoxSku(null, id).Select(p => new BoxSkuModel(p))
                         .OrderBy(p => p.Style)
                         .ThenBy(p => p.Color)
                         .ThenBy(p => p.Dimension)
                         .ThenBy(p => p.SkuSize)
                         .ToArray();

            result.AddWorkSheet(allSku, "SKU", "List of SKUs on Pallet " + id);
            var history = _repos.Value.GetBoxPalletHistory(id).Select(p => new BoxPalletHistoryModel(p)).ToArray();

            result.AddWorkSheet(history, "History", "Audit Entries for Pallet " + id);
            return(result);
        }
        public virtual ActionResult ReturnReceiptExcel(string id)
        {
            var returnSku = _repos.Value.GetReturnReceiptInfo(id).Where(p => !string.IsNullOrWhiteSpace(p.Upc)).Select(p => new ReturnSkuModel
            {
                Upc         = p.Upc,
                Style       = p.Style,
                Color       = p.Color,
                Dimension   = p.Dimension,
                SkuSize     = p.SkuSize,
                RetailPrice = (p.RetailPrice * p.Quantity),
                Pieces      = p.Quantity
            }).ToList();
            var result = new ExcelResult("ReturnReceipt_" + id);

            result.AddWorkSheet(returnSku, "SKU", "List of KU in Return Receipt " + id);
            return(result);
        }