Esempio n. 1
0
 public void Add(SalesTaxCode taxcode)
 {
     QbDb.SalesTaxCodes.InsertOnSubmit(taxcode);
 }
Esempio n. 2
0
        public static void ItemSalesTaxGroupQueryRs(string response)
        {
            var rep = new Repository();
            var client = rep.GetClient(rep.GetUser(WebSecurity.CurrentUserId).ClientID ?? 0);
            var db = Database.Open("Quickbooks");
            var taxCodes = XDocument.Parse(response).Document.Root.Descendants("QBXMLMsgsRs").Descendants("ItemSalesTaxGroupQueryRs").FirstOrDefault().Descendants("ItemSalesTaxGroupRet");
            var clientID = rep.GetUser(WebSecurity.CurrentUserId).ClientID;
            foreach (var item in taxCodes)
            {
                var taxCode = rep.GetSalesTaxCode(rep.GetUser(WebSecurity.CurrentUserId).ClientID ?? 0, item.Descendants("Name").FirstOrDefault().Value);
                var taxCodeExists = taxCode != null;
                var name = item.Descendants("Name").FirstOrDefault().Value;
                var listID = item.Descendants("ListID").FirstOrDefault().Value;
                decimal rate = 0;

                foreach(var rat in item.Descendants("ItemSalesTaxRef"))
                {
                    rate += rep.GetSalesTaxCode(clientID ?? 0,rat.Descendants("FullName").FirstOrDefault().Value).Rate;
                }
                var taxRate = rate;
                if (!taxCodeExists)
                {
                    var taxcode = new SalesTaxCode()
                    {
                        ClientID = clientID ?? 0,
                        QuickbooksFullName = name,
                        Rate = taxRate
                    };
                    rep.Add(taxcode);
                }

                rep.Save();
            }
        }
Esempio n. 3
0
		private void detach_SalesTaxCodes(SalesTaxCode entity)
		{
			this.SendPropertyChanging();
			entity.Client = null;
		}
Esempio n. 4
0
 partial void DeleteSalesTaxCode(SalesTaxCode instance);
Esempio n. 5
0
 partial void UpdateSalesTaxCode(SalesTaxCode instance);
Esempio n. 6
0
 partial void InsertSalesTaxCode(SalesTaxCode instance);