Example #1
0
        public ActionResult GetOrderSummary(int id)
        {
            var poht  = SalesService.FindSalesOrderHeaderTempModel(id, CurrentCompany);
            var model = SalesService.CreateOrderSummary(poht);

            model.CurrencySymbol = LookupService.FindCurrencySymbol(CurrentCompany.DefaultCurrencyID);
            return(View("OrderSummary", model));
        }
        public void CreateOrderSummaryTest()
        {
            var testUser     = GetTestUser();
            var testCompany  = GetTestCompany(testUser, true);
            var testCustomer = GetTestCustomer(testCompany, testUser);

            // Create a record
            var temp = GetTestSalesOrderHeader(testCompany, testCustomer, testUser, 10);
            var soht = SalesService.CopySaleToTemp(testCompany, temp, testUser, false);

            var summary = SalesService.CreateOrderSummary(soht);

            Assert.IsTrue(summary.SubTotal > 0, $"Error: SubTotal {summary.SubTotal} was returned when a value greater than 0 was expected");
            Assert.IsTrue(!string.IsNullOrEmpty(summary.TaxName), $"Error: TaxName {summary.TaxName} was returned when a no-empty string was expected");
            Assert.IsTrue(summary.TaxTotal > 0, $"Error: TaxTotal {summary.TaxTotal} was returned when a value greater than 0 was expected");
            Assert.IsTrue(summary.Total > 0, $"Error: Total {summary.Total} was returned when a value greater than 0 was expected");
            Assert.IsTrue(summary.TotalCbms > 0, $"Error: TotalCbms {summary.TotalCbms} was returned when a value greater than 0 was expected");
            Assert.IsTrue(!string.IsNullOrEmpty(summary.CurrencySymbol), $"Error: CurrencySymbol {summary.CurrencySymbol} was returned when a no-empty string was expected");
        }