Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Sales Tax Question

Featured Replies

If you have products and services in an invoice, and you want the Sales tax to only calculate tax on the subtotal of the products, what is the best way to differentiate a taxab;e item from a non-taxable item on an invoice line?

Thanks

In such a case you really need two subtotals, a non-taxable item subtotal and a taxable item subtotal. You might not want to display both, but to apply the sales tax percentage, you will need the intermediate result. To allow the calculation of these two different subtotals, you will need two calculated fields on each line. Your fields might be:

LineItemAmount (number)

Taxable? (number, show as checkbox)

cLineItemTaxable (calculation, number) = If(Taxable?, LineItemAmount, 0)

cLineItemNoTax (calculation, number) = If(Taxable?, 0, LineItemAmount)

The two different subtotals, taxable and non-taxable, would sum the two calculated fields above. The displayed subtotal field adds these two subtotal fields.

-bd

  • Author

Thank you, LiveOak.

So when you use a checkbox how does a formula evaluate it? If it is checked it is a result of 1, and if it is not checked it has a value of 0?

If Taxable = 1

extended prce * Sales Tax

else

extended price

I don't understand what

cLineItemTaxable (calculation, number) = If(Taxable?, LineItemAmount, 0)

cLineItemNoTax (calculation, number) = If(Taxable?, 0, LineItemAmount)

means.

I understand what you are saying, but the code doesn't make sense to me. Is what you have written here the exact code?

Sorry I am very new at this.

Thanks

If( field, anotherfield, 0 ) or Case( field, anotherfield, 0 ) will return anotherfield when field is any number but zero, and 0 otherwise. It is a semi-boolean calcualation treating all non-zero numbers as 'true'.

  • Author

Thank you, BTW aren't you being a little modest, showing your skill level as intermediate? If you are Intermediate, I can't even be considered a beginner.:

The confusing thing for me anyway is, since there can be multiple items on an invoice, let's say 2 taxable, and 3 non-taxable, doesn't each one of these two subtotal fields need to have a sum in it?

As shown:

cLineItemTaxable (calculation, number) = If(Taxable?, LineItemAmount, 0)

cLineItemNoTax (calculation, number) = If(Taxable?, 0, LineItemAmount)

Maybe like, If(Taxable; sum(extendedprice*salestax);extendedprice)

and If (Taxable;0;extendedprice)

Then subtotal = cLineItemTaxable+cLineItemNoTax

Thanks again

As Brent said, you would have two additional subtotal fields to sum the calculated LineItemAmounts and a total field to add these two sums. You could combine them, if you like. I'm assuming you would be doing this from an invoice table where the line item records would be related by invoice number, in which case it would be a calculation like Sum(LineItems::cLineItemTaxable) * salestax + Sum(LineItems::cLineItemNoTax).

Thanks for the compliment, but I don't see myself as proficient as some of the gurus. I don't do FMU, CDML, XML, and the like. I just love calculations and cool scripts, is all. smile.gif

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.