public JsonResult AddARDebitNote(string accountcode, string amount, string customerCode) { ARDebitNoteDetail item = new ARDebitNoteDetail(); item.AccountCodeDescription = new NetStock.BusinessFactory.ChartOfAccountBO().GetChartOfAccount(new ChartOfAccount { AccountCode = accountcode, BranchID = Utility.SsnBranch }).Description; item.AccountCode = accountcode; item.BaseAmount = Convert.ToDecimal(amount); item.LocalAmount = Convert.ToDecimal(amount); item.CurrencyCode = "THB"; item.TaxAmount = 0; var debtorAccount = new NetStock.BusinessFactory.DebtorBO().GetDebtor(new Debtor { DebtorCode = customerCode }).DebtorAccount; /* Debit Credit Account start */ var debitCreditObj = Utility.GetAccountType(debtorAccount); var customerDC = debitCreditObj != null ? (!string.IsNullOrWhiteSpace(debitCreditObj.DebitCredit) ? debitCreditObj.DebitCredit : "DEBIT") : "DEBIT"; debitCreditObj = Utility.GetAccountType(accountcode); string accountDC = debitCreditObj != null ? (!string.IsNullOrWhiteSpace(debitCreditObj.DebitCredit) ? debitCreditObj.DebitCredit : "DEBIT") : "DEBIT"; /* Debit Credit Account end */ return(Json(new { Message = "Success", ARDebitNoteDetail = item, DebtorAccount = debtorAccount, CustomerDebitCredit = customerDC, AccountDebitCredit = accountDC }, JsonRequestBehavior.AllowGet)); //return Json(new { Message = "Success", ARDebitNoteDetail = item, DebtorAccount = debtorAccount }, JsonRequestBehavior.AllowGet); }
public ActionResult AddARDebitNoteItem(string documentNo, Int16 itemNo) { ARDebitNoteDetail ARDebitNotedetail = null; if (documentNo == string.Empty || documentNo == null) { ARDebitNotedetail = new ARDebitNoteDetail(); } else { ARDebitNotedetail = new NetStock.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 bool Delete(string documentNo, DbTransaction parentTransaction) { var arDebitNotedetailItem = new ARDebitNoteDetail { DocumentNo = documentNo }; return(Delete(arDebitNotedetailItem, parentTransaction)); }
public ARDebitNoteDetail GetARDebitNoteDetail(ARDebitNoteDetail item) { return((ARDebitNoteDetail)ardebitnotedetailDAL.GetItem <ARDebitNoteDetail>(item)); }
public bool DeleteARDebitNoteDetail(ARDebitNoteDetail item) { return(ardebitnotedetailDAL.Delete(item)); }
public bool SaveARDebitNoteDetail(ARDebitNoteDetail newItem) { return(ardebitnotedetailDAL.Save(newItem)); }