I have developed a method to handle the vexing problems associated with tax-on-tax and multitiered taxes. Those of you who live in states where multi-tiered taxes would know what I am talking about.
The method works perfectly except for some pesky expression errors in my invoicing form that I can't for the life of me figure out. The funny thing is that the results of using exactly the same expressions produce the correct results when they are used in other forms and reports.
I have an invoicing set that contains a TAX table. Each invoice item can be associated with more than one tax. For example there could be a city tax and a state tax. Each tax occupies a record in the tax table. The tax table is composed of the following fields:
tax_name
tax_type
tax_rate
The idea is that when I bring up my invoicing form, I can see each invoice line item and on the bottom of the form the TAX table is used to create a little self expanding embedded browse that identifies each of the tax regimes that may apply to the invoice. I've created a calculated field called SALES_TAX that I have inserted into this embedded browse.
SALES_TAX is basically tax_rate * sales_amount so if there were two taxes there
would be two rows associated with an invoice. EAch tax is identified with a tax_name, a tax_type, a tax_rate and a SALES_TAX.
I have another calculated field called TAX_TOTAL that totals this SALE_TAX calculated field. The expression is a follows:
TAX_TOTAL=total(calc->SALES_TAX,GRP->GRAND)
Believe me, this works! I have tried every other combination and permutation in the book to no avail. This expression structure works like a charm in every report and form I use it in except for one. In this one form, TAX_TOTAL generates the correct answer only if there is more than one tax row associated with an invoice. The answer is incorrect if there is only one row. If i were to print a report with the same values I would get the correct answers.
I am at wits end on this. Perhaps I could side step the whole issue if there is another way to total a calculated field in an embedded browse.
The method works perfectly except for some pesky expression errors in my invoicing form that I can't for the life of me figure out. The funny thing is that the results of using exactly the same expressions produce the correct results when they are used in other forms and reports.
I have an invoicing set that contains a TAX table. Each invoice item can be associated with more than one tax. For example there could be a city tax and a state tax. Each tax occupies a record in the tax table. The tax table is composed of the following fields:
tax_name
tax_type
tax_rate
The idea is that when I bring up my invoicing form, I can see each invoice line item and on the bottom of the form the TAX table is used to create a little self expanding embedded browse that identifies each of the tax regimes that may apply to the invoice. I've created a calculated field called SALES_TAX that I have inserted into this embedded browse.
SALES_TAX is basically tax_rate * sales_amount so if there were two taxes there
would be two rows associated with an invoice. EAch tax is identified with a tax_name, a tax_type, a tax_rate and a SALES_TAX.
I have another calculated field called TAX_TOTAL that totals this SALE_TAX calculated field. The expression is a follows:
TAX_TOTAL=total(calc->SALES_TAX,GRP->GRAND)
Believe me, this works! I have tried every other combination and permutation in the book to no avail. This expression structure works like a charm in every report and form I use it in except for one. In this one form, TAX_TOTAL generates the correct answer only if there is more than one tax row associated with an invoice. The answer is incorrect if there is only one row. If i were to print a report with the same values I would get the correct answers.
I am at wits end on this. Perhaps I could side step the whole issue if there is another way to total a calculated field in an embedded browse.
Comment