コード例 #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");
        }
コード例 #2
0
        public ActionResult SearchAPDebitNote(string documentNo)
        {
            if (documentNo != "0")
            {
                APDebitNote apDebitNote = null;

                apDebitNote = new NetStock.BusinessFactory.APDebitNoteBO().GetAPDebitNote(new APDebitNote {
                    DocumentNo = documentNo
                });

                if (apDebitNote == null)
                {
                    apDebitNote = new APDebitNote();
                    apDebitNote.DocumentDate       = DateTime.Today.Date;
                    apDebitNote.APDebitNoteDetails = new List <APDebitNoteDetail>();
                }


                return(RedirectToAction("APDebitNote", new { InvoiceType = "", DocumentNo = documentNo }));
                //return View("CBReceipt", cbReceipt);
            }
            else
            {
                return(RedirectToAction("APDebitNote"));
            }
        }
コード例 #3
0
        public JsonResult SaveAPDebitNote(NetStock.Contract.APDebitNote apDebitNoteData)
        {
            try
            {
                apDebitNoteData.CreatedBy  = Utility.DEFAULTUSER;
                apDebitNoteData.ModifiedBy = Utility.DEFAULTUSER;
                apDebitNoteData.Source     = "";


                var result = new NetStock.BusinessFactory.APDebitNoteBO().SaveAPDebitNote(apDebitNoteData);
            }
            catch (Exception ex)
            {
                ModelState.AddModelError("Error", ex.Message);
            }

            return(Json(new { success = true, Message = "Debit Note saved successfully.", apDebitNoteData = apDebitNoteData }));
        }
コード例 #4
0
        public JsonResult DeleteAPDebitNote(string documentNo, string cancelBy)
        {
            //CBReceipt CBReceiptdata =
            var result = false;

            cancelBy = Utility.DEFAULTUSER;
            string message = string.Empty;

            try
            {
                result = new NetStock.BusinessFactory.APDebitNoteBO().DeleteAPDebitNote(new APDebitNote {
                    DocumentNo = documentNo, CancelledBy = cancelBy
                });
            }
            catch (Exception ex)
            {
                ModelState.AddModelError("Error", ex.Message);
            }

            return(Json(new { result = result, Message = "Debit Note deleted successfully.", documentNo = documentNo }));
        }
コード例 #5
0
        public ActionResult APDebitNote(string invoiceType, string documentNo)
        {
            APDebitNote apDebitNote = null;

            if (invoiceType == Utility.NEWRECORD)
            {
                apDebitNote = new APDebitNote();
                apDebitNote.DocumentDate       = DateTime.UtcNow.ThaiTime();
                apDebitNote.APDebitNoteDetails = new List <APDebitNoteDetail>();
                apDebitNote.CreditorList       = Utility.GetCreditorList();
                apDebitNote.AccountCodeList    = Utility.GetAccountCodeItemList();
            }
            else
            {
                if (documentNo != null && documentNo != "")
                {
                    apDebitNote = new NetStock.BusinessFactory.APDebitNoteBO().GetAPDebitNote(new APDebitNote {
                        DocumentNo = documentNo
                    });
                    apDebitNote.CreditorList    = Utility.GetCreditorList();
                    apDebitNote.AccountCodeList = Utility.GetAccountCodeItemList();
                }
                else
                {
                    //apInvoice = new NetStock.BusinessFactory.APInvoiceBO().GetList().FirstOrDefault();

                    apDebitNote = new APDebitNote();
                    apDebitNote.DocumentDate       = DateTime.UtcNow.ThaiTime();
                    apDebitNote.APDebitNoteDetails = new List <APDebitNoteDetail>();
                    apDebitNote.CreditorList       = Utility.GetCreditorList();
                    apDebitNote.AccountCodeList    = Utility.GetAccountCodeItemList();
                }
            }

            return(View("APDebitNote", apDebitNote));
        }