Invoice Add-on Math not working with decimal values

This topic contains 4 reply and 3 voices, and was last updated by Nayem 9 years, 8 months ago
Viewing 4 Posts - 1 through 4 (of 4 total)
Author Posts
March 28, 2015 at 3:11 am 40132
Nayem Hello, The Issue: I bill in 15 min increments, so it's really important to use values with decimals like 5.25 hours, or 0.5 hours. The current invoice line totals are showing correct sums after saving, but the subtotal and total did not reflect any amounts using the decimal. In other words, I'd enter $50 / hour, at 0.5 hours, and it would total up as $0.00 Or, I'd enter $50 / hour, at 1.5 hours, and it would total up as $50 instead of $75
March 28, 2015 at 3:18 am 40133
Blake Blake

The Solution:
I had someone from my team just fix it for me.

Essentially find-and-replace “parseInt” with “parseFloat” in two files:
wp-content/plugins/wedevs-pm-invoice-71cc7c6140ab/assets/js/script.js
wp-content/plugins/wedevs-pm-invoice-71cc7c6140ab/assets/js/script.min.js

This seems to work for me. Hopefully someone finds this helpful.
View Screenshot

March 28, 2015 at 2:27 pm 40158
Nayem Nayem

Hello Blake,

Thank you for sharing this great solution. It will help many client.

March 30, 2015 at 11:12 pm 40310
Gary Gary

This needs to be rolled into an update I have a few clients sites which I will be installing this on soon and I know at least two of them want to bill in 15 minutes slots.

March 31, 2015 at 12:03 pm 40335
Nayem Nayem

Hello,

I have already notified to our developer team about this. They will add this decimal values in our next release.

Thank you 🙂

Viewing 4 Posts - 1 through 4 (of 4 total)