Esempio n. 1
0
        public ActionResult AddSalesDeliveryLineItem(Models.ViewModels.Sales.SalesDeliveryViewModel model)
        {
            var item = _inventoryService.GetItemById(model.ItemId.Value);
            var line = new Models.ViewModels.Sales.SalesDeliveryLineViewModel()
            {
                ItemId             = model.ItemId,
                MeasurementId      = model.MeasurementId,
                Quantity           = model.Quantity,
                Price              = item.Price.Value * model.Quantity,
                Discount           = model.Discount,
                LineTotalTaxAmount = item.ItemTaxAmountOutput * model.Quantity
            };

            model.SalesDeliveryLines.Add(line);
            return(View(model));
        }
Esempio n. 2
0
        public ActionResult AddSalesDeliveryLineItem(Models.ViewModels.Sales.SalesDeliveryViewModel model)
        {
            var item = _inventoryService.GetItemById(model.ItemId.Value);
            var line = new Models.ViewModels.Sales.SalesDeliveryLineViewModel()
            {
                ItemId = model.ItemId,
                MeasurementId = model.MeasurementId,
                Quantity = model.Quantity,
                Price = item.Price.Value * model.Quantity,
                Discount  = model.Discount,
                LineTotalTaxAmount = item.ItemTaxAmountOutput * model.Quantity
            };

            model.SalesDeliveryLines.Add(line);
            return View(model);
        }