throw an exception if Avalara is misconfigured, and clean up exception handling for...
[freeside.git] / FS / FS / TaxEngine.pm
index 54e305f..ac30eb1 100644 (file)
@@ -40,8 +40,12 @@ FS::TaxEngine - Base class for tax calculation engines.
 Creates an L<FS::TaxEngine> object.  The subclass will be chosen by the 
 'enable_taxproducts' configuration setting.
 
-CUST_MAIN and TIME are required.  OPTIONS can include "cancel" => 1 to 
-indicate that the package is being billed on cancellation.
+CUST_MAIN and TIME are required.  OPTIONS can include:
+
+"cancel" => 1 to indicate that the package is being billed on cancellation.
+
+"estimate" => 1 to indicate that this calculation is for tax estimation,
+and isn't an actual sale invoice, in case that matters.
 
 =cut
 
@@ -91,6 +95,11 @@ L<FS::cust_bill_pkg> objects to add to the invoice.  The base implementation
 is to call L</make_taxlines> to produce a list of "raw" tax line items, 
 then L</consolidate_taxlines> to combine those with the same itemdesc.
 
+If this fails, it will throw an exception. (Accordingly it should not trap
+exceptions from internal methods that it calls, except to translate error 
+messages into a more meaningful form.) If it succeeds, it MUST return an
+arrayref (even if the arrayref is empty).
+
 =cut
 
 sub calculate_taxes {