Customizing Tax Calculation

Like the Shipping Calculations, the Tax behavior is implemented as a method on the busInvoice object in the CalculateTax method. By default this method returns a simple tax calculation based on the state and taxrate that you entered in the store's configuration.

The basic behavior is as follows (from busInvoice):

public virtual decimal CalculateTax() { if (this.ShipInfo.UseInvoiceFields) { this.ShipInfo.LoadFromInvoice(this); } if (this.ShipInfo.State != App.Configuration.TaxState) return (decimal) 0.00; return this.SubTotal * App.Configuration.TaxRate; }

Like in the Shipping Calculation the ShipInfo object can used in the calculations. Be sure you don't access the invoice fields directly as a full invoice may not actually exist yet.

This calculation might be all you need. If you need more perform more tasks override the method in a custom subclass of the busInvoice object which takes the form of:

public override decimal CalculateTax() { ... your code here return 0.00; }


 Last Updated: 8/3/2006 | Send topic feedback