public static void PlanQuantitiesForOrderCompletion(List<ViewPlanningJournal> myOrderCompletionJrnl)
        {
            var db = new IstokDoorsDBContext();

            var dbOrderCompletionJrnl = db.PlanningJournals.ToList();

            //Save IsManufacturedForOrder to PlanningJournal
            foreach (var item in dbOrderCompletionJrnl)
            {
                for (int i = 0; i < myOrderCompletionJrnl.Count; i++)
                {

                    if (item.OrderId == myOrderCompletionJrnl[i].OrderId &&
                        item.OrderItemId == myOrderCompletionJrnl[i].OrderItemId)
                    {

                        if (item.IsManufacturedForOrder != myOrderCompletionJrnl[i].IsManufacturedForOrder)
                        {
                            //Calculate the difference between present and former IsManufacturedForOrder quantity
                            int calculatedManufacturedForOrder = myOrderCompletionJrnl[i].IsManufacturedForOrder -
                                                         item.IsManufacturedForOrder??0;

                            db.usp_PlanQuantitiesForOrderCompletion(myOrderCompletionJrnl[i].FactoryId,
                                myOrderCompletionJrnl[i].OrderId, myOrderCompletionJrnl[i].OrderItemId,
                                myOrderCompletionJrnl[i].DoorId, calculatedManufacturedForOrder);

                            item.IsManufacturedForOrder = myOrderCompletionJrnl[i].IsManufacturedForOrder;
                        }

                        //Check wether Order is Done (OrderStatus 4)

                      
                    }

                }
            }

          
            db.SaveChanges();

        }