public string CreateInvoice(string invoiceobj)
        {
            dynamic invoiceobject = System.Web.Helpers.Json.Decode(invoiceobj);
            string xmldocument = Newtonsoft.Json.JsonConvert.DeserializeXmlNode(invoiceobj, "invoice").InnerXml;
            xmldocument = xmldocument.Replace("  ", "");
            Business.DataLayer bd = new Business.DataLayer();
            string invoice = bd.GenerateInvoice(Session["userid"].ToString(), Session["companyid"].ToString(), "", Session["companyid"].ToString(), "invoice", "outbound", xmldocument);

            return invoice;
        }
        public string AddExternalInvoice(string invoiceobj)
        {
            dynamic invoiceobject = System.Web.Helpers.Json.Decode(invoiceobj);
            string  xmldocument   = Newtonsoft.Json.JsonConvert.DeserializeXmlNode(invoiceobj, "invoice").InnerXml;

            xmldocument = xmldocument.Replace("  ", "");
            Business.DataLayer bd      = new Business.DataLayer();
            string             invoice = bd.GenerateInvoice(Session["userid"].ToString(), Session["companyid"].ToString(), "", Session["companyid"].ToString(), "invoice", "inbound", xmldocument);

            return(invoice);
        }