Пример #1
0
        /* PRINT **********************************************************************************************************************************************/

        // GET: Payments/Print
        public ActionResult Print(Guid?id)
        {
            if (id == null || !UserAccountsController.getUserAccess(Session).Payments_View)
            {
                return(RedirectToAction(nameof(HomeController.Index), "Home"));
            }

            PaymentsModel model = get((Guid)id);

            ViewBag.InvoiceHeaderText    = new BranchesController().get(Helper.getActiveBranchId(Session)).InvoiceHeaderText;
            ViewData["SaleInvoiceItems"] = SaleInvoiceItemsController.get(null, null, null, model.Id, null, null, null, null, null, null)
                                           .OrderBy(x => x.SaleInvoices_No)
                                           .ThenBy(x => x.RowNo)
                                           .ToList();
            ViewData["PaymentItems"] = PaymentItemsController.get(null, model.Id);
            ViewBag.TotalAmount      = model.CashAmount + model.ConsignmentAmount + model.DebitAmount;

            return(View(model));
        }
Пример #2
0
        public ActionResult setCreateViewBagsAndReturn(string saleInvoiceIdList)
        {
            List <SaleInvoiceItemsModel> SaleInvoiceItems = SaleInvoiceItemsController.get(null, null, saleInvoiceIdList, null, null, null, null, null, null, null)
                                                            .OrderBy(x => x.SaleInvoices_No)
                                                            .ThenBy(x => x.RowNo)
                                                            .ToList();

            ViewBag.TotalAmount = SaleInvoiceItems.Sum(x => x.TotalAmount);

            List <SaleInvoicesModel> saleinvoices = SaleInvoicesController.get(Session, saleInvoiceIdList);

            ViewBag.DueAmount = saleinvoices.Sum(x => x.Due);

            ViewBag.id = saleInvoiceIdList;
            //BanksController.setDropDownListViewBag(this);
            ConsignmentsController.setDropDownListViewBag(this);

            return(View(SaleInvoiceItems));
        }