I took the invoice template, and modified it for inputting receipt data. Worked fine until I realized I needed a way to set up the repeating section so that each item could either be taxed or not. Well I set up a check box with a default check. I then added a hidden field (copied the extendedTotal field, and it created extendedTotal1.) I added an if statement so that the field would be filled with the same info as the original field, but it would be 0 if the check box is not checked.
I then changed the tax calculated field to:
Pretty much all I did was add a 1 to it. But testing it, it worked exactly how it should.
Next I modified the grandTotal field (again adding in just the 1) like this:
Now suddenly I get an error with the javascript, telling me that it's Unable to get the value of the property 'total': object is null or undefined.
I remove the 1, and the error goes away, but then it doesn't filter out the taxes.
Because the tax field already has the number I need, I tried this:
Lo and behold, it works. But with issues.
If you change the tax rate, or make it 0, it updates. If you uncheck the box, the tax updated, but not the grandTotal, until you change the tax rate.
So I am confused as to why just adding a 1 will cause one field to fail, but not another, and why using a different variable results in the other issues I mentioned.
All these fields are unbound calculated fields, so no data is actually affected. But I know people will be confused. If there is a glitch, people will find it, and this one is pretty easy to find.
I then changed the tax calculated field to:
Code:
(summary.EXTENDEDTOTAL1.total * TaxRate ) / 100
Next I modified the grandTotal field (again adding in just the 1) like this:
Code:
(summary.EXTENDEDTOTAL.total) + ((summary.EXTENDEDTOTAL1.total * TaxRate ) / 100) + shipping
I remove the 1, and the error goes away, but then it doesn't filter out the taxes.
Because the tax field already has the number I need, I tried this:
Code:
(summary.EXTENDEDTOTAL.total) + tax + shipping
If you change the tax rate, or make it 0, it updates. If you uncheck the box, the tax updated, but not the grandTotal, until you change the tax rate.
So I am confused as to why just adding a 1 will cause one field to fail, but not another, and why using a different variable results in the other issues I mentioned.
All these fields are unbound calculated fields, so no data is actually affected. But I know people will be confused. If there is a glitch, people will find it, and this one is pretty easy to find.
Comment