Exemplo n.º 1
0
        public ActionResult DoCreatePicks(string sohIds)
        {
            var result = new JSONResultModel();

            result.Error = SalesService.CreatePicks(CurrentCompany, CurrentUser, sohIds, false);
            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 2
0
        public ActionResult GetDeliveryWindowClose(string windowOpen)
        {
            DateTime dt = DateTime.ParseExact(windowOpen, CurrentUser.DateFormat, CultureInfo.InvariantCulture);

            var result = new JSONResultModel();

            result.Data = LookupService.GetDeliveryWindow(dt).ToString(CurrentUser.DateFormat);

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
        public ActionResult GetProduct(string id)
        {
            var result = new JSONResultModel {
                Data = ProductService.FindProductModel(id, null, CurrentCompany, true)
            };

            if (result.Data == null)
            {
                result.Error.SetError(EvolutionResources.errProductNotFound, "", "PurchaseOrderDetailTemp_ProductName");
            }
            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 4
0
        public ActionResult GetCards(int id)
        {
            var result = new JSONResultModel {
                Data = CustomerService.FindCreditCardsListItemModel(CurrentCompany, id)
            };

            if (result.Data == null)
            {
                result.Error.SetError(EvolutionResources.errFailedToRetrieveCustomerCards, "SaleTemp_CustomerName");
            }
            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 5
0
        public ActionResult GetCustomerDetails(int id)
        {
            var result = new JSONResultModel {
                Data = CustomerService.FindCustomerModel(id, CurrentCompany, true)
            };

            if (result.Data == null)
            {
                result.Error.SetError(EvolutionResources.errFailedToRetrieveCustomer, "SaleTemp_CustomerName");
            }
            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 6
0
        public ActionResult SetPrimaryImage(int id, int productMediaId)
        {
            JSONResultModel model   = new JSONResultModel();
            var             product = ProductService.FindProductModel(id, null, null, false);

            if (product == null)
            {
                model.Error.SetRecordError("Product", id);
            }
            else
            {
                model.Error = ProductService.SetPrimaryMedia(product, productMediaId, CurrentUser, ProductService.LockProduct(product));
            }
            return(Json(model, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 7
0
        public ActionResult SaveKeyProperties(int sohtId, int locationId, int brandcatgeoryId,
                                              int?oaId, bool isOverrideMSQ, string lgst)
        {
            var result = new JSONResultModel();

            var soht = SalesService.FindSalesOrderHeaderTempModel(sohtId, CurrentCompany, false);

            if (soht != null)
            {
                soht.LocationId         = locationId;
                soht.BrandCategoryId    = brandcatgeoryId;
                soht.OverrideApproverId = oaId;
                soht.IsOverrideMSQ      = isOverrideMSQ;
                result.Error            = SalesService.InsertOrUpdateSalesOrderHeaderTemp(soht, CurrentUser, lgst, true);
                if (!result.Error.IsError)
                {
                    result.Data = SalesService.LockSalesOrderHeaderTemp(soht);
                }
            }
            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 8
0
        public ActionResult GetUnitPrice(string pn, int custId, bool isOverrideMSQ)
        {
            // id is the string productNumber
            var result  = new JSONResultModel();
            var product = ProductService.FindProductModel(pn, null, null, false);

            if (product != null)
            {
                var data      = new PricingInfoModel();
                var prodPrice = ProductService.FindProductPrice(CurrentCompany, product.Id, custId);
                if (prodPrice != null)
                {
                    data.SellingPrice = prodPrice.SellingPrice;
                    data.MinSaleQty   = (product.MinSaleQty == null || isOverrideMSQ ? 1 : product.MinSaleQty.Value);   // Was CustomField3 in MYOB
                    result.Data       = data;
                }
                else
                {
                    result.Error.SetError(EvolutionResources.errProductPriceNotFound, "SalesOrderDetailTemp_UnitPriceExTax");
                }
            }
            return(Json(result, JsonRequestBehavior.AllowGet));
        }