I have a storm site where, when I create an invoice, I can't set "VAT application" to "do not apply tax". Likewise, I can't set VAT percentage to "0" (zero). When I do this, these items get reverted to the default variables (true and 20 respectively).
I traced this to the storm_taxation() function in storm.module, which fetches the default value for these items if they are not set. However, by using

  if (!$node->tax1app) ...

rather than

  if ($node->tax1app === null) ...

the function will consider the "tax application" and "tax percentage" to be not set if they are zero. In this case zero and not set are different values.
The enclosed patch addresses the problem and works on my test site (although I haven't tested it extensively). Comments welcome.
Cheers,
Albert.

CommentFileSizeAuthor
taxation_issue.patch1.05 KBalberto56

Comments

Magnity’s picture

Good spot.

Though I wonder whether if (!isset($node->tax1app)) ... would be a little more self documenting.

Magnity’s picture

Status: Needs review » Fixed

Committed to both branches.

Thanks for pointing out!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.