/// <summary> /// Adds the world tax rule. /// This method adds a tax rule associated with a particular state. /// </summary> /// <param name="TaxRate">The tax rate associated with a tax rule. Tax /// rates are expressed as decimal values. For example, a value of 0.0825 /// specifies a tax rate of 8.25%.</param> public void AddWorldAreaTaxRule(double TaxRate) { foreach (AutoGen.AlternateTaxRule tr in _taxRules) { if (tr.taxarea.Item.GetType() == typeof(AutoGen.WorldArea)) { throw new ApplicationException( "Only one world tax area may exist."); } } AutoGen.AlternateTaxRule rule = new AutoGen.AlternateTaxRule(); rule.rateSpecified = true; rule.rate = TaxRate; rule.taxarea = new AutoGen.AlternateTaxRuleTaxarea(); AutoGen.WorldArea ThisArea = new AutoGen.WorldArea(); rule.taxarea.Item = ThisArea; _taxRules.Add(rule); }
/// <summary> /// Adds the country tax rule. /// This method adds a tax rule associated with a particular state. /// </summary> /// <param name="TaxRate">The tax rate associated with a tax rule. Tax /// rates are expressed as decimal values. For example, a value of 0.0825 /// specifies a tax rate of 8.25%.</param> /// <param name="ShippingTaxed"> /// If this parameter has a value of <b>true</b>, then shipping costs will /// be taxed for items that use the associated tax rule. /// </param> public void AddWorldAreaTaxRule(double TaxRate, bool ShippingTaxed) { AutoGen.DefaultTaxRule Rule = new AutoGen.DefaultTaxRule(); Rule.rateSpecified = true; Rule.rate = TaxRate; Rule.shippingtaxedSpecified = true; Rule.shippingtaxed = ShippingTaxed; Rule.taxarea = new AutoGen.DefaultTaxRuleTaxarea(); AutoGen.WorldArea ThisArea = new AutoGen.WorldArea(); Rule.taxarea.Item = ThisArea; AddNewTaxRule(Rule); }