Roundup Issue with Pending amount

I have an entry in the system, where the pending amount is being shown as 1500.80 INR in database(invoice_amounts table). Now when I go to enter payment in payment form , it shows pending amount is 1501 INR coz of round up.

Now when I enter 1501 INR, it doesnt make me submit the payment form as the system checks if the payment amount is <= pending amount.

I am using the latest updated version of invoiceplane, please advise an entry point for code level changes that I have to do.

Can you upload a screenshot?

There are several ways to enter a payment, which one are you using?

  • the Options button -> Enter Payment in the View Invoices window, that opens a modal window,
  • the Payments -> Enter Payment option in the top menu that opens the payments/form page, or
  • the New button in the View Payments that opens the payments/form page too.

What happens if you enter in the payment form the amount saved in the database,1500.80?

23-01-25-32

The problem is that the amount is rounded up and showed in the amount field, and the user has no clue that the actual amount is 1500.80… When I went to check in the database, thats where I came to know that the actual amount is 1500.80.-------------This is happening in the modal window.

==========================================
3
The second screnshot shows an error page when i try to enter a payment more than the amount due, from the payments module (payments->new).

==========================================
The same error is encountered in the ajax call while entering the payment(I am referring to screnshot 1) and hence it does’nt get submitted.

The Payments Form in the second screenshot looks different than the one in the last version v1.5.9 (see demo site at http://demo.invoiceplane.com). Which version of IP are you running? because I don’t see that behavior in the current version.

I am running 1.5.9. The same is happening even with the online version. Try updating a value of amount greater than the actual invoice amount, you would see that error.

I am a bit confused now. I thought the problem was that IP was displaying the rounded up amount of the invoice and fooling users, but now you say the problem is that IP is not accepting over-payments which are planned for IP 2.0 (see IP-253 - Add option to add an existing balance for clients.)

So, is your IP installation displaying rounded-up amounts in the payment forms or are you trying to enter an over-payment?

You need to go through the screenshot more precisely, I have made myself very clear. For better understanding

  • Create an invoice which equates to a decimal amount may be 1000.80/- and check in the database what gets saved(confirm that in the database table “invoice_balance = 1000.80”).
  • Now come to the front end and do the payment.

In the payment form you will be shown 1001/- as the balance amount, this transaction would not go through when u enter 1001. Hope this clarifies the issue…

I’ve run a test case in the demo version. I have created an invoice with a total amount of $22,729,74,

720Z

The amount is correctly displayed in the modal “Enter Payment”

640Z

and in the “Payment Form”

086Z

and if I enter the correct amount (equal or less than the total amount) the payment gets processed,

348Z

and the invoice status changes,

970Z

In summary, I cannot reproduce the problem you describe in the current stable version.

Just in case, can you post a screen shot of your “Amount Settings” in the Settings → System Settings → General tab?

For instance, this was the configuration of demo when I ran the test,

798Z

Database Entry
23-16-19-10
Payment Modal
23-16-22-15
Payment Form
23-16-23-28
Settings
23-16-14-43

The only difference I see is that my (decimal point) field value is empty. It seems to work fine when I put a value “.”
Had to face a lot of hardship with this, probably if we put some validation on this would be great and helpful for those who might end up in a mess in case they remove the decimal point value.

Thanks for your quick revert miquel_cabanas

Glad to know that the problem is solved.

Also, you are right that the code should be improved to make sure this error doesn’t happen, so I have opened an issue,

IP-727 - Improve handling of decimal and thousand separator symbols

An additional benefit is that I have spotted another small bug,

IP-728 - Add “Bank Transaction ID” field to the modal window “Enter Payment”

I have just submitted a fix for this problem,

if accepted, in future versions users will choose the number format and the decimal and thousands separators will be set accordingly by the software.

Screenshot_new_number_format_selector