Page 1 of 1

Invoice Not Accepting Part Values in Qty

Posted: Wed May 10, 2017 9:08 pm
by Chewie
The invoice is not generating the correct 'Total' amount if the qty is a non-whole number (ie 2.5) it seems to drop the partial number from the equation (ie the .5).

Re: Invoice Not Accepting Part Values in Qty

Posted: Thu May 11, 2017 11:54 am
by Esmond
Ah, that's because quantity has to be a whole number. If you need to change that, changes to the database will be required from INT to DECIMAL.

Re: Invoice Not Accepting Part Values in Qty

Posted: Tue May 23, 2017 10:20 pm
by nicknick
I would like to have this feature. Maybe you could elaborate on which tables would need to be changed. I have changed 'invoice_item' to decimal value however the system stripes any number right of the decimal and does not calculate a new total.

Re: Invoice Not Accepting Part Values in Qty

Posted: Fri May 26, 2017 8:35 am
by Esmond
On top of changing the database, you will need to look into admin/model/billing/invoice.php and change (int) to (float). That should get things going for you.

Re: Invoice Not Accepting Part Values in Qty

Posted: Thu Jun 01, 2017 6:09 pm
by nicknick
Thanks for instructions. I have applied this suggestion however my results aren't really working the way they should. Attached are the results I am getting. It seems to have calculated somewhat however it isn't working throughout the system. Any additional help would be greate! Sorry not well versed in php

Re: Invoice Not Accepting Part Values in Qty

Posted: Fri Jun 02, 2017 9:22 am
by Esmond
in admin/controller/billing/invoice.php look for the following

Code: Select all

(int)$item['quantity']
and change to

Code: Select all

(float)$item['quantity']

Re: Invoice Not Accepting Part Values in Qty

Posted: Fri Jun 30, 2017 12:39 am
by nicknick
Esmond - Thanks works great!