Invoice Not Accepting Part Values in Qty

Request for general support related to Logic Invoice.
Post Reply
Chewie
Posts: 7
Joined: Wed May 10, 2017 9:06 pm

Invoice Not Accepting Part Values in Qty

Post by Chewie » Wed May 10, 2017 9:08 pm

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).

User avatar
Esmond
Site Admin
Posts: 274
Joined: Tue Sep 15, 2015 3:08 pm
Location: Singapore
Contact:

Re: Invoice Not Accepting Part Values in Qty

Post by Esmond » Thu May 11, 2017 11:54 am

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.

nicknick
Posts: 5
Joined: Tue May 23, 2017 10:10 pm

Re: Invoice Not Accepting Part Values in Qty

Post by nicknick » Tue May 23, 2017 10:20 pm

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.

User avatar
Esmond
Site Admin
Posts: 274
Joined: Tue Sep 15, 2015 3:08 pm
Location: Singapore
Contact:

Re: Invoice Not Accepting Part Values in Qty

Post by Esmond » Fri May 26, 2017 8:35 am

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.

nicknick
Posts: 5
Joined: Tue May 23, 2017 10:10 pm

Re: Invoice Not Accepting Part Values in Qty

Post by nicknick » Thu Jun 01, 2017 6:09 pm

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
Attachments
Untitled-2.jpg
Untitled-2.jpg (34.58 KiB) Viewed 781 times
Untitled-1.jpg
Untitled-1.jpg (42.44 KiB) Viewed 781 times

User avatar
Esmond
Site Admin
Posts: 274
Joined: Tue Sep 15, 2015 3:08 pm
Location: Singapore
Contact:

Re: Invoice Not Accepting Part Values in Qty

Post by Esmond » Fri Jun 02, 2017 9:22 am

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']

nicknick
Posts: 5
Joined: Tue May 23, 2017 10:10 pm

Re: Invoice Not Accepting Part Values in Qty

Post by nicknick » Fri Jun 30, 2017 12:39 am

Esmond - Thanks works great!

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests