public ActionResult AddARDebitNoteItem(string documentNo, Int16 itemNo) { ARDebitNoteDetail ARDebitNotedetail = null; if (documentNo == string.Empty || documentNo == null) { ARDebitNotedetail = new ARDebitNoteDetail(); } else { ARDebitNotedetail = new POSAccount.BusinessFactory.ARDebitNoteBO().GetARDebitNote(new Contract.ARDebitNote { DocumentNo = documentNo }) .ARDebitNoteDetails.Where(dt => dt.ItemNo == itemNo).FirstOrDefault(); if (ARDebitNotedetail == null) { ARDebitNotedetail = new ARDebitNoteDetail(); } } ARDebitNotedetail.CurrencyCodeList = Utility.GetCurrencyItemList(); ARDebitNotedetail.AccountCodeList = Utility.GetAccountCodeItemList(); //arInvoicedetailsItem.ServiceTypeList = Utility.GetLookupItemList("ServiceType"); return(PartialView("AddARDebitNoteItem", ARDebitNotedetail)); //return PartialView("AddQuotationItem"); }
public ActionResult SearchARDebitNote(string documentNo) { if (documentNo != "0") { ARDebitNote ARDebitNote = null; ARDebitNote = new POSAccount.BusinessFactory.ARDebitNoteBO().GetARDebitNote(new ARDebitNote { DocumentNo = documentNo }); if (ARDebitNote == null) { ARDebitNote = new ARDebitNote(); ARDebitNote.DocumentDate = DateTime.Today.Date; ARDebitNote.ARDebitNoteDetails = new List <ARDebitNoteDetail>(); } return(RedirectToAction("ARDebitNote", new { InvoiceType = "", DocumentNo = documentNo })); //return View("CBReceipt", cbReceipt); } else { return(RedirectToAction("ARDebitNote")); } }
public ActionResult ARDebitNote(string invoiceType, string documentNo) { ARDebitNote ARDebitNote = null; if (invoiceType == Utility.NEWRECORD) { ARDebitNote = new ARDebitNote(); ARDebitNote.DocumentDate = DateTime.UtcNow.ThaiTime(); ARDebitNote.ARDebitNoteDetails = new List <ARDebitNoteDetail>(); } else { if (documentNo != null && documentNo != "" && documentNo != "null") { ARDebitNote = new POSAccount.BusinessFactory.ARDebitNoteBO().GetARDebitNote(new ARDebitNote { DocumentNo = documentNo }); } else { //ARInvoice = new POSAccount.BusinessFactory.ARInvoiceBO().GetList().FirstOrDefault(); ARDebitNote = new ARDebitNote(); ARDebitNote.DocumentDate = DateTime.Today.Date; ARDebitNote.ARDebitNoteDetails = new List <ARDebitNoteDetail>(); } } ARDebitNote.DebtorList = Utility.GetDebtorList(); ARDebitNote.CurrencyCodeList = Utility.GetCurrencyItemList(); ARDebitNote.DebtorAccountList = Utility.GetDebtorAccountList(); ARDebitNote.AccountCodeList = Utility.GetAccountCodeItemList(); return(View("ARDebitNote", ARDebitNote)); }
public JsonResult SaveARDebitNote(POSAccount.Contract.ARDebitNote ARDebitNoteData) { try { ARDebitNoteData.CreatedBy = Utility.DEFAULTUSER; ARDebitNoteData.ModifiedBy = Utility.DEFAULTUSER; ARDebitNoteData.Source = ""; var result = new POSAccount.BusinessFactory.ARDebitNoteBO().SaveARDebitNote(ARDebitNoteData); } catch (Exception ex) { ModelState.AddModelError("Error", ex.Message); } return(Json(new { success = true, Message = "Debit Note saved successfully.", ARDebitNoteData = ARDebitNoteData })); }
public JsonResult DeleteARDebitNote(string documentNo, string cancelBy) { //CBReceipt CBReceiptdata = var result = false; cancelBy = Utility.DEFAULTUSER; string message = string.Empty; try { result = new POSAccount.BusinessFactory.ARDebitNoteBO().DeleteARDebitNote(new ARDebitNote { DocumentNo = documentNo, CancelledBy = cancelBy }); } catch (Exception ex) { ModelState.AddModelError("Error", ex.Message); } return(Json(new { result = result, Message = "Debit Note deleted successfully.", documentNo = documentNo })); }