Software Venture Consulting

FileMaker Pro downloads & Resources
FileMaker Custom Functions
FileMaker Web Viewer Examples
FileMaker Pro & Lasso Consulting
Training
FileMaker Books
FileMaker Articles
FileMaker Error Reference

Free Web Tools
Free FileMaker Tools

Personal Pages
Videos
Adventures
Links

Shopping Cart
Shopping Cart

Search:

Free Newsletter
Signup


Contact


Privacy Policy



FileMaker is a registered trademark of FileMaker, Inc. in the U.S. and other countries.

 

 FileMaker Pro Custom Functions

List  |  Show Random  |  Upload  |  Add This to Your Site

SalesTax ( Taxable ; Exempt ; Rate ; Method ; Start )

Rate this function:  

RatingRatingRatingRatingRating
  Average rating: 4.4  (13 votes)
  Discuss this Custom Function

Jeep Watson, Uptown Press
www.uptownpress.com

Calculate Sales Tax

Sample Input:
Ohio - SalesTax ( 8.40 ; 0 ; .0675 ; "R" ; .08 )
Maryland - SalesTax ( 10.75 ; 0 ; .06 ; "C" ; .20 )
Texas - SalesTax ( 11.59 ; 0 ; .0825 ; "R" ; .07 )
Texas - SalesTax ( 11.59 ; 1 ; .0825 ; "R" ; .07 )
Sample Output:
.57
.65
.96
.00


 Then copy & paste into FileMaker Advanced's Edit Custom Function window.

Click here to copy To Clip Manager if you have myFMbutler's Clip Manager installed

Description:

I've written software for several retail clients in my home state of Maryland. In 2008
Maryland raised its Retail Sales Tax from 5% to 6%. The 5% rate was relatively easy
to do with a simple calculation. Not so with the 6% rate. Multiplying a subtotal by 6%
(.06) results in fractional cents. I tried using the Round function in Filemaker,
thinking that would be an equitable solution but the results did not line up with the
state's published tax chart. Rather than spending more time on figuring out the math
behind Maryland's chart, I decided to make the calculation a simple lookup table. It
took less than 20 lines of code, was easy to write, and was plenty quick enough.

Recently I was tuning up some older custom functions and thought it might be a
good idea to create a custom function for calculating Sales Tax. Nice and portable
and easy to implement in new applications. I posted the function on Brian Dunning's
site for others to use. In a couple of days I got a response from Michael Horak
(Comment, as he is known on various Filemaker forums) showing a short calculation
using the Ceiling function - a variation of the Round function (it always rounds up).
The results synced perfectly with Maryland's chart.

After rewriting the function, I thought "why not make it flexible so it could be used in
other states." I downloaded charts from a dozen other states, added a few extra
parameters, and started testing. The results were accurate for every state I tested.
You just need test it to see which computational method is used by your state. That's
why I created this testing demo. I can't guarantee every state will use one of these
computational methods but if it works for you, enjoy.

A demo file and state charts are available at this link:

https://www.dropbox.com/sh/pj3as15ttiphvwp/AAAfkZfWPaamJXNRDGksDRkOa?dl=0

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

This is my Custom Function and I want to edit it

Discuss:

There are no comments yet. Be the first to post a comment about this Custom Function! Please try to keep it brief & to the point. Anyone can post:

Your Name:
City/Location:
Comment:
characters left. If you paste in more than 1500 characters, it will be truncated. Discuss the function - advertisements and other useless posts will be deleted.
Answer 1 + 9 =
Search for Custom Functions:

Custom Functions Widget
Download the Custom Function Dashboard Widget for OS X
Keep all the latest Custom Functions right at your fingertips!

Newest Custom Functions:

1. ProperAllWords ( text )
  (Thu, Dec 14, 5:19pm)
2. MatchExist ( SourceTable.Field ; DestTable.Field ; ReturnField )
  (Thu, Dec 14, 1:07pm)
3. BVR_Format ( bvr )
  (Wed, Dec 13, 5:32pm)
4. NumberToHexadecimal(NumberValue)
  (Fri, Dec 08, 8:54am)
5. Get_BaseTable
  (Thu, Dec 07, 4:27pm)
6. JSONCreateVarsFromKeys ( json ; namespace )
  (Wed, Dec 06, 8:21pm)
7. GetTableNzme ( field )
  (Tue, Dec 05, 9:16pm)
8. TimeFormatAsText ( theTime )
  (Mon, Nov 13, 1:59pm)

RSS Feed of Custom Functions