public ActionResult LoadAllLocalPayment(DateTime fromDate, DateTime toDate) { List <LocalMarketPayment> paymentList = new List <LocalMarketPayment>(); var partyPayment = partyBalanceService.GetAll(fromDate, toDate).OrderBy(a => a.InvoiceNo); foreach (var item in partyPayment) { LocalMarketPayment payment = new LocalMarketPayment(); var invoice = paymentList.Where(a => a.InvoiceNo == item.AgainstInvoiceNo).FirstOrDefault(); if (invoice == null) { payment.LedgerId = item.LedgerId; if (string.IsNullOrEmpty(item.InvoiceNo)) { payment.InvoiceNo = ""; } else { payment.InvoiceNo = item.InvoiceNo; } payment.PaidAmount = item.Debit ?? 0; payment.Party = item.AccountLedger.LedgerName; payment.PostingDate = item.PostingDate.Value.ToString("dd-MM-yyyy") ?? DateTime.Now.ToString("dd-MM-yyyy"); payment.TotalAmount = item.Credit ?? 0; payment.RestAmount = payment.TotalAmount - payment.PaidAmount; paymentList.Add(payment); } else { invoice.PaidAmount = invoice.PaidAmount + item.Credit ?? 0; invoice.RestAmount = payment.TotalAmount - invoice.PaidAmount; } } return(Json(paymentList, JsonRequestBehavior.AllowGet)); }
public ActionResult EditLedgerPosting(int ledgerPostingId) { var posting = postingService.GetById(ledgerPostingId); var allPosting = partyBalanceService.GetAll(); return(Json("", JsonRequestBehavior.AllowGet)); }