Ejemplo n.º 1
0
 public ActionResult Receipt()
 {
     var model = new BuyModel();
     if (TempData["Invoice"] != null)
     {
         model = (BuyModel)TempData["Invoice"];
     }
     var pdf = new PdfResult(model, "Receipt");
     return pdf;
 }
Ejemplo n.º 2
0
        public ActionResult View(string id)
        {
            var invoice = new Invoice();
            invoice = _invoiceService.GetDataById(new Guid(id));

            var model = new BuyModel();
            var store = new StoreModel();
            var cashier = new Profiles();
            var appraiser = new Profiles();
            var customer = new Customer();
            cashier = _profileService.GetProfileByUserId(invoice.Cashier.Id);
            appraiser = _profileService.GetProfileByUserId(invoice.Appraiser.Id);
            customer = _customerService.GetDataById(invoice.Customer.Id);

            model.StoreId = invoice.Store.Id.ToString();
            model.StoreName = invoice.Store.Name;
            model.StoreAddress = invoice.Store.Address;
            model.StoreTelephoneNo = invoice.Store.TelephoneNo;

            model.InvoiceNo = invoice.InvoiceNo;
            model.Cashier = Base.GenerateFullName(cashier.FirstName, cashier.MiddleName, cashier.LastName);
            model.Appraiser = Base.GenerateFullName(appraiser.FirstName, appraiser.MiddleName, appraiser.LastName);
            model.Customer = Base.GenerateFullName(customer.FirstName, customer.MiddleName, customer.LastName);
            //summary
            model.SubTotal = invoice.SubTotal;
            model.TotalBonus = invoice.TotalBonus;
            model.GrandTotal = invoice.GrandTotal;
            //purchases
            model.Purchases = invoice.Purchases;
            //company
            model.CompanyName = ConfigManager.Exchange.CompanyName;

            TempData["Invoice"] = model;

            return View(model);
        }
Ejemplo n.º 3
0
        public ActionResult Index()
        {
            var model = new BuyModel();
            var store = _common.GetCurrentUserStoreAccess();
            var profile = _common.GetCurrentUserProfile();

            model.ProductList = _service.GetProductList(new Guid());
            model.StoreId = store.Id;
            model.StoreName = store.StoreName;
            model.InvoiceNo = Base.GenerateInvoiceNumber("INV", store.StoreCode,
                _invoiceService.GetTotalInvoiceBySTore(new Guid(store.Id)));
            model.Cashier = profile.Name;
            model.CashierId = profile.UserId;
            return View(model);
        }