Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7365 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

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

Posted

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

Posted

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'.

Posted

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

Posted

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

This topic is 7365 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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