public ActionResult SavePaymentToVendor(Models.ViewModels.Purchases.MakePayment model)
        {
            var invoice = _purchasingService.GetPurchaseInvoiceById(model.InvoiceId);

            if (model.AmountToPay < 1)
            {
                return(RedirectToAction("MakePayment", new { id = model.InvoiceId }));
            }
            _purchasingService.SavePayment(invoice.Id, invoice.VendorId.Value, model.AccountId, model.AmountToPay, DateTime.Now);
            return(RedirectToAction("PurchaseInvoices"));
        }
        public ActionResult MakePayment(int id)
        {
            var model   = new Models.ViewModels.Purchases.MakePayment();
            var invoice = _purchasingService.GetPurchaseInvoiceById(id);

            model.InvoiceId = invoice.Id;
            model.InvoiceNo = invoice.No;
            model.Vendor    = invoice.Vendor.Name;
            model.Amount    = invoice.PurchaseInvoiceLines.Sum(a => a.Amount);
            return(View(model));
        }
        public ActionResult MakePayment(int id)
        {
            var model   = new Models.ViewModels.Purchases.MakePayment();
            var invoice = _purchasingService.GetPurchaseInvoiceById(id);

            model.InvoiceId = invoice.Id;
            model.InvoiceNo = invoice.No;
            model.Vendor    = invoice.Vendor.Party.Name;
            //model.Amount = invoice.GeneralLedgerHeader.GeneralLedgerLines.Where(dr => dr.DrCr == Core.Domain.DrOrCrSide.Dr).Sum(l => l.Amount);

            return(View(model));
        }
        public ActionResult MakePayment(int id)
        {
            var model = new Models.ViewModels.Purchases.MakePayment();
            var invoice = _purchasingService.GetPurchaseInvoiceById(id);

            model.InvoiceId = invoice.Id;
            model.InvoiceNo = invoice.No;
            model.Vendor = invoice.Vendor.Name;
            model.Amount = invoice.GeneralLedgerHeader.GeneralLedgerLines.Where(dr => dr.DrCr == Core.Domain.DrOrCrSide.Dr).Sum(l => l.Amount);

            return View(model);
        }
Esempio n. 5
0
 public ActionResult MakePayment(int id)
 {
     var model = new Models.ViewModels.Purchases.MakePayment();
     var invoice = _purchasingService.GetPurchaseInvoiceById(id);
     model.InvoiceId = invoice.Id;
     model.InvoiceNo = invoice.No;
     model.Vendor = invoice.Vendor.Name;
     model.Amount = invoice.PurchaseInvoiceLines.Sum(a => a.Amount);
     return View(model);
 }