Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Payment Entry: Allocated Amount cannot be greater than outstanding amount #42062

Open
Ponyooooo opened this issue Jun 27, 2024 · 15 comments
Open
Assignees
Labels

Comments

@Ponyooooo
Copy link

Information about bug

Payment entry shows pop up message for Allocated Amount cannot be greater than outstanding amount when creating payments for expense claim. Not yet tested if the pop up message also shows up for purchase order and purchase invoice.

image

Module

accounts

Version

ERPNext: v14.70.7 (HEAD)
Frappe Framework: v14.77.1 (HEAD)

Installation method

FrappeCloud

Relevant log output / Stack trace / Full Error Message.

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 97, in application
    response = frappe.api.handle()
  File "apps/frappe/frappe/api.py", line 55, in handle
    return frappe.handler.handle()
  File "apps/frappe/frappe/handler.py", line 48, in handle
    data = execute_cmd(cmd)
  File "apps/frappe/frappe/handler.py", line 86, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "apps/frappe/frappe/__init__.py", line 1619, in call
    return fn(*args, **newargs)
  File "apps/frappe/frappe/model/workflow.py", line 131, in apply_workflow
    doc.save()
  File "apps/frappe/frappe/model/document.py", line 310, in save
    return self._save(*args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 345, in _save
    self.run_before_save_methods()
  File "apps/frappe/frappe/model/document.py", line 1061, in run_before_save_methods
    self.run_method("validate")
  File "apps/frappe/frappe/model/document.py", line 931, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1283, in composer
    return composed(self, method, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1265, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "apps/frappe/frappe/model/document.py", line 928, in fn
    return method_object(*args, **kwargs)
  File "apps/erpnext/erpnext/accounts/doctype/payment_entry/payment_entry.py", line 89, in validate
    self.validate_allocated_amount()
  File "apps/erpnext/erpnext/accounts/doctype/payment_entry/payment_entry.py", line 173, in validate_allocated_amount
    frappe.throw(fail_message.format(d.idx))
  File "apps/frappe/frappe/__init__.py", line 548, in throw
    msgprint(
  File "apps/frappe/frappe/__init__.py", line 509, in msgprint
    _raise_exception()
  File "apps/frappe/frappe/__init__.py", line 455, in _raise_exception
    raise raise_exception(msg)
frappe.exceptions.ValidationError: Row #1: Allocated Amount cannot be greater than outstanding amount.
@Ponyooooo Ponyooooo added the bug label Jun 27, 2024
@Ponyooooo
Copy link
Author

this is a bug from the recent version update. We do not usually experience this one.

@quebn
Copy link

quebn commented Jun 29, 2024

Also Experiencing this also on latest version of version-15, message shows up on journal entry as references.

@Ponyooooo
Copy link
Author

This is still not resolved

@ruthra-kumar ruthra-kumar self-assigned this Jul 2, 2024
@Ponyooooo
Copy link
Author

Any update on this? We cannot process payment entries due to the message :(

@Ponyooooo
Copy link
Author

any update on this?

@szufisher
Copy link
Contributor

added precision parameter in flt function solved the problem.
image

@Ponyooooo
Copy link
Author

how can we add this when using frappecloud? looks like this bug is still not added to the latest version update

@Ponyooooo
Copy link
Author

Any update on this?

@Ponyooooo
Copy link
Author

@ruthra-kumar how can we fix the bug when using a frappecloud?

@ruthra-kumar
Copy link
Member

ruthra-kumar commented Jul 11, 2024

@Ponyooooo If you are in FrappeCloud, would suggest you to raise a support ticket on this.

@Ponyooooo
Copy link
Author

Hi @szufisher how can we integrate your solution using client script or server script since frappecloud does not allow us to edit the backcodes of the erpnext. Our only way is to use client or server script only unless your solution will be included on the next version update. :(

@Ramesh-Udhyam
Copy link

It looks like this issue is still not solved. Is this not impacting many people? How come it is not a P0 issue?

@Ponyooooo
Copy link
Author

Still no progress on this one

@Ponyooooo
Copy link
Author

Any progress? This is not possible to be added on the client script

@quebn
Copy link

quebn commented Aug 7, 2024

Found the issue why this Bug happens.
in our case it's Because if the Journal Entry has the following Entries shown below:
image

  • if the accounting entries have a payable entry credited on a party. but has also an entry debited on the same party.
    when we set them as references in the payment entry the system will calculated the outstanding by subtracting the debited entry on the credited entry despite the accounts of those entry clearly being different. so the payment entry will only show the difference as the outstanding show below
    image
    hence the error message below when we try to save/submit the payment entry
    image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants