And now?
Printable View
And now?
BINGO THAT WORKED
THANKS FOR ALL YOUR HELP!!!!! :wave: :wave: :wave: :wave: :wave: :wave: :wave: :wave: :wave: :wave: :wave: :wave: ;) ;) :eek:
Ok well I thought we had the VB Program figured out, however it seems its incorrect;
I have 2 seprate invoices, the calculations work on the 1 of the invoices but not on another.
The way i can double check to see if its correct is:
Once the get the tax % and then get the tax % on the part, i get the difference between that part price with the tax added on, and minus it from the original price of the part, this will give me how much tax was on the part.
I take that number, add it to the shipping and handling tax back, and it should equal the total tax amount, but on the second invoice it dosent.
First Invoice:
Total Amount 9.12
Total Tax Amount .68
Shipping 3.95
Sales Amount/Price of part 4.49
When calculated tax back on shipping is 35 cents, and tax back on part is 33 cents, that equals .68 cents, the same as the tax amount, so this one is correct.
Second Invoice:
Total Amount 15.54
Total Tax Amount .98
Shipping 4.95
Sales Amount/Price of part 9.61
The Tax amount back on the shipping is .30 cents, tax back on the part is.610000000
these added together are .91 cents, and it should be .98
Are you sure you didn't input it wrong?
Also im sorry to say that is an error with your invoice program. Do it with a calculator, The total Amount / The Tax amount = Tax Percent
Sales Amount + Shipping = Total amount before tax
Tax = Total Amount before tax * Tax Percent
Total Amount = Tax + Total Amount before tax
You will see the program is right... and the invoice program is wrong
The invoice program is correct, its the VB program that is wrong..
This is the way to double check:
Once you get your tax %, then add sales amount + s&H and * it by the tax% and you should get the tax amoubnt, but you dont, its lower.
Frist Invoice:
Total Amount 9.12
Total Tax Amount .68
Shipping 3.95
Sales Amount/Price of part 4.49
Tax Percent is 7.46% ' this value is found using the vb program you sent
7.46% * Shipping + price of part ($8.44) = .63 (Wrong)
Second Invoice:
Total Amount 15.54
Total Tax Amount .98
Shipping 4.95
Sales Amount/Price of part 9.61
Tax Percent is 6.31% ' this value is found using the vb program you sent
6.31 * Shipping + price of part ($14.10) = .89 (wrong)
Ok, i think i found the error. When you figure out tax using the total cost and the tax amount you have to subtract the tax from the total cost before you do the tax calculation... Try this out and see if it works...
in this example the las 2 amounts printed are equalVB Code:
Dim ship As Currency, sale As Currency, tax As Currency ship = 3.95 sale = 4.49 tax = 0.68 trate = Round(tax / (ship + sale), 2) ' =.08 or 8% tax rate, when rounded to 2 decimal places Debug.Print trate Debug.Print Round(ship * (trate + 1), 2) + Round(sale * (trate + 1), 2) Debug.Print "Invoice total " & Round((ship + sale) * 1.08, 2)
in this exmple the the different ways of calculateing the invoice total produce different resultsVB Code:
Dim ship As Currency, sale As Currency, tax As Currency ship = 3.95 sale = 4.47 tax = 0.68 trate = Round(tax / (ship + sale), 2) Debug.Print trate ' or Debug.Print Round(tax / (inv - tax), 2) Debug.Print Round(ship * (trate + 1), 2) + Round(sale * (trate + 1), 2) Debug.Print "Invoice total " & Round((ship + sale) * 1.08, 2)
on multi line invoicing it depends if the tax is calculated on each line then summed up, or if the tax is caculated once for the total of the taxable amount, many programs calculate the tax on each line, so to get the accurate tax percentage is difficult, the more lines the greater inaccuracy if calculating from the total
hope this helps with your caclulations
pete
I am not sure how the old system calculated tax, all i know is if i take the 2 totals and of tax that is credited it should equal the correct amount.
Justin H. It seems the "credit back on part is right" but the shipping credit is now wrong, when i add the 2 differences together to dosent equal the right price
Everytime i check it in the excel spreed sheet i posted, the values come back and equal the Total tax that was charged, maybe VB can duplicate Excel lol
Did you try that last attached Program Yesterday at 7:07 pm?
Yes, I tried it.
Values
**INVOICE 1***
Invoice Amount(total order) 9.12
Tax amount (total tax) .68
S&H $3.95
Sales Amount (Price on parts) $4.49
** THIS COMES OUT RIGHT ON THE CALC.
**INVOICE 2***
Invoice Amount(total order) 15.54
Tax amount (total tax) .98
S&H $4.95
Sales Amount (Price on parts) $9.61
** THIS COMES OUT INCORRECT ON THE CALC.
**INVOICE 3***
Invoice Amount(total order) 36.21
Tax amount (total tax) 2.21
S&H $11.95
Sales Amount (Price on parts) $22.05
** THIS COMES OUT INCORRECT ON THE CALC.
Ok, there was a problem it with using the rounded number to do the tax, which i put it that way a long time ago when you said it was off a cent and i was trying to match the excel sheet... Try this one...
Still incorrect!
Im not sure why the first one works but the others 2 dont, maybe the first one is just a fluke.
The last worked for me on the ones you provided...
Im sorry for some reason i uploaded the old version instead of the one i wanted to give you, i edited the message with that upload and posted the correct one please download that one and try it then thanks
... That work Joe??
The repost did it.
It worked on all 4 examples!
Thanks again!