[freeside-users] Error: Error billing custnum 5981: Can't call method "setuptax" on an undefined value at /usr/share/perl5/FS/TaxEngine/internal.pm line 127.

JD Erickson erickson.jd at gmail.com
Mon Jul 4 19:35:57 PDT 2016


Hello,

I may have a found a potential bug in FreeSide 4.0 (running on Debian 8.5),
which I recently installed from deb packages just a couple weeks ago.

I realize that FreeSide offers paid support services, but I am posting to
the mailing list because I believe this is a bug rather than a PEBKAC or
"dumb admin" problem. If a developer feels differently after reading my
post, they can say so and I'll go from there.

When attempting to "Bill Now" on any customer who is not "tax exempt" whose
billing address has a configured state/county/city locale in the internal
tax engine, I receive the following error:

Error: Error billing custnum 5981: Can't call method "setuptax" on an
undefined value at /usr/share/perl5/FS/TaxEngine/internal.pm line 127.

I'm certain I have not set anything up incorrectly. I'm by no means a Perl
expert, but the code throwing an error there seems to be implying that
either $part_pkg or $tax_object are undefined values, which strikes me as
very strange. If they were undefined values it doesn't seem like execution
should even be making it that far into the billing process.

Also, $tax_object doesn't seem to be treated as being undefined earlier in
the taxline subroutine code (methods/attributes of $tax_object are checked
several times), which seems to point the finger at $part_pkg despite the
fact that no error is thrown when it is initialized from
$cust_bill_pkg->part_pkg on line 102.

Again, if I exempt the customer from taxes, the error is not thrown.
Setting tax exemptions inside a package definition has no effect.

I have not not done anything strange inside the "Locales and tax rates"
configuration settings. I have only set basic State Sales & Use Tax rates
for a few cities inside my county/state. Changing the Setup tax exemption
flag on these does not help either.

HOWEVER, throwing another wrench into the works, if I REMOVE the tax
city/locale of my test customer from the tax locale configurations, "Bill
Now" works as normal with no problem, including the processing/addition of
fees like state E911 fees and municipal telecom tax license recovery fees
during billing events, and also checking if there is automatic payment
information available to process a card or ACH.

The only problem is that I cannot properly assess Sales & Use Taxes using
the internal tax engine. I could do it if I removed the locale and add a
manual tax adjustment for each customer in that locale, but I would have to
keep an eye on it every time there is a package or service change since
it's a flat adjustment, which makes it a hack-y workaround and not a fix
for this problem. Since practically 0 of my customers are tax exempt, I
have also considered another workaround by assessing the sales tax as a
"fee" and invoicing it in the same way as the E911 and MTLT fees, at least
until a solution can be found. Although this introduces another problem
since, in my state, the MTLT fee is part of the taxable base of the sales
tax (and I have it currently configured as such), but E911 is not. Adding
the sales tax as a fee definition will require me to set it up in a way
that may not calculate the all of the sales taxes correctly.

Anyone have any idea what could be going on here?

Thanks in advance for any help provided.

--
JD Erickson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://freeside.biz/pipermail/freeside-users/attachments/20160704/8796a17f/attachment.html>


More information about the freeside-users mailing list