public ActionResult AddARInvoiceItem(string documentNo, Int16 itemNo) { ARInvoiceDetail arInvoicedetail = null; if (documentNo == string.Empty || documentNo == null) { arInvoicedetail = new ARInvoiceDetail(); } else { arInvoicedetail = new NetStock.BusinessFactory.ARInvoiceBO().GetARInvoice(new Contract.ARInvoice { DocumentNo = documentNo }) .ARInvoiceDetails.Where(dt => dt.ItemNo == itemNo).FirstOrDefault(); if (arInvoicedetail == null) { arInvoicedetail = new ARInvoiceDetail(); } } arInvoicedetail.CurrencyCodeList = Utility.GetCurrencyItemList(); arInvoicedetail.AccountCodeList = Utility.GetAccountCodeItemList(); //arInvoicedetailsItem.ServiceTypeList = Utility.GetLookupItemList("ServiceType"); return(PartialView("AddARInvoiceItem", arInvoicedetail)); //return PartialView("AddQuotationItem"); }
public ActionResult SearchARInvoice(string documentNo) { if (documentNo != "0") { ARInvoice arinvoice = null; arinvoice = new NetStock.BusinessFactory.ARInvoiceBO().GetARInvoice(new ARInvoice { DocumentNo = documentNo }); if (arinvoice == null) { arinvoice = new ARInvoice(); arinvoice.DocumentDate = DateTime.Today.Date; arinvoice.ARInvoiceDetails = new List <ARInvoiceDetail>(); } arinvoice.DebtorList = Utility.GetDebtorList(); arinvoice.CurrencyCodeList = Utility.GetCurrencyItemList(); return(RedirectToAction("ARInvoice", new { InvoiceType = "", DocumentNo = documentNo })); } else { return(RedirectToAction("ARInvoice")); } }
public ActionResult ARInvoice(string documentNo) { ARInvoice arInvoice = null; if (documentNo == Utility.NEWRECORD) { arInvoice = new ARInvoice(); //arInvoice.DocumentDate = Convert.ToDateTime(DateTime.Now.Date.ToString("dd-MM-yyyy")); arInvoice.DocumentDate = DateTime.UtcNow.ThaiTime(); arInvoice.ARInvoiceDetails = new List <ARInvoiceDetail>(); } else { if (documentNo != null && documentNo != "" && documentNo != "null") { arInvoice = new NetStock.BusinessFactory.ARInvoiceBO().GetARInvoice(new ARInvoice { DocumentNo = documentNo }); } else { arInvoice = new ARInvoice(); arInvoice.DocumentDate = DateTime.Today.Date; arInvoice.ARInvoiceDetails = new List <ARInvoiceDetail>(); } } arInvoice.DebtorList = Utility.GetDebtorList(); arInvoice.DiscountTypeList = Utility.GetDiscountList(); arInvoice.CurrencyCodeList = Utility.GetCurrencyItemList(); arInvoice.AccountCodeList = Utility.GetAccountCodeItemList(); return(View("ARInvoice", arInvoice)); }
public JsonResult SaveARInvoice(NetStock.Contract.ARInvoice arInvoiceData) { var recStatus = false; var strMessage = ""; try { arInvoiceData.CreatedBy = Utility.DEFAULTUSER; arInvoiceData.ModifiedBy = Utility.DEFAULTUSER; arInvoiceData.Source = "AR"; arInvoiceData.CurrencyCode = Utility.DEFAULTCURRENCYCODE; arInvoiceData.BranchID = Utility.SsnBranch; strMessage = "Invoice saved successfully."; var result = new NetStock.BusinessFactory.ARInvoiceBO().SaveARInvoice(arInvoiceData); recStatus = result; } catch (Exception ex) { ModelState.AddModelError("Error", ex.Message); strMessage = ex.Message + " >> " + ex.InnerException.Message; } return(Json(new { success = recStatus, Message = strMessage, arInvoiceData = arInvoiceData })); }
public JsonResult SearchItem(string searchText, int limitRecords, string source = null) { try { IQueryable <ARInvoice> _iQCBReceipt; _iQCBReceipt = new NetStock.BusinessFactory.ARInvoiceBO().GetList().AsQueryable();//.GetARInvoice(searchText, limitRecords); //var res = (from r in result where r.BranchID.ToString().Contains(searchText) select r.BranchID).ToList(); return(Json(new { data = _iQCBReceipt }, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { return(Json(ex.Message)); } }
public JsonResult DeleteARInvoice(string documentNo, string cancelBy) { var result = false; cancelBy = Utility.DEFAULTUSER; string message = string.Empty; try { result = new NetStock.BusinessFactory.ARInvoiceBO().DeleteARInvoice(new ARInvoice { DocumentNo = documentNo, CancelledBy = cancelBy }); } catch (Exception ex) { ModelState.AddModelError("Error", ex.Message); } return(Json(new { result = result, Message = "Invoice deleted successfully.", documentNo = documentNo })); }
public ActionResult ARInvoiceList() { var lstARInvoices = new NetStock.BusinessFactory.ARInvoiceBO().GetList().Where(x => x.IsCancel == false).ToList(); return(View("ARInvoiceList", lstARInvoices)); }