public ActionResult GetTotalCollection(int shopNumber) { BillingMain bm = new BillingMain(); List <PaymentViewModel> totalcollection = bm.getTotalCollection(shopNumber); return(Json(totalcollection, JsonRequestBehavior.AllowGet)); }
public ActionResult DetailsLevelTwo(int shopnumber, string billdate) { BillingMain bm = new BillingMain(); List <BillingMain> result = bm.getBills_billeddate(shopnumber, DateTime.Parse(billdate).ToString("yyyy-MM-dd")); TempData["Message"] = ""; return(result.Count != 0 ? View(result) : View("DetailsLevelOne", new VendorPayments().getVendorPayments_unpaid(shopnumber))); }
public bool GenerateBill(ref string invNumber, Shop shop) { CardRegistration card = new CardRegistration(); card = card.getCardInfo(this.cardNumber); Dictionary <string, decimal> calResults = caluclations(card); BillingChild billChild = new BillingChild(); BillingMain billMain = new BillingMain(); int billcount = billMain.getBillCount(shop.ShopNumber); int todaysBillCount = billMain.getTodaysBillCount(shop.ShopNumber); invNumber = "YON" + DateTime.Now.Year + "-" + (billcount + 1); billMain.invoiceNumber = invNumber; billMain.billedDate = DateTime.Now; billMain.time = DateTime.Now.ToShortTimeString(); billMain.shopNumber = shop.ShopNumber; billMain.GST_amt = calResults["taxVal"]; billMain.totalAmount = calResults["totalWithoutTax"]; billMain.discount = card.Discount; billMain.CGST_amt = calResults["taxVal"] / 2; billMain.SGST_amt = calResults["taxVal"] / 2; billMain.cardNumber = card.CardNumber; billMain.name = card.Name; billMain.phoneNumber = card.PhoneNumber; billMain.netAmount = calResults["totalAfterDiscount"] + calResults["taxVal"]; billMain.order_number = todaysBillCount + 1; billMain.billedBy = shop.Owner; List <bool> results = new List <bool>(); results.Add(billMain.newBill()); string financialYear = billMain.getLastFinancialYear(shop.ShopNumber); foreach (var bi in this.billItems) { billChild.financialYear = financialYear; billChild.invoiceNumber = invNumber; billChild.BilledDate = DateTime.Now; billChild.shopNumber = shop.ShopNumber; billChild.itemName = bi.itemName; billChild.quantity = bi.qty; billChild.price = bi.Price; billChild.total = bi.totalWithoutTax; billChild.totalWithTax = bi.total; billChild.gst = bi.gst; billChild.cgst = bi.gst / 2; billChild.sgst = bi.gst / 2; billChild.gst_amt = bi.totalWithoutTax - bi.total; billChild.cgst_amt = (bi.total - bi.totalWithoutTax) / 2; billChild.sgst_amt = (bi.total - bi.totalWithoutTax) / 2; billChild.slno = billItems.IndexOf(bi) + 1; results.Add(billChild.addBillItem()); } results.Add(card.UpdateBalanceDebit(calResults["totalAfterDiscount"] + calResults["taxVal"])); return(!results.Contains(false)); }
public ActionResult Details(string invNumber) { if (string.IsNullOrEmpty(invNumber)) { return(RedirectToAction("Details")); } BillingMain bm = new BillingMain(); bm = bm.getBillInfo(((Shop)Session["Shop"]).ShopNumber, invNumber); return(View(bm)); }
public ActionResult Manage(string fromDate = null, string toDate = null) { if (Session["Shop"] == null) { return(RedirectToAction("Logout", "AdminHome")); } BillingMain bm = new BillingMain(); List <BillingMain> bills = new List <BillingMain>(); if (string.IsNullOrEmpty(fromDate) && string.IsNullOrEmpty(toDate)) { bills = bm.getBills(((Shop)Session["Shop"]).ShopNumber); } else { bills = bm.getBills(fromDate, toDate, ((Shop)Session["Shop"]).ShopNumber); } return(View(bills)); }
public ActionResult CancelBill(string invNumber) { bool success = false; string message = ""; BillingMain bm = new BillingMain(); bm = bm.getBillInfo(((Shop)Session["Shop"]).ShopNumber, invNumber); if (bm.UpdateBillStatus("Cancelled")) { success = true; message = "Bill Cancelled Successfully"; } else { success = false; message = "Bill Cancellation Failed"; } return(Json(new { success = success, message = message }, JsonRequestBehavior.AllowGet)); }