Ejemplo n.º 1
0
        public ActionResult AddAPDebitNoteItem(string documentNo, Int16 itemNo)
        {
            APDebitNoteDetail apDebitNotedetail = null;

            if (documentNo == string.Empty || documentNo == null)
            {
                apDebitNotedetail = new APDebitNoteDetail();
            }
            else
            {
                apDebitNotedetail = new NetStock.BusinessFactory.APDebitNoteBO().GetAPDebitNote(new Contract.APDebitNote {
                    DocumentNo = documentNo
                })
                                    .APDebitNoteDetails.Where(dt => dt.ItemNo == itemNo).FirstOrDefault();
                if (apDebitNotedetail == null)
                {
                    apDebitNotedetail = new APDebitNoteDetail();
                }
            }

            apDebitNotedetail.CurrencyCodeList = Utility.GetCurrencyItemList();
            apDebitNotedetail.AccountCodeList  = Utility.GetAccountCodeItemList();

            //arInvoicedetailsItem.ServiceTypeList = Utility.GetLookupItemList("ServiceType");
            return(PartialView("AddAPDebitNoteItem", apDebitNotedetail));
            //return PartialView("AddQuotationItem");
        }
Ejemplo n.º 2
0
        public bool Delete(string documentNo, DbTransaction parentTransaction)
        {
            var item = new APDebitNoteDetail {
                DocumentNo = documentNo
            };

            return(Delete(item, parentTransaction));
        }
Ejemplo n.º 3
0
        public JsonResult AddAPDebitNote(string accountcode, string amount, string customerCode)
        {
            APDebitNoteDetail item = new APDebitNoteDetail();

            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 creditorAccount = new NetStock.BusinessFactory.CreditorBO().GetCreditor(new Creditor {
                CreditorCode = customerCode
            }).CreditorAccount;
            /* Debit Credit Account start */
            var debitCreditObj = Utility.GetAccountType(creditorAccount);
            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",
                ARCreditNoteDetail = item,
                CreditorAccount = creditorAccount,
                CustomerDebitCredit = customerDC,
                AccountDebitCredit = accountDC
            }, JsonRequestBehavior.AllowGet));


            //    var creditorAccount = new NetStock.BusinessFactory.CreditorBO().GetCreditor(new Creditor { CreditorCode = customerCode }).CreditorAccount;

            //return Json(new { Message = "Success", APDebitNoteDetail = item, CreditorAccount = creditorAccount}, JsonRequestBehavior.AllowGet);
        }
Ejemplo n.º 4
0
 public APDebitNoteDetail GetAPDebitNoteDetail(APDebitNoteDetail item)
 {
     return((APDebitNoteDetail)apdebitnotedetailDAL.GetItem <APDebitNoteDetail>(item));
 }
Ejemplo n.º 5
0
 public bool DeleteAPDebitNoteDetail(APDebitNoteDetail item)
 {
     return(apdebitnotedetailDAL.Delete(item));
 }
Ejemplo n.º 6
0
 public bool SaveAPDebitNoteDetail(APDebitNoteDetail newItem)
 {
     return(apdebitnotedetailDAL.Save(newItem));
 }