示例#1
0
 public Shipping(ILocationFunctionsService locationfunctionsService
                 , IInventoryUnitsService inventoryunitsService
                 , IInventoryLocationsSlottingService inventorylocationsslottingService
                 , VolumeAndWeight volumeAndWeight
                 , IInventoryLocationsService inventorylocationsService
                 , CommonLookUps commonLookUps
                 , IOutboundCarrierManifestsService outboundcarriermanifestsService
                 , IOutboundOrdersRepository outboundordersRepository
                 //, IOutboundCarrierManifestPickupsService outboundcarriermanifestpickupsService
                 , IOutboundShipmentsService outboundshipmentsService
                 , IOutboundOrderLinesService outboundorderlinesService
                 , IOutboundOrderLinePackingService outboundorderlinepackingService
                 , IOutboundOrderLinesInventoryAllocationService outboundorderlinesinventoryallocationService
                 , IHandlingUnitsService handlingunitsService
                 )
 {
     _locationfunctionsService          = locationfunctionsService;
     _inventoryunitsService             = inventoryunitsService;
     _inventorylocationsslottingService = inventorylocationsslottingService;
     _volumeAndWeight                 = volumeAndWeight;
     _inventorylocationsService       = inventorylocationsService;
     _commonLookUps                   = commonLookUps;
     _outboundcarriermanifestsService = outboundcarriermanifestsService;
     _outboundordersRepository        = outboundordersRepository;
     //_outboundcarriermanifestpickupsService = outboundcarriermanifestpickupsService;
     _outboundshipmentsService        = outboundshipmentsService;
     _outboundorderlinesService       = outboundorderlinesService;
     _outboundorderlinepackingService = outboundorderlinepackingService;
     _outboundorderlinesinventoryallocationService = outboundorderlinesinventoryallocationService;
     _handlingunitsService = handlingunitsService;
 }
 //Custom Code End
 //Custom Code Start | Replaced Code Block
 //Replaced Code Block Start
 //public OutboundOrdersService(IOutboundOrdersRepository outboundordersRepository)
 //Replaced Code Block End
 public OutboundOrdersService(IOutboundOrdersRepository outboundordersRepository, IPickBatchesService pickbatchesService, IOutboundShipmentsService outboundshipmentsService, ICarriersService carriersService, IOutboundOrderLinesService outboundorderlinesService)
 //Custom Code End
 {
     _outboundordersRepository = outboundordersRepository;
     //Custom Code Start | Added Code Block
     _pickbatchesService        = pickbatchesService;
     _outboundshipmentsService  = outboundshipmentsService;
     _carriersService           = carriersService;
     _outboundorderlinesService = outboundorderlinesService;
     //Custom Code End
 }
        public OutboundCarrierManifestPickupsPostValidator(
            IOutboundShipmentsRepository outboundshipmentsRepository
            , IOutboundOrdersRepository outboundordersRepository
            , CommonLookUpsRepository commonLookUps
            , IOutboundOrderLinesRepository outboundorderlinesRepository
            , IOutboundOrderLinesInventoryAllocationRepository outboundorderlinesinventoryallocationRepository
            )
        {
            //We have to check that all the outbound shipments are completely picked (Allocated qtys)
            _outboundshipmentsRepository = outboundshipmentsRepository;
            _outboundordersRepository    = outboundordersRepository;
            _commonLookUps = commonLookUps;
            _outboundorderlinesRepository = outboundorderlinesRepository;
            _outboundorderlinesinventoryallocationRepository = outboundorderlinesinventoryallocationRepository;

            var ixStatusActive = _commonLookUps.getStatuses().Where(s => s.sStatus == "Active").Select(s => s.ixStatus).FirstOrDefault();

            RuleFor(x => x.ixOutboundCarrierManifest)
            .Custom((ixOutboundCarrierManifest, context) =>
            {
                var outboundshipments = _outboundshipmentsRepository.IndexDb().Where(sh => sh.ixOutboundCarrierManifest == ixOutboundCarrierManifest && sh.ixStatus == ixStatusActive)
                                        .Select(sh => sh.ixOutboundShipment).ToList();

                var outboundorders = _outboundordersRepository.IndexDb().Where(o => o.ixStatus == ixStatusActive)
                                     .Join(outboundshipments, o => o.ixOutboundShipment, sh => sh, (o, sh) => new { O = o, Sh = sh })
                                     .Select(x => x.O.ixOutboundOrder).ToList();

                var outboundorderlines = _outboundorderlinesRepository.IndexDb()
                                         .Join(outboundorders, ol => ol.ixOutboundOrder, o => o, (ol, o) => new { Ol = ol, O = o })
                                         .Select(x => x.Ol.ixOutboundOrderLine).ToList();

                var outboundorderlinesNotCompletelyPicked = _outboundorderlinesinventoryallocationRepository.IndexDb()
                                                            .Join(outboundorderlines, ola => ola.ixOutboundOrderLine, ol => ol, (ola, ol) => new { Ola = ola, Ol = ol })
                                                            .Where(x => x.Ola.nBaseUnitQuantityPicked < x.Ola.nBaseUnitQuantityAllocated).Select(x => x.Ola.ixOutboundOrderLine).ToList();

                if (outboundorderlinesNotCompletelyPicked.Count() > 0)
                {
                    string errorList = "";

                    outboundorderlinesNotCompletelyPicked
                    .ToList()
                    .ForEach(e => errorList += e.ToString() + ", ");

                    errorList = errorList.TrimEnd(' ');
                    errorList = errorList.TrimEnd(',');


                    context.AddFailure($"The following outbound order lines have not been completely picked: {errorList}. Please complete the picking first.");
                }
            }
                    );
        }
示例#4
0
 //Custom Code End
 //Custom Code Start | Replaced Code Block
 //Replaced Code Block Start
 //public PickBatchesService(IPickBatchesRepository pickbatchesRepository)
 //Replaced Code Block End
 public PickBatchesService(IPickBatchesRepository pickbatchesRepository
                           , CommonLookUps commonLookUps
                           , Shipping shipping
                           , IOutboundCarrierManifestsService outboundcarriermanifestsService
                           , IOutboundOrdersRepository outboundordersRepository
                           , IOutboundShipmentsService outboundshipmentsService
                           )
 //Custom Code End
 {
     _pickbatchesRepository = pickbatchesRepository;
     //Custom Code Start | Added Code Block
     _commonLookUps = commonLookUps;
     _shipping      = shipping;
     _outboundcarriermanifestsService = outboundcarriermanifestsService;
     _outboundordersRepository        = outboundordersRepository;
     _outboundshipmentsService        = outboundshipmentsService;
     //Custom Code End
 }
示例#5
0
 public Inventory(IInventoryUnitsRepository inventoryunitsRepository
                  , IOutboundOrderLinesInventoryAllocationRepository outboundorderlinesinventoryallocationRepository
                  , IOutboundOrderLinesRepository outboundorderlinesRepository
                  , IStatusesRepository statusesRepository
                  , IInventoryStatesRepository inventorystatesRepository
                  , IPickBatchesRepository pickbatchesRepository
                  , IOutboundOrdersRepository outboundordersRepository
                  , IOutboundOrderLinesService outboundorderlinesService
                  , IOutboundOrderLinesInventoryAllocationService outboundorderlinesinventoryallocationService
                  )
 {
     _inventoryunitsRepository = inventoryunitsRepository;
     _outboundorderlinesinventoryallocationRepository = outboundorderlinesinventoryallocationRepository;
     _outboundorderlinesRepository = outboundorderlinesRepository;
     _statusesRepository           = statusesRepository;
     _inventorystatesRepository    = inventorystatesRepository;
     _pickbatchesRepository        = pickbatchesRepository;
     _outboundordersRepository     = outboundordersRepository;
     _outboundorderlinesService    = outboundorderlinesService;
     _outboundorderlinesinventoryallocationService = outboundorderlinesinventoryallocationService;
 }