private Receipt mapRecipt(ReceiptPlanToWms receiptPlan)
        {
            Receipt receipt = new Receipt
            {
                Supplier      = Mapper.Map <Suppliers, Supplier>(receiptPlan.Supplier),
                ReceiptHeader = Mapper.Map <ReceiptPlans, ReceiptHeader>(receiptPlan.ReceiptPlans),
                ReceiptLines  = Mapper.Map <List <VReceiptPlanLines>, List <ReceiptLine> >(receiptPlan.VReceiptPlanLines)
            };

            return(receipt);
        }
        private List <ReceiptPlanToWms> getAllReceiptPlansToSend()
        {
            var receiptPlanToWmsList = new List <ReceiptPlanToWms>();
            var receiptPlans         = db.ReceiptPlans.Where(x => x.WmsUpdate == null && x.ReceiptPlanStatusId == (int)ReceiptPlanStatusId.Ended).ToList();

            foreach (var receiptPlan in receiptPlans)
            {
                var supplier         = db.Suppliers.FirstOrDefault(x => x.SupplierId == receiptPlan.SupplierId);
                var receiptplanlines = db.VReceiptPlanLines.Where(x => x.ReceiptPlanId == receiptPlan.ReceiptPlanId).ToList();
                var receiptPlanToWms = new ReceiptPlanToWms()
                {
                    ReceiptPlans      = receiptPlan,
                    Supplier          = supplier,
                    VReceiptPlanLines = receiptplanlines
                };
                receiptPlanToWmsList.Add(receiptPlanToWms);
            }

            return(receiptPlanToWmsList);
        }