Exemple #1
0
        public ActionResult ProcessOrder(int?id)
        {
            if (!caSession.AuthoriseSession())
            {
                return(Redirect((string)Session["ErrorUrl"]));
            }

            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var Order = OrderService.GetOrderById(id.Value);

            if (Order == null)
            {
                return(HttpNotFound());
            }
            VerifyOrderStatus(Order.OrderID);
            ViewBag.Consignments = new SelectList(OrderService.GetAllValidConsignmentTypes(CurrentTenantId), "ConsignmentTypeId", "ConsignmentType");
            var orderDto = new VModels.TransferOrderVM
            {
                OrderID                    = Order.OrderID,
                OrderNumber                = Order.OrderNumber,
                DeliveryNumber             = GaneStaticAppExtensions.GenerateDateRandomNo(),
                Type                       = Order.TransactionType.InventoryTransactionTypeId,
                InventoryTransactionTypeId = Order.TransactionType.InventoryTransactionTypeId,
                Warehouse                  = Order.TransactionType.InventoryTransactionTypeId == (int)InventoryTransactionTypeEnum.TransferIn ? Order.TransferWarehouse.WarehouseName : Order.TransferWarehouse.WarehouseName
            };

            return(View(orderDto));
        }
Exemple #2
0
        public ActionResult ReceivePO(int?id)
        {
            if (!caSession.AuthoriseSession())
            {
                return(Redirect((string)Session["ErrorUrl"]));
            }
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Order order = OrderService.GetOrderById(id.Value);

            if (order == null)
            {
                return(HttpNotFound());
            }

            var orderDto = Mapper.Map(order, new ReceivePOVM());

            VerifyOrderStatus(order.OrderID);
            orderDto.DeliveryNumber             = GaneStaticAppExtensions.GenerateDateRandomNo();
            orderDto.InventoryTransactionTypeId = (int)InventoryTransactionTypeEnum.PurchaseOrder;
            if (TempData["AutoCompleteError"] != null)
            {
                ViewBag.Warning = TempData["AutoCompleteError"].ToString();
            }
            return(View(orderDto));
        }
 public ActionResult DispatchPallets(PalletDispatchViewModel model)
 {
     model.AllVehicles = _marketServices.GetAllValidMarketVehicles(CurrentTenantId).MarketVehicles
                         .Select(m => new SelectListItem()
     {
         Text = m.Name, Value = m.Id.ToString()
     });
     model.AllDrivers = _employeeServices.GetAllEmployees(CurrentTenantId)
                        .Select(m => new SelectListItem()
     {
         Text = m.Name, Value = m.ResourceId.ToString()
     });
     model.AllSentMethods = _palletingService.GetAllSentMethods()
                            .Select(m => new SelectListItem()
     {
         Text = m.Name, Value = m.SentMethodID.ToString()
     });
     model.DispatchRefrenceNumber       = GaneStaticAppExtensions.GenerateDateRandomNo();
     ViewBag.ControllerName             = "Pallets";
     Session["UploadedPalletEvidences"] = null;
     return(PartialView("_PalletDisptachDetail", model));
 }
        public ActionResult GoodsReturn()
        {
            if (!caSession.AuthoriseSession())
            {
                return(Redirect((string)Session["ErrorUrl"]));
            }
            //var products = (from prds in _productServices.GetAllValidProductMasters(CurrentTenantId).ToList()
            //                select new
            //                {
            //                    prds.ProductId,
            //                    prds.SKUCode,
            //                    prds.NameWithCode
            //                }).ToList();
            //ViewBag.grProducts = new SelectList(products, "ProductId", "NameWithCode");
            Guid guid = Guid.NewGuid();

            ViewBag.DeliveryNo = GaneStaticAppExtensions.GenerateDateRandomNo();
            ViewBag.groupToken = guid.ToString();


            return(View());
        }
        public ActionResult ProcessOrder(int?id)
        {
            if (!caSession.AuthoriseSession())
            {
                return(Redirect((string)Session["ErrorUrl"]));
            }

            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Order Order = OrderService.GetOrderById(id.Value);

            if (Order == null)
            {
                return(HttpNotFound());
            }

            VerifyOrderAccountStatus(Order);

            var orderDto = AutoMapper.Mapper.Map <ReceivePOVM>(Order);

            orderDto.DeliveryNumber             = GaneStaticAppExtensions.GenerateDateRandomNo();
            orderDto.InventoryTransactionTypeId = (int)InventoryTransactionTypeEnum.SalesOrder;
            orderDto.AccountID   = Order.AccountID ?? 0;
            ViewBag.Consignments = new SelectList(OrderService.GetAllValidConsignmentTypes(CurrentTenantId), "ConsignmentTypeId", "ConsignmentType", Order.ConsignmentTypeId);

            //get http refferer

            string referrer = (Request.UrlReferrer != null) ? Request.UrlReferrer.ToString() : "/";

            // route to appropriate controller / action
            ViewBag.RController = "SalesOrders";

            if (referrer.Contains("PickList"))
            {
                ViewBag.RController = "PickList";
            }

            if (TempData["AutoCompleteError"] != null)
            {
                ViewBag.Warning = TempData["AutoCompleteError"].ToString();
            }

            var latestOrderProcess = Order.OrderProcess.OrderByDescending(m => m.DateCreated).FirstOrDefault();

            if (latestOrderProcess != null)
            {
                orderDto.ShipmentAddressLine1    = latestOrderProcess.ShipmentAddressLine1;
                orderDto.ShipmentAddressLine2    = latestOrderProcess.ShipmentAddressLine2;
                orderDto.ShipmentAddressLine3    = latestOrderProcess.ShipmentAddressLine3;
                orderDto.ShipmentAddressLine4    = latestOrderProcess.ShipmentAddressLine4;
                orderDto.ShipmentAddressPostcode = latestOrderProcess.ShipmentAddressPostcode;
            }
            else if (Order.Account != null)
            {
                if (Order.Account.AccountAddresses.Any())
                {
                    var address         = Order.Account.AccountAddresses.FirstOrDefault();
                    var shippingAddress = Order.Account.AccountAddresses.FirstOrDefault(m => m.AddTypeShipping == true);
                    if (shippingAddress != null)
                    {
                        address = shippingAddress;
                    }
                    if (address != null)
                    {
                        orderDto.ShipmentAddressLine1    = address.AddressLine1;
                        orderDto.ShipmentAddressLine2    = address.AddressLine2;
                        orderDto.ShipmentAddressLine3    = address.AddressLine3;
                        orderDto.ShipmentAddressLine4    = address.AddressLine4;
                        orderDto.ShipmentAddressPostcode = address.PostCode + ", " + address.GlobalCountry.CountryName;
                    }
                }
            }
            return(View(orderDto));
        }
Exemple #6
0
        public ActionResult BlindShipment(bool?delivery)
        {
            if (!caSession.AuthoriseSession())
            {
                return(Redirect((string)Session["ErrorUrl"]));
            }

            var accounts = AccountServices.GetAllValidAccounts(CurrentTenantId).Select(acnts => new
            {
                acnts.AccountID,
                acnts.AccountNameCode
            }).ToList();

            ViewBag.AccountID        = new SelectList(accounts, "AccountID", "AccountNameCode");
            ViewBag.AccountAddresses = new List <SelectListItem>()
            {
                new SelectListItem()
                {
                    Text = "Select", Value = "0"
                }
            };
            ViewBag.ShowPriceInBlindShipment = caCurrent.CurrentWarehouse().ShowPriceInBlindShipment;
            ViewBag.ShowTaxInBlindShipment   = caCurrent.CurrentWarehouse().ShowTaxInBlindShipment;
            ViewBag.ShowQtyInBlindShipment   = caCurrent.CurrentWarehouse().ShowQtyInBlindShipment;
            ViewBag.ProductGroup             = new List <SelectListItem>()
            {
                new SelectListItem()
                {
                    Text = "Select Group", Value = "0"
                }
            };
            ViewBag.ProductDepartment = new List <SelectListItem>()
            {
                new SelectListItem()
                {
                    Text = "Select Department", Value = "0"
                }
            };
            ViewBag.Groups      = new SelectList(LookupServices.GetAllValidProductGroups(CurrentTenantId), "ProductGroupId", "ProductGroup");
            ViewBag.Departments = new SelectList(LookupServices.GetAllValidTenantDepartments(CurrentTenantId), "DepartmentId", "DepartmentName");
            var taxes = (from gtax in LookupServices.GetAllValidGlobalTaxes(CurrentTenant.CountryID)
                         select new
            {
                TaxId = gtax.TaxID,
                TaxName = gtax.TaxName + " - " + gtax.PercentageOfAmount + " %"
            }).ToList();

            ViewBag.GlobalTaxes = new SelectList(taxes, "TaxId", "TaxName");
            ViewBag.DeliveryNo  = GaneStaticAppExtensions.GenerateDateRandomNo();
            Session["bsList"]   = new List <BSDto>();
            if (delivery != null && delivery == true)
            {
                ViewBag.type     = (int)InventoryTransactionTypeEnum.SalesOrder;
                ViewBag.Title    = "Create Delivery";
                ViewBag.delivery = delivery;
                return(View());
            }

            ViewBag.Title = "Create Shipment";
            ViewBag.type  = (int)InventoryTransactionTypeEnum.PurchaseOrder;
            return(View());
        }