public ActionResult APInvoiceList() { var lstAPInvoices = new NetStock.BusinessFactory.APInvoiceBO().GetList(); //HttpContext.Session["OrderItems"] = null; return(View("APInvoiceList", lstAPInvoices)); }
public ActionResult AddAPInvoiceItem(string documentNo, Int16 itemNo) { APInvoiceDetail apInvoicedetail = null; if (documentNo == string.Empty || documentNo == null) { apInvoicedetail = new APInvoiceDetail(); } else { apInvoicedetail = new NetStock.BusinessFactory.APInvoiceBO().GetAPInvoice(new Contract.APInvoice { DocumentNo = documentNo }) .APInvoiceDetails.Where(dt => dt.ItemNo == itemNo).FirstOrDefault(); if (apInvoicedetail == null) { apInvoicedetail = new APInvoiceDetail(); } } apInvoicedetail.CurrencyCodeList = Utility.GetCurrencyItemList(); apInvoicedetail.AccountCodeList = Utility.GetAccountCodeItemList(); //arInvoicedetailsItem.ServiceTypeList = Utility.GetLookupItemList("ServiceType"); return(View("AddAPInvoiceItem", apInvoicedetail)); //return PartialView("AddQuotationItem"); }
public ActionResult SearchAPInvoice(string documentNo) { if (documentNo != "0") { APInvoice apinvoice = null; apinvoice = new NetStock.BusinessFactory.APInvoiceBO().GetAPInvoice(new APInvoice { DocumentNo = documentNo }); if (apinvoice == null) { apinvoice = new APInvoice(); apinvoice.DocumentDate = DateTime.Today.Date; apinvoice.APInvoiceDetails = new List <APInvoiceDetail>(); } return(RedirectToAction("APInvoice", new { InvoiceType = "", DocumentNo = documentNo })); //return View("CBReceipt", cbReceipt); } else { return(RedirectToAction("APInvoice")); } }
public JsonResult SaveAPInvoice(NetStock.Contract.APInvoice apInvoiceData) { try { apInvoiceData.CreatedBy = Utility.DEFAULTUSER; apInvoiceData.ModifiedBy = Utility.DEFAULTUSER; apInvoiceData.Source = "AP"; apInvoiceData.CurrencyCode = Utility.DEFAULTCURRENCYCODE; apInvoiceData.BranchID = Utility.SsnBranch; var result = new NetStock.BusinessFactory.APInvoiceBO().SaveAPInvoice(apInvoiceData); } catch (Exception ex) { ModelState.AddModelError("Error", ex.Message); } return(Json(new { success = true, Message = "Invoice saved successfully.", apInvoiceData = apInvoiceData })); }
public JsonResult DeleteAPInvoice(string documentNo, string cancelBy) { //CBReceipt CBReceiptdata = var result = false; cancelBy = Utility.DEFAULTUSER; string message = string.Empty; try { result = new NetStock.BusinessFactory.APInvoiceBO().DeleteAPInvoice(new APInvoice { 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 APInvoice(string invoiceType, string documentNo) { APInvoice apInvoice = null; if (invoiceType == Utility.NEWRECORD) { apInvoice = new APInvoice(); apInvoice.DocumentDate = DateTime.UtcNow.ThaiTime(); apInvoice.APInvoiceDetails = new List <APInvoiceDetail>(); } else { if (documentNo != null && documentNo != "") { apInvoice = new NetStock.BusinessFactory.APInvoiceBO().GetAPInvoice(new APInvoice { DocumentNo = documentNo }); } else { //apInvoice = new NetStock.BusinessFactory.APInvoiceBO().GetList().FirstOrDefault(); apInvoice = new APInvoice(); apInvoice.DocumentDate = DateTime.Today.Date; apInvoice.APInvoiceDetails = new List <APInvoiceDetail>(); } } if (apInvoice != null) { apInvoice.CreditorList = Utility.GetCreditorList(); apInvoice.CurrencyCodeList = Utility.GetCurrencyItemList(); apInvoice.AccountCodeList = Utility.GetAccountCodeItemList().ToList(); } return(View("APInvoice", apInvoice)); }