From erickson.jd at gmail.com Mon Jul 4 19:35:57 2016 From: erickson.jd at gmail.com (JD Erickson) Date: Mon, 4 Jul 2016 20:35:57 -0600 Subject: [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. Message-ID: 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: From erickson.jd at gmail.com Mon Jul 4 23:59:14 2016 From: erickson.jd at gmail.com (JD Erickson) Date: Tue, 5 Jul 2016 00:59:14 -0600 Subject: [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. In-Reply-To: References: Message-ID: After a fair bit of head-scratching and consternation I think I've figured out a work-around which won't make me fully tax-compliant (or even really able to track the proper amount of tax liability) but will at least generate invoices with an MTLT and semi-accurate Sales Tax. I say semi-accurate because the Municipal Telecom License Tax levied by individual cities in my state (and collected and disbursed by the State Tax Commission) is part of the calculated tax base for the purposes of Sales tax (the MTLT is levied on me/my company, but I can recover 100% of it from the customer, making it taxable sales revenue). I can only do this if I make the MTLT a taxable fee that is added as a percentage of package balances and based on other package criteria. However, that taxable fee definition seems to be what was causing the error. When I removed the fee definition and related billing-event, and added the MTLT as a separate tax that isn't part of the sales tax base, everything started working fine. At this point I am considering adding the MTLT as a separate package to make it a taxable line-item, but I don't see a way to define a package price as a percentage of certain other packages on the invoice. Is there a way to do this? It kinda looks like the Fees tool is what you guys created to handle this scenario, but I can't figure out what's causing the bug. On Mon, Jul 4, 2016 at 8:35 PM, JD Erickson wrote: > 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: