示例#1
0
        public ActionResult SearchAPCreditNote(string documentNo)
        {
            if (documentNo != "0")
            {
                APCreditNote apCreditNote = null;

                apCreditNote = new NetStock.BusinessFactory.APCreditNoteBO().GetAPCreditNote(new APCreditNote {
                    DocumentNo = documentNo
                });

                if (apCreditNote == null)
                {
                    apCreditNote = new APCreditNote();
                    apCreditNote.DocumentDate        = DateTime.Today.Date;
                    apCreditNote.APCreditNoteDetails = new List <APCreditNoteDetail>();
                }


                return(RedirectToAction("APCreditNote", new { InvoiceType = "", DocumentNo = documentNo }));
                //return View("CBReceipt", cbReceipt);
            }
            else
            {
                return(RedirectToAction("APCreditNote"));
            }
        }
示例#2
0
        public ActionResult APCreditNote(string invoiceType, string documentNo)
        {
            APCreditNote apCreditNote = null;

            if (invoiceType == Utility.NEWRECORD)
            {
                apCreditNote = new APCreditNote();
                apCreditNote.DocumentDate        = DateTime.UtcNow.ThaiTime();
                apCreditNote.APCreditNoteDetails = new List <APCreditNoteDetail>();
                apCreditNote.CreditorList        = Utility.GetCreditorList();
                apCreditNote.AccountCodeList     = Utility.GetAccountCodeItemList();
            }
            else
            {
                if (documentNo != null && documentNo != "")
                {
                    apCreditNote = new NetStock.BusinessFactory.APCreditNoteBO().GetAPCreditNote(new APCreditNote {
                        DocumentNo = documentNo
                    });
                    apCreditNote.CreditorList    = Utility.GetCreditorList();
                    apCreditNote.AccountCodeList = Utility.GetAccountCodeItemList();
                }
                else
                {
                    //apInvoice = new NetStock.BusinessFactory.APInvoiceBO().GetList().FirstOrDefault();

                    apCreditNote = new APCreditNote();
                    apCreditNote.DocumentDate        = DateTime.Today.Date;
                    apCreditNote.APCreditNoteDetails = new List <APCreditNoteDetail>();
                    apCreditNote.CreditorList        = Utility.GetCreditorList();
                    apCreditNote.AccountCodeList     = Utility.GetAccountCodeItemList();
                }
            }
            //apCreditNote.CreditorList = Utility.GetCreditorList();
            //apCreditNote.CurrencyCodeList = Utility.GetCurrencyItemList();


            return(View("APCreditNote", apCreditNote));
        }
示例#3
0
 public APCreditNote GetAPCreditNote(APCreditNote item)
 {
     return((APCreditNote)apcreditnoteDAL.GetItem <APCreditNote>(item));
 }
示例#4
0
 public bool DeleteAPCreditNote(APCreditNote item)
 {
     return(apcreditnoteDAL.Delete(item));
 }
示例#5
0
 public bool SaveAPCreditNote(APCreditNote newItem)
 {
     return(apcreditnoteDAL.Save(newItem));
 }